gNB: when creating a ReconfigurationWithSync, make sure epochTime_r17 is present if there is a ntn_Config_r17
Fixes #995
This commit is contained in:
@@ -804,7 +804,7 @@ printf("%d\n", slot);
|
||||
rnti_t rnti = 0x1234;
|
||||
int uid = 0;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc, frame);
|
||||
|
||||
/* -U option modify DMRS */
|
||||
if(modify_dmrs) {
|
||||
|
||||
@@ -708,7 +708,7 @@ int main(int argc, char *argv[])
|
||||
rnti_t rnti = 0x1234;
|
||||
int uid = 0;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc, frame);
|
||||
|
||||
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
|
||||
|
||||
|
||||
@@ -572,11 +572,11 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C
|
||||
const nr_mac_config_t *configuration = &mac->radio_config;
|
||||
if (is_SA) {
|
||||
cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config);
|
||||
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc);
|
||||
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc, mac->frame);
|
||||
} else {
|
||||
NR_UE_NR_Capability_t *cap = get_ue_nr_cap_from_cg_config_info(cgci);
|
||||
cellGroupConfig = get_default_secondaryCellGroup(scc, cap, 1, 1, configuration, UE->uid);
|
||||
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc);
|
||||
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc, mac->frame);
|
||||
// TODO: in NSA we assign capabilities here, otherwise outside => not logic
|
||||
UE->capability = cap;
|
||||
}
|
||||
|
||||
@@ -4123,7 +4123,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
return secondaryCellGroup;
|
||||
}
|
||||
|
||||
NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc)
|
||||
NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc, int frame)
|
||||
{
|
||||
NR_ReconfigurationWithSync_t *reconfigurationWithSync = calloc(1, sizeof(*reconfigurationWithSync));
|
||||
reconfigurationWithSync->newUE_Identity = rnti;
|
||||
@@ -4133,6 +4133,19 @@ NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t u
|
||||
|
||||
reconfigurationWithSync->spCellConfigCommon = clone_ServingCellConfigCommon(scc);
|
||||
|
||||
// in case of ReconfigurationWithSync, the epochTime_r17 must be present if there is a ntn_Config_r17
|
||||
if (reconfigurationWithSync->spCellConfigCommon->ext2 && reconfigurationWithSync->spCellConfigCommon->ext2->ntn_Config_r17) {
|
||||
NR_NTN_Config_r17_t *ntncfg = reconfigurationWithSync->spCellConfigCommon->ext2->ntn_Config_r17;
|
||||
if (!ntncfg->epochTime_r17) {
|
||||
ntncfg->epochTime_r17 = calloc(1, sizeof(*ntncfg->epochTime_r17));
|
||||
// the epochTime_r17 is esp. relevant for the timer T430, which runs for multiples of 5 seconds.
|
||||
// here we don't have access to the current subFrame number, so we only set the SFN.
|
||||
// the error of up to 10 ms should be acceptable for this long running timer.
|
||||
ntncfg->epochTime_r17->sfn_r17 = frame;
|
||||
ntncfg->epochTime_r17->subFrameNR_r17 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
reconfigurationWithSync->rach_ConfigDedicated = calloc(1, sizeof(*reconfigurationWithSync->rach_ConfigDedicated));
|
||||
reconfigurationWithSync->rach_ConfigDedicated->present = NR_ReconfigurationWithSync__rach_ConfigDedicated_PR_uplink;
|
||||
NR_RACH_ConfigDedicated_t *uplink = calloc(1, sizeof(*uplink));
|
||||
|
||||
@@ -110,7 +110,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
const nr_mac_config_t *configuration,
|
||||
int uid);
|
||||
|
||||
NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc);
|
||||
NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc, int frame);
|
||||
|
||||
NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId,
|
||||
long priority,
|
||||
|
||||
Reference in New Issue
Block a user