Commit 4156f895 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Set nrofSRS_Ports = min(maxNumberSRS_Ports, maxMIMO_Layers)

parent 14d4afe6
......@@ -1003,9 +1003,10 @@ void fill_initial_SpCellConfig(int uid,
SpCellConfig->spCellConfigDedicated = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated));
SpCellConfig->spCellConfigDedicated->uplinkConfig = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->uplinkConfig));
NR_UplinkConfig_t *uplinkConfig = SpCellConfig->spCellConfigDedicated->uplinkConfig;
NR_BWP_UplinkDedicated_t *initialUplinkBWP = calloc(1,sizeof(*initialUplinkBWP));
SpCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP = initialUplinkBWP;
uplinkConfig->initialUplinkBWP = initialUplinkBWP;
initialUplinkBWP->pucch_Config = calloc(1,sizeof(*initialUplinkBWP->pucch_Config));
initialUplinkBWP->pucch_Config->present = NR_SetupRelease_PUCCH_Config_PR_setup;
NR_PUCCH_Config_t *pucch_Config = calloc(1,sizeof(*pucch_Config));
......@@ -1090,9 +1091,15 @@ void fill_initial_SpCellConfig(int uid,
pusch_Config->uci_OnPUSCH=NULL;
pusch_Config->tp_pi2BPSK=NULL;
long maxMIMO_Layers = uplinkConfig &&
uplinkConfig->pusch_ServingCellConfig &&
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 &&
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
// 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, NULL, curr_bwp, uid, 0, 0);
config_srs(initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, 0);
scheduling_request_config(scc, pucch_Config);
......@@ -1216,7 +1223,7 @@ void fill_initial_SpCellConfig(int uid,
n_ul_bwp = servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
}
if(n_ul_bwp>0) {
SpCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList));
uplinkConfig->uplinkBWP_ToAddModList = calloc(1,sizeof(*uplinkConfig->uplinkBWP_ToAddModList));
for (int bwp_loop = 0; bwp_loop < n_ul_bwp; bwp_loop++) {
NR_BWP_Uplink_t *ubwp = calloc(1, sizeof(*ubwp));
config_uplinkBWP(ubwp, bwp_loop, true, uid,
......@@ -1224,13 +1231,12 @@ void fill_initial_SpCellConfig(int uid,
servingcellconfigdedicated,
scc,
NULL);
ASN_SEQUENCE_ADD(&SpCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list, ubwp);
ASN_SEQUENCE_ADD(&uplinkConfig->uplinkBWP_ToAddModList->list, ubwp);
}
SpCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id));
*SpCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id : 1;
uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*uplinkConfig->firstActiveUplinkBWP_Id));
*uplinkConfig->firstActiveUplinkBWP_Id = uplinkConfig->firstActiveUplinkBWP_Id ? *uplinkConfig->firstActiveUplinkBWP_Id : 1;
}
SpCellConfig->spCellConfigDedicated->csi_MeasConfig=calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->csi_MeasConfig));
SpCellConfig->spCellConfigDedicated->csi_MeasConfig->present = NR_SetupRelease_CSI_MeasConfig_PR_setup;
......@@ -1585,6 +1591,12 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
if(scc) {
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
NR_UplinkConfig_t *uplinkConfig = SpCellConfig && SpCellConfig->spCellConfigDedicated ? SpCellConfig->spCellConfigDedicated->uplinkConfig : NULL;
long maxMIMO_Layers = uplinkConfig &&
uplinkConfig->pusch_ServingCellConfig &&
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 &&
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
// SRS configuration
if (configuration->do_SRS &&
SpCellConfig &&
......@@ -1600,6 +1612,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
curr_bwp,
uid,
0,
maxMIMO_Layers,
configuration->do_SRS);
}
......@@ -1625,6 +1638,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
bwp_size,
uid,
i+1,
maxMIMO_Layers,
configuration->do_SRS);
}
}
......
......@@ -356,8 +356,9 @@ 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) {
const long maxMIMO_Layers,
const int do_srs)
{
setup_release_srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
NR_SRS_Config_t *srs_Config;
......@@ -420,6 +421,7 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
srs_res0->srs_ResourceId = res_id;
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
if (do_srs) {
long nrofSRS_Ports = 1;
if (uecap &&
uecap->featureSets &&
uecap->featureSets->featureSetsUplink &&
......@@ -427,18 +429,33 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
NR_FeatureSetUplink_t *ul_feature_setup = uecap->featureSets->featureSetsUplink->list.array[0];
switch (ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource) {
case NR_SRS_Resources__maxNumberSRS_Ports_PerResource_n1:
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
nrofSRS_Ports = 1;
break;
case NR_SRS_Resources__maxNumberSRS_Ports_PerResource_n2:
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports2;
nrofSRS_Ports = 2;
break;
case NR_SRS_Resources__maxNumberSRS_Ports_PerResource_n4:
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports4;
nrofSRS_Ports = 4;
break;
default:
LOG_E(NR_RRC, "Max Number of SRS Ports Per Resource %ld is invalid!\n",
ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource);
}
nrofSRS_Ports = min(nrofSRS_Ports, maxMIMO_Layers);
switch (nrofSRS_Ports) {
case 1:
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_port1;
break;
case 2:
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports2;
break;
case 4:
srs_res0->nrofSRS_Ports = NR_SRS_Resource__nrofSRS_Ports_ports4;
break;
default:
LOG_E(NR_RRC, "Number of SRS Ports Per Resource %ld is invalid!\n",
ul_feature_setup->supportedSRS_Resources->maxNumberSRS_Ports_PerResource);
}
}
LOG_I(NR_RRC, "SRS configured with %d ports\n", 1<<srs_res0->nrofSRS_Ports);
}
......@@ -1138,12 +1155,20 @@ void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
pusch_Config->uci_OnPUSCH=NULL;
pusch_Config->tp_pi2BPSK=NULL;
long maxMIMO_Layers = servingcellconfigdedicated &&
servingcellconfigdedicated->uplinkConfig
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1
&& servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
*servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
ubwp->bwp_Dedicated->srs_Config = calloc(1,sizeof(*ubwp->bwp_Dedicated->srs_Config));
config_srs(ubwp->bwp_Dedicated->srs_Config,
NULL,
curr_bwp,
uid,
bwp_loop+1,
maxMIMO_Layers,
configuration->do_SRS);
ubwp->bwp_Dedicated->configuredGrantConfig = NULL;
......
......@@ -150,6 +150,7 @@ void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
const int curr_bwp,
const int uid,
const int res_id,
const long maxMIMO_Layers,
const int do_srs);
void set_dl_mcs_table(int scs,
NR_UE_NR_Capability_t *cap,
......
......@@ -478,9 +478,15 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
LOG_I(RRC,"TRANSFORM PRECODING ENABLED......\n");
}
long maxMIMO_Layers = servingcellconfigdedicated->uplinkConfig &&
servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig &&
servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 &&
servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
*servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
config_srs(initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, configuration->do_SRS);
config_srs(initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, 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