Commit 774b8d9a authored by rmagueta's avatar rmagueta

Fix TA in CFRA

parent 1af7e716
...@@ -1816,9 +1816,8 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -1816,9 +1816,8 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
// MAC CE // MAC CE
case DL_SCH_LCID_CCCH: case DL_SCH_LCID_CCCH:
// MSG4 RRC Connection Setup 38.331 // MSG4 RRC Setup 38.331
// variable length // variable length
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8)
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); | ((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, ...@@ -1828,7 +1827,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
mac_subheader_len = 2; 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); LOG_D(NR_MAC,"DL_SCH_LCID_CCCH with payload len %d: bits\n", mac_sdu_len);
......
...@@ -247,14 +247,11 @@ void nr_process_mac_pdu( ...@@ -247,14 +247,11 @@ void nr_process_mac_pdu(
// RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes // RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes
mac_sdu_len = 8; mac_sdu_len = 8;
// FIXME: Need to handle properly MAC PDU with all 00's // Check if it is a valid CCCH1 message, we get all 00's messages very often
//[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
if (pdu_len != 9) { if (pdu_len != 9) {
//LOG_E(MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len); //LOG_E(MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len);
return; return;
} }
} else { } else {
// fixed length of 6 bytes // fixed length of 6 bytes
mac_sdu_len = 6; mac_sdu_len = 6;
...@@ -525,8 +522,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -525,8 +522,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
current_rnti); current_rnti);
continue; continue;
} }
const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->secondaryCellGroup); 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; 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, LOG_I(NR_MAC,
"[gNB %d][RAPROC] PUSCH with TC-RNTI %x received correctly, " "[gNB %d][RAPROC] PUSCH with TC-RNTI %x received correctly, "
"adding UE MAC Context UE_id %d/RNTI %04x\n", "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, ...@@ -555,9 +557,6 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
// First byte corresponds to R/LCID MAC sub-header // First byte corresponds to R/LCID MAC sub-header
memcpy(ra->cont_res_id, &sduP[1], sizeof(uint8_t) * 6); 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); nr_process_mac_pdu(gnb_mod_idP, current_rnti, CC_idP, frameP, sduP, sdu_lenP);
ra->state = Msg4; ra->state = Msg4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment