NR UE: calculate the epoch_hfn whenever an ntn_Config_r17 is received

This commit is contained in:
Thomas Schlichter
2025-11-19 10:05:45 +01:00
committed by francescomani
parent 0bf99d9d16
commit 654fadb116
5 changed files with 12 additions and 2 deletions
@@ -562,6 +562,7 @@ typedef struct {
} fapi_nr_ta_command_pdu;
typedef struct {
int epoch_hfn;
int epoch_sfn;
int epoch_subframe;
+1
View File
@@ -95,6 +95,7 @@ static void configure_ntn_params(PHY_VARS_NR_UE *ue, fapi_nr_dl_ntn_config_comma
ue->ntn_config_message = CALLOC(1, sizeof(*ue->ntn_config_message));
}
ue->ntn_config_message->ntn_config_params.epoch_hfn = ntn_params_message->epoch_hfn;
ue->ntn_config_message->ntn_config_params.epoch_sfn = ntn_params_message->epoch_sfn;
ue->ntn_config_message->ntn_config_params.epoch_subframe = ntn_params_message->epoch_subframe;
ue->ntn_config_message->ntn_config_params.cell_specific_k_offset = ntn_params_message->cell_specific_k_offset;
+8 -2
View File
@@ -318,6 +318,10 @@ static void configure_ntn_ta(module_id_t module_id,
// epochTime_r17 must be present (this is assured by function `eval_epoch_time()`)
const NR_EpochTime_r17_t *epoch_time_r17 = ntn_Config_r17->epochTime_r17;
AssertFatal(epoch_time_r17, "epoch_time_r17 should not be NULL here\n");
if (epoch_time_r17->sfn_r17 >= frame)
ntn_ta->epoch_hfn = hfn;
else
ntn_ta->epoch_hfn = hfn + 1;
ntn_ta->epoch_sfn = epoch_time_r17->sfn_r17;
ntn_ta->epoch_subframe = epoch_time_r17->subFrameNR_r17;
@@ -368,9 +372,11 @@ static void configure_ntn_ta(module_id_t module_id,
ntn_ta->ntn_params_changed = true;
LOG_D(NR_MAC,
"SIB19 Rxd. Epoch SFN: %d, Epoch Subframe: %d, k_offset: %ldms, N_Common_Ta: %fms, drift: %fµs/s, variant %fµs/s², "
LOG_I(NR_MAC,
"SIB19 Rxd. Epoch HFN: %d, Epoch SFN: %d, Epoch Subframe: %d, k_offset: %ldms, "
"N_Common_Ta: %fms, drift: %fµs/s, variant %fµs/s², "
"N_UE_TA: %fms, drift: %fµs/s, variant %fµs/s²\n",
ntn_ta->epoch_hfn,
ntn_ta->epoch_sfn,
ntn_ta->epoch_subframe,
ntn_ta->cell_specific_k_offset,
+1
View File
@@ -543,6 +543,7 @@ typedef struct {
} si_schedInfo_t;
typedef struct ntn_timing_advance_components {
int epoch_hfn;
int epoch_sfn;
int epoch_subframe;
@@ -2849,6 +2849,7 @@ static void schedule_ntn_config_command(fapi_nr_dl_config_request_t *dl_config,
{
fapi_nr_dl_ntn_config_command_pdu *ntn_config_command_pdu = &dl_config->dl_config_list[dl_config->number_pdus].ntn_config_command_pdu;
ntn_config_command_pdu->epoch_hfn = mac->ntn_ta.epoch_hfn;
ntn_config_command_pdu->epoch_sfn = mac->ntn_ta.epoch_sfn;
ntn_config_command_pdu->epoch_subframe = mac->ntn_ta.epoch_subframe;
ntn_config_command_pdu->cell_specific_k_offset = mac->ntn_ta.cell_specific_k_offset;