From de3330993542b33b5f622f8fab2c5a8f6e9d70be Mon Sep 17 00:00:00 2001 From: Andrew Burger Date: Mon, 8 Jun 2020 10:41:34 -0700 Subject: [PATCH] New changes to get rach working.. Still not working --- openair2/LAYER2/MAC/ra_procedures.c | 6 +++++- openair2/LAYER2/MAC/ue_procedures.c | 14 +++++++------- targets/RT/USER/lte-ue.c | 3 +++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index 0d1afdf2a2..ddeaab6989 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -199,7 +199,9 @@ get_prach_resources(module_id_t module_idP, UE_mac_inst[module_idP]. RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER = get_Po_NOMINAL_PUSCH(module_idP, CC_id); - } else { // Msg3 is being retransmitted + } else { + LOG_E(MAC, "Didnt set UE Mode Correctly\n"); + // Msg3 is being retransmitted if (UE_mac_inst[module_idP].RA_usedGroupA == 1) { if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) { UE_mac_inst[module_idP].RA_prach_resources. @@ -288,6 +290,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id, uint8_t Size = 0; UE_MODE_t UE_mode; + LOG_E(MAC, "got inside ue_get_rach\n"); + // Modification for phy_stub_ue operation if(NFAPI_MODE == NFAPI_UE_STUB_PNF) { // phy_stub_ue mode UE_mode = UE_mac_inst[module_idP].UE_mode[0]; diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 46b5f842b8..fca1d1b2f5 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -153,9 +153,9 @@ void ue_init_mac(module_id_t module_idP) { UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[i] = 0; } - if(NFAPI_MODE==NFAPI_UE_STUB_PNF) { + if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { pthread_mutex_init(&UE_mac_inst[module_idP].UL_INFO_mutex,NULL); - UE_mac_inst[module_idP].UE_mode[0] = NOT_SYNCHED; //PRACH; + UE_mac_inst[module_idP].UE_mode[0] = PRACH; //NOT_SYNCHED; UE_mac_inst[module_idP].first_ULSCH_Tx =0; UE_mac_inst[module_idP].SI_Decoded = 0; next_ra_frame = 0; @@ -439,7 +439,7 @@ ue_send_sdu(module_id_t module_idP, "[UE %d][RAPROC] Contention detected, RA failed\n", module_idP); - if(NFAPI_MODE==NFAPI_UE_STUB_PNF) { // phy_stub mode + if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { // phy_stub mode // Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to // PRACH state. LOG_I(MAC, "nfapi_mode3: Setting UE_mode BACK to PRACH 1\n"); @@ -465,7 +465,7 @@ ue_send_sdu(module_id_t module_idP, [module_idP]. RA_contention_resolution_timer_active = 0; - if(NFAPI_MODE==NFAPI_UE_STUB_PNF) { // phy_stub mode + if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { // phy_stub mode // Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH UE_mac_inst[module_idP].UE_mode[eNB_index] = PUSCH; } else { // Full stack mode @@ -483,7 +483,7 @@ ue_send_sdu(module_id_t module_idP, #endif // Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct? - if (NFAPI_MODE!=NFAPI_UE_STUB_PNF) { + if (NFAPI_MODE!=NFAPI_UE_STUB_PNF && NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) { process_timing_advance(module_idP,CC_id,payload_ptr[0]); } @@ -2152,7 +2152,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, // build PHR and update the timers if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) { - if(NFAPI_MODE==NFAPI_UE_STUB_PNF) { + if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { //Substitute with a static value for the MAC layer abstraction (phy_stub mode) phr_p->PH = 60; } else { @@ -2600,7 +2600,7 @@ ue_scheduler(const module_id_t module_idP, "Module id %u Contention resolution timer expired, RA failed\n", module_idP); - if(NFAPI_MODE==NFAPI_UE_STUB_PNF) { // phy_stub mode + if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { // phy_stub mode // Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to // PRACH state. LOG_I(MAC, "nfapi_mode3: Setting UE_mode to PRACH 2 \n"); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 791b509790..f49869d510 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1173,6 +1173,9 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) } if (dl_config_req && tx_request_pdu_list) { + if ((num_pairs % 1000) == 0) { + LOG_I(MAC, "num_pairs:%d, num_lone:%d\n", num_pairs, num_lone); + } nfapi_dl_config_request_body_t* dl_config_req_body = &dl_config_req->dl_config_request_body; for (int i = 0; i < dl_config_req_body->number_pdu; ++i) { nfapi_dl_config_request_pdu_t* pdu = &dl_config_req_body->dl_config_pdu_list[i];