Commit ae29f644 authored by francescomani's avatar francescomani

adapting function for dl 256 qam

parent 5e3e1e42
......@@ -36,6 +36,27 @@
const char *duplex_mode[]={"FDD","TDD"};
int tables_5_3_2[5][11] = {
{25, 52, 79, 106, 133, 160, 216, 270, -1, -1, -1}, // 15 FR1
{11, 24, 38, 51, 65, 78, 106, 133, 162, 217, 273}, // 30 FR1
{-1, 11, 18, 24, 31, 38, 51, 65, 79, 107, 135}, // 60 FR1
{66, 132, 264, -1 , -1, -1, -1, -1, -1, -1, -1}, // 60 FR2
{32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1} // 120FR2
};
int get_supported_band_index(int scs, int band, int n_rbs){
int scs_index = scs;
if (band>256)
scs_index++;
for (int i=0; i<11; i++) {
if(n_rbs == tables_5_3_2[scs][i])
return i;
}
return (-1); // not found
}
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101)
// Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101)
// Notes:
......
......@@ -72,6 +72,7 @@ int get_subband_size(int NPRB,int size);
void SLIV2SL(int SLIV,int *S,int *L);
int get_dmrs_port(int nl, uint16_t dmrs_ports);
int get_nb_periods_per_frame(uint8_t tdd_period);
int get_supported_band_index(int scs, int band, int n_rbs);
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
......
......@@ -98,6 +98,71 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3);
}
}
}
void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap) {
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing;
struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList;
int bw_rb = -1;
for(int i=0; i<scs_list.list.count; i++){
if(scs == scs_list.list.array[i]->subcarrierSpacing){
bw_rb = scs_list.list.array[i]->carrierBandwidth;
break;
}
}
AssertFatal(bw_rb>0,"Could not find scs-SpecificCarrierList element for scs %d",scs);
int bw = get_supported_band_index(scs, band, bw_rb);
AssertFatal(bw>0,"Supported band corresponding to %d RBs not found\n", bw_rb);
bool supported = false;
if (band>256) {
for (int i=0;i<cap->rf_Parameters.supportedBandListNR.list.count;i++) {
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
if(bandNRinfo->bandNR == band && bandNRinfo->pdsch_256QAM_FR2) {
supported = true;
break;
}
}
}
else if (cap->phy_Parameters.phy_ParametersFR1 && cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1)
supported = true;
// check featureSet
NR_FeatureSets_t *fs=cap->featureSets;
NR_ModulationOrder_t supported_mo = 0;
if (fs && supported) {
// go through DL feature sets and look for one with current SCS
for (int i=0;i<fs->featureSetsDownlinkPerCC->list.count;i++) {
int supported_bw;
NR_FeatureSetDownlinkPerCC_t *fs_cc = fs->featureSetsDownlinkPerCC->list.array[i];
switch (fs_cc->supportedBandwidthDL.present) {
case NR_SupportedBandwidth_PR_fr1:
supported_bw = fs_cc->supportedBandwidthDL.choice.fr1;
break;
case NR_SupportedBandwidth_PR_fr2:
supported_bw = fs_cc->supportedBandwidthDL.choice.fr2;
break;
default:
AssertFatal(1==0,"Invalid parameter for supported bandwith choice\n");
}
if (fs_cc->supportedSubcarrierSpacingDL == scs &&
supported_bw == bw &&
fs_cc->supportedModulationOrderDL)
supported_mo = *fs_cc->supportedModulationOrderDL ;
}
}
if (supported && (supported_mo == NR_ModulationOrder_qam256)) {
long *mcs_Table = bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table;
if(mcs_Table == NULL)
mcs_Table = calloc(1, sizeof(*mcs_Table));
*mcs_Table = NR_PDSCH_Config__mcs_Table_qam256;
}
else
bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
}
......@@ -113,6 +113,7 @@ typedef struct physicalcellgroup_s{
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc);
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap);
#endif
......@@ -2891,30 +2891,6 @@ unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
return(0);
}
int is_dl_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
if (common_band>256) {
for (int i=0;i<cap->rf_Parameters.supportedBandListNR.list.count;i++) {
NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i];
if (bandNRinfo->bandNR == common_band && !bandNRinfo->pdsch_256QAM_FR2) return (0);
}
}
else if (cap->phy_Parameters.phy_ParametersFR1 && !cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) return(0);
// check featureSet
NR_FeatureSets_t *fs=cap->featureSets;
if (fs) {
// go through DL feature sets and look for one with current SCS
for (int i=0;i<fs->featureSetsDownlinkPerCC->list.count;i++) {
if (fs->featureSetsDownlinkPerCC->list.array[i]->supportedSubcarrierSpacingDL == common_scs &&
fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL &&
*fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL == NR_ModulationOrder_qam256) return(1);
}
}
return(0);
}
int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) {
int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0];
int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
......@@ -3005,11 +2981,9 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
}
if (ue_context_p->ue_context.UE_Capability_nr) {
fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr));
......
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