Check all RA procs in nr_rx_sdu() if unknown RNTI
This commit is contained in:
@@ -322,51 +322,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
UE_info = &gNB_mac->UE_info;
|
UE_info = &gNB_mac->UE_info;
|
||||||
int target_snrx10 = gNB_mac->pusch_target_snrx10;
|
int target_snrx10 = gNB_mac->pusch_target_snrx10;
|
||||||
|
|
||||||
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[0];
|
|
||||||
|
|
||||||
if (sduP != NULL) {
|
if (sduP != NULL) {
|
||||||
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
|
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
|
||||||
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
|
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
|
||||||
T_BUFFER(sduP, sdu_lenP));
|
T_BUFFER(sduP, sdu_lenP));
|
||||||
}
|
}
|
||||||
|
|
||||||
// random access pusch with TC-RNTI
|
|
||||||
if (ra->state == WAIT_Msg3) {
|
|
||||||
if (sduP != NULL) { // if the CRC passed
|
|
||||||
|
|
||||||
if (ra->rnti != current_rnti) {
|
|
||||||
LOG_E(MAC,
|
|
||||||
"expected TC-RNTI %04x to match current RNTI %04x\n",
|
|
||||||
ra->rnti,
|
|
||||||
current_rnti);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
free(ra->preambles.preamble_list);
|
|
||||||
ra->state = RA_IDLE;
|
|
||||||
LOG_I(MAC, "reset RA state information for RA-RNTI %04x\n", ra->rnti);
|
|
||||||
const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti);
|
|
||||||
UE_info->secondaryCellGroup[UE_id] = ra->secondaryCellGroup;
|
|
||||||
compute_csi_bitlen (ra->secondaryCellGroup, UE_info, UE_id);
|
|
||||||
UE_info->UE_beam_index[UE_id] = ra->beam_id;
|
|
||||||
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
|
|
||||||
AssertFatal(bwpList->list.count == 1,
|
|
||||||
"downlinkBWP_ToAddModList has %d BWP!\n",
|
|
||||||
bwpList->list.count);
|
|
||||||
const int bwp_id = 1;
|
|
||||||
UE_info->UE_sched_ctrl[UE_id].active_bwp = bwpList->list.array[bwp_id - 1];
|
|
||||||
LOG_I(MAC,
|
|
||||||
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
|
|
||||||
"adding UE MAC Context UE_id %d/RNTI %04x\n",
|
|
||||||
gnb_mod_idP,
|
|
||||||
current_rnti,
|
|
||||||
UE_id,
|
|
||||||
ra->rnti);
|
|
||||||
// re-initialize ta update variables afrer RA procedure completion
|
|
||||||
UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UE_id != -1) {
|
if (UE_id != -1) {
|
||||||
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
|
||||||
|
|
||||||
@@ -410,6 +371,53 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (!sduP) // check that CRC passed
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* we don't know this UE (yet). Check whether there is a ongoing RA (Msg 3)
|
||||||
|
* and check the corresponding UE's RNTI match, in which case we activate
|
||||||
|
* it. */
|
||||||
|
for (int i = 0; i < NR_NB_RA_PROC_MAX; ++i) {
|
||||||
|
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[i];
|
||||||
|
if (ra->state != WAIT_Msg3)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// random access pusch with TC-RNTI
|
||||||
|
if (ra->rnti != current_rnti) {
|
||||||
|
LOG_W(MAC,
|
||||||
|
"expected TC-RNTI %04x to match current RNTI %04x\n",
|
||||||
|
ra->rnti,
|
||||||
|
current_rnti);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti);
|
||||||
|
UE_info->secondaryCellGroup[UE_id] = ra->secondaryCellGroup;
|
||||||
|
compute_csi_bitlen(ra->secondaryCellGroup, UE_info, UE_id);
|
||||||
|
UE_info->UE_beam_index[UE_id] = ra->beam_id;
|
||||||
|
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
|
||||||
|
AssertFatal(bwpList->list.count == 1,
|
||||||
|
"downlinkBWP_ToAddModList has %d BWP!\n",
|
||||||
|
bwpList->list.count);
|
||||||
|
const int bwp_id = 1;
|
||||||
|
UE_info->UE_sched_ctrl[UE_id].active_bwp = bwpList->list.array[bwp_id - 1];
|
||||||
|
LOG_I(MAC,
|
||||||
|
"[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly, "
|
||||||
|
"adding UE MAC Context UE_id %d/RNTI %04x\n",
|
||||||
|
gnb_mod_idP,
|
||||||
|
current_rnti,
|
||||||
|
UE_id,
|
||||||
|
ra->rnti);
|
||||||
|
// re-initialize ta update variables afrer RA procedure completion
|
||||||
|
UE_info->UE_sched_ctrl[UE_id].ta_frame = frameP;
|
||||||
|
|
||||||
|
free(ra->preambles.preamble_list);
|
||||||
|
ra->state = RA_IDLE;
|
||||||
|
LOG_I(MAC,
|
||||||
|
"reset RA state information for RA-RNTI %04x/index %d\n",
|
||||||
|
ra->rnti,
|
||||||
|
i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user