Fix missing E2SM-RC message forward

E2SM-RC RRC message forwarding (e.g., to signal a new UE, measurement
reports, ...) was broken since commit d6c29b2d2c, as we accidentally
removed the E2_AGENT compilation definition from RRC layer.

Although this commit fixes the mentioned issue, it also causes undefined
references to functions defined in ran_func_rc.c file.  Therefore, we
add a hack that provides the definition, and abort if we ever hit these
functions, which in theory should not happen.

Future cleanup should avoid linking in RRC and other layers into
simulators.

Fixes: d6c29b2d2c ("Fix E2_AGENT linking w.r.t. simulators ")
This commit is contained in:
Robert Schmidt
2025-12-02 19:10:08 +01:00
parent 1603077171
commit 388ad30f6b
3 changed files with 27 additions and 0 deletions
+9
View File
@@ -464,6 +464,9 @@ target_include_directories(f1ap PUBLIC F1AP_DIR)
target_link_libraries(f1ap PUBLIC asn1_f1ap GTPV1U)
target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE f1ap_lib)
target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib)
if(E2_AGENT)
target_compile_definitions(f1ap PRIVATE E2_AGENT)
endif()
# LPP
##############
@@ -1288,6 +1291,9 @@ add_library(L2
)
target_link_libraries(L2 PRIVATE x2ap s1ap lte_rrc m2ap)
target_link_libraries(L2 PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
if(E2_AGENT)
target_compile_definitions(L2 PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
endif()
add_library(MAC_UE_NR ${MAC_NR_SRC_UE})
target_link_libraries(MAC_UE_NR PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs PUBLIC nr_ue_power_procedures nr_ue_ra_procedures)
@@ -1303,6 +1309,9 @@ add_library(L2_NR
target_link_libraries(L2_NR PRIVATE ds alg)
target_link_libraries(L2_NR PRIVATE f1ap_lib)
target_include_directories(L2_NR PRIVATE ${F1AP_DIR}/lib)
if(E2_AGENT)
target_compile_definitions(L2_NR PRIVATE ${E2AP_VERSION} ${KPM_VERSION} E2_AGENT)
endif()
add_library(e1_if
${NR_RRC_DIR}/cucp_cuup_direct.c
+9
View File
@@ -118,6 +118,15 @@ void nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t
{
}
/* this is a hack, but necessary for E2 agent. We compile in all of RRC
* (because of CMakeLists.txt), but we don't need it (only nr_radio_config.c).
* however, if E2 agent is defined, the following functions are used in
* rrc_gNB.c, but defined in RAN functions. In order to avoid pulling this in
* here as well, only provide a prototype (and abort if they are ever called). */
void signal_rrc_msg(void /*const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba*/ ) { abort(); }
void signal_rrc_state_changed_to(void /* const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state */) { abort(); }
void signal_ue_id(void /* const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id */) { abort(); }
/* Function to set or overwrite PTRS DL RRC parameters */
static void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, long *ptrsNrb, long *ptrsMcs, long *epre_Ratio, long *reOffset)
{
+9
View File
@@ -120,6 +120,15 @@ void nr_derive_key_ng_ran_star(uint16_t pci, uint64_t nr_arfcn_dl, const uint8_t
{
}
/* this is a hack, but necessary for E2 agent. We compile in all of RRC
* (because of CMakeLists.txt), but we don't need it (only nr_radio_config.c).
* however, if E2 agent is defined, the following functions are used in
* rrc_gNB.c, but defined in RAN functions. In order to avoid pulling this in
* here as well, only provide a prototype (and abort if they are ever called). */
void signal_rrc_msg(void /*const nr_rrc_class_e nr_channel, const uint32_t rrc_msg_id, const byte_array_t rrc_ba*/ ) { abort(); }
void signal_rrc_state_changed_to(void /* const gNB_RRC_UE_t *rrc_ue_context, const rrc_state_e2sm_rc_e rrc_state */) { abort(); }
void signal_ue_id(void /* const gNB_RRC_UE_t *rrc_ue_context, const uint16_t class, const uint32_t msg_id */) { abort(); }
extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration
void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req) { abort(); }