Commit 9d9902d8 authored by francescomani's avatar francescomani

apply ITTI queue to SIB19

parent 35e9d1e0
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
#include "openair1/PHY/defs_nr_UE.h" #include "openair1/PHY/defs_nr_UE.h"
#include "position_interface.h"
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return (0); } int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return (0); }
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req) { return (0); } int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req) { return (0); }
...@@ -19,7 +19,7 @@ int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t ...@@ -19,7 +19,7 @@ int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t
int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; } int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; }
int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { return 0; } int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { return 0; }
int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; } int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { return 0; }
void get_position_coordinates(int Mod_id, position_t *position) {}
int32_t get_uldl_offset(int nr_bandP) { return (0); } int32_t get_uldl_offset(int nr_bandP) { return (0); }
void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {} void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {}
......
...@@ -87,6 +87,7 @@ MESSAGE_DEF(NR_MAC_RRC_CONFIG_RESET, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_res ...@@ -87,6 +87,7 @@ MESSAGE_DEF(NR_MAC_RRC_CONFIG_RESET, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_res
MESSAGE_DEF(NR_MAC_RRC_CONFIG_CG, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_cg_t, nr_mac_rrc_config_cg) MESSAGE_DEF(NR_MAC_RRC_CONFIG_CG, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_cg_t, nr_mac_rrc_config_cg)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_MIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_mib_t, nr_mac_rrc_config_mib) MESSAGE_DEF(NR_MAC_RRC_CONFIG_MIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_mib_t, nr_mac_rrc_config_mib)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_SIB1, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_sib1_t, nr_mac_rrc_config_sib1) MESSAGE_DEF(NR_MAC_RRC_CONFIG_SIB1, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_sib1_t, nr_mac_rrc_config_sib1)
MESSAGE_DEF(NR_MAC_RRC_CONFIG_OTHER_SIB, MESSAGE_PRIORITY_MED, nr_mac_rrc_config_other_sib_t, nr_mac_rrc_config_other_sib)
// eNB: RLC -> RRC messages // eNB: RLC -> RRC messages
MESSAGE_DEF(RLC_SDU_INDICATION, MESSAGE_PRIORITY_MED, RlcSduIndication, rlc_sdu_indication) MESSAGE_DEF(RLC_SDU_INDICATION, MESSAGE_PRIORITY_MED, RlcSduIndication, rlc_sdu_indication)
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
#define NR_MAC_RRC_CONFIG_CG(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_cg #define NR_MAC_RRC_CONFIG_CG(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_cg
#define NR_MAC_RRC_CONFIG_MIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_mib #define NR_MAC_RRC_CONFIG_MIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_mib
#define NR_MAC_RRC_CONFIG_SIB1(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_sib1 #define NR_MAC_RRC_CONFIG_SIB1(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_sib1
#define NR_MAC_RRC_CONFIG_OTHER_SIB(mSGpTR) (mSGpTR)->ittiMsg.nr_mac_rrc_config_other_sib
#define NR_RRC_RLC_MAXRTX(mSGpTR) (mSGpTR)->ittiMsg.nr_rlc_maxrtx_indication #define NR_RRC_RLC_MAXRTX(mSGpTR) (mSGpTR)->ittiMsg.nr_rlc_maxrtx_indication
...@@ -477,5 +478,8 @@ typedef struct { ...@@ -477,5 +478,8 @@ typedef struct {
typedef struct { typedef struct {
NR_SIB1_t *sib1; NR_SIB1_t *sib1;
} nr_mac_rrc_config_sib1_t; } nr_mac_rrc_config_sib1_t;
typedef struct {
NR_SIB19_r17_t *sib19;
} nr_mac_rrc_config_other_sib_t;
#endif /* RRC_MESSAGES_TYPES_H_ */ #endif /* RRC_MESSAGES_TYPES_H_ */
...@@ -1751,7 +1751,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *si ...@@ -1751,7 +1751,7 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *si
} }
// computes delay between ue and sat based on SIB19 ephemeris data // computes delay between ue and sat based on SIB19 ephemeris data
static double calculate_ue_sat_ta(const position_t *position_params, struct NR_PositionVelocity_r17 *sat_pos) static double calculate_ue_sat_ta(const position_t *position_params, NR_PositionVelocity_r17_t *sat_pos)
{ {
// get UE position coordinates // get UE position coordinates
double posx = position_params->positionX; double posx = position_params->positionX;
...@@ -1770,39 +1770,45 @@ static double calculate_ue_sat_ta(const position_t *position_params, struct NR_P ...@@ -1770,39 +1770,45 @@ static double calculate_ue_sat_ta(const position_t *position_params, struct NR_P
return ta_ms; return ta_ms;
} }
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, const position_t *pos, NR_SIB19_r17_t *sib19_r17) void nr_rrc_mac_config_other_sib(module_id_t module_id, NR_SIB19_r17_t *sib19)
{ {
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
int ret = pthread_mutex_lock(&mac->if_mutex); int ret = pthread_mutex_lock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret); AssertFatal(!ret, "mutex failed %d\n", ret);
// update ntn_Config_r17 with received values if (sib19) {
struct NR_NTN_Config_r17 *ntn_Config_r17 = mac->sc_info.ntn_Config_r17; // update ntn_Config_r17 with received values
UPDATE_IE(ntn_Config_r17, sib19_r17->ntn_Config_r17, NR_NTN_Config_r17_t); NR_NTN_Config_r17_t *ntn_Config_r17 = mac->sc_info.ntn_Config_r17;
UPDATE_IE(ntn_Config_r17, sib19->ntn_Config_r17, NR_NTN_Config_r17_t);
// populate ntn_ta structure from mac
// if ephemerisInfo_r17 present in SIB19 position_t position_params = {0};
struct NR_EphemerisInfo_r17 *ephemeris_info = ntn_Config_r17->ephemerisInfo_r17; get_position_coordinates(module_id, &position_params);
if (ephemeris_info) {
struct NR_PositionVelocity_r17 *position_velocity = ephemeris_info->choice.positionVelocity_r17; // populate ntn_ta structure from mac
if (position_velocity // if ephemerisInfo_r17 present in SIB19
&& (position_velocity->positionX_r17 != 0 || position_velocity->positionY_r17 != 0 NR_EphemerisInfo_r17_t *ephemeris_info = ntn_Config_r17->ephemerisInfo_r17;
|| position_velocity->positionZ_r17 != 0)) { if (ephemeris_info) {
mac->ntn_ta.N_UE_TA_adj = calculate_ue_sat_ta(pos, position_velocity); NR_PositionVelocity_r17_t *position_velocity = ephemeris_info->choice.positionVelocity_r17;
} if (position_velocity
} && (position_velocity->positionX_r17 != 0
// if cellSpecificKoffset_r17 is present || position_velocity->positionY_r17 != 0
if (ntn_Config_r17->cellSpecificKoffset_r17) { || position_velocity->positionZ_r17 != 0)) {
mac->ntn_ta.cell_specific_k_offset = *ntn_Config_r17->cellSpecificKoffset_r17; mac->ntn_ta.N_UE_TA_adj = calculate_ue_sat_ta(&position_params, position_velocity);
} }
// Check if ta_Info_r17 is present and convert directly ta_Common_r17 (is in units of 4.072e-3 µs) }
if (ntn_Config_r17->ta_Info_r17) { // if cellSpecificKoffset_r17 is present
mac->ntn_ta.N_common_ta_adj = ntn_Config_r17->ta_Info_r17->ta_Common_r17 * 4.072e-6; if (ntn_Config_r17->cellSpecificKoffset_r17) {
// ta_CommonDrift_r17 (is in units of 0.2e-3 µs/s) mac->ntn_ta.cell_specific_k_offset = *ntn_Config_r17->cellSpecificKoffset_r17;
if (ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17) }
mac->ntn_ta.ntn_ta_commondrift = *ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17 * 0.2e-3; // Check if ta_Info_r17 is present and convert directly ta_Common_r17 (is in units of 4.072e-3 µs)
} if (ntn_Config_r17->ta_Info_r17) {
mac->ntn_ta.ntn_params_changed = true; mac->ntn_ta.N_common_ta_adj = ntn_Config_r17->ta_Info_r17->ta_Common_r17 * 4.072e-6;
// ta_CommonDrift_r17 (is in units of 0.2e-3 µs/s)
if (ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17)
mac->ntn_ta.ntn_ta_commondrift = *ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17 * 0.2e-3;
}
mac->ntn_ta.ntn_params_changed = true;
}
ret = pthread_mutex_unlock(&mac->if_mutex); ret = pthread_mutex_unlock(&mac->if_mutex);
AssertFatal(!ret, "mutex failed %d\n", ret); AssertFatal(!ret, "mutex failed %d\n", ret);
} }
......
...@@ -88,7 +88,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, ...@@ -88,7 +88,7 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *sib1); void nr_rrc_mac_config_req_sib1(module_id_t module_id, int cc_idP, NR_SIB1_t *sib1);
struct position; /* forward declaration */ struct position; /* forward declaration */
void nr_rrc_mac_config_req_sib19_r17(module_id_t module_id, const struct position *pos, NR_SIB19_r17_t *sib19_r17); void nr_rrc_mac_config_other_sib(module_id_t module_id, NR_SIB19_r17_t *sib19_r17);
void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause); void nr_rrc_mac_config_req_reset(module_id_t module_id, NR_UE_MAC_reset_cause_t cause);
......
...@@ -141,6 +141,9 @@ void process_msg_rcc_to_mac(MessageDef *msg) ...@@ -141,6 +141,9 @@ void process_msg_rcc_to_mac(MessageDef *msg)
nr_rrc_mac_config_req_sib1(ue_id, 0, sib1); nr_rrc_mac_config_req_sib1(ue_id, 0, sib1);
SEQUENCE_free(&asn_DEF_NR_SIB1, NR_MAC_RRC_CONFIG_SIB1(msg).sib1, ASFM_FREE_EVERYTHING); SEQUENCE_free(&asn_DEF_NR_SIB1, NR_MAC_RRC_CONFIG_SIB1(msg).sib1, ASFM_FREE_EVERYTHING);
} break; } break;
case NR_MAC_RRC_CONFIG_OTHER_SIB:
nr_rrc_mac_config_other_sib(ue_id, NR_MAC_RRC_CONFIG_OTHER_SIB(msg).sib19);
break;
default: default:
LOG_E(NR_MAC, "Unexpected msg from RRC: %d\n", ITTI_MSG_ID(msg)); LOG_E(NR_MAC, "Unexpected msg from RRC: %d\n", ITTI_MSG_ID(msg));
} }
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "executables/position_interface.h"
#ifndef CELLULAR #ifndef CELLULAR
#include "RRC/NR/MESSAGES/asn1_msg.h" #include "RRC/NR/MESSAGES/asn1_msg.h"
...@@ -166,7 +165,7 @@ static void set_DRB_status(NR_UE_RRC_INST_t *rrc, NR_DRB_Identity_t drb_id, NR_R ...@@ -166,7 +165,7 @@ static void set_DRB_status(NR_UE_RRC_INST_t *rrc, NR_DRB_Identity_t drb_id, NR_R
rrc->status_DRBs[drb_id - 1] = status; rrc->status_DRBs[drb_id - 1] = status;
} }
static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si, instance_t ue_id, position_t *position) static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si, instance_t ue_id)
{ {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_IN);
...@@ -181,6 +180,7 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si, ...@@ -181,6 +180,7 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si,
return; return;
} }
NR_SIB19_r17_t *sib19 = NULL;
for (int i = 0; i < si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.count; i++) { for (int i = 0; i < si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.count; i++) {
SystemInformation_IEs__sib_TypeAndInfo__Member *typeandinfo; SystemInformation_IEs__sib_TypeAndInfo__Member *typeandinfo;
typeandinfo = si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.array[i]; typeandinfo = si->criticalExtensions.choice.systemInformation->sib_TypeAndInfo.list.array[i];
...@@ -242,20 +242,19 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si, ...@@ -242,20 +242,19 @@ static void nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si,
SI_info->SInfo_r17.sib19_validity = SIB_VALID; SI_info->SInfo_r17.sib19_validity = SIB_VALID;
if (g_log->log_component[NR_RRC].level >= OAILOG_DEBUG) if (g_log->log_component[NR_RRC].level >= OAILOG_DEBUG)
xer_fprint(stdout, &asn_DEF_NR_SIB19_r17, (const void *)typeandinfo->choice.sib19_v1700); xer_fprint(stdout, &asn_DEF_NR_SIB19_r17, (const void *)typeandinfo->choice.sib19_v1700);
sib19 = typeandinfo->choice.sib19_v1700;
// allocate memory for position coordinates
if (!position)
position = CALLOC(1, sizeof(*position));
// populate position with position from config file
get_position_coordinates(ue_id, position);
nr_rrc_mac_config_req_sib19_r17(ue_id, position, typeandinfo->choice.sib19_v1700);
nr_timer_start(&SI_info->SInfo_r17.sib19_timer); nr_timer_start(&SI_info->SInfo_r17.sib19_timer);
break; break;
default: default:
break; break;
} }
} }
if (sib19) {
MessageDef *msg = itti_alloc_new_message(TASK_RRC_NRUE, 0, NR_MAC_RRC_CONFIG_OTHER_SIB);
asn_copy(&asn_DEF_NR_SIB19_r17, (void **)&NR_MAC_RRC_CONFIG_OTHER_SIB(msg).sib19, sib19);
itti_send_msg_to_task(TASK_MAC_UE, ue_id, msg);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_OUT);
} }
...@@ -397,7 +396,7 @@ static void nr_rrc_process_reconfiguration_v1530(NR_UE_RRC_INST_t *rrc, NR_RRCRe ...@@ -397,7 +396,7 @@ static void nr_rrc_process_reconfiguration_v1530(NR_UE_RRC_INST_t *rrc, NR_RRCRe
SEQUENCE_free(&asn_DEF_NR_SystemInformation, si, 1); SEQUENCE_free(&asn_DEF_NR_SystemInformation, si, 1);
} else { } else {
LOG_I(NR_RRC, "[UE %ld] Decoding dedicatedSystemInformationDelivery\n", rrc->ue_id); LOG_I(NR_RRC, "[UE %ld] Decoding dedicatedSystemInformationDelivery\n", rrc->ue_id);
nr_decode_SI(SI_info, si, rrc->ue_id, rrc->position_coordinates); nr_decode_SI(SI_info, si, rrc->ue_id);
} }
} }
if (rec_1530->otherConfig) { if (rec_1530->otherConfig) {
...@@ -959,7 +958,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(NR_UE_RRC_INST_t *rrc, ...@@ -959,7 +958,7 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(NR_UE_RRC_INST_t *rrc,
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation: case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformation:
LOG_I(NR_RRC, "[UE %ld] Decoding SI\n", rrc->ue_id); LOG_I(NR_RRC, "[UE %ld] Decoding SI\n", rrc->ue_id);
NR_SystemInformation_t *si = bcch_message->message.choice.c1->choice.systemInformation; NR_SystemInformation_t *si = bcch_message->message.choice.c1->choice.systemInformation;
nr_decode_SI(SI_info, si, rrc->ue_id, rrc->position_coordinates); nr_decode_SI(SI_info, si, rrc->ue_id);
break; break;
case NR_BCCH_DL_SCH_MessageType__c1_PR_NOTHING: case NR_BCCH_DL_SCH_MessageType__c1_PR_NOTHING:
default: default:
......
...@@ -202,8 +202,6 @@ typedef struct rrcPerNB { ...@@ -202,8 +202,6 @@ typedef struct rrcPerNB {
NR_RSRP_Range_t s_measure; NR_RSRP_Range_t s_measure;
} rrcPerNB_t; } rrcPerNB_t;
/* forward declaration */
struct position;
typedef struct NR_UE_RRC_INST_s { typedef struct NR_UE_RRC_INST_s {
instance_t ue_id; instance_t ue_id;
rrcPerNB_t perNB[NB_CNX_UE]; rrcPerNB_t perNB[NB_CNX_UE];
...@@ -243,9 +241,6 @@ typedef struct NR_UE_RRC_INST_s { ...@@ -243,9 +241,6 @@ typedef struct NR_UE_RRC_INST_s {
bool reconfig_after_reestab; bool reconfig_after_reestab;
//Sidelink params //Sidelink params
NR_SL_PreconfigurationNR_r16_t *sl_preconfig; NR_SL_PreconfigurationNR_r16_t *sl_preconfig;
struct position *position_coordinates;
} NR_UE_RRC_INST_t; } NR_UE_RRC_INST_t;
#endif #endif
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