Commit 0289bb57 authored by francescomani's avatar francescomani

SRS for multiple BWPs

parent 8403b2c6
......@@ -1092,7 +1092,7 @@ void fill_initial_SpCellConfig(int uid,
// We are using do_srs = 0 here because the periodic SRS will only be enabled in update_cellGroupConfig() if do_srs == 1
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
config_srs(initialUplinkBWP->srs_Config, curr_bwp, uid, 0);
config_srs(initialUplinkBWP->srs_Config, curr_bwp, uid, 0, 0);
scheduling_request_config(scc, pucch_Config);
......@@ -1598,6 +1598,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
config_srs(SpCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config,
curr_bwp,
uid,
0,
configuration->do_SRS);
}
......@@ -1606,6 +1607,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,
configuration->force_256qam_off ? NULL : uecap, bwp_Dedicated, scc);
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
struct NR_UplinkConfig__uplinkBWP_ToAddModList *UL_BWP_list = SpCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList;
if (DL_BWP_list) {
for (int i=0; i<DL_BWP_list->list.count; i++){
NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i];
......@@ -1613,6 +1615,17 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
set_dl_mcs_table(scs, configuration->force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, scc);
}
}
if (UL_BWP_list) {
for (int i=0; i<UL_BWP_list->list.count; i++) {
NR_BWP_Uplink_t *ul_bwp = UL_BWP_list->list.array[i];
int bwp_size = NRRIV2BW(ul_bwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
config_srs(ul_bwp->bwp_Dedicated->srs_Config,
bwp_size,
uid,
i+1,
configuration->do_SRS);
}
}
update_cqitables(bwp_Dedicated->pdsch_Config, SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup);
}
}
......
......@@ -354,6 +354,7 @@ long rrc_get_max_nr_csrs(const uint8_t max_rbs, const long b_SRS) {
void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
const int curr_bwp,
const int uid,
const int res_id,
const int do_srs) {
setup_release_srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
......@@ -383,10 +384,10 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
srs_Config->srs_ResourceSetToAddModList = calloc(1,sizeof(*srs_Config->srs_ResourceSetToAddModList));
NR_SRS_ResourceSet_t *srs_resset0 = calloc(1,sizeof(*srs_resset0));
srs_resset0->srs_ResourceSetId = 0;
srs_resset0->srs_ResourceSetId = res_id;
srs_resset0->srs_ResourceIdList = calloc(1,sizeof(*srs_resset0->srs_ResourceIdList));
NR_SRS_ResourceId_t *srs_resset0_id = calloc(1,sizeof(*srs_resset0_id));
*srs_resset0_id = 0;
*srs_resset0_id = res_id;
ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list, srs_resset0_id);
srs_Config->srs_ResourceToReleaseList=NULL;
if (do_srs) {
......@@ -415,7 +416,7 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
srs_Config->srs_ResourceToAddModList = calloc(1,sizeof(*srs_Config->srs_ResourceToAddModList));
NR_SRS_Resource_t *srs_res0=calloc(1,sizeof(*srs_res0));
srs_res0->srs_ResourceId = 0;
srs_res0->srs_ResourceId = res_id;
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
srs_res0->ptrs_PortIndex = NULL;
srs_res0->transmissionComb.present = NR_SRS_Resource__transmissionComb_PR_n2;
......@@ -1114,11 +1115,11 @@ void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
pusch_Config->tp_pi2BPSK=NULL;
ubwp->bwp_Dedicated->srs_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->srs_Config));
ubwp->bwp_Dedicated->srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
config_srs(ubwp->bwp_Dedicated->srs_Config,
curr_bwp,
uid,
0);
bwp_loop+1,
configuration->do_SRS);
ubwp->bwp_Dedicated->configuredGrantConfig = NULL;
ubwp->bwp_Dedicated->beamFailureRecoveryConfig = NULL;
......
......@@ -147,6 +147,7 @@ void config_csiim(int do_csirs, int dl_antenna_ports, int curr_bwp,
void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
const int curr_bwp,
const int uid,
const int res_id,
const int do_srs);
void set_dl_mcs_table(int scs,
NR_UE_NR_Capability_t *cap,
......
......@@ -489,8 +489,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
initialUplinkBWP->srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
config_srs(initialUplinkBWP->srs_Config, curr_bwp, uid, configuration->do_SRS);
config_srs(initialUplinkBWP->srs_Config, curr_bwp, uid, 0, configuration->do_SRS);
// Downlink BWPs
int n_dl_bwp = 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