Commit 43b7c16e authored by rmagueta's avatar rmagueta

Fix RA after merge

parent 72b5fccc
...@@ -339,9 +339,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -339,9 +339,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int pdsch_AntennaPorts, int pdsch_AntennaPorts,
int pusch_AntennaPorts, int pusch_AntennaPorts,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
int add_ue, int add_ue,
uint32_t rnti, uint32_t rnti,
NR_CellGroupConfig_t *CellGroup){ NR_CellGroupConfig_t *CellGroup){
if (scc != NULL ) { if (scc != NULL ) {
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present); AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
...@@ -384,7 +384,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -384,7 +384,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
ssb_SubcarrierOffset, ssb_SubcarrierOffset,
pdsch_AntennaPorts, pdsch_AntennaPorts,
pusch_AntennaPorts, pusch_AntennaPorts,
scc); scc);
LOG_E(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req); LOG_E(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req);
// if in nFAPI mode // if in nFAPI mode
...@@ -448,19 +448,23 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -448,19 +448,23 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
if (CellGroup) { if (CellGroup) {
const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated; const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated;
const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList; const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList;
AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n"); if(bwpList) {
for (int i = 0; i < bwpList->list.count; ++i) { AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n");
const NR_BWP_Downlink_t *bwp = bwpList->list.array[i]; for (int i = 0; i < bwpList->list.count; ++i) {
calculate_preferred_dl_tda(Mod_idP, bwp); const NR_BWP_Downlink_t *bwp = bwpList->list.array[i];
calculate_preferred_dl_tda(Mod_idP, bwp);
}
} }
const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList;
servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList; if(ubwpList) {
AssertFatal(ubwpList->list.count > 0, "downlinkBWP_ToAddModList no BWPs!\n"); AssertFatal(ubwpList->list.count > 0, "downlinkBWP_ToAddModList no BWPs!\n");
for (int i = 0; i < ubwpList->list.count; ++i) { for (int i = 0; i < ubwpList->list.count; ++i) {
const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[i]; const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[i];
calculate_preferred_ul_tda(Mod_idP, ubwp); calculate_preferred_ul_tda(Mod_idP, ubwp);
}
} }
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
...@@ -482,7 +486,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -482,7 +486,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
NR_RA_t *ra = &cc->ra[ra_index]; NR_RA_t *ra = &cc->ra[ra_index];
ra->CellGroup = CellGroup; ra->CellGroup = CellGroup;
if (CellGroup->spCellConfig && CellGroup->spCellConfig->reconfigurationWithSync && if (CellGroup->spCellConfig && CellGroup->spCellConfig->reconfigurationWithSync &&
CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated!=NULL) { CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated!=NULL) {
if (CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra != NULL) { if (CellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra != NULL) {
ra->cfra = true; ra->cfra = true;
ra->rnti = rnti; ra->rnti = rnti;
......
...@@ -355,7 +355,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -355,7 +355,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing); nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing);
} }
memset(RC.nrmac[module_idP]->cce_list[bwp_id][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 memset(RC.nrmac[module_idP]->cce_list[0][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0
memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1 memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1
NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info;
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id])
......
...@@ -713,10 +713,6 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -713,10 +713,6 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
int UE_id = UE_info->list.head; int UE_id = UE_info->list.head;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot];
if (tda < 0)
return;
const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp ? const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp ?
sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth:
scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,
......
...@@ -139,9 +139,7 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, ...@@ -139,9 +139,7 @@ NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
"search space\n"); "search space\n");
return coreset; return coreset;
} else { } else {
// AssertFatal(bwp!=NULL,"bwp is null here, we have to check for a dedicated configuration for initialBWP in CellGroup, todo\n");
const int n = bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.count; const int n = bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.count;
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
NR_ControlResourceSet_t *coreset = NR_ControlResourceSet_t *coreset =
bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[i]; bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[i];
...@@ -1800,6 +1798,7 @@ int get_ul_bwp_id(const NR_ServingCellConfig_t *servingCellConfig) ...@@ -1800,6 +1798,7 @@ int get_ul_bwp_id(const NR_ServingCellConfig_t *servingCellConfig)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellGroup) int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellGroup)
{ {
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_idP]->common_channels[0].ServingCellConfigCommon;
NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info;
LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti %x (num_UEs %d)\n", LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti %x (num_UEs %d)\n",
mod_idP, mod_idP,
...@@ -1841,9 +1840,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG ...@@ -1841,9 +1840,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
bwpList->list.count); bwpList->list.count);
const int bwp_id = 1; const int bwp_id = 1;
sched_ctrl->active_bwp = bwpList ? bwpList->list.array[bwp_id - 1] : NULL; sched_ctrl->active_bwp = bwpList ? bwpList->list.array[bwp_id - 1] : NULL;
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common;
sched_ctrl->search_space = get_searchspace(NULL, sched_ctrl->active_bwp, target_ss); sched_ctrl->search_space = get_searchspace(scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss);
sched_ctrl->coreset = get_coreset(NULL, sched_ctrl->active_bwp, sched_ctrl->search_space, 1 /* dedicated */); sched_ctrl->coreset = get_coreset(scc, sched_ctrl->active_bwp, sched_ctrl->search_space, target_ss);
const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL; const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL;
if (ubwpList) AssertFatal(ubwpList->list.count == 1, if (ubwpList) AssertFatal(ubwpList->list.count == 1,
"uplinkBWP_ToAddModList has %d BWP!\n", "uplinkBWP_ToAddModList has %d BWP!\n",
......
...@@ -1144,7 +1144,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -1144,7 +1144,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
* schedule now (slot + k2 is not UL slot) */ * schedule now (slot + k2 is not UL slot) */
int UE_id = UE_info->list.head; int UE_id = UE_info->list.head;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const int tda = nr_mac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot]; const int tda = sched_ctrl->active_ubwp ? nr_mac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0;
if (tda < 0) if (tda < 0)
return false; return false;
int K2 = get_K2(scc, sched_ctrl->active_ubwp, tda, mu); int K2 = get_K2(scc, sched_ctrl->active_ubwp, tda, mu);
......
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