Commit b62474bd authored by Robert Schmidt's avatar Robert Schmidt

Move fill_default_secondaryCellGroup() and change signature

fill_default_secondaryCellGroup() is moved to nr_rrc_config.c.
Furthermore, the signature is changes to return the NR_CellGroupConfig
from the functions, instead of filling a pre-allocated structure (which
is, in all cases, allocated just before calling
fill_default_secondaryCellGroup().

There is a problem with this function: the function also fills the
ServingCellConfig (a parameter to this function). This behavior has not
been changed.
parent c1a2b656
......@@ -717,8 +717,7 @@ int main(int argc, char **argv)
.do_SRS = 0,
.force_256qam_off = false
};
NR_CellGroupConfig_t *secondaryCellGroup = calloc(1, sizeof(*secondaryCellGroup));
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, &conf, 0);
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, 0);
/* RRC parameter validation for secondaryCellGroup */
fix_scd(scd);
......
......@@ -631,7 +631,6 @@ int main(int argc, char **argv)
NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t));
prepare_scd(scd);
NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup));
// TODO do a UECAP for phy-sim
const gNB_RrcConfigurationReq conf = {
.pdsch_AntennaPorts = { .N1 = 1, .N2 = 1, .XP = 1 },
......@@ -641,7 +640,7 @@ int main(int argc, char **argv)
.do_SRS = 0,
.force_256qam_off = false
};
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, &conf, 0);
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, NULL, 0, 1, &conf, 0);
/* RRC parameter validation for secondaryCellGroup */
fix_scd(scd);
......
......@@ -68,6 +68,7 @@ NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(
long channelId,
long priority,
e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucketSizeDuration);
NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority);
NR_RadioBearerConfig_t *get_default_rbconfig(int eps_bearer_id,
int rb_id,
......
This diff is collapsed.
......@@ -45,8 +45,8 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,
int curr_bwp);
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap);
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap);
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, const NR_UE_NR_Capability_t *uecap);
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, const NR_UE_NR_Capability_t *uecap);
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time, NR_SubcarrierSpacing_t subcarrierSpacing);
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs);
void scheduling_request_config(const NR_ServingCellConfigCommon_t *scc,
......@@ -80,7 +80,7 @@ void config_srs(const NR_ServingCellConfigCommon_t *scc,
const int do_srs);
struct NR_SetupRelease_PDSCH_Config *config_pdsch(uint64_t ssb_bitmap, int bwp_Id, int dl_antenna_ports);
void set_dl_mcs_table(int scs,
NR_UE_NR_Capability_t *cap,
const NR_UE_NR_Capability_t *cap,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
const NR_ServingCellConfigCommon_t *scc);
void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
......@@ -92,7 +92,7 @@ struct NR_SetupRelease_PUSCH_Config *config_pusch(NR_PUSCH_Config_t *pusch_Confi
void config_downlinkBWP(NR_BWP_Downlink_t *bwp,
const NR_ServingCellConfigCommon_t *scc,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_UE_NR_Capability_t *uecap,
const NR_UE_NR_Capability_t *uecap,
int dl_antenna_ports,
bool force_256qam_off,
int bwp_loop, bool is_SA);
......@@ -101,7 +101,7 @@ void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
const gNB_RrcConfigurationReq *configuration,
const NR_ServingCellConfig_t *servingcellconfigdedicated,
const NR_ServingCellConfigCommon_t *scc,
NR_UE_NR_Capability_t *uecap);
const NR_UE_NR_Capability_t *uecap);
NR_MAC_CellGroupConfig_t *configure_mac_cellgroup(void);
......@@ -127,4 +127,16 @@ void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig);
int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size);
NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buffer_size);
/* Note: this function returns a new CellGroupConfig for a user with given
* configuration, but it will also overwrite the ServingCellConfig passed in
* parameter servingcellconfigdedicated! */
NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
const NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
const gNB_RrcConfigurationReq *configuration,
int uid);
#endif
......@@ -73,15 +73,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti);
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_CellGroupConfig_t *secondaryCellGroup,
NR_UE_NR_Capability_t *uecap,
int scg_id,
int servCellIndex,
const gNB_RrcConfigurationReq *configuration,
int uid);
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_ServingCellConfig_t *servingcellconfigdedicated,
NR_RRCReconfiguration_IEs_t *reconfig,
......
......@@ -151,7 +151,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
// NR RRCReconfiguration
UE->reconfig = calloc(1, sizeof(NR_RRCReconfiguration_t));
UE->secondaryCellGroup = calloc(1, sizeof(NR_CellGroupConfig_t));
memset((void *)UE->reconfig, 0, sizeof(NR_RRCReconfiguration_t));
UE->reconfig->rrc_TransactionIdentifier = 0;
UE->reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
......@@ -239,6 +238,16 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
}
NR_ServingCellConfig_t *scc = UE->spCellConfig ? UE->spCellConfig->spCellConfigDedicated : NULL;
UE->secondaryCellGroup = get_default_secondaryCellGroup(carrier->servingcellconfigcommon,
scc,
UE->UE_Capability_nr,
1,
1,
configuration,
ue_context_p->ue_context.gNB_ue_ngap_id);
AssertFatal(UE->secondaryCellGroup != NULL, "out of memory\n");
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, UE->secondaryCellGroup);
fill_default_reconfig(carrier->servingcellconfigcommon, scc, reconfig_ies, UE->secondaryCellGroup, UE->UE_Capability_nr, configuration, ue_context_p->ue_context.gNB_ue_ngap_id);
// the UE context is not yet inserted in the RRC UE manager
// rrc_gNB_update_ue_context_rnti(UE->secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, rrc,
......
This diff is collapsed.
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