diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 6473741076..cf106184dd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1816,9 +1816,8 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, // MAC CE case DL_SCH_LCID_CCCH: - // MSG4 RRC Connection Setup 38.331 + // MSG4 RRC Setup 38.331 // variable length - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) | ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); @@ -1828,7 +1827,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, mac_subheader_len = 2; } - if ( mac_sdu_len > 0) { + if ( mac_sdu_len > 0 ) { LOG_D(NR_MAC,"DL_SCH_LCID_CCCH with payload len %d: bits\n", mac_sdu_len); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 48204fc394..8b75abca74 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -247,14 +247,11 @@ void nr_process_mac_pdu( // RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes mac_sdu_len = 8; - // FIXME: Need to handle properly MAC PDU with all 00's - //[MAC] nr_process_mac_pdu() residual mac pdu length < 0!, pdu_len: -2 - //[MAC] MAC PDU 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + // Check if it is a valid CCCH1 message, we get all 00's messages very often if (pdu_len != 9) { //LOG_E(MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len); return; } - } else { // fixed length of 6 bytes mac_sdu_len = 6; @@ -525,8 +522,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, current_rnti); continue; } + const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->secondaryCellGroup); UE_info->UE_beam_index[UE_id] = ra->beam_id; + + // re-initialize ta update variables after RA procedure completion + UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP; + LOG_I(NR_MAC, "[gNB %d][RAPROC] PUSCH with TC-RNTI %x received correctly, " "adding UE MAC Context UE_id %d/RNTI %04x\n", @@ -555,9 +557,6 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, // First byte corresponds to R/LCID MAC sub-header memcpy(ra->cont_res_id, &sduP[1], sizeof(uint8_t) * 6); - // re-initialize ta update variables afrer RA procedure completion - UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP; - nr_process_mac_pdu(gnb_mod_idP, current_rnti, CC_idP, frameP, sduP, sdu_lenP); ra->state = Msg4;