Commit 1f8cdc16 authored by Robert Schmidt's avatar Robert Schmidt

Trigger calculate_preferred_[du]l_tda() for all BWPs in secondaryCellGroup

parent 65979cae
......@@ -418,9 +418,21 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
RC.nrmac[Mod_idP]->secondaryCellGroupCommon = secondaryCellGroup;
const int bwp_id = 1;
calculate_preferred_dl_tda(Mod_idP, secondaryCellGroup, bwp_id);
calculate_preferred_ul_tda(Mod_idP, secondaryCellGroup, bwp_id);
const NR_ServingCellConfig_t *servingCellConfig = secondaryCellGroup->spCellConfig->spCellConfigDedicated;
const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList;
AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n");
for (int i = 0; i < bwpList->list.count; ++i) {
const NR_BWP_Downlink_t *bwp = bwpList->list.array[i];
calculate_preferred_dl_tda(Mod_idP, bwp);
}
const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList =
servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList;
AssertFatal(ubwpList->list.count > 0, "downlinkBWP_ToAddModList no BWPs!\n");
for (int i = 0; i < ubwpList->list.count; ++i) {
const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[i];
calculate_preferred_ul_tda(Mod_idP, ubwp);
}
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
if (add_ue == 1 && get_softmodem_params()->phy_test) {
......
......@@ -56,9 +56,10 @@
#define WORD 32
//#define SIZE_OF_POINTER sizeof (void *)
void calculate_preferred_dl_tda(module_id_t module_id, NR_CellGroupConfig_t *secondaryCellGroup, int bwp_id)
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp)
{
gNB_MAC_INST *nrmac = RC.nrmac[module_id];
const int bwp_id = bwp->bwp_Id;
if (nrmac->preferred_dl_tda[bwp_id])
return;
......@@ -68,14 +69,6 @@ void calculate_preferred_dl_tda(module_id_t module_id, NR_CellGroupConfig_t *sec
scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
const int symb_dlMixed = tdd ? (1 << tdd->nrofDownlinkSymbols) - 1 : 0;
const NR_ServingCellConfig_t *servingCellConfig = secondaryCellGroup->spCellConfig->spCellConfigDedicated;
const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList;
AssertFatal(bwpList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP but cannot handle more in %s!\n",
bwpList->list.count,
__func__);
const NR_BWP_Downlink_t *bwp = bwpList->list.array[bwp_id - 1];
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
const NR_SearchSpace_t *search_space = get_searchspace(bwp, target_ss);
const NR_ControlResourceSet_t *coreset = get_coreset(bwp, search_space, 1 /* dedicated */);
......
......@@ -61,9 +61,10 @@ const uint32_t NR_LONG_BSR_TABLE[256] ={
35910462, 38241455, 40723756, 43367187, 46182206, 49179951, 52372284, 55771835, 59392055, 63247269, 67352729, 71724679, 76380419, 81338368, 162676736, 4294967295
};
void calculate_preferred_ul_tda(module_id_t module_id, NR_CellGroupConfig_t *secondaryCellGroup, int bwp_id)
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp)
{
gNB_MAC_INST *nrmac = RC.nrmac[module_id];
const int bwp_id = ubwp->bwp_Id;
if (nrmac->preferred_ul_tda[bwp_id])
return;
......@@ -75,14 +76,6 @@ void calculate_preferred_ul_tda(module_id_t module_id, NR_CellGroupConfig_t *sec
/* Uplink symbols are at the end of the slot */
const int symb_ulMixed = tdd ? ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols) : 0;
const NR_ServingCellConfig_t *servingCellConfig = secondaryCellGroup->spCellConfig->spCellConfigDedicated;
const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList;
AssertFatal(ubwpList->list.count == 1,
"downlinkBWP_ToAddModList has %d BWP but cannot handle more in %s!\n",
ubwpList->list.count,
__func__);
const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[bwp_id - 1];
const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList;
// for the moment, just block any symbol that might hold a PUCCH, regardless
// of the RB. This is a big simplification, as most RBs will NOT have a PUCCH
......
......@@ -383,8 +383,8 @@ int16_t ssb_index_from_prach(module_id_t module_idP,
void find_SSB_and_RO_available(module_id_t module_idP);
void calculate_preferred_dl_tda(module_id_t module_id, NR_CellGroupConfig_t *secondaryCellGroup, int bwp_id);
void calculate_preferred_ul_tda(module_id_t module_id, NR_CellGroupConfig_t *secondaryCellGroup, int bwp_id);
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp);
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp);
bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id);
......
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