Commit 4f58d669 authored by rmagueta's avatar rmagueta

Merge remote-tracking branch 'origin/nr_csirs_rrc_harmonization' into develop-CSI

# Conflicts:
#	openair1/SIMULATION/NR_PHY/dlsim.c
#	openair1/SIMULATION/NR_PHY/ulsim.c
#	openair2/RRC/NR/MESSAGES/asn1_msg.c
#	openair2/RRC/NR/rrc_gNB_nsa.c
#	openair2/RRC/NR/rrc_gNB_reconfig.c
parents 2b108cdd edb32cad
...@@ -777,7 +777,8 @@ int main(int argc, char **argv) ...@@ -777,7 +777,8 @@ int main(int argc, char **argv)
prepare_scd(scd); prepare_scd(scd);
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0, 0); // TODO do a UECAP for phy-sim
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 6, 0, 0, 0, 0);
/* RRC parameter validation for secondaryCellGroup */ /* RRC parameter validation for secondaryCellGroup */
fix_scd(scd); fix_scd(scd);
......
...@@ -720,7 +720,8 @@ int main(int argc, char **argv) ...@@ -720,7 +720,8 @@ int main(int argc, char **argv)
prepare_scd(scd); prepare_scd(scd);
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0, 0); // TODO do a UECAP for phy-sim
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, 0, 0);
// xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
......
...@@ -1451,6 +1451,23 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ...@@ -1451,6 +1451,23 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb); ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb);
} }
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
rrc_gNB_carrier_data_t *carrier,
int uid,
NR_UE_NR_Capability_t *uecap) {
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
if (SpCellConfig == NULL) return;
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig;
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
config_csirs(scc, csi_MeasConfig, uid, carrier->pdsch_AntennaPorts, curr_bwp, carrier->do_CSIRS);
}
void fill_initial_cellGroupConfig(int uid, void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
...@@ -1870,6 +1887,8 @@ int16_t do_RRCReconfiguration( ...@@ -1870,6 +1887,8 @@ int16_t do_RRCReconfiguration(
NR_SDAP_Config_t *sdap_config, NR_SDAP_Config_t *sdap_config,
NR_MeasConfig_t *meas_config, NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
rrc_gNB_ue_context_t *const ue_context_pP,
rrc_gNB_carrier_data_t *carrier,
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
NR_CellGroupConfig_t *cellGroupConfig) NR_CellGroupConfig_t *cellGroupConfig)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -1906,15 +1925,6 @@ int16_t do_RRCReconfiguration( ...@@ -1906,15 +1925,6 @@ int16_t do_RRCReconfiguration(
ie->radioBearerConfig->srb3_ToRelease = NULL; ie->radioBearerConfig->srb3_ToRelease = NULL;
ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList; ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList;
} }
/******************** Secondary Cell Group ********************/
// rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier);
// fill_default_secondaryCellGroup( carrier->servingcellconfigcommon,
// ue_context_pP->ue_context.secondaryCellGroup,
// 1,
// 1,
// carrier->pdsch_AntennaPorts,
// carrier->initial_csi_index[ue_context_p->local_uid + 1],
// ue_context_pP->local_uid);
/******************** Meas Config ********************/ /******************** Meas Config ********************/
// measConfig // measConfig
...@@ -1930,6 +1940,10 @@ int16_t do_RRCReconfiguration( ...@@ -1930,6 +1940,10 @@ int16_t do_RRCReconfiguration(
} }
if(cellGroupConfig!=NULL){ if(cellGroupConfig!=NULL){
update_cellGroupConfig(cellGroupConfig,
carrier,
ue_context_pP->local_uid,
ue_context_pP->ue_context.UE_Capability_nr);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
NULL, NULL,
(void *)cellGroupConfig, (void *)cellGroupConfig,
......
...@@ -110,6 +110,11 @@ void fill_initial_cellGroupConfig(int uid, ...@@ -110,6 +110,11 @@ void fill_initial_cellGroupConfig(int uid,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
rrc_gNB_carrier_data_t *carrier); rrc_gNB_carrier_data_t *carrier);
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
rrc_gNB_carrier_data_t *carrier,
int uid,
NR_UE_NR_Capability_t *uecap);
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup);
uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
...@@ -145,6 +150,8 @@ int16_t do_RRCReconfiguration( ...@@ -145,6 +150,8 @@ int16_t do_RRCReconfiguration(
NR_SDAP_Config_t *sdap_config, NR_SDAP_Config_t *sdap_config,
NR_MeasConfig_t *meas_config, NR_MeasConfig_t *meas_config,
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList,
rrc_gNB_ue_context_t *const ue_context_pP,
rrc_gNB_carrier_data_t *carrier,
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
NR_CellGroupConfig_t *cellGroupConfig); NR_CellGroupConfig_t *cellGroupConfig);
......
...@@ -31,6 +31,144 @@ ...@@ -31,6 +31,144 @@
#include "nr_rrc_config.h" #include "nr_rrc_config.h"
#include "common/utils/nr/nr_common.h" #include "common/utils/nr/nr_common.h"
const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160};
void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, int nb_slots_per_period) {
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
int ideal_period = nb_slots_per_period*MAX_MOBILES_PER_GNB;
if (ideal_period<5) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots4;
nzpcsi0->periodicityAndOffset->choice.slots4 = nb_slots_per_period*uid;
}
else if (ideal_period<6) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots5;
nzpcsi0->periodicityAndOffset->choice.slots5 = nb_slots_per_period*uid;
}
else if (ideal_period<9) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots8;
nzpcsi0->periodicityAndOffset->choice.slots8 = nb_slots_per_period*uid;
}
else if (ideal_period<11) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots10;
nzpcsi0->periodicityAndOffset->choice.slots10 = nb_slots_per_period*uid;
}
else if (ideal_period<17) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots16;
nzpcsi0->periodicityAndOffset->choice.slots16 = nb_slots_per_period*uid;
}
else if (ideal_period<21) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots20;
nzpcsi0->periodicityAndOffset->choice.slots20 = nb_slots_per_period*uid;
}
else if (ideal_period<41) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots40;
nzpcsi0->periodicityAndOffset->choice.slots40 = nb_slots_per_period*uid;
}
else if (ideal_period<81) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots80;
nzpcsi0->periodicityAndOffset->choice.slots80 = nb_slots_per_period*uid;
}
else if (ideal_period<161) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160;
nzpcsi0->periodicityAndOffset->choice.slots160 = nb_slots_per_period*uid;
}
else {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
nzpcsi0->periodicityAndOffset->choice.slots320 = (nb_slots_per_period*uid)%320 + (nb_slots_per_period*uid)/320;
}
}
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_CSI_MeasConfig_t *csi_MeasConfig,
int uid,
int num_dl_antenna_ports,
int curr_bwp,
int do_csirs) {
if (do_csirs) {
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
*nzpid0 = 0;
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
nzpcsirs0->repetition = NULL;
nzpcsirs0->aperiodicTriggeringOffset = NULL;
nzpcsirs0->trs_Info = NULL;
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
const NR_TDD_UL_DL_Pattern_t *tdd = servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon ?
&servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
const int n_slots_frame = slotsperframe[*servingcellconfigcommon->ssbSubcarrierSpacing];
int nb_slots_per_period = n_slots_frame;
if (tdd)
nb_slots_per_period = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
NR_CSI_RS_ResourceMapping_t resourceMapping;
switch (num_dl_antenna_ports) {
case 1:
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
break;
case 2:
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
break;
case 4:
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4;
resourceMapping.frequencyDomainAllocation.choice.row4.buf = calloc(2, sizeof(uint8_t));
resourceMapping.frequencyDomainAllocation.choice.row4.size = 1;
resourceMapping.frequencyDomainAllocation.choice.row4.bits_unused = 5;
resourceMapping.frequencyDomainAllocation.choice.row4.buf[0] = 32;
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p4;
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
break;
default:
AssertFatal(1==0,"Number of ports not yet supported\n");
}
resourceMapping.firstOFDMSymbolInTimeDomain = 13; // last symbol of slot
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
resourceMapping.density.choice.one = (NULL_t)0;
resourceMapping.freqBand.startingRB = 0;
resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
nzpcsi0->resourceMapping = resourceMapping;
nzpcsi0->powerControlOffset = 0;
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
set_csirs_periodicity(nzpcsi0, uid, nb_slots_per_period);
nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL;
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
}
else {
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL;
}
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
csi_MeasConfig->nzp_CSI_RS_ResourceToReleaseList = NULL;
}
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){
lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
......
...@@ -113,6 +113,12 @@ typedef struct physicalcellgroup_s{ ...@@ -113,6 +113,12 @@ typedef struct physicalcellgroup_s{
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); 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 nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_CSI_MeasConfig_t *csi_MeasConfig,
int uid,
int num_dl_antenna_ports,
int curr_bwp,
int do_csirs);
#endif #endif
...@@ -76,6 +76,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti); ...@@ -76,6 +76,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti);
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated, NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int scg_id, int scg_id,
int servCellIndex, int servCellIndex,
int dl_antenna_ports, int dl_antenna_ports,
...@@ -85,12 +86,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -85,12 +86,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
int initial_csi_index, int initial_csi_index,
int uid); int uid);
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs);
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated, NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig, NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports, int dl_antenna_ports,
int minRXTXTIMEpdsch, int minRXTXTIMEpdsch,
int do_csirs, int do_csirs,
......
...@@ -763,6 +763,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( ...@@ -763,6 +763,8 @@ rrc_gNB_generate_defaultRRCReconfiguration(
NULL, NULL,
dedicatedNAS_MessageList, dedicatedNAS_MessageList,
NULL, NULL,
NULL,
NULL,
NULL); NULL);
free(ue_context_pP->ue_context.nas_pdu.buffer); free(ue_context_pP->ue_context.nas_pdu.buffer);
...@@ -1032,6 +1034,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1032,6 +1034,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
NULL, NULL,
NULL, NULL,
dedicatedNAS_MessageList, dedicatedNAS_MessageList,
ue_context_pP,
&rrc->carrier,
NULL, NULL,
cellGroupConfig); cellGroupConfig);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n");
...@@ -1141,6 +1145,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( ...@@ -1141,6 +1145,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
NULL, NULL,
dedicatedNAS_MessageList, dedicatedNAS_MessageList,
NULL, NULL,
NULL,
NULL,
NULL); NULL);
ue_context_pP->ue_context.pdu_session_release_command_flag = 1; ue_context_pP->ue_context.pdu_session_release_command_flag = 1;
...@@ -1711,6 +1717,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( ...@@ -1711,6 +1717,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
NULL, // MeasObj_list, NULL, // MeasObj_list,
NULL, NULL,
NULL, NULL,
NULL,
NULL,
NULL); NULL);
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,
"[MSG] RRC Reconfiguration\n"); "[MSG] RRC Reconfiguration\n");
......
...@@ -263,26 +263,28 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -263,26 +263,28 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
} }
if (ue_context_p->ue_context.spCellConfig) { if (ue_context_p->ue_context.spCellConfig) {
fill_default_reconfig(carrier->servingcellconfigcommon, fill_default_reconfig(carrier->servingcellconfigcommon,
ue_context_p->ue_context.spCellConfig->spCellConfigDedicated, ue_context_p->ue_context.spCellConfig->spCellConfigDedicated,
reconfig_ies, reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup, ue_context_p->ue_context.secondaryCellGroup,
carrier->pdsch_AntennaPorts, ue_context_p->ue_context.UE_Capability_nr,
carrier->minRXTXTIME, carrier->pdsch_AntennaPorts,
carrier->do_CSIRS, carrier->minRXTXTIME,
carrier->do_SRS, carrier->do_CSIRS,
carrier->initial_csi_index[ue_context_p->local_uid + 1], carrier->do_SRS,
ue_context_p->local_uid); carrier->initial_csi_index[ue_context_p->local_uid + 1],
ue_context_p->local_uid);
} else { } else {
fill_default_reconfig(carrier->servingcellconfigcommon, fill_default_reconfig(carrier->servingcellconfigcommon,
NULL, NULL,
reconfig_ies, reconfig_ies,
ue_context_p->ue_context.secondaryCellGroup, ue_context_p->ue_context.secondaryCellGroup,
carrier->pdsch_AntennaPorts, ue_context_p->ue_context.UE_Capability_nr,
carrier->minRXTXTIME, carrier->pdsch_AntennaPorts,
carrier->do_CSIRS, carrier->minRXTXTIME,
carrier->do_SRS, carrier->do_CSIRS,
carrier->initial_csi_index[ue_context_p->local_uid + 1], carrier->do_SRS,
ue_context_p->local_uid); carrier->initial_csi_index[ue_context_p->local_uid + 1],
ue_context_p->local_uid);
} }
ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity;
NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config)); NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config));
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "SIMULATION/TOOLS/sim.h" #include "SIMULATION/TOOLS/sim.h"
#include "executables/softmodem-common.h" #include "executables/softmodem-common.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h" #include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "nr_rrc_config.h"
#define false 0 #define false 0
#define true 1 #define true 1
...@@ -52,6 +53,7 @@ ...@@ -52,6 +53,7 @@
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated, NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int scg_id, int scg_id,
int servCellIndex, int servCellIndex,
int dl_antenna_ports, int dl_antenna_ports,
...@@ -1099,24 +1101,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -1099,24 +1101,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL;
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
if (do_csirs) { config_csirs(servingcellconfigcommon, csi_MeasConfig, uid, dl_antenna_ports, curr_bwp, do_csirs);
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList));
NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0));
nzpcsirs0->nzp_CSI_ResourceSetId = 0;
NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0));
*nzpid0 = 0;
ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0);
nzpcsirs0->repetition = NULL;
nzpcsirs0->aperiodicTriggeringOffset = NULL;
nzpcsirs0->trs_Info = NULL;
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0);
}
else
csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL;
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs);
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL; csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
...@@ -1135,9 +1120,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -1135,9 +1120,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList)); csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
if (do_csirs) { if (do_csirs) {
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0)); NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
csires0->csi_ResourceConfigId=0; csires0->csi_ResourceConfigId=0;
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB; csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
...@@ -1314,63 +1299,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -1314,63 +1299,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
} }
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) {
if (do_csirs) {
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
NR_CSI_RS_ResourceMapping_t resourceMapping;
switch (dl_antenna_ports) {
case 1:
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
break;
case 2:
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
break;
default:
AssertFatal(1==0,"Number of ports not yet supported\n");
}
resourceMapping.firstOFDMSymbolInTimeDomain = 6;
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
resourceMapping.density.choice.one = (NULL_t)0;
resourceMapping.freqBand.startingRB = 0;
resourceMapping.freqBand.nrofRBs = 108;
nzpcsi0->resourceMapping = resourceMapping;
nzpcsi0->powerControlOffset = 0;
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
nzpcsi0->periodicityAndOffset->choice.slots320 = 0;
nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL;
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
}
else
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
}
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated, NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig, NR_RRCReconfiguration_IEs_t *reconfig,
NR_CellGroupConfig_t *secondaryCellGroup, NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports, int dl_antenna_ports,
int minRXTXTIME, int minRXTXTIME,
int do_csirs, int do_csirs,
...@@ -1386,6 +1319,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon ...@@ -1386,6 +1319,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
fill_default_secondaryCellGroup(servingcellconfigcommon, fill_default_secondaryCellGroup(servingcellconfigcommon,
servingcellconfigdedicated, servingcellconfigdedicated,
secondaryCellGroup, secondaryCellGroup,
uecap,
1, 1,
1, 1,
dl_antenna_ports, dl_antenna_ports,
......
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