Commit 914b8da9 authored by Francesco Mani's avatar Francesco Mani

fix after integration

parent ae6af7ed
...@@ -486,7 +486,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -486,7 +486,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
ra->Msg2_slot = msg2_slot; ra->Msg2_slot = msg2_slot;
LOG_I(MAC, "%s() Msg2[%04d%d] SFN/SF:%04d%d\n", __FUNCTION__, ra->Msg2_frame, ra->Msg2_slot, frameP, slotP); LOG_I(MAC, "%s() Msg2[%04d%d] SFN/SF:%04d%d\n", __FUNCTION__, ra->Msg2_frame, ra->Msg2_slot, frameP, slotP);
if(pr_found) if (!ra->cfra) {
do { do {
ra->rnti = (taus() % 65518) + 1; ra->rnti = (taus() % 65518) + 1;
loop++; loop++;
...@@ -496,6 +496,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -496,6 +496,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
LOG_E(MAC,"%s:%d:%s: [RAPROC] initialisation random access aborted\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(MAC,"%s:%d:%s: [RAPROC] initialisation random access aborted\n", __FILE__, __LINE__, __FUNCTION__);
abort(); abort();
} }
}
ra->RA_rnti = ra_rnti; ra->RA_rnti = ra_rnti;
ra->preamble_index = preamble_index; ra->preamble_index = preamble_index;
ra->beam_id = beam_index; ra->beam_id = beam_index;
......
...@@ -340,6 +340,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -340,6 +340,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
LOG_I(MAC, "reset RA state information for RA-RNTI %04x\n", ra->rnti); 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); const int UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti);
UE_info->secondaryCellGroup[UE_id] = ra->secondaryCellGroup; UE_info->secondaryCellGroup[UE_id] = ra->secondaryCellGroup;
UE_info->UE_beam_index[UE_id] = ra->beam_id;
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
AssertFatal(bwpList->list.count == 1, AssertFatal(bwpList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP!\n", "downlinkBWP_ToAddModList has %d BWP!\n",
...@@ -401,45 +402,5 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -401,45 +402,5 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
} }
} }
else if (sduP != NULL) { // if the CRC passed
// random access pusch with TC-RNTI
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[0];
if (ra->state != WAIT_Msg3) {
LOG_E(MAC,
"expected RA state WAIT_Msg3/%d (but is %d) for RA-RNTI %04x\n",
WAIT_Msg3,
ra->state,
ra->rnti);
return;
}
if (ra->rnti != current_rnti) {
LOG_E(MAC,
"expected RA-RNTI %04x (C-RNTI %04x) to match current RNTI %04x\n",
ra->rnti,
ra->crnti,
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->crnti);
UE_info->secondaryCellGroup[UE_id] = ra->secondaryCellGroup;
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_W(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->crnti);
}
} }
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