Adding first layer timing advance

- Added new structure to hold timing advance parameters
   - Made SIB19 related calculation to save to this struct
   - Modified in ra to get ta struct values
This commit is contained in:
Roberto Rosca
2024-12-11 10:20:35 +02:00
parent 698ff73c7f
commit f88c47ba3e
4 changed files with 24 additions and 11 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id)
ue->if_inst = nr_ue_if_module_init(UE_id);
ue->dci_thres = 0;
ue->target_Nid_cell = -1;
ue->timing_advance = ue->frame_parms.samples_per_subframe * get_nrUE_params()->ntn_ta_common;
ue->timing_advance = ue->frame_parms.samples_per_subframe * 2 * get_nrUE_params()->ntn_ta_common;
check_position(UE_id);
// initialize all signal buffers
+10 -3
View File
@@ -1775,16 +1775,23 @@ void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, NR_SIB19_r17_t *sib1
// ntn-Config-r17 deep copy into mac
asn_copy(&asn_DEF_NR_NTN_Config_r17, (void **)&mac->sc_info.ntn_Config_r17, sib19_r17->ntn_Config_r17);
// populate ntn_ta structure from mac
// if ephemerisInfo_r17 present in SIB19
if (mac->sc_info.ntn_Config_r17->ephemerisInfo_r17 && mac->sc_info.ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17
&& (mac->sc_info.ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionX_r17 != 0
|| mac->sc_info.ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionY_r17 != 0
|| mac->sc_info.ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->positionZ_r17 != 0)) {
get_nrUE_params()->ntn_ta_common =
mac->ntn_ta.N_UE_TA_adj =
calculate_ue_sat_ta(get_position(module_id), mac->sc_info.ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17);
}
get_nrUE_params()->ntn_koffset = *mac->sc_info.ntn_Config_r17->cellSpecificKoffset_r17;
// if cellSpecificKoffset_r17 is present
if (sib19_r17->ntn_Config_r17->cellSpecificKoffset_r17) {
mac->ntn_ta.cell_specific_k_offset = *sib19_r17->ntn_Config_r17->cellSpecificKoffset_r17;
}
// Check if ta_Info_r17 is present and convert directly ta_Common_r17 (is in units of 4.072e-3 µs)
if (sib19_r17->ntn_Config_r17->ta_Info_r17) {
mac->ntn_ta.N_common_ta_adj = sib19_r17->ntn_Config_r17->ta_Info_r17->ta_Common_r17 * 4.072e-6;
}
}
static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac,
+9
View File
@@ -554,6 +554,13 @@ typedef struct {
A_SEQUENCE_OF(si_schedinfo_config_t) si_SchedInfo_list;
} si_schedInfo_t;
typedef struct ntn_timing_advance_components {
// N_common_ta_adj and N_UE_TA_adj are in ms
double N_common_ta_adj;
double N_UE_TA_adj;
long cell_specific_k_offset;
} ntn_timing_advance_componets_t;
/*!\brief Top level UE MAC structure */
typedef struct NR_UE_MAC_INST_s {
module_id_t ue_id;
@@ -623,6 +630,8 @@ typedef struct NR_UE_MAC_INST_s {
int p_Max_alt;
int n_ta_offset; // -1 not present, otherwise value to be applied
ntn_timing_advance_componets_t ntn_ta;
long pdsch_HARQ_ACK_Codebook;
NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config;
+4 -7
View File
@@ -40,16 +40,13 @@
#include <executables/softmodem-common.h>
#include "openair2/LAYER2/RLC/rlc.h"
#include "openair2/LAYER2/NR_MAC_UE/mac_defs.h"
#include "nr-uesoftmodem.h"
static double get_ta_Common_ms(NR_NTN_Config_r17_t *ntn_Config_r17)
static double get_ta_Common_ms(const ntn_timing_advance_componets_t* ntn_ta)
{
if (ntn_Config_r17 && ntn_Config_r17->ta_Info_r17) {
// ta_Common_r17 is in units of 4.072e-3 µs
return (ntn_Config_r17->ta_Info_r17->ta_Common_r17 * 4.072e-6 + get_nrUE_params()->ntn_ta_common) * 2;
}
return 0.0;
return (ntn_ta->N_common_ta_adj + ntn_ta->N_UE_TA_adj) * 2;
}
int16_t get_prach_tx_power(NR_UE_MAC_INST_t *mac)
@@ -625,7 +622,7 @@ void nr_Msg3_transmitted(NR_UE_MAC_INST_t *mac, uint8_t CC_id, frame_t frameP, s
{
RA_config_t *ra = &mac->ra;
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = mac->current_UL_BWP->rach_ConfigCommon;
const double ta_Common_ms = get_ta_Common_ms(mac->sc_info.ntn_Config_r17);
const double ta_Common_ms = get_ta_Common_ms(&mac->ntn_ta);
const int mu = mac->current_UL_BWP->scs;
const int slots_per_ms = nr_slots_per_frame[mu] / 10;