Commit adcd2949 authored by Robert Schmidt's avatar Robert Schmidt

Rename NR_UE_list_t to NR_UE_info_t

The name NR_UE_list_t is misleading: beyond being a simple "list", this
structure carries all/most UE-related MAC information. If at all, it is
a container for multiple lists. The next commit introduces a
NR_UE_list_t structure that organizes UEs in lists such that it is
easier to go through the UEs.
parent 476c7177
...@@ -698,7 +698,7 @@ int main(int argc, char **argv) ...@@ -698,7 +698,7 @@ int main(int argc, char **argv)
nr_ue_phy_config_request(&UE_mac->phy_config); nr_ue_phy_config_request(&UE_mac->phy_config);
NR_UE_list_t *UE_list = &RC.nrmac[0]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info;
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels; //NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
snrRun = 0; snrRun = 0;
...@@ -759,11 +759,11 @@ int main(int argc, char **argv) ...@@ -759,11 +759,11 @@ int main(int argc, char **argv)
memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int)); memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int));
clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot); clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot);
UE_list->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1); UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1);
UE_list->UE_sched_ctrl[0].harq_processes[harq_pid].round = round; UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round;
UE_list->UE_sched_ctrl[0].current_harq_pid = harq_pid; UE_info->UE_sched_ctrl[0].current_harq_pid = harq_pid;
gNB->dlsch[0][0]->harq_processes[harq_pid]->round = round; gNB->dlsch[0][0]->harq_processes[harq_pid]->round = round;
if (css_flag == 0) nr_schedule_uss_dlsch_phytest(0,frame,slot,&pucch_sched,&dlsch_config); if (css_flag == 0) nr_schedule_uss_dlsch_phytest(0,frame,slot,&pucch_sched,&dlsch_config);
......
...@@ -346,29 +346,29 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -346,29 +346,29 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if (secondaryCellGroup) { if (secondaryCellGroup) {
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
int UE_id; int UE_id;
if (add_ue == 1) { if (add_ue == 1) {
UE_id = add_new_nr_ue(Mod_idP,rnti); UE_id = add_new_nr_ue(Mod_idP,rnti);
UE_list->secondaryCellGroup[UE_id] = secondaryCellGroup; UE_info->secondaryCellGroup[UE_id] = secondaryCellGroup;
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList =
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; 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",
bwpList->list.count); bwpList->list.count);
const int bwp_id = 1; const int bwp_id = 1;
UE_list->UE_sched_ctrl[UE_id].active_bwp = bwpList->list.array[bwp_id - 1]; UE_info->UE_sched_ctrl[UE_id].active_bwp = bwpList->list.array[bwp_id - 1];
uint8_t num_preamble = secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list.count; uint8_t num_preamble = secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list.count;
UE_list->preambles[UE_id].num_preambles = num_preamble; UE_info->preambles[UE_id].num_preambles = num_preamble;
UE_list->preambles[UE_id].preamble_list = (uint8_t *) malloc(num_preamble*sizeof(uint8_t)); UE_info->preambles[UE_id].preamble_list = (uint8_t *) malloc(num_preamble*sizeof(uint8_t));
for (int i=0; i<num_preamble; i++) { for (int i=0; i<num_preamble; i++) {
UE_list->preambles[UE_id].preamble_list[i] = secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list.array[i]->ra_PreambleIndex; UE_info->preambles[UE_id].preamble_list[i] = secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list.array[i]->ra_PreambleIndex;
} }
LOG_I(PHY,"Added new UE_id %d/%x with initial secondaryCellGroup\n",UE_id,rnti); LOG_I(PHY,"Added new UE_id %d/%x with initial secondaryCellGroup\n",UE_id,rnti);
} }
else { // secondaryCellGroup has been updated else { // secondaryCellGroup has been updated
UE_id = find_nr_UE_id(Mod_idP,rnti); UE_id = find_nr_UE_id(Mod_idP,rnti);
UE_list->secondaryCellGroup[UE_id] = secondaryCellGroup; UE_info->secondaryCellGroup[UE_id] = secondaryCellGroup;
LOG_I(PHY,"Modified UE_id %d/%x with secondaryCellGroup\n",UE_id,rnti); LOG_I(PHY,"Modified UE_id %d/%x with secondaryCellGroup\n",UE_id,rnti);
} }
} }
......
This diff is collapsed.
...@@ -253,8 +253,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -253,8 +253,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
uint16_t msg2_frame, msg2_slot,monitoring_slot_period,monitoring_offset; uint16_t msg2_frame, msg2_slot,monitoring_slot_period,monitoring_offset;
gNB_MAC_INST *nr_mac = RC.nrmac[module_idP]; gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
NR_UE_list_t *UE_list = &nr_mac->UE_list; NR_UE_info_t *UE_info = &nr_mac->UE_info;
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id]; NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id];
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
NR_RA_t *ra = &cc->ra[0]; NR_RA_t *ra = &cc->ra[0];
...@@ -262,14 +262,14 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -262,14 +262,14 @@ void nr_initiate_ra_proc(module_id_t module_idP,
// if the preamble received correspond to one of the listed // if the preamble received correspond to one of the listed
// the UE sent a RACH either for starting RA procedure or RA procedure failed and UE retries // the UE sent a RACH either for starting RA procedure or RA procedure failed and UE retries
int pr_found=0; int pr_found=0;
for (int i=0;i<UE_list->preambles[UE_id].num_preambles;i++) { for (int i=0;i<UE_info->preambles[UE_id].num_preambles;i++) {
if (preamble_index == UE_list->preambles[UE_id].preamble_list[i]) { if (preamble_index == UE_info->preambles[UE_id].preamble_list[i]) {
pr_found=1; pr_found=1;
break; break;
} }
} }
if (pr_found) if (pr_found)
UE_list->fiveG_connected[UE_id] = false; UE_info->fiveG_connected[UE_id] = false;
else { else {
LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated for UE_id %d\n", LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated for UE_id %d\n",
module_idP, preamble_index, UE_id); module_idP, preamble_index, UE_id);
...@@ -325,7 +325,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -325,7 +325,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
ra->RA_rnti = ra_rnti; ra->RA_rnti = ra_rnti;
ra->preamble_index = preamble_index; ra->preamble_index = preamble_index;
UE_list->tc_rnti[UE_id] = ra->rnti; UE_info->tc_rnti[UE_id] = ra->rnti;
LOG_I(MAC,"[gNB %d][RAPROC] CC_id %d Frame %d Activating Msg2 generation in frame %d, slot %d using RA rnti %x\n", LOG_I(MAC,"[gNB %d][RAPROC] CC_id %d Frame %d Activating Msg2 generation in frame %d, slot %d using RA rnti %x\n",
module_idP, module_idP,
...@@ -434,7 +434,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t ...@@ -434,7 +434,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id]; NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
NR_RA_t *ra = &cc->ra[0]; NR_RA_t *ra = &cc->ra[0];
NR_UE_list_t *UE_list = &mac->UE_list; NR_UE_info_t *UE_info = &mac->UE_info;
int UE_id = 0; int UE_id = 0;
if (ra->state == RA_IDLE) { if (ra->state == RA_IDLE) {
...@@ -448,9 +448,9 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t ...@@ -448,9 +448,9 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t
memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t)); memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t));
AssertFatal(UE_list->active[UE_id] >=0,"Cannot find UE_id %d is not active\n", UE_id); AssertFatal(UE_info->active[UE_id] >=0,"Cannot find UE_id %d is not active\n", UE_id);
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id]; NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1, AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP!\n", secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count); "downlinkBWP_ToAddModList has %d BWP!\n", secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count);
NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[ra->bwp_id-1]; NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[ra->bwp_id-1];
...@@ -547,7 +547,7 @@ void nr_generate_Msg2(module_id_t module_idP, ...@@ -547,7 +547,7 @@ void nr_generate_Msg2(module_id_t module_idP,
gNB_MAC_INST *nr_mac = RC.nrmac[module_idP]; gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = &nr_mac->common_channels[0]; NR_COMMON_channels_t *cc = &nr_mac->common_channels[0];
NR_RA_t *ra = &cc->ra[0]; NR_RA_t *ra = &cc->ra[0];
NR_UE_list_t *UE_list = &nr_mac->UE_list; NR_UE_info_t *UE_info = &nr_mac->UE_info;
NR_SearchSpace_t *ss = ra->ra_ss; NR_SearchSpace_t *ss = ra->ra_ss;
uint16_t RA_rnti = ra->RA_rnti; uint16_t RA_rnti = ra->RA_rnti;
...@@ -597,7 +597,7 @@ void nr_generate_Msg2(module_id_t module_idP, ...@@ -597,7 +597,7 @@ void nr_generate_Msg2(module_id_t module_idP,
// This code from this point on will not work on initialBWP or CORESET0 // This code from this point on will not work on initialBWP or CORESET0
AssertFatal(ra->bwp_id>0,"cannot work on initialBWP for now\n"); AssertFatal(ra->bwp_id>0,"cannot work on initialBWP for now\n");
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id]; NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1, AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP!\n", secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count); "downlinkBWP_ToAddModList has %d BWP!\n", secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count);
NR_BWP_Downlink_t *bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id - 1]; NR_BWP_Downlink_t *bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[ra->bwp_id - 1];
......
...@@ -76,12 +76,12 @@ int nr_generate_dlsch_pdu(module_id_t module_idP, ...@@ -76,12 +76,12 @@ int nr_generate_dlsch_pdu(module_id_t module_idP,
ce_ptr = &mac_header_control_elements[0]; ce_ptr = &mac_header_control_elements[0];
uint16_t UE_id = 0; //TODO need to get as a function parameter or need to invoke api to UE_id using module Id and RNTI uint16_t UE_id = 0; //TODO need to get as a function parameter or need to invoke api to UE_id using module Id and RNTI
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
NR_UE_list_t *UE_list = &gNB_mac->UE_list; NR_UE_info_t *UE_info = &gNB_mac->UE_info;
NR_UE_sched_ctrl_t *ue_sched_ctl = NULL; NR_UE_sched_ctrl_t *ue_sched_ctl = NULL;
//NR_CellGroupConfig_t *config = UE_list->secondaryCellGroup[UE_id]; //NR_CellGroupConfig_t *config = UE_info->secondaryCellGroup[UE_id];
ue_sched_ctl = &(UE_list->UE_sched_ctrl[UE_id]); ue_sched_ctl = &(UE_info->UE_sched_ctrl[UE_id]);
NR_mac_stats_t *mac_stats = &(UE_list->mac_stats[UE_id]); NR_mac_stats_t *mac_stats = &(UE_info->mac_stats[UE_id]);
// 1) Compute MAC CE and related subheaders // 1) Compute MAC CE and related subheaders
...@@ -449,19 +449,18 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id, ...@@ -449,19 +449,18 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
frame_t frame, frame_t frame,
sub_frame_t slot, sub_frame_t slot,
int num_slots_per_tdd) { int num_slots_per_tdd) {
NR_UE_list_t *UE_list = &RC.nrmac[module_id]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
const int UE_id = 0; const int UE_id = 0;
const int CC_id = 0; const int CC_id = 0;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
// TODO: reset per UE-info NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
sched_ctrl->rbSize = 0; sched_ctrl->rbSize = 0;
/* Retrieve amount of data to send for this UE */ /* Retrieve amount of data to send for this UE */
sched_ctrl->num_total_bytes = 0; sched_ctrl->num_total_bytes = 0;
const int lcid = DL_SCH_LCID_DTCH; const int lcid = DL_SCH_LCID_DTCH;
const uint16_t rnti = UE_list->rnti[UE_id]; const uint16_t rnti = UE_info->rnti[UE_id];
sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id, sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
rnti, rnti,
module_id, module_id,
...@@ -544,8 +543,8 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -544,8 +543,8 @@ void nr_schedule_ue_spec(module_id_t module_id,
sub_frame_t slot, sub_frame_t slot,
int num_slots_per_tdd) { int num_slots_per_tdd) {
gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_id];
NR_UE_list_t *UE_list = &gNB_mac->UE_list; NR_UE_info_t *UE_info = &gNB_mac->UE_info;
if (UE_list->num_UEs == 0) if (UE_info->num_UEs == 0)
return; return;
/* PREPROCESSOR */ /* PREPROCESSOR */
...@@ -555,7 +554,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -555,7 +554,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
const int UE_id = 0; const int UE_id = 0;
const int CC_id = 0; const int CC_id = 0;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
if (sched_ctrl->rbSize < 0 && !get_softmodem_params()->phy_test) if (sched_ctrl->rbSize < 0 && !get_softmodem_params()->phy_test)
return; return;
...@@ -594,7 +593,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -594,7 +593,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES]; uint8_t mac_sdus[MAX_NR_DLSCH_PAYLOAD_BYTES];
unsigned char sdu_lcids[NB_RB_MAX] = {0}; unsigned char sdu_lcids[NB_RB_MAX] = {0};
const rnti_t rnti = UE_list->rnti[UE_id]; const rnti_t rnti = UE_info->rnti[UE_id];
const int lcid = DL_SCH_LCID_DTCH; const int lcid = DL_SCH_LCID_DTCH;
if (sched_ctrl->num_total_bytes > 0) { if (sched_ctrl->num_total_bytes > 0) {
LOG_D(MAC, LOG_D(MAC,
...@@ -661,7 +660,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -661,7 +660,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
const int offset = nr_generate_dlsch_pdu( const int offset = nr_generate_dlsch_pdu(
module_id, module_id,
(unsigned char *)mac_sdus, (unsigned char *)mac_sdus,
(unsigned char *)gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0], (unsigned char *)gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0],
num_sdus, // num_sdus num_sdus, // num_sdus
sdu_lengths, sdu_lengths,
sdu_lcids, sdu_lcids,
...@@ -672,7 +671,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -672,7 +671,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
// Padding: fill remainder of DLSCH with 0 // Padding: fill remainder of DLSCH with 0
if (post_padding > 0) { if (post_padding > 0) {
for (int j = 0; j < TBS - offset; j++) for (int j = 0; j < TBS - offset; j++)
gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0][offset + j] = 0; gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0][offset + j] = 0;
} }
const int current_harq_pid = sched_ctrl->current_harq_pid; const int current_harq_pid = sched_ctrl->current_harq_pid;
...@@ -680,9 +679,9 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -680,9 +679,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
NR_sched_pucch *pucch = &sched_ctrl->sched_pucch[sched_ctrl->pucch_sched_idx]; NR_sched_pucch *pucch = &sched_ctrl->sched_pucch[sched_ctrl->pucch_sched_idx];
harq->feedback_slot = pucch->ul_slot; harq->feedback_slot = pucch->ul_slot;
harq->is_waiting = 1; harq->is_waiting = 1;
UE_list->mac_stats[UE_id].dlsch_rounds[harq->round]++; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
if (harq->round == 0) if (harq->round == 0)
UE_list->mac_stats[UE_id].dlsch_total_bytes += TBS; UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS;
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
nr_fill_nfapi_dl_pdu(module_id, nr_fill_nfapi_dl_pdu(module_id,
...@@ -728,7 +727,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -728,7 +727,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
slot, slot,
TBS); TBS);
for(int i = 0; i < 10; i++) { for(int i = 0; i < 10; i++) {
LOG_I(MAC, "byte %d : %x\n", i,((uint8_t *)gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0])[i]); LOG_I(MAC, "byte %d : %x\n", i,((uint8_t *)gNB_mac->UE_info.DLSCH_pdu[0][0].payload[0])[i]);
} }
} }
#endif #endif
......
...@@ -180,9 +180,9 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, ...@@ -180,9 +180,9 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
// NR_COMMON_channels_t *cc = nr_mac->common_channels; // NR_COMMON_channels_t *cc = nr_mac->common_channels;
// NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; // NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
NR_UE_list_t *UE_list = &nr_mac->UE_list; NR_UE_info_t *UE_info = &nr_mac->UE_info;
AssertFatal(UE_list->active[UE_id] >=0,"UE_id %d is not active\n",UE_id); AssertFatal(UE_info->active[UE_id] >=0,"UE_id %d is not active\n",UE_id);
int coreset_id = coreset->controlResourceSetId; int coreset_id = coreset->controlResourceSetId;
int *cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id]; int *cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id];
...@@ -196,7 +196,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, ...@@ -196,7 +196,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
uint16_t N_reg = n_rb * coreset->duration; uint16_t N_reg = n_rb * coreset->duration;
uint16_t Y=0, N_cce, M_s_max, n_CI=0; uint16_t Y=0, N_cce, M_s_max, n_CI=0;
uint16_t n_RNTI = search_space == 1 ? UE_list->rnti[UE_id]:0; uint16_t n_RNTI = search_space == 1 ? UE_info->rnti[UE_id]:0;
uint32_t A[3]={39827,39829,39839}; uint32_t A[3]={39827,39829,39839};
N_cce = N_reg / NR_NB_REG_PER_CCE; N_cce = N_reg / NR_NB_REG_PER_CCE;
...@@ -464,12 +464,9 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP, ...@@ -464,12 +464,9 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
NR_COMMON_channels_t *cc = nr_mac->common_channels; NR_COMMON_channels_t *cc = nr_mac->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu;
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list; NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id];
AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1, AssertFatal(secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP!\n", "downlinkBWP_ToAddModList has %d BWP!\n",
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count); secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count);
...@@ -479,12 +476,12 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP, ...@@ -479,12 +476,12 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
AssertFatal(bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count>0, AssertFatal(bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count>0,
"searchPsacesToAddModList is empty\n"); "searchPsacesToAddModList is empty\n");
dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); memset((void*)dl_tti_pdcch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE; dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE;
dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu));
dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs+1]; nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs+1];
memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE; dl_tti_pdsch_pdu->PDUType = NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE;
dl_tti_pdsch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdsch_pdu)); dl_tti_pdsch_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdsch_pdu));
...@@ -494,7 +491,7 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP, ...@@ -494,7 +491,7 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->pduBitmap = 0;
pdsch_pdu_rel15->rnti = UE_list->rnti[UE_id]; pdsch_pdu_rel15->rnti = UE_info->rnti[UE_id];
pdsch_pdu_rel15->pduIndex = 0; pdsch_pdu_rel15->pduIndex = 0;
// BWP // BWP
...@@ -569,7 +566,7 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP, ...@@ -569,7 +566,7 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
dci_pdu_rel15[0].dai[0].val = (pucch_sched->dai_c-1)&3; dci_pdu_rel15[0].dai[0].val = (pucch_sched->dai_c-1)&3;
// TPC for PUCCH // TPC for PUCCH
dci_pdu_rel15[0].tpc = UE_list->UE_sched_ctrl[UE_id].tpc1; // table 7.2.1-1 in 38.213 dci_pdu_rel15[0].tpc = UE_info->UE_sched_ctrl[UE_id].tpc1; // table 7.2.1-1 in 38.213
// PUCCH resource indicator // PUCCH resource indicator
dci_pdu_rel15[0].pucch_resource_indicator = pucch_sched->resource_indicator; dci_pdu_rel15[0].pucch_resource_indicator = pucch_sched->resource_indicator;
// PDSCH to HARQ TI // PDSCH to HARQ TI
...@@ -594,7 +591,7 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP, ...@@ -594,7 +591,7 @@ void nr_fill_nfapi_dl_pdu(int Mod_idP,
nr_configure_pdcch(nr_mac, nr_configure_pdcch(nr_mac,
pdcch_pdu_rel15, pdcch_pdu_rel15,
UE_list->rnti[UE_id], UE_info->rnti[UE_id],
ss, ss,
coreset, coreset,
scc, scc,
...@@ -1593,10 +1590,10 @@ int extract_length(int startSymbolAndLength) { ...@@ -1593,10 +1590,10 @@ int extract_length(int startSymbolAndLength) {
} }
/* /*
* Dump the UL or DL UE_list into LOG_T(MAC) * Dump the UL or DL UE_info into LOG_T(MAC)
*/ */
void void
dump_nr_ue_list(NR_UE_list_t *listP, dump_nr_ue_list(NR_UE_info_t *listP,
int ul_flag) int ul_flag)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
...@@ -1621,11 +1618,11 @@ int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP) ...@@ -1621,11 +1618,11 @@ int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
int UE_id; int UE_id;
NR_UE_list_t *UE_list = &RC.nrmac[mod_idP]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info;
for (UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) { for (UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) {
if (UE_list->active[UE_id] == TRUE) { if (UE_info->active[UE_id]) {
if (UE_list->rnti[UE_id] == rntiP) { if (UE_info->rnti[UE_id] == rntiP) {
return UE_id; return UE_id;
} }
} }
...@@ -1638,7 +1635,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1638,7 +1635,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
int UE_id; int UE_id;
int i; int i;
NR_UE_list_t *UE_list = &RC.nrmac[mod_idP]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info;
NR_COMMON_channels_t *cc = RC.nrmac[mod_idP]->common_channels; NR_COMMON_channels_t *cc = RC.nrmac[mod_idP]->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
int num_slots_ul = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; int num_slots_ul = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
...@@ -1647,29 +1644,29 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1647,29 +1644,29 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
LOG_I(MAC, "[gNB %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n", LOG_I(MAC, "[gNB %d] Adding UE with rnti %x (next avail %d, num_UEs %d)\n",
mod_idP, mod_idP,
rntiP, rntiP,
UE_list->avail, UE_info->avail,
UE_list->num_UEs); UE_info->num_UEs);
dump_nr_ue_list(UE_list, 0); dump_nr_ue_list(UE_info, 0);
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) { for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (UE_list->active[i] == TRUE) if (UE_info->active[i])
continue; continue;
UE_id = i; UE_id = i;
UE_list->num_UEs++; UE_info->num_UEs++;
UE_list->active[UE_id] = TRUE; UE_info->active[UE_id] = TRUE;
UE_list->rnti[UE_id] = rntiP; UE_info->rnti[UE_id] = rntiP;
memset((void *) &UE_list->UE_sched_ctrl[UE_id], memset((void *) &UE_info->UE_sched_ctrl[UE_id],
0, 0,
sizeof(NR_UE_sched_ctrl_t)); sizeof(NR_UE_sched_ctrl_t));
UE_list->UE_sched_ctrl[UE_id].ul_rssi = 0; UE_info->UE_sched_ctrl[UE_id].ul_rssi = 0;
UE_list->UE_sched_ctrl[UE_id].sched_pucch = (NR_sched_pucch *)malloc(num_slots_ul*sizeof(NR_sched_pucch)); UE_info->UE_sched_ctrl[UE_id].sched_pucch = (NR_sched_pucch *)malloc(num_slots_ul*sizeof(NR_sched_pucch));
UE_list->UE_sched_ctrl[UE_id].sched_pusch = (NR_sched_pusch *)malloc(num_slots_ul*sizeof(NR_sched_pusch)); UE_info->UE_sched_ctrl[UE_id].sched_pusch = (NR_sched_pusch *)malloc(num_slots_ul*sizeof(NR_sched_pusch));
for (int k=0; k<num_slots_ul; k++) { for (int k=0; k<num_slots_ul; k++) {
memset((void *) &UE_list->UE_sched_ctrl[UE_id].sched_pucch[k], memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pucch[k],
0, 0,
sizeof(NR_sched_pucch)); sizeof(NR_sched_pucch));
memset((void *) &UE_list->UE_sched_ctrl[UE_id].sched_pusch[k], memset((void *) &UE_info->UE_sched_ctrl[UE_id].sched_pusch[k],
0, 0,
sizeof(NR_sched_pusch)); sizeof(NR_sched_pusch));
} }
...@@ -1677,14 +1674,14 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){ ...@@ -1677,14 +1674,14 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
mod_idP, mod_idP,
UE_id, UE_id,
rntiP); rntiP);
dump_nr_ue_list(UE_list, dump_nr_ue_list(UE_info,
0); 0);
return (UE_id); return (UE_id);
} }
// printf("MAC: cannot add new UE for rnti %x\n", rntiP); // printf("MAC: cannot add new UE for rnti %x\n", rntiP);
LOG_E(MAC, "error in add_new_ue(), could not find space in UE_list, Dumping UE list\n"); LOG_E(MAC, "error in add_new_ue(), could not find space in UE_info, Dumping UE list\n");
dump_nr_ue_list(UE_list, dump_nr_ue_list(UE_info,
0); 0);
return -1; return -1;
} }
...@@ -1707,8 +1704,8 @@ void get_pdsch_to_harq_feedback(int Mod_idP, ...@@ -1707,8 +1704,8 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
uint8_t *pdsch_to_harq_feedback) { uint8_t *pdsch_to_harq_feedback) {
int bwp_id=1; int bwp_id=1;
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id]; NR_CellGroupConfig_t *secondaryCellGroup = UE_info->secondaryCellGroup[UE_id];
NR_BWP_Downlink_t *bwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]; NR_BWP_Downlink_t *bwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1];
NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]; NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1];
...@@ -1760,7 +1757,7 @@ void nr_update_pucch_scheduling(int Mod_idP, ...@@ -1760,7 +1757,7 @@ void nr_update_pucch_scheduling(int Mod_idP,
int *pucch_id) { int *pucch_id) {
NR_ServingCellConfigCommon_t *scc = RC.nrmac[Mod_idP]->common_channels->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = RC.nrmac[Mod_idP]->common_channels->ServingCellConfigCommon;
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
NR_sched_pucch *curr_pucch; NR_sched_pucch *curr_pucch;
int first_ul_slot_tdd,k,i; int first_ul_slot_tdd,k,i;
uint8_t pdsch_to_harq_feedback[8]; uint8_t pdsch_to_harq_feedback[8];
...@@ -1775,7 +1772,7 @@ void nr_update_pucch_scheduling(int Mod_idP, ...@@ -1775,7 +1772,7 @@ void nr_update_pucch_scheduling(int Mod_idP,
// for each possible ul or mixed slot // for each possible ul or mixed slot
for (k=0; k<nr_ulmix_slots; k++) { for (k=0; k<nr_ulmix_slots; k++) {
curr_pucch = &UE_list->UE_sched_ctrl[UE_id].sched_pucch[k]; curr_pucch = &UE_info->UE_sched_ctrl[UE_id].sched_pucch[k];
// if there is free room in current pucch structure // if there is free room in current pucch structure
if (curr_pucch->dai_c<MAX_ACK_BITS) { if (curr_pucch->dai_c<MAX_ACK_BITS) {
curr_pucch->frame = frameP; curr_pucch->frame = frameP;
......
...@@ -212,7 +212,7 @@ void nr_process_mac_pdu( ...@@ -212,7 +212,7 @@ void nr_process_mac_pdu(
LOG_D(MAC, "[UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len); LOG_D(MAC, "[UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len);
int UE_id = find_nr_UE_id(module_idP, rnti); int UE_id = find_nr_UE_id(module_idP, rnti);
RC.nrmac[module_idP]->UE_list.mac_stats[UE_id].lc_bytes_rx[rx_lcid] += mac_sdu_len; RC.nrmac[module_idP]->UE_info.mac_stats[UE_id].lc_bytes_rx[rx_lcid] += mac_sdu_len;
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP);
...@@ -313,19 +313,19 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -313,19 +313,19 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const uint16_t rssi){ const uint16_t rssi){
int current_rnti = 0, UE_id = -1, harq_pid = 0; int current_rnti = 0, UE_id = -1, harq_pid = 0;
gNB_MAC_INST *gNB_mac = NULL; gNB_MAC_INST *gNB_mac = NULL;
NR_UE_list_t *UE_list = NULL; NR_UE_info_t *UE_info = NULL;
NR_UE_sched_ctrl_t *UE_scheduling_control = NULL; NR_UE_sched_ctrl_t *UE_scheduling_control = NULL;
current_rnti = rntiP; current_rnti = rntiP;
UE_id = find_nr_UE_id(gnb_mod_idP, current_rnti); UE_id = find_nr_UE_id(gnb_mod_idP, current_rnti);
gNB_mac = RC.nrmac[gnb_mod_idP]; gNB_mac = RC.nrmac[gnb_mod_idP];
UE_list = &gNB_mac->UE_list; UE_info = &gNB_mac->UE_info;
int target_snrx10 = gNB_mac->pusch_target_snrx10; int target_snrx10 = gNB_mac->pusch_target_snrx10;
if (UE_id != -1) { if (UE_id != -1) {
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]); UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
UE_list->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP; UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP;
LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d\n", LOG_D(MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d\n",
gnb_mod_idP, gnb_mod_idP,
harq_pid, harq_pid,
...@@ -369,10 +369,10 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -369,10 +369,10 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
// random access pusch with TC-RNTI // random access pusch with TC-RNTI
if (sduP != NULL) { // if the CRC passed if (sduP != NULL) { // if the CRC passed
for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) { for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) {
if (UE_list->active[i] == TRUE) { if (UE_info->active[i]) {
if (UE_list->tc_rnti[i] == current_rnti) { if (UE_info->tc_rnti[i] == current_rnti) {
// for now the only thing we are doing is set the UE as 5G connected // for now the only thing we are doing is set the UE as 5G connected
UE_list->fiveG_connected[i] = true; UE_info->fiveG_connected[i] = true;
LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n", LOG_I(MAC, "[gNB %d][RAPROC] PUSCH with TC_RNTI %x received correctly and UE_id %d is now 5G connected\n",
gnb_mod_idP, current_rnti, i); gnb_mod_idP, current_rnti, i);
} }
......
...@@ -300,7 +300,7 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB); ...@@ -300,7 +300,7 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
void dump_nr_ue_list(NR_UE_list_t *listP, int ul_flag); void dump_nr_ue_list(NR_UE_info_t *listP, int ul_flag);
int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP); int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP);
......
...@@ -50,7 +50,7 @@ void mac_top_init_gNB(void) ...@@ -50,7 +50,7 @@ void mac_top_init_gNB(void)
{ {
module_id_t i; module_id_t i;
int list_el; int list_el;
NR_UE_list_t *UE_list; NR_UE_info_t *UE_info;
gNB_MAC_INST *nrmac; gNB_MAC_INST *nrmac;
LOG_I(MAC, "[MAIN] Init function start:nb_nr_macrlc_inst=%d\n",RC.nb_nr_macrlc_inst); LOG_I(MAC, "[MAIN] Init function start:nb_nr_macrlc_inst=%d\n",RC.nb_nr_macrlc_inst);
...@@ -104,29 +104,29 @@ void mac_top_init_gNB(void) ...@@ -104,29 +104,29 @@ void mac_top_init_gNB(void)
nrmac = RC.nrmac[i]; nrmac = RC.nrmac[i];
nrmac->if_inst = NR_IF_Module_init(i); nrmac->if_inst = NR_IF_Module_init(i);
UE_list = &nrmac->UE_list; UE_info = &nrmac->UE_info;
UE_list->num_UEs = 0; UE_info->num_UEs = 0;
UE_list->head = -1; UE_info->head = -1;
UE_list->head_ul = -1; UE_info->head_ul = -1;
UE_list->avail = 0; UE_info->avail = 0;
for (list_el = 0; list_el < MAX_MOBILES_PER_GNB - 1; list_el++) { for (list_el = 0; list_el < MAX_MOBILES_PER_GNB - 1; list_el++) {
UE_list->next[list_el] = list_el + 1; UE_info->next[list_el] = list_el + 1;
UE_list->next_ul[list_el] = list_el + 1; UE_info->next_ul[list_el] = list_el + 1;
UE_list->active[list_el] = FALSE; UE_info->active[list_el] = FALSE;
for (int list_harq = 0; list_harq < NR_MAX_NB_HARQ_PROCESSES; list_harq++) { for (int list_harq = 0; list_harq < NR_MAX_NB_HARQ_PROCESSES; list_harq++) {
UE_list->UE_sched_ctrl[list_el].harq_processes[list_harq].round = 0; UE_info->UE_sched_ctrl[list_el].harq_processes[list_harq].round = 0;
UE_list->UE_sched_ctrl[list_el].harq_processes[list_harq].ndi = 0; UE_info->UE_sched_ctrl[list_el].harq_processes[list_harq].ndi = 0;
UE_list->UE_sched_ctrl[list_el].harq_processes[list_harq].is_waiting = 0; UE_info->UE_sched_ctrl[list_el].harq_processes[list_harq].is_waiting = 0;
UE_list->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].round = 0; UE_info->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].round = 0;
UE_list->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].ndi = 0; UE_info->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].ndi = 0;
UE_list->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].state = 0; UE_info->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].state = 0;
} }
} }
UE_list->next[list_el] = -1; UE_info->next[list_el] = -1;
UE_list->next_ul[list_el] = -1; UE_info->next_ul[list_el] = -1;
UE_list->active[list_el] = FALSE; UE_info->active[list_el] = FALSE;
} }
srand48(0); srand48(0);
......
...@@ -361,7 +361,7 @@ typedef struct { ...@@ -361,7 +361,7 @@ typedef struct {
rnti_t tc_rnti[MAX_MOBILES_PER_GNB]; rnti_t tc_rnti[MAX_MOBILES_PER_GNB];
NR_preamble_ue preambles[MAX_MOBILES_PER_GNB]; NR_preamble_ue preambles[MAX_MOBILES_PER_GNB];
NR_CellGroupConfig_t *secondaryCellGroup[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *secondaryCellGroup[MAX_MOBILES_PER_GNB];
} NR_UE_list_t; } NR_UE_info_t;
/*! \brief top level eNB MAC structure */ /*! \brief top level eNB MAC structure */
typedef struct gNB_MAC_INST_s { typedef struct gNB_MAC_INST_s {
...@@ -399,7 +399,7 @@ typedef struct gNB_MAC_INST_s { ...@@ -399,7 +399,7 @@ typedef struct gNB_MAC_INST_s {
/// NFAPI DL PDU structure /// NFAPI DL PDU structure
nfapi_nr_tx_data_request_t TX_req[NFAPI_CC_MAX]; nfapi_nr_tx_data_request_t TX_req[NFAPI_CC_MAX];
NR_UE_list_t UE_list; NR_UE_info_t UE_info;
/// UL handle /// UL handle
uint32_t ul_handle; uint32_t ul_handle;
......
...@@ -181,10 +181,10 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { ...@@ -181,10 +181,10 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
clear_nr_nfapi_information(mac,CC_id,UL_info->frame,UL_info->slot); clear_nr_nfapi_information(mac,CC_id,UL_info->frame,UL_info->slot);
handle_nr_rach(UL_info); handle_nr_rach(UL_info);
handle_nr_uci(UL_info,&mac->UE_list.UE_sched_ctrl[0],&mac->UE_list.mac_stats[0],mac->pucch_target_snrx10); handle_nr_uci(UL_info,&mac->UE_info.UE_sched_ctrl[0],&mac->UE_info.mac_stats[0],mac->pucch_target_snrx10);
// clear HI prior to handling ULSCH // clear HI prior to handling ULSCH
mac->UL_dci_req[CC_id].numPdus = 0; mac->UL_dci_req[CC_id].numPdus = 0;
handle_nr_ulsch(UL_info, &mac->UE_list.UE_sched_ctrl[0],&mac->UE_list.mac_stats[0]); handle_nr_ulsch(UL_info, &mac->UE_info.UE_sched_ctrl[0],&mac->UE_info.mac_stats[0]);
if (nfapi_mode != 1) { if (nfapi_mode != 1) {
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) { if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
......
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