From 13d129768f62b3251584084345db3a293e31a872 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 9 Mar 2026 11:17:34 +0100 Subject: [PATCH 01/37] apply unused arguments flag to LAYER2 folder (mostly for RLC and PDCP files as far as I undestand) --- common/platform_types.h | 3 +++ openair1/PHY/defs_nr_UE.h | 2 -- openair2/LAYER2/CMakeLists.txt | 1 + openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c | 8 ++++---- openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.h | 3 +-- openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c | 4 ++-- openair2/LAYER2/nr_rlc/nr_rlc_entity_um.h | 13 ++++--------- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 13 ++++++------- 8 files changed, 21 insertions(+), 26 deletions(-) diff --git a/common/platform_types.h b/common/platform_types.h index 179a6d4df9..26c4bafa75 100644 --- a/common/platform_types.h +++ b/common/platform_types.h @@ -241,6 +241,9 @@ typedef struct protocol_ctxt_s { bool brOption; } protocol_ctxt_t; +/// suppress compiler warning for unused arguments +#define UNUSED(x) (void)x; + #define UE_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD + RC.nb_inst #define ENB_MODULE_ID_TO_INSTANCE(mODULE_iD) mODULE_iD #define UE_INSTANCE_TO_MODULE_ID(iNSTANCE) iNSTANCE - RC.nb_inst diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 385fef3a8e..06fb2f5c46 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -47,8 +47,6 @@ #define openair_sched_exit() exit(-1) #define bzero(s,n) (memset((s),0,(n))) -/// suppress compiler warning for unused arguments -#define UNUSED(x) (void)x; // Set the number of barriers for processSlotTX to 512. This value has to be at least 483 for NTN where // DL-to-UL offset is up to 483. The selected value is also half of the frame range so that diff --git a/openair2/LAYER2/CMakeLists.txt b/openair2/LAYER2/CMakeLists.txt index d93e781891..1c325288a8 100644 --- a/openair2/LAYER2/CMakeLists.txt +++ b/openair2/LAYER2/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(nr_rlc) add_subdirectory(nr_pdcp) add_subdirectory(NR_MAC_UE) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c index a9d6e4bfd3..f88a7a7fb2 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.c @@ -9,7 +9,6 @@ #include "nr_rlc_pdu.h" #include "common/utils/time_stat.h" - #include "LOG/log.h" /*************************************************************************/ @@ -78,9 +77,9 @@ static int generate_tx_pdu(nr_rlc_entity_tm_t *entity, char *buffer, int size) return ret; } -nr_rlc_entity_buffer_status_t nr_rlc_entity_tm_buffer_status( - nr_rlc_entity_t *_entity, int maxsize) +nr_rlc_entity_buffer_status_t nr_rlc_entity_tm_buffer_status(nr_rlc_entity_t *_entity, int maxsize) { + UNUSED(maxsize); nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity; nr_rlc_entity_buffer_status_t ret; @@ -166,7 +165,8 @@ void nr_rlc_entity_tm_set_time(nr_rlc_entity_t *_entity, uint64_t now) void nr_rlc_entity_tm_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id) { - /* nothing to do */ + UNUSED(_entity); + UNUSED(sdu_id); } static void clear_entity(nr_rlc_entity_tm_t *entity) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.h b/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.h index e81ad1db2b..085eb7996c 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_tm.h @@ -30,8 +30,7 @@ void nr_rlc_entity_tm_recv_sdu(nr_rlc_entity_t *entity, int sdu_id); void nr_rlc_entity_tm_recv_pdu(nr_rlc_entity_t *entity, char *buffer, int size); -nr_rlc_entity_buffer_status_t nr_rlc_entity_tm_buffer_status( - nr_rlc_entity_t *entity, int maxsize); +nr_rlc_entity_buffer_status_t nr_rlc_entity_tm_buffer_status(nr_rlc_entity_t *entity, int maxsize); int nr_rlc_entity_tm_generate_pdu(nr_rlc_entity_t *entity, char *buffer, int size); void nr_rlc_entity_tm_set_time(nr_rlc_entity_t *entity, uint64_t now); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c index b0ada2e514..e33ff346c9 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c @@ -517,9 +517,9 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size) return ret; } -nr_rlc_entity_buffer_status_t nr_rlc_entity_um_buffer_status( - nr_rlc_entity_t *_entity, int maxsize) +nr_rlc_entity_buffer_status_t nr_rlc_entity_um_buffer_status(nr_rlc_entity_t *_entity, int maxsize) { + UNUSED(maxsize); nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity; nr_rlc_entity_buffer_status_t ret; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.h b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.h index b3e5da5b16..a230ac22cf 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.h @@ -49,15 +49,10 @@ typedef struct { int tx_maxsize; } nr_rlc_entity_um_t; -void nr_rlc_entity_um_recv_sdu(nr_rlc_entity_t *entity, - char *buffer, int size, - int sdu_id); -void nr_rlc_entity_um_recv_pdu(nr_rlc_entity_t *entity, - char *buffer, int size); -nr_rlc_entity_buffer_status_t nr_rlc_entity_um_buffer_status( - nr_rlc_entity_t *entity, int maxsize); -int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *entity, - char *buffer, int size); +void nr_rlc_entity_um_recv_sdu(nr_rlc_entity_t *entity, char *buffer, int size, int sdu_id); +void nr_rlc_entity_um_recv_pdu(nr_rlc_entity_t *entity, char *buffer, int size); +nr_rlc_entity_buffer_status_t nr_rlc_entity_um_buffer_status(nr_rlc_entity_t *entity, int maxsize); +int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *entity, char *buffer, int size); void nr_rlc_entity_um_set_time(nr_rlc_entity_t *entity, uint64_t now); void nr_rlc_entity_um_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id); void nr_rlc_entity_um_reestablishment(nr_rlc_entity_t *_entity); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index cd18d0261b..d0c2afa3cb 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -163,7 +163,7 @@ void nr_mac_rlc_data_ind(const module_id_t module_idP, logical_chan_id_t ch = data[i].ch; nr_rlc_entity_t *rb = get_rlc_entity_from_lcid(ue, ch); if (rb != NULL) { - LOG_D(RLC, "RB found! (channel ID %d) \n", ch); + LOG_D(RLC, "RB found! (instance %d channel ID %d) \n", module_idP, ch); rb->set_time(rb, get_nr_rlc_current_time()); rb->recv_pdu(rb, (char *)data[i].buf, data[i].len); } else { @@ -196,7 +196,7 @@ int nr_mac_rlc_multi_data_req(const module_id_t module_idP, pdu_siz[0] = rb->generate_pdu(rb, buffer_pP + 3, tb_sizeP - 3); if (pdu_siz[0] == 0) break; - LOG_D(RLC, "MAC PDU created: channel_idP %d len %d\n", channel_idP, pdu_siz[0]); + LOG_D(RLC, "MAC PDU created: instance %d channel_idP %d len %d\n", module_idP, channel_idP, pdu_siz[0]); // reserve header tb_sizeP -= 3 + pdu_siz[0]; buffer_pP += 3 + pdu_siz[0]; @@ -233,7 +233,7 @@ tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP, nr_rlc_entity_t *rb = get_rlc_entity_from_lcid(ue, channel_idP); if (rb != NULL) { - LOG_D(RLC, "MAC PDU to get created for channel_idP:%d \n", channel_idP); + LOG_D(RLC, "MAC PDU to get created for channel_idP:%d instance %d\n", channel_idP, module_idP); rb->set_time(rb, get_nr_rlc_current_time()); maxsize = tb_sizeP; ret = rb->generate_pdu(rb, buffer_pP, maxsize); @@ -245,8 +245,7 @@ tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP, nr_rlc_manager_unlock(nr_rlc_ue_manager); if (gnb_flagP) - T(T_ENB_RLC_MAC_DL, T_INT(module_idP), T_INT(ue_id), - T_INT(channel_idP), T_INT(ret)); + T(T_ENB_RLC_MAC_DL, T_INT(module_idP), T_INT(ue_id), T_INT(channel_idP), T_INT(ret)); return ret; } @@ -911,6 +910,7 @@ struct srb0_data { void deliver_sdu_srb0(void *deliver_sdu_data, nr_rlc_entity_t *entity, char *buf, int size) { + UNUSED(entity); struct srb0_data *s0 = (struct srb0_data *)deliver_sdu_data; s0->send_initial_ul_rrc_message(s0->ue_id, (unsigned char *)buf, size, s0->data); } @@ -933,8 +933,7 @@ bool nr_rlc_activate_srb0(int ue_id, srb0_data->data = data; srb0_data->send_initial_ul_rrc_message = send_initial_ul_rrc_message; - nr_rlc_entity_t *nr_rlc_tm = new_nr_rlc_entity_tm(10000, - deliver_sdu_srb0, srb0_data); + nr_rlc_entity_t *nr_rlc_tm = new_nr_rlc_entity_tm(10000, deliver_sdu_srb0, srb0_data); nr_rlc_ue_add_srb_rlc_entity(ue, 0, nr_rlc_tm); LOG_I(RLC, "Activated srb0 for UE %d\n", ue_id); From 709c06f08e089b476c9cec937d1b95266df1b4f9 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 9 Mar 2026 17:50:16 +0100 Subject: [PATCH 02/37] add flag for unused function arguments in nfapi CMakeLists --- nfapi/CMakeLists.txt | 1 + nfapi/oai_integration/aerial/fapi_nvIPC.c | 19 ++- nfapi/oai_integration/aerial/fapi_nvIPC.h | 2 +- nfapi/oai_integration/aerial/fapi_vnf_p7.c | 9 +- nfapi/oai_integration/aerial/fapi_vnf_p7.h | 7 +- nfapi/oai_integration/nfapi_vnf.c | 2 +- nfapi/oai_integration/socket/socket_pnf.c | 1 + nfapi/open-nFAPI/fapi/inc/nr_fapi_p7.h | 43 +++--- nfapi/open-nFAPI/fapi/src/nr_fapi.c | 2 + nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c | 2 + nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c | 139 ++++++++----------- nfapi/open-nFAPI/fapi/src/nr_fapi_p7_utils.c | 2 + nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 58 ++++---- nfapi/open-nFAPI/utils/nfapi_hex_parser.c | 1 + 14 files changed, 130 insertions(+), 158 deletions(-) diff --git a/nfapi/CMakeLists.txt b/nfapi/CMakeLists.txt index 521465f058..7dd9cf744d 100644 --- a/nfapi/CMakeLists.txt +++ b/nfapi/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(oai_integration/aerial) if (OAI_WLS) add_subdirectory(oai_integration/wls_integration) diff --git a/nfapi/oai_integration/aerial/fapi_nvIPC.c b/nfapi/oai_integration/aerial/fapi_nvIPC.c index 973b21e09c..5178fce014 100644 --- a/nfapi/oai_integration/aerial/fapi_nvIPC.c +++ b/nfapi/oai_integration/aerial/fapi_nvIPC.c @@ -63,7 +63,7 @@ static uint16_t old_sfn = 0; static uint16_t old_slot = 0; //////////////////////////////////////////////////////////////////////// // Handle an RX message -static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg) +static int ipc_handle_rx_msg(nv_ipc_msg_t *msg) { if (msg == NULL) { LOG_E(NFAPI_VNF, "%s: ERROR: buffer is empty\n", __func__); @@ -121,12 +121,7 @@ static int ipc_handle_rx_msg(nv_ipc_t *ipc, nv_ipc_msg_t *msg) int dataBufLen = msg->data_len; uint8_t *data_end = msg->data_buf + dataBufLen; nfapi_nr_srs_indication_t ind; - aerial_unpack_nr_srs_indication(&pReadPackedMessage, - end, - &pReadData, - data_end, - &ind, - &vnf_p7_config->_public.codec_config); + aerial_unpack_nr_srs_indication(&pReadPackedMessage, end, &pReadData, data_end, &ind); if (vnf_p7_config->_public.nr_srs_indication) { (vnf_p7_config->_public.nr_srs_indication)(&ind); } @@ -285,7 +280,7 @@ bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_messa } // Always allocate message buffer, but allocate data buffer only when data_len > 0 -static int aerial_recv_msg(nv_ipc_t *ipc, nv_ipc_msg_t *recv_msg) +static int aerial_recv_msg(nv_ipc_msg_t *recv_msg) { if (ipc == NULL) { return -1; @@ -305,7 +300,7 @@ static int aerial_recv_msg(nv_ipc_t *ipc, nv_ipc_msg_t *recv_msg) recv_msg->msg_len, recv_msg->data_len, recv_msg->data_pool); - ipc_handle_rx_msg(ipc, recv_msg); + ipc_handle_rx_msg(recv_msg); // Release buffer of RX message int release_retval = ipc->rx_release(ipc, recv_msg); @@ -318,6 +313,7 @@ static int aerial_recv_msg(nv_ipc_t *ipc, nv_ipc_msg_t *recv_msg) void *epoll_recv_task(void *arg) { + UNUSED(arg); struct epoll_event ev, events[MAX_EVENTS]; LOG_D(NFAPI_VNF,"Aerial recv task start \n"); @@ -356,7 +352,7 @@ void *epoll_recv_task(void *arg) if (events[n].data.fd == ipc_rx_event_fd) { ipc->get_value(ipc); nv_ipc_msg_t recv_msg; - while (aerial_recv_msg(ipc, &recv_msg) == 0); + while (aerial_recv_msg(&recv_msg) == 0); } } } @@ -482,7 +478,8 @@ int oai_fapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) return retval; } -int oai_fapi_send_end_request(int cell, uint32_t frame, uint32_t slot){ +int oai_fapi_send_end_request(uint32_t frame, uint32_t slot) +{ nfapi_vnf_p7_config_t *p7_config = get_p7_vnf_config(); nfapi_nr_slot_indication_scf_t nr_slot_resp = {.header.message_id = 0x8F, .sfn = frame, .slot = slot}; diff --git a/nfapi/oai_integration/aerial/fapi_nvIPC.h b/nfapi/oai_integration/aerial/fapi_nvIPC.h index 306f9e5ae9..65853b7556 100644 --- a/nfapi/oai_integration/aerial/fapi_nvIPC.h +++ b/nfapi/oai_integration/aerial/fapi_nvIPC.h @@ -24,7 +24,7 @@ void release_msg(nv_ipc_msg_t* send_msg); bool send_nvipc_msg(nv_ipc_msg_t* send_msg); bool aerial_nr_send_p5_message(vnf_t *vnf, uint16_t p5_idx, nfapi_nr_p4_p5_message_header_t *msg, uint32_t msg_len); int nvIPC_Init(nvipc_params_t nvipc_params_s); -int oai_fapi_send_end_request(int cell_id, uint32_t frame, uint32_t slot); +int oai_fapi_send_end_request(uint32_t frame, uint32_t slot); int oai_fapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req); int oai_fapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req); int oai_fapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req); diff --git a/nfapi/oai_integration/aerial/fapi_vnf_p7.c b/nfapi/oai_integration/aerial/fapi_vnf_p7.c index 3dc42180c4..e8e5d133a7 100644 --- a/nfapi/oai_integration/aerial/fapi_vnf_p7.c +++ b/nfapi/oai_integration/aerial/fapi_vnf_p7.c @@ -68,14 +68,9 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, return 1; } -uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, - uint8_t *end, - uint8_t **pDataMsg, - uint8_t *data_end, - void *msg, - nfapi_p7_codec_config_t *config) +uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, uint8_t **pDataMsg, uint8_t *data_end, void *msg) { - uint8_t retval = unpack_nr_srs_indication(ppReadPackedMsg, end, msg, config); + uint8_t retval = unpack_nr_srs_indication(ppReadPackedMsg, end, msg); nfapi_nr_srs_indication_t *srs_ind = (nfapi_nr_srs_indication_t *)msg; for (uint8_t pdu_idx = 0; pdu_idx < srs_ind->number_of_pdus; pdu_idx++) { nfapi_nr_srs_indication_pdu_t *pdu = &srs_ind->pdu_list[pdu_idx]; diff --git a/nfapi/oai_integration/aerial/fapi_vnf_p7.h b/nfapi/oai_integration/aerial/fapi_vnf_p7.h index b0c3a32f86..947532c461 100644 --- a/nfapi/oai_integration/aerial/fapi_vnf_p7.h +++ b/nfapi/oai_integration/aerial/fapi_vnf_p7.h @@ -33,11 +33,6 @@ uint8_t aerial_unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, nfapi_nr_rx_data_indication_t *msg, nfapi_p7_codec_config_t *config); -uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, - uint8_t *end, - uint8_t **pDataMsg, - uint8_t *data_end, - void *msg, - nfapi_p7_codec_config_t *config); +uint8_t aerial_unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, uint8_t **pDataMsg, uint8_t *data_end, void *msg); bool aerial_nr_send_p7_message(vnf_p7_t *vnf_p7, nfapi_nr_p7_message_header_t *header); #endif // OPENAIRINTERFACE_FAPI_VNF_P7_H diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 9873337b80..354141a5c9 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -916,7 +916,7 @@ int phy_nr_slot_indication(nfapi_nr_slot_indication_scf_t *ind) send_slt_resp = true; } if (send_slt_resp) { - oai_fapi_send_end_request(0, ind->sfn, ind->slot); + oai_fapi_send_end_request(ind->sfn, ind->slot); } #else if (sched_response.DL_req.dl_tti_request_body.nPDUs > 0) diff --git a/nfapi/oai_integration/socket/socket_pnf.c b/nfapi/oai_integration/socket/socket_pnf.c index 3db7d5249f..f72417d002 100644 --- a/nfapi/oai_integration/socket/socket_pnf.c +++ b/nfapi/oai_integration/socket/socket_pnf.c @@ -61,6 +61,7 @@ static int send_p7_msg(pnf_p7_t *pnf_p7, uint8_t *msg, uint32_t len) bool pnf_nr_send_p7_message(pnf_p7_t *pnf_p7, nfapi_nr_p7_message_header_t *header, uint32_t msg_len) { + UNUSED(msg_len); if (pnf_p7->terminate) { //don't send any further P7 messages after terminating return false; diff --git a/nfapi/open-nFAPI/fapi/inc/nr_fapi_p7.h b/nfapi/open-nFAPI/fapi/inc/nr_fapi_p7.h index a4f7c7a7b6..c8a0a5a42e 100644 --- a/nfapi/open-nFAPI/fapi/inc/nr_fapi_p7.h +++ b/nfapi/open-nFAPI/fapi/inc/nr_fapi_p7.h @@ -12,28 +12,25 @@ bool fapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config); -uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_nr_slot_indication_scf_t *msg, - nfapi_p7_codec_config_t *config); -uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); -uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); +uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_slot_indication_scf_t *msg); +uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); +uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); uint8_t unpack_nr_srs_report_tlv_value(nfapi_srs_report_tlv_t *report_tlv, uint8_t **ppReadPackedMsg, uint8_t *end); -uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config); -uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config); +uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end); +uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg); #endif // OPENAIRINTERFACE_NR_FAPI_P7_H diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi.c b/nfapi/open-nFAPI/fapi/src/nr_fapi.c index 5302542bf3..fe8937f5ac 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi.c @@ -153,6 +153,7 @@ bool fapi_nr_p7_message_header_unpack(void *pMessageBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { + UNUSED(config); return fapi_nr_message_header_unpack(pMessageBuf, messageBufLen, pUnpackedBuf, @@ -166,6 +167,7 @@ bool fapi_nr_message_header_unpack(void *pMessageBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t *config) { + UNUSED(config); uint8_t *pReadPackedMessage = pMessageBuf; nfapi_nr_p4_p5_message_header_t *header = pUnpackedBuf; fapi_message_header_t fapi_msg = {0}; diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c index 4d40fe87c7..2f9bc6e3f7 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p5.c @@ -66,6 +66,7 @@ int fapi_nr_p5_message_pack(void *pMessageBuf, const uint32_t packedBufLen, nfapi_p4_p5_codec_config_t *config) { + UNUSED(messageBufLen); nfapi_nr_p4_p5_message_header_t *pMessageHeader = pMessageBuf; uint8_t *pWritePackedMessage = pPackedBuf; AssertFatal(isFAPIMessageIDValid(pMessageHeader->message_id), @@ -1141,6 +1142,7 @@ uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e // END Digital Beam Table (DBT) PDU #ifdef ENABLE_AERIAL + UNUSED(config); retval &= pack_nr_tlv(NFAPI_NR_CONFIG_NUM_TX_PORT_TAG, &(pNfapiMsg->carrier_config.num_tx_port), ppWritePackedMsg, diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c index d82fd18e13..6f224438ec 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p7.c @@ -15,38 +15,38 @@ uint8_t fapi_nr_p7_message_body_pack(nfapi_nr_p7_message_header_t *header, uint8_t result = 0; switch (header->message_id) { case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - result = pack_dl_tti_request(header, ppWritePackedMsg, end, config); + result = pack_dl_tti_request(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - result = pack_ul_tti_request(header, ppWritePackedMsg, end, config); + result = pack_ul_tti_request(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: - result = pack_nr_slot_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_slot_indication(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - result = pack_ul_dci_request(header, ppWritePackedMsg, end, config); + result = pack_ul_dci_request(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - result = pack_tx_data_request(header, ppWritePackedMsg, end, config); + result = pack_tx_data_request(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: - result = pack_nr_rx_data_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_rx_data_indication(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: - result = pack_nr_crc_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_crc_indication(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: - result = pack_nr_uci_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_uci_indication(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: - result = pack_nr_srs_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_srs_indication(header, ppWritePackedMsg, end); break; case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: - result = pack_nr_rach_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_rach_indication(header, ppWritePackedMsg, end); break; #ifdef ENABLE_AERIAL case NFAPI_NR_PHY_MSG_TYPE_VENDOR_EXT_SLOT_RESPONSE: - result = pack_nr_slot_indication(header, ppWritePackedMsg, end, config); + result = pack_nr_slot_indication(header, ppWritePackedMsg, end); break; #endif default: { @@ -150,49 +150,49 @@ bool fapi_nr_p7_message_unpack(void *pMessageBuf, switch (pMessageHeader->message_id) { case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST, unpackedBufLen)) - result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST, unpackedBufLen)) - result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION, unpackedBufLen)) { nfapi_nr_slot_indication_scf_t *msg = (nfapi_nr_slot_indication_scf_t *)pMessageHeader; - result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg, config); + result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg); } break; case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen)) - result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST, unpackedBufLen)) - result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen)) { - result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader); } break; case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen)) { - result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader); } break; case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen)) { - result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader); } break; case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen)) { - result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader); } break; case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen)) { - result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader); } break; default: @@ -435,7 +435,7 @@ static uint8_t pack_dl_tti_request_body_value(void *tlv, uint8_t **ppWritePacked return push16(value->PDUSize, &pPackedLengthField, end); } -uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg; @@ -665,7 +665,7 @@ static uint8_t unpack_dl_tti_request_body_value(uint8_t **ppReadPackedMsg, uint8 return 1; } -uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg; pNfapiMsg->vendor_extension = NULL; @@ -979,7 +979,7 @@ static uint8_t pack_ul_tti_groups_list_value(void *tlv, uint8_t **ppWritePackedM return 1; } -uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; pNfapiMsg->n_ulcch = 0; @@ -1297,7 +1297,7 @@ static uint8_t unpack_ul_tti_groups_list_value(uint8_t **ppReadPackedMsg, uint8_ return 1; } -uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; @@ -1328,7 +1328,7 @@ uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg return 1; } -uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t *)msg; @@ -1338,10 +1338,7 @@ uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t * return 1; } -uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_nr_slot_indication_scf_t *msg, - nfapi_p7_codec_config_t *config) +uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_slot_indication_scf_t *msg) { nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t *)msg; @@ -1414,7 +1411,7 @@ static uint8_t pack_ul_dci_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg, return push16(value->PDUSize, &pPackedLengthField, end); } -uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg; @@ -1485,7 +1482,7 @@ static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t * return 1; } -uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg; @@ -1554,7 +1551,7 @@ static uint8_t pack_tx_data_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg return 1; } -uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg; @@ -1622,7 +1619,7 @@ static uint8_t unpack_tx_data_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t return 1; } -uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg; @@ -1653,7 +1650,7 @@ static uint8_t pack_nr_rx_data_indication_body(const nfapi_nr_rx_data_pdu_t *val return 1; } -uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t *)msg; @@ -1669,10 +1666,7 @@ uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_ return 1; } -static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) +static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { if (!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end) && pull8(ppReadPackedMsg, &value->harq_id, end) && pull32(ppReadPackedMsg, &value->pdu_length, end) @@ -1689,7 +1683,7 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, return 1; } -uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t *)msg; @@ -1702,7 +1696,7 @@ uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, vo } for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) { - if (!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end, config)) + if (!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end)) return 0; } @@ -1730,7 +1724,7 @@ static uint8_t pack_nr_crc_indication_body(const nfapi_nr_crc_t *value, uint8_t return 1; } -uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *)msg; @@ -1768,7 +1762,7 @@ uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t *value, uint8_t **ppReadPac return 1; } -uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *)msg; @@ -1971,7 +1965,7 @@ static uint8_t pack_nr_uci_indication_body(nfapi_nr_uci_t *value, uint8_t **ppWr return 1; } -uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t *)msg; @@ -1990,10 +1984,7 @@ uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e return 1; } -static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) +static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { if (!pull8(ppReadPackedMsg, &value->pduBitmap, end)) return 0; @@ -2063,10 +2054,7 @@ static uint8_t unpack_nr_uci_pusch(nfapi_nr_uci_pusch_pdu_t *value, return 1; } -static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) +static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { if (!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end) && pull8(ppReadPackedMsg, &value->pucch_format, end) @@ -2094,10 +2082,7 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu return 1; } -static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) +static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { if (!pull8(ppReadPackedMsg, &value->pduBitmap, end)) return 0; @@ -2183,10 +2168,7 @@ static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t * return 1; } -static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) +static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { if (!pull16(ppReadPackedMsg, &value->pdu_type, end)) return 0; @@ -2196,19 +2178,19 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, switch (value->pdu_type) { case NFAPI_NR_UCI_PUSCH_PDU_TYPE: { nfapi_nr_uci_pusch_pdu_t *uci_pdu = &value->pusch_pdu; - if (!unpack_nr_uci_pusch(uci_pdu, ppReadPackedMsg, end, config)) + if (!unpack_nr_uci_pusch(uci_pdu, ppReadPackedMsg, end)) return 0; break; } case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &value->pucch_pdu_format_0_1; - if (!unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end, config)) + if (!unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end)) return 0; break; } case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; - if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end, config)) + if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end)) return 0; break; } @@ -2220,7 +2202,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, return 1; } -uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t *)msg; @@ -2233,15 +2215,15 @@ uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void * pNfapiMsg->uci_list = calloc(pNfapiMsg->num_ucis, sizeof(*pNfapiMsg->uci_list)); for (int i = 0; i < pNfapiMsg->num_ucis; i++) { - if (!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config)) + if (!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end)) return 0; } return 1; } -static uint8_t pack_nr_srs_report_tlv(const nfapi_srs_report_tlv_t *report_tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - +static uint8_t pack_nr_srs_report_tlv(const nfapi_srs_report_tlv_t *report_tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ if(!(push16(report_tlv->tag, ppWritePackedMsg, end) && push32(report_tlv->length, ppWritePackedMsg, end))) { return 0; @@ -2256,8 +2238,8 @@ static uint8_t pack_nr_srs_report_tlv(const nfapi_srs_report_tlv_t *report_tlv, return 1; } -static uint8_t pack_nr_srs_indication_body(const nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) { - +static uint8_t pack_nr_srs_indication_body(const nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) +{ if(!(push32(value->handle, ppWritePackedMsg, end) && push16(value->rnti, ppWritePackedMsg, end) && push16(value->timing_advance_offset, ppWritePackedMsg, end) && @@ -2274,7 +2256,7 @@ static uint8_t pack_nr_srs_indication_body(const nfapi_nr_srs_indication_pdu_t * return 1; } -uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t *)msg; @@ -2328,8 +2310,8 @@ static uint8_t unpack_nr_srs_report_tlv(nfapi_srs_report_tlv_t *report_tlv, uint return 1; } -static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { - +static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) +{ if(!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end) && pull16(ppReadPackedMsg, &value->timing_advance_offset, end) && @@ -2346,7 +2328,7 @@ static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *valu return 1; } -uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t *)msg; if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn, end) && pull16(ppReadPackedMsg, &pNfapiMsg->slot, end) @@ -2381,7 +2363,7 @@ static uint8_t pack_nr_rach_indication_body(void *tlv, uint8_t **ppWritePackedMs return 1; } -uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) +uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t *)msg; @@ -2397,10 +2379,7 @@ uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t * return 1; } -static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) +static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *value, uint8_t **ppReadPackedMsg, uint8_t *end) { if (!(pull16(ppReadPackedMsg, &value->phy_cell_id, end) && pull8(ppReadPackedMsg, &value->symbol_index, end) && pull8(ppReadPackedMsg, &value->slot_index, end) && pull8(ppReadPackedMsg, &value->freq_index, end) @@ -2419,7 +2398,7 @@ static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t *v return 1; } -uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) +uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t *)msg; @@ -2431,7 +2410,7 @@ uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void if (pNfapiMsg->number_of_pdus > 0) { pNfapiMsg->pdu_list = calloc(pNfapiMsg->number_of_pdus, sizeof(*pNfapiMsg->pdu_list)); for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) { - if (!unpack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]), ppReadPackedMsg, end, config)) + if (!unpack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]), ppReadPackedMsg, end)) return 0; } } diff --git a/nfapi/open-nFAPI/fapi/src/nr_fapi_p7_utils.c b/nfapi/open-nFAPI/fapi/src/nr_fapi_p7_utils.c index 6da1b487ad..3f7f36ec6a 100644 --- a/nfapi/open-nFAPI/fapi/src/nr_fapi_p7_utils.c +++ b/nfapi/open-nFAPI/fapi/src/nr_fapi_p7_utils.c @@ -862,11 +862,13 @@ void free_ul_tti_request(nfapi_nr_ul_tti_request_t *msg) void free_slot_indication(nfapi_nr_slot_indication_scf_t *msg) { // Nothing to free + UNUSED(msg); } void free_ul_dci_request(nfapi_nr_ul_dci_request_t *msg) { // Nothing to free + UNUSED(msg); } void free_tx_data_request(nfapi_nr_tx_data_request_t *msg) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 3ac4d2e27a..e00924025e 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -2620,19 +2620,19 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe uint8_t result = 0; switch (pMessageHeader->message_id) { case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - result = pack_dl_tti_request(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_dl_tti_request(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_UE_RELEASE_REQUEST: result = pack_nr_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config); @@ -2643,27 +2643,27 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe break; case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: - result = pack_nr_slot_indication(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_nr_slot_indication(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: - result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: - result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: - result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: - result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: - result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config); + result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end); break; case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: @@ -6258,20 +6258,20 @@ bool nfapi_nr_p7_message_unpack(void *pMessageBuf, switch (pMessageHeader->message_id) { case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST, unpackedBufLen)) - result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST, unpackedBufLen)) - result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST, unpackedBufLen)) - result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen)) - result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader); break; case NFAPI_UE_RELEASE_REQUEST: if (check_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen)) @@ -6280,39 +6280,39 @@ bool nfapi_nr_p7_message_unpack(void *pMessageBuf, case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION, unpackedBufLen)) { nfapi_nr_slot_indication_scf_t *msg = (nfapi_nr_slot_indication_scf_t *)pMessageHeader; - result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg, config); + result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg); } break; case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen)) { - result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader, config); + result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, pMessageHeader); } - break; + break; case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen)) { - result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader, config); - } - break; + result = unpack_nr_crc_indication(&pReadPackedMessage, end, pMessageHeader); + } + break; case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen)) { - result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader, config); - } - break; + result = unpack_nr_uci_indication(&pReadPackedMessage, end, pMessageHeader); + } + break; case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen)) { - result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader, config); - } - break; + result = unpack_nr_srs_indication(&pReadPackedMessage, end, pMessageHeader); + } + break; case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen)) { - result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader, config); - } - break; + result = unpack_nr_rach_indication(&pReadPackedMessage, end, pMessageHeader); + } + break; case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: if (check_nr_fapi_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC, unpackedBufLen)) diff --git a/nfapi/open-nFAPI/utils/nfapi_hex_parser.c b/nfapi/open-nFAPI/utils/nfapi_hex_parser.c index e40484aa2e..7e9a8c3e96 100644 --- a/nfapi/open-nFAPI/utils/nfapi_hex_parser.c +++ b/nfapi/open-nFAPI/utils/nfapi_hex_parser.c @@ -15,6 +15,7 @@ void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) { + UNUSED(assert); if (s != NULL) { printf("%s:%d %s() Exiting OAI (n)FAPI Hex Parser: %s\n", file, line, function, s); } From 39fa6d81ec9976ee7eb507e8ecbba96244ed1a46 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 10 Mar 2026 09:18:44 +0100 Subject: [PATCH 03/37] add flag for unused function arguments in rfsimulator CMakeLists --- radio/rfsimulator/CMakeLists.txt | 1 + radio/rfsimulator/apply_channelmod.c | 7 +------ radio/rfsimulator/rfsimulator.h | 7 +------ radio/rfsimulator/simulator.cpp | 12 +++++++++++- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/radio/rfsimulator/CMakeLists.txt b/radio/rfsimulator/CMakeLists.txt index c93ab8cbec..e04ad1edcc 100644 --- a/radio/rfsimulator/CMakeLists.txt +++ b/radio/rfsimulator/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_library(rfsimulator MODULE simulator.cpp apply_channelmod.c diff --git a/radio/rfsimulator/apply_channelmod.c b/radio/rfsimulator/apply_channelmod.c index 800cf9b55d..0994231376 100644 --- a/radio/rfsimulator/apply_channelmod.c +++ b/radio/rfsimulator/apply_channelmod.c @@ -213,12 +213,7 @@ void update_channel_model(channel_desc_t *channelDesc, int nbSamples, uint64_t T either we regenerate the channel (call again random_channel(desc,0)), or we keep it over subframes legacy: we regenerate each sub frame in UL, and each frame only in DL */ -void rxAddInput(c16_t **input_sig, - cf_t *after_channel_sig, - int rxAnt, - channel_desc_t *channelDesc, - int nbSamples, - uint64_t TS) +void rxAddInput(c16_t **input_sig, cf_t *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, int nbSamples) { // channelDesc->path_loss_dB should contain the total path gain // so, in actual RF: tx gain + path loss + rx gain (+antenna gain, ...) diff --git a/radio/rfsimulator/rfsimulator.h b/radio/rfsimulator/rfsimulator.h index be8884fbe6..895f9b8341 100644 --- a/radio/rfsimulator/rfsimulator.h +++ b/radio/rfsimulator/rfsimulator.h @@ -5,11 +5,6 @@ #ifndef __RFSIMULATOR_H #define __RFSIMULATOR_H #include -void rxAddInput(c16_t **input_sig, - cf_t *after_channel_sig, - int rxAnt, - channel_desc_t *channelDesc, - int nbSamples, - uint64_t TS); +void rxAddInput(c16_t **input_sig, cf_t *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, int nbSamples); void update_channel_model(channel_desc_t *channelDesc, int nbSamples, uint64_t TS); #endif diff --git a/radio/rfsimulator/simulator.cpp b/radio/rfsimulator/simulator.cpp index 38b5351e40..f122b21fa0 100644 --- a/radio/rfsimulator/simulator.cpp +++ b/radio/rfsimulator/simulator.cpp @@ -605,6 +605,7 @@ static void rfsimulator_readconfig(rfsimulator_state_t *rfsimulator) static int rfsimu_set_beam(char *buff, int debug, telnet_printfunc_t prnt, void *arg) { + UNUSED(debug); rfsimulator_state_t *t = (rfsimulator_state_t *)arg; rfsim_beam_ctrl_t *beam_ctrl = t->beam_ctrl; AssertFatal(beam_ctrl->enable_beams, "Beam simualtion is disabled, cannot set beams\n"); @@ -619,6 +620,7 @@ static int rfsimu_set_beam(char *buff, int debug, telnet_printfunc_t prnt, void static int rfsimu_set_beamids(char *buff, int debug, telnet_printfunc_t prnt, void *arg) { + UNUSED(debug); rfsimulator_state_t *t = (rfsimulator_state_t *)arg; rfsim_beam_ctrl_t *beam_ctrl = t->beam_ctrl; AssertFatal(beam_ctrl->enable_beams, "Beam simualtion is disabled, cannot set beams\n"); @@ -787,6 +789,8 @@ static int rfsimu_getdistance_cmd(char *buff, int debug, telnet_printfunc_t prnt static int rfsimu_vtime_cmd(char *buff, int debug, telnet_printfunc_t prnt, void *arg) { + UNUSED(debug); + UNUSED(buff); rfsimulator_state_t *t = (rfsimulator_state_t *)arg; const openair0_timestamp_t ts = t->nextRxTstamp; const double sample_rate = t->sample_rate; @@ -1316,7 +1320,7 @@ static void rfsimulator_read_internal(rfsimulator_state_t *t, input); for (int aarx = 0; aarx < nbAnt; aarx++) { - rxAddInput(input, temp_array[aarx], aarx, ptr->channel_model, nsamps, timestamp); + rxAddInput(input, temp_array[aarx], aarx, ptr->channel_model, nsamps); } } else { if (is_first_beam && is_first_peer && (ptr->nbAnt == 1 || nbAnt == 1)) { @@ -1528,10 +1532,12 @@ static int rfsimulator_read(openair0_device_t *device, openair0_timestamp_t *pti static int rfsimulator_get_stats(openair0_device_t *device) { + UNUSED(device); return 0; } static int rfsimulator_reset_stats(openair0_device_t *device) { + UNUSED(device); return 0; } static void rfsimulator_end(openair0_device_t *device) @@ -1559,6 +1565,7 @@ static void stopServer(openair0_device_t *device) static int rfsimulator_stop(openair0_device_t *device) { + UNUSED(device); return 0; } static int rfsimulator_set_freq(openair0_device_t *device, openair0_config_t *openair0_cfg) @@ -1569,10 +1576,13 @@ static int rfsimulator_set_freq(openair0_device_t *device, openair0_config_t *op } static int rfsimulator_set_gains(openair0_device_t *device, openair0_config_t *openair0_cfg) { + UNUSED(device); + UNUSED(openair0_cfg); return 0; } static int rfsimulator_write_init(openair0_device_t *device) { + UNUSED(device); return 0; } From 008c6fa73cec8ddbc743e96a2bf71cde20d52299 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 10 Mar 2026 09:22:50 +0100 Subject: [PATCH 04/37] add flag for unused function arguments in USRP lib CMakeLists --- radio/USRP/CMakeLists.txt | 1 + radio/USRP/usrp_lib.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/radio/USRP/CMakeLists.txt b/radio/USRP/CMakeLists.txt index 2540e8d182..c0e4f551fa 100644 --- a/radio/USRP/CMakeLists.txt +++ b/radio/USRP/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) #find_package(Boost REQUIRED) find_package(UHD REQUIRED UHD) diff --git a/radio/USRP/usrp_lib.cpp b/radio/USRP/usrp_lib.cpp index ead8660738..5b8b34c9ed 100644 --- a/radio/USRP/usrp_lib.cpp +++ b/radio/USRP/usrp_lib.cpp @@ -260,7 +260,7 @@ static void trx_usrp_start_interdigital_gpio(openair0_device_t *device, usrp_sta s->usrp->set_gpio_attr(s->gpio_bank, "OUT", (1 << 4), 0x1c); } -static void trx_usrp_start_generic_gpio(openair0_device_t *device, usrp_state_t *s) +static void trx_usrp_start_generic_gpio(usrp_state_t *s) { // setup GPIO for TDD, GPIO(4) = ATR_RX // set data direction register (DDR) to output @@ -298,7 +298,7 @@ static int trx_usrp_start(openair0_device_t *device) case RU_GPIO_CONTROL_NONE: break; case RU_GPIO_CONTROL_GENERIC: - trx_usrp_start_generic_gpio(device, s); + trx_usrp_start_generic_gpio(s); break; case RU_GPIO_CONTROL_INTERDIGITAL: trx_usrp_start_interdigital_gpio(device, s); @@ -881,6 +881,7 @@ int trx_usrp_set_gains(openair0_device_t *device, */ int trx_usrp_stop(openair0_device_t *device) { + UNUSED(device); return(0); } @@ -1002,6 +1003,7 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_ */ int trx_usrp_get_stats(openair0_device_t *device) { + UNUSED(device); return(0); } @@ -1011,6 +1013,7 @@ int trx_usrp_get_stats(openair0_device_t *device) */ int trx_usrp_reset_stats(openair0_device_t *device) { + UNUSED(device); return(0); } From 6b5a8b691de872a57718ce418fbed1b5e2a0fe0e Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 10 Mar 2026 11:10:12 +0100 Subject: [PATCH 05/37] further L1 cleanup for unused arguments in functions --- openair1/PHY/MODULATION/beamforming.c | 1 - openair1/PHY/MODULATION/nr_modulation.h | 1 - .../NR_ESTIMATION/nr_ul_channel_estimation.c | 2 + .../PHY/NR_TRANSPORT/nr_transport_proto.h | 12 +---- .../PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 37 ++++------------ .../NR_TRANSPORT/nr_ulsch_llr_computation.c | 13 ++---- .../nr_dl_channel_estimation.c | 4 +- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 1 - openair1/PHY/NR_UE_TRANSPORT/csi_rx.c | 44 +++++++++---------- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 7 +-- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 1 - openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair1/SCHED_NR_UE/defs.h | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 15 files changed, 41 insertions(+), 88 deletions(-) diff --git a/openair1/PHY/MODULATION/beamforming.c b/openair1/PHY/MODULATION/beamforming.c index 9dd48a02fe..56def37b41 100644 --- a/openair1/PHY/MODULATION/beamforming.c +++ b/openair1/PHY/MODULATION/beamforming.c @@ -86,7 +86,6 @@ void nr_beam_precoding(c16_t **txdataF, c16_t **txdataF_BF, NR_DL_FRAME_PARMS *frame_parms, int32_t ***beam_weights, - int slot, int symbol, int aa, int nb_antenna_ports, diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h index 2afd9f81f4..ef834db509 100644 --- a/openair1/PHY/MODULATION/nr_modulation.h +++ b/openair1/PHY/MODULATION/nr_modulation.h @@ -80,7 +80,6 @@ void nr_beam_precoding(c16_t **txdataF, c16_t **txdataF_BF, NR_DL_FRAME_PARMS *frame_parms, int32_t ***beam_weights, - int slot, int symbol, int aa, int nb_antenna_ports, diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 1878fc2d55..4d70db6f02 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -783,6 +783,8 @@ int nr_srs_ls_channel_estimation(int ant, #ifdef SRS_DEBUG LOG_I(NR_PHY, "====================== UE port %d --> gNB Rx antenna %i ======================\n", p_index, ant); LOG_I(NR_PHY, "============================== SRS symbol index %d ===========================\n", srs_symb); +#else + UNUSED(ant); #endif uint16_t subcarrier = CIRCULAR_INC(subcarrier_offset + nr_srs_info->k_0_p[p_index][srs_symb], 0, ofdm_symbol_size); diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 61d8df03b8..e815b3edd7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -88,14 +88,8 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM @param UE_id id of current UE @param frame Frame number @param slot Slot number - @param harq_pid HARQ process ID */ -int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, - uint8_t ulsch_id, - uint32_t frame, - uint8_t slot, - unsigned char harq_pid, - int beam_nb); +int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, uint8_t ulsch_id, uint32_t frame, uint8_t slot, int beam_nb); /*! \brief This function implements the idft transform precoding in PUSCH @@ -147,9 +141,7 @@ void nr_ulsch_compute_llr(c16_t *rxdataF_comp, void reset_active_stats(PHY_VARS_gNB *gNB, int frame); void reset_active_ulsch(PHY_VARS_gNB *gNB, int frame); -void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars, - uint32_t symbol, - c16_t *rxdataF_comp0, +void nr_ulsch_compute_ML_llr(c16_t *rxdataF_comp0, c16_t *rxdataF_comp1, c16_t *ul_ch_mag0, c16_t *ul_ch_mag1, diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 4674800eb6..ecc0d416ed 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -80,7 +80,6 @@ static void nr_ulsch_extract_rbs(c16_t* const rxdataF, c16_t *chFext, int rxoffset, int choffset, - int aarx, int is_dmrs_symbol, nfapi_nr_pusch_pdu_t *pusch_pdu, NR_DL_FRAME_PARMS *frame_parms) @@ -266,9 +265,7 @@ static void nr_ulsch_det_HhH(c16_t *after_mf_00, // a c16_t *after_mf_10, // c c16_t *after_mf_11, // d uint32_t *det_fin, // 1/ad-bc - unsigned short nb_rb, - unsigned char symbol, - int32_t shift) + unsigned short nb_rb) { simde__m128i *after_mf_00_128,*after_mf_01_128, *after_mf_10_128, *after_mf_11_128, ad_re_128, bc_re_128; //ad_im_128, bc_im_128; simde__m128i *det_fin_128, det_re_128; //det_im_128, tmp_det0, tmp_det1; @@ -391,8 +388,7 @@ static void nr_ulsch_construct_HhH_elements(c16_t *conjch00_ch00, c16_t *after_mf_01, c16_t *after_mf_10, c16_t *after_mf_11, - unsigned short nb_rb, - unsigned char symbol) + unsigned short nb_rb) { //This function is used to construct the (H_hermitian * H matrix) matrix elements simde__m128i *conjch00_ch00_128 = (simde__m128i *)conjch00_ch00; @@ -679,8 +675,7 @@ static uint8_t nr_ulsch_mmse_2layers(c16_t **rxdataF_comp, af_mf_01, af_mf_10, af_mf_11, - nb_rb_0, - symbol); + nb_rb_0); } if (nb_rx_ant == 2) { nr_ulsch_construct_HhH_elements(conjch00_ch00, @@ -703,8 +698,7 @@ static uint8_t nr_ulsch_mmse_2layers(c16_t **rxdataF_comp, af_mf_01, af_mf_10, af_mf_11, - nb_rb_0, - symbol); + nb_rb_0); } // Add noise_var such that: H^h * H + noise_var * I @@ -726,9 +720,7 @@ static uint8_t nr_ulsch_mmse_2layers(c16_t **rxdataF_comp, af_mf_10,//c af_mf_11,//d determ_fin, - nb_rb_0, - symbol, - shift); + nb_rb_0); /* 2- Compute the channel matrix inversion ********************************** * * |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)| @@ -872,10 +864,8 @@ static void inner_rx(PHY_VARS_gNB *gNB, NR_gNB_PUSCH *pusch_vars, nfapi_nr_pusch_pdu_t *rel15_ul, c16_t **rxF, - c16_t **ul_ch, int16_t **llr, int soffset, - int length, int symbol, int output_shift, uint32_t nvar, @@ -907,7 +897,6 @@ static void inner_rx(PHY_VARS_gNB *gNB, chFext[aatx][aarx], soffset+(symbol * frame_parms->ofdm_symbol_size), dmrs_symbol * frame_parms->ofdm_symbol_size, - aarx, dmrs_symbol_flag, rel15_ul, frame_parms); @@ -973,10 +962,8 @@ static void inner_rx(PHY_VARS_gNB *gNB, if (nb_layer == 2) { if (rel15_ul->qam_mod_order <= 6) { - nr_ulsch_compute_ML_llr(pusch_vars, - symbol, - &pusch_vars->rxdataF_comp[0][symbol * buffer_length], - &pusch_vars->rxdataF_comp[nb_rx_ant][symbol * buffer_length], + nr_ulsch_compute_ML_llr((c16_t *)&pusch_vars->rxdataF_comp[0][symbol * buffer_length], + (c16_t *)&pusch_vars->rxdataF_comp[nb_rx_ant][symbol * buffer_length], rxF_ch_maga[0], rxF_ch_maga[1], llr[0], @@ -1058,10 +1045,8 @@ static void nr_pusch_symbol_processing(void *arg) pusch_vars, rel15_ul, gNB->common_vars.rxdataF[rdata->beam_nb], - (c16_t **)gNB->pusch_vars[ulsch_id].ul_ch_estimates, llrss, soffset, - gNB->pusch_vars[ulsch_id].ul_valid_re_per_slot[symbol], symbol, gNB->pusch_vars[ulsch_id].log2_maxh, rdata->nvar, @@ -1114,12 +1099,7 @@ static uint32_t average_u32(const uint32_t *x, uint16_t size) return (uint32_t)(sum_x / size); } -int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, - uint8_t ulsch_id, - uint32_t frame, - uint8_t slot, - unsigned char harq_pid, - int beam_nb) +int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, uint8_t ulsch_id, uint32_t frame, uint8_t slot, int beam_nb) { NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id].harq_process->ulsch_pdu; @@ -1324,7 +1304,6 @@ int nr_rx_pusch_tp(PHY_VARS_gNB *gNB, (c16_t*)&ul_ch_estimates_ext[nl * frame_parms->nb_antennas_rx + aarx][meas_symbol * nb_re_pusch], soffset + meas_symbol * frame_parms->ofdm_symbol_size, dmrs_symbol * frame_parms->ofdm_symbol_size, - aarx, (rel15_ul->ul_dmrs_symb_pos >> meas_symbol) & 0x01, rel15_ul, frame_parms); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c index 0e4ef15d32..318da26b75 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c @@ -1741,12 +1741,7 @@ void nr_ulsch_qam64_qam64(c16_t *stream0_in, #endif } -static void nr_ulsch_shift_llr(int16_t *llr_layer0, - int16_t *llr_layer1, - uint32_t nb_re, - uint32_t rxdataF_ext_offset, - uint8_t mod_order, - int shift) +static void nr_ulsch_shift_llr(int16_t *llr_layer0, int16_t *llr_layer1, uint32_t nb_re, int shift) { simde__m128i *llr_layers0 = (simde__m128i *)llr_layer0; simde__m128i *llr_layers1 = (simde__m128i *)llr_layer1; @@ -1770,9 +1765,7 @@ static void nr_ulsch_shift_llr(int16_t *llr_layer0, } } -void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars, - uint32_t symbol, - c16_t *rxdataF_comp0, +void nr_ulsch_compute_ML_llr(c16_t *rxdataF_comp0, c16_t *rxdataF_comp1, c16_t *ul_ch_mag0, c16_t *ul_ch_mag1, @@ -1787,7 +1780,7 @@ void nr_ulsch_compute_ML_llr(NR_gNB_PUSCH *pusch_vars, case 2: nr_ulsch_qpsk_qpsk(rxdataF_comp0, rxdataF_comp1, llr_layers0, rho0, nb_re); nr_ulsch_qpsk_qpsk(rxdataF_comp1, rxdataF_comp0, llr_layers1, rho1, nb_re); - nr_ulsch_shift_llr((int16_t *)llr_layers0, (int16_t *)llr_layers1, nb_re, pusch_vars->llr_offset[symbol] >> 1, 2, 4); + nr_ulsch_shift_llr((int16_t *)llr_layers0, (int16_t *)llr_layers1, nb_re, 4); break; case 4: nr_ulsch_qam16_qam16(rxdataF_comp0, rxdataF_comp1, ul_ch_mag0, ul_ch_mag1, llr_layers0, rho0, nb_re); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index bda26b0d52..8219a7f8cd 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -517,7 +517,6 @@ int nr_prs_channel_estimation(uint8_t gNB_id, } c32_t nr_pbch_dmrs_correlation(const NR_DL_FRAME_PARMS *fp, - const UE_nr_rxtx_proc_t *proc, const int symbol, const int dmrss, const int Nid_cell, @@ -535,8 +534,7 @@ c32_t nr_pbch_dmrs_correlation(const NR_DL_FRAME_PARMS *fp, unsigned int k = Nid_cell % 4; - DEBUG_PBCH("PBCH DMRS Correlation : gNB_id %d , OFDM size %d, Ncp=%d, k=%u symbol %d\n", - proc->gNB_id, + DEBUG_PBCH("PBCH DMRS Correlation : OFDM size %d, Ncp=%d, k=%u symbol %d\n", fp->ofdm_symbol_size, fp->Ncp, k, diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index a9755283c8..6c5b049634 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -39,7 +39,6 @@ void nr_pdcch_channel_estimation(const PHY_VARS_NR_UE *ue, c16_t *pilot); c32_t nr_pbch_dmrs_correlation(const NR_DL_FRAME_PARMS *fp, - const UE_nr_rxtx_proc_t *proc, const int symbol, const int dmrss, const int Nid_cell, diff --git a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c index 3914837795..5d35e385e3 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c +++ b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c @@ -211,6 +211,9 @@ static int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ant_rx, rx_csi_rs_signal[k].r, rx_csi_rs_signal[k].i); +#else + UNUSED(proc); + UNUSED(nr_csi_info); #endif } } @@ -419,14 +422,13 @@ static int nr_csi_rs_channel_estimation( return 0; } -int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, - const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, - const nr_csi_info_t *nr_csi_info, - const uint8_t N_ports, - uint8_t mem_offset, - c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN], - const int16_t log2_maxh, - uint8_t *rank_indicator) +static int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, + const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, + const uint8_t N_ports, + uint8_t mem_offset, + c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN], + const int16_t log2_maxh, + uint8_t *rank_indicator) { const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; const int16_t cond_dB_threshold = 5; @@ -552,18 +554,16 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, return 0; } -int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, - const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, - const nr_csi_info_t *nr_csi_info, - const uint8_t N_ports, - uint8_t mem_offset, - const c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN], - const uint32_t interference_plus_noise_power, - const uint8_t rank_indicator, - const int16_t log2_re, - uint8_t *i1, - uint8_t *i2, - int32_t *precoded_sinr_dB) +static int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, + const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, + const uint8_t N_ports, + uint8_t mem_offset, + const c16_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size + FILTER_MARGIN], + const uint32_t interference_plus_noise_power, + const uint8_t rank_indicator, + const int16_t log2_re, + uint8_t *i2, + int32_t *precoded_sinr_dB) { const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; @@ -788,7 +788,6 @@ static void nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue, } void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, - const UE_nr_rxtx_proc_t *proc, const c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP], const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu) { @@ -918,7 +917,6 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, if (csirs_config_pdu->measurement_bitmap & 2) { nr_csi_rs_ri_estimation(ue, csirs_config_pdu, - csi_info, mapping_parms.ports, mem_offset, csi_rs_estimated_channel_freq, @@ -934,14 +932,12 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, if (csirs_config_pdu->measurement_bitmap & 8) { nr_csi_rs_pmi_estimation(ue, csirs_config_pdu, - csi_info, mapping_parms.ports, mem_offset, csi_rs_estimated_channel_freq, csi_info->csi_im_meas_computed ? csi_info->interference_plus_noise_power : noise_power, rank_indicator, log2_re, - i1, i2, &precoded_sinr_dB); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index b7de100b57..b58ebe8049 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -123,8 +123,7 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol, int length, unsigned char mod_order, unsigned short nb_rb, - unsigned char output_shift, - PHY_NR_MEASUREMENTS *measurements) + unsigned char output_shift) { simde__m128i *dl_ch128, *dl_ch128_2, *dl_ch_mag128, *dl_ch_mag128b, *dl_ch_mag128r, *rxdataF128, *rxdataF_comp128, *rho128; simde__m128i QAM_amp128 = {0}, QAM_amp128b = {0}, QAM_amp128r = {0}; @@ -967,7 +966,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, memset(dl_ch_estimates_ext, 0, sizeof(dl_ch_estimates_ext)); NR_UE_COMMON *common_vars = &ue->common_vars; - PHY_NR_MEASUREMENTS *measurements = &ue->measurements; const int frame = proc->frame_rx; const int nr_slot_rx = proc->nr_slot_rx; const int gNB_id = proc->gNB_id; @@ -1228,8 +1226,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_re_pdsch, dlsch_config->qamModOrder, nb_rb_pdsch, - *log2_maxh, - measurements); // log2_maxh+I0_shift + *log2_maxh); // log2_maxh+I0_shift stop_meas_nr_ue_phy(ue, DLSCH_CHANNEL_COMPENSATION_STATS); if (meas_enabled) { LOG_D(PHY, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 87ab4abc57..5f13981b3a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -59,7 +59,6 @@ static bool nr_pbch_detection(const UE_nr_rxtx_proc_t *proc, cd_t cumul = {0}; for (int i = pbch_initial_symbol; i < pbch_initial_symbol + 3; i++) { c32_t meas = nr_pbch_dmrs_correlation(frame_parms, - proc, i, i - pbch_initial_symbol, Nid_cell, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 4806a48bda..367d0ba155 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -141,6 +141,7 @@ There is no data in DMRS symbol for other scenarios in type 1. */ static void map_data_dmrs_type1_cdm1_rb(const unsigned int num_cdm_no_data, const c16_t *data, c16_t *out) { + UNUSED(num_cdm_no_data); *(out + 1) = *data++; *(out + 3) = *data++; *(out + 5) = *data++; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index de72db32db..7a5af5b070 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -1112,7 +1112,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N pusch_decode_done = 1; start_meas(&gNB->rx_pusch_stats); - nr_rx_pusch_tp(gNB, ULSCH_id, frame_rx, slot_rx, ulsch->harq_pid, ulsch->beam_nb); + nr_rx_pusch_tp(gNB, ULSCH_id, frame_rx, slot_rx, ulsch->beam_nb); NR_gNB_PUSCH *pusch_vars = &gNB->pusch_vars[ULSCH_id]; pusch_vars->ulsch_power_tot = 0; pusch_vars->ulsch_noise_power_tot = 0; diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index eb952035aa..02c192378a 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -129,7 +129,6 @@ void nr_pdcch_dci_indication(const UE_nr_rxtx_proc_t *proc, c16_t llr[phy_data->phy_pdcch_config.nb_search_space][max_monOcc][llr_size]); void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, - const UE_nr_rxtx_proc_t *proc, const c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP], const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0b853820f3..fa63588d85 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1241,7 +1241,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ slot_fep_map[symb] = true; } } - nr_ue_csi_im_procedures(ue, proc, rxdataF, &phy_data->csiim_vars.csiim_config_pdu); + nr_ue_csi_im_procedures(ue, rxdataF, &phy_data->csiim_vars.csiim_config_pdu); } // do procedures for CSI-RS From 0da39e702ce64a541b25db6c408b0b3c99cc7536 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 11 Mar 2026 17:51:30 +0100 Subject: [PATCH 06/37] add flag for unused function arguments in F1AP CMakeLists --- openair2/F1AP/CMakeLists.txt | 1 + openair2/F1AP/lib/f1ap_positioning.c | 9 +++++++++ openair2/F1AP/lib/f1ap_ue_context.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/openair2/F1AP/CMakeLists.txt b/openair2/F1AP/CMakeLists.txt index fc9d451f5b..bf38ec70e5 100644 --- a/openair2/F1AP/CMakeLists.txt +++ b/openair2/F1AP/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(lib) add_subdirectory(MESSAGES) diff --git a/openair2/F1AP/lib/f1ap_positioning.c b/openair2/F1AP/lib/f1ap_positioning.c index c353d22407..bfcac8e495 100644 --- a/openair2/F1AP/lib/f1ap_positioning.c +++ b/openair2/F1AP/lib/f1ap_positioning.c @@ -3552,6 +3552,7 @@ bool eq_positioning_information_req(const f1ap_positioning_information_req_t *a, void free_positioning_information_req(f1ap_positioning_information_req_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -3839,6 +3840,7 @@ bool eq_positioning_information_failure(const f1ap_positioning_information_failu void free_positioning_information_failure(f1ap_positioning_information_failure_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -4130,6 +4132,7 @@ bool eq_positioning_activation_resp(const f1ap_positioning_activation_resp_t *a, void free_positioning_activation_resp(f1ap_positioning_activation_resp_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -4258,6 +4261,7 @@ bool eq_positioning_activation_failure(const f1ap_positioning_activation_failure void free_positioning_activation_failure(f1ap_positioning_activation_failure_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -4401,6 +4405,7 @@ bool eq_positioning_deactivation(const f1ap_positioning_deactivation_t *a, const void free_positioning_deactivation(f1ap_positioning_deactivation_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -5063,6 +5068,7 @@ bool eq_trp_information_failure(const f1ap_trp_information_failure_t *a, const f void free_trp_information_failure(f1ap_trp_information_failure_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -5761,6 +5767,7 @@ bool eq_positioning_measurement_failure(const f1ap_positioning_measurement_failu void free_positioning_measurement_failure(f1ap_positioning_measurement_failure_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -6084,6 +6091,7 @@ bool eq_positioning_measurement_abort(const f1ap_positioning_measurement_abort_t void free_positioning_measurement_abort(f1ap_positioning_measurement_abort_t *msg) { // nothing to free + UNUSED(msg); } /** @@ -6230,6 +6238,7 @@ bool eq_positioning_measurement_failure_indication(const f1ap_positioning_measur void free_positioning_measurement_failure_indication(f1ap_positioning_measurement_failure_indication_t *msg) { // nothing to free + UNUSED(msg); } /** diff --git a/openair2/F1AP/lib/f1ap_ue_context.c b/openair2/F1AP/lib/f1ap_ue_context.c index 8899c8888c..ee50db20e9 100644 --- a/openair2/F1AP/lib/f1ap_ue_context.c +++ b/openair2/F1AP/lib/f1ap_ue_context.c @@ -287,6 +287,7 @@ static bool eq_srb_to_setup(const f1ap_srb_to_setup_t *a, const f1ap_srb_to_setu static void free_srb_to_setup(f1ap_srb_to_setup_t *srbs) { // nothing to free + UNUSED(srbs); } static F1AP_SRBs_Setup_List_t encode_srbs_setup(int n, const f1ap_srb_setup_t *srbs) @@ -375,6 +376,7 @@ static bool eq_srb_setup(const f1ap_srb_setup_t *a, const f1ap_srb_setup_t *b) static void free_srb_setup(f1ap_srb_setup_t *srbs) { // nothing to free + UNUSED(srbs); } static F1AP_QoSFlowLevelQoSParameters_t encode_qos_flow_param(const f1ap_qos_flow_param_t *p) @@ -639,6 +641,7 @@ static bool eq_up_tnl(const f1ap_up_tnl_t *a, const f1ap_up_tnl_t *b) static void free_up_tnl(const f1ap_up_tnl_t *tnl) { // nothing to free + UNUSED(tnl); } /* Encode a DRBs_ToSetup list for UE Context Setup Request, from f1ap_drb_to_setup_t. */ @@ -1115,6 +1118,7 @@ static bool eq_drb_to_release(const f1ap_drb_to_release_t *a, const f1ap_drb_to_ static void free_drb_to_release(f1ap_drb_to_release_t *drb) { // nothing to free + UNUSED(drb); } /** @@ -2224,6 +2228,7 @@ bool eq_ue_context_rel_req(const f1ap_ue_context_rel_req_t *a, const f1ap_ue_con void free_ue_context_rel_req(f1ap_ue_context_rel_req_t *req) { // nothing to free + UNUSED(req); } /* @@ -2491,4 +2496,5 @@ bool eq_ue_context_rel_cplt(const f1ap_ue_context_rel_cplt_t *a, const f1ap_ue_c void free_ue_context_rel_cplt(f1ap_ue_context_rel_cplt_t *cplt) { // nothing to free + UNUSED(cplt); } From 99bded7b87cac7196699d1f33a7ee7012bc1d875 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 11 Mar 2026 18:48:13 +0100 Subject: [PATCH 07/37] improve nr_unitary_common file to prevent unused parameter warnings --- .../SIMULATION/NR_PHY/nr_unitary_common.c | 101 +++++++++++++----- 1 file changed, 73 insertions(+), 28 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_common.c b/openair1/SIMULATION/NR_PHY/nr_unitary_common.c index 92d1bd1b87..9a595a9295 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_common.c +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_common.c @@ -20,61 +20,62 @@ void sigint_handler(int arg) { static const char msg[] = "\nCaught SIGINT, shutting down\nPress again CTRL+C to force shutdown\n"; __attribute__((unused)) int unused = write(STDOUT_FILENO, msg, sizeof(msg) - 1); - + UNUSED(arg); stop = true; } -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_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req) -{ - return (0); -} -int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req) -{ - return (0); -} int oai_nfapi_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { + UNUSED(ind); return (0); } int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind) { + UNUSED(ind); return (0); } int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { + UNUSED(ind); return (0); } int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) { + UNUSED(ind); return (0); } int oai_nfapi_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { + UNUSED(ind); return 0; } void handle_nr_slot_ind(uint16_t sfn, uint16_t slot) { + UNUSED(sfn); + UNUSED(slot); } int pack_nr_srs_beamforming_report(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { + UNUSED(pMessageBuf); + UNUSED(pPackedBuf); + UNUSED(packedBufLen); return 0; } int unpack_nr_srs_beamforming_report(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen) { + UNUSED(pMessageBuf); + UNUSED(messageBufLen); + UNUSED(pUnpackedBuf); + UNUSED(unpackedBufLen); return 0; } int pack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen) { + UNUSED(pMessageBuf); + UNUSED(pPackedBuf); + UNUSED(packedBufLen); return 0; } int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, @@ -82,24 +83,31 @@ int unpack_nr_srs_normalized_channel_iq_matrix(void *pMessageBuf, void *pUnpackedBuf, uint32_t unpackedBufLen) { + UNUSED(pMessageBuf); + UNUSED(messageBufLen); + UNUSED(pUnpackedBuf); + UNUSED(unpackedBufLen); return 0; } -void get_position_coordinates(int Mod_id, position_t *position) -{ -} -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) { + UNUSED(vnf_ip_addr); + UNUSED(vnf_p5_port); + UNUSED(pnf_ip_addr); + UNUSED(pnf_p7_port); + UNUSED(vnf_p7_port); } void configure_nr_nfapi_vnf(eth_params_t params) { + UNUSED(params); } int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t *config) { + UNUSED(pMessageBuf); + UNUSED(pPackedBuf); + UNUSED(packedBufLen); + UNUSED(config); return 0; } bool nfapi_nr_p7_message_unpack(void *pMessageBuf, @@ -108,6 +116,11 @@ bool nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { + UNUSED(pMessageBuf); + UNUSED(messageBufLen); + UNUSED(pUnpackedBuf); + UNUSED(unpackedBufLen); + UNUSED(config); return false; } int nfapi_p7_message_header_unpack(void *pMessageBuf, @@ -116,23 +129,37 @@ int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { + UNUSED(pMessageBuf); + UNUSED(messageBufLen); + UNUSED(pUnpackedBuf); + UNUSED(unpackedBufLen); + UNUSED(config); return 0; } void nr_mac_rrc_sync_ind(const module_id_t module_id, const frame_t frame, const bool in_sync) { + UNUSED(module_id); + UNUSED(frame); + UNUSED(in_sync); } void nr_mac_rrc_msg3_ind(const module_id_t mod_id, int rnti, int gnb_id) { + UNUSED(mod_id); + UNUSED(gnb_id); + UNUSED(rnti); } void nr_mac_rrc_ra_ind(const module_id_t mod_id, bool success) { + UNUSED(mod_id); + UNUSED(success); } void nr_mac_rrc_inactivity_timer_ind(const module_id_t mod_id) { + UNUSED(mod_id); } void rrc_data_ind(const protocol_ctxt_t *const ctxt_pP, @@ -140,6 +167,10 @@ void rrc_data_ind(const protocol_ctxt_t *const ctxt_pP, const sdu_size_t sdu_sizeP, const uint8_t *const buffer_pP) { + UNUSED(ctxt_pP); + UNUSED(Srb_id); + UNUSED(sdu_sizeP); + UNUSED(buffer_pP); } typedef uint32_t channel_t; @@ -156,12 +187,20 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const uint8_t *pduP, const sdu_size_t pdu_len) { + UNUSED(module_id); + UNUSED(CC_id); + UNUSED(gNB_index); + UNUSED(hfn); + UNUSED(frame); + UNUSED(slot); + UNUSED(rnti); + UNUSED(arfcn); + UNUSED(channel); + UNUSED(pduP); + UNUSED(pdu_len); + UNUSED(cellid); return 0; } -void *rrc_nrue(void *notUsed) -{ - return NULL; -} void nr_mac_rrc_meas_ind_ue(module_id_t module_id, uint32_t gNB_index, @@ -170,4 +209,10 @@ void nr_mac_rrc_meas_ind_ue(module_id_t module_id, bool is_neighboring_cell, int rsrp_dBm) { + UNUSED(module_id); + UNUSED(Nid_cell); + UNUSED(gNB_index); + UNUSED(csi_meas); + UNUSED(is_neighboring_cell); + UNUSED(rsrp_dBm); } From f59d67e5265a1e2f45655e306b6a6ed51b9f166d Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 13 Mar 2026 14:47:00 +0100 Subject: [PATCH 08/37] add flag for unused function arguments in E1AP CMakeLists --- openair2/E1AP/CMakeLists.txt | 1 + openair2/E1AP/e1ap.c | 201 ++---------------- .../E1AP/lib/e1ap_bearer_context_management.c | 4 + 3 files changed, 24 insertions(+), 182 deletions(-) diff --git a/openair2/E1AP/CMakeLists.txt b/openair2/E1AP/CMakeLists.txt index ea7647e57f..ed2942e3f2 100644 --- a/openair2/E1AP/CMakeLists.txt +++ b/openair2/E1AP/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(MESSAGES) add_subdirectory(lib) diff --git a/openair2/E1AP/e1ap.c b/openair2/E1AP/e1ap.c index 5722bc5bcc..265341024c 100644 --- a/openair2/E1AP/e1ap.c +++ b/openair2/E1AP/e1ap.c @@ -103,46 +103,6 @@ static void e1_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *s AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } -int e1ap_send_RESET(bool isCu, sctp_assoc_t assoc_id, E1AP_Reset_t *Reset) -{ - AssertFatal(false, "Not implemented yet\n"); - E1AP_E1AP_PDU_t *pdu = calloc_or_fail(1, sizeof(*pdu)); - return e1ap_encode_send(isCu, assoc_id, pdu, 0, __func__); -} - -int e1ap_send_RESET_ACKNOWLEDGE(instance_t instance, E1AP_Reset_t *Reset) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1ap_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1ap_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -/* - Error Indication -*/ -int e1ap_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1ap_send_ERROR_INDICATION(instance_t instance, E1AP_ErrorIndication_t *ErrorIndication) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - void e1ap_send_SETUP_RESPONSE(sctp_assoc_t assoc_id, const e1ap_setup_resp_t *e1ap_setup_resp) { E1AP_E1AP_PDU_t *pdu = encode_e1ap_cuup_setup_response(e1ap_setup_resp); @@ -162,6 +122,7 @@ static void e1apCUCP_send_SETUP_FAILURE(sctp_assoc_t assoc_id, const e1ap_setup_ int e1apCUCP_handle_SETUP_REQUEST(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { DevAssert(pdu != NULL); + UNUSED(inst); /* Create ITTI message and send to queue */ MessageDef *msg_p = itti_alloc_new_message(TASK_CUCP_E1, 0 /*unused by callee*/, E1AP_SETUP_REQ); // Decode E1 CU-UP Setup Request @@ -187,6 +148,7 @@ int e1apCUCP_handle_SETUP_REQUEST(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, int e1apCUUP_handle_SETUP_RESPONSE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); // Decode E1 CU-UP Setup Response e1ap_setup_resp_t out = {0}; if (!decode_e1ap_cuup_setup_response(pdu, &out)) { @@ -210,6 +172,7 @@ int e1apCUUP_handle_SETUP_RESPONSE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst */ int e1apCUUP_handle_SETUP_FAILURE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); LOG_D(E1AP, "CU-UP: Decoding E1AP Setup Failure...\n"); E1AP_GNB_CU_UP_E1SetupFailureIEs_t *ie; DevAssert(pdu != NULL); @@ -302,58 +265,6 @@ int e1apCUCP_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(void) return -1; } -int e1apCUCP_handle_CONFIGURATION_UPDATE(E1AP_E1AP_PDU_t *pdu) -{ - /* - E1AP_GNB_CU_UP_E1SetupRequestIEs_t *ie; - DevAssert(pdu != NULL); - E1AP_GNB_CU_UP_E1SetupRequest_t *in = &pdu->choice.initiatingMessage->value.choice.GNB_CU_UP_E1SetupRequest; - */ - - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUUP_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUUP_handle_gNB_DU_CONFIGURATION_FAILURE(sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -/* - E1 release -*/ - -int e1ap_send_RELEASE_REQUEST(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1ap_send_RELEASE_ACKNOWLEDGE(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1ap_handle_RELEASE_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1ap_handle_RELEASE_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - void e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, e1ap_bearer_setup_req_t *const bearerCxt) { E1AP_E1AP_PDU_t *pdu = encode_E1_bearer_context_setup_request(bearerCxt); @@ -375,6 +286,8 @@ static void e1apCUUP_send_BEARER_CONTEXT_SETUP_FAILURE(sctp_assoc_t assoc_id, co int e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *e1_inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); + UNUSED(e1_inst); // Decode E1AP message e1ap_bearer_setup_req_t bearerCxt = {0}; if (!decode_E1_bearer_context_setup_request(pdu, &bearerCxt)) { @@ -387,6 +300,7 @@ int e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, e1ap_upc int e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(inst); MessageDef *msg = itti_alloc_new_message(TASK_CUCP_E1, 0, E1AP_BEARER_CONTEXT_SETUP_RESP); // Decode e1ap_bearer_setup_resp_t *bearerCxt = &E1AP_BEARER_CONTEXT_SETUP_RESP(msg); @@ -404,6 +318,7 @@ int e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, e1ap_up int e1apCUCP_handle_BEARER_CONTEXT_SETUP_FAILURE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(inst); e1ap_bearer_context_setup_failure_t fail = {0}; if (!decode_E1_bearer_context_setup_failure(&fail, pdu)) { LOG_E(E1AP, "Failed to decode Bearer Context Setup Failure\n"); @@ -447,6 +362,8 @@ int e1apCUUP_handle_BEARER_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *e1_inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); + UNUSED(e1_inst); e1ap_bearer_mod_req_t bearerCxt = {0}; if (!decode_E1_bearer_context_mod_request(pdu, &bearerCxt)) { LOG_E(E1AP, "Failed to handle Bearer Context Modification Request\n"); @@ -462,6 +379,8 @@ int e1apCUCP_handle_BEARER_CONTEXT_MODIFICATION_RESPONSE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *e1_inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); + UNUSED(e1_inst); MessageDef *msg = itti_alloc_new_message(TASK_CUUP_E1, 0, E1AP_BEARER_CONTEXT_MODIFICATION_RESP); e1ap_bearer_modif_resp_t *modif = &E1AP_BEARER_CONTEXT_MODIFICATION_RESP(msg); if(!decode_E1_bearer_context_mod_response(modif, pdu)) { @@ -474,6 +393,8 @@ int e1apCUCP_handle_BEARER_CONTEXT_MODIFICATION_RESPONSE(sctp_assoc_t assoc_id, int e1apCUCP_handle_BEARER_CONTEXT_MODIFICATION_FAILURE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); + UNUSED(inst); e1ap_bearer_context_mod_failure_t failure = {0}; if (!decode_E1_bearer_context_mod_failure(&failure, pdu)) { free_E1_bearer_context_mod_failure(&failure); @@ -489,35 +410,6 @@ int e1apCUCP_handle_BEARER_CONTEXT_MODIFICATION_FAILURE(sctp_assoc_t assoc_id, e return 0; } -int e1apCUUP_send_BEARER_CONTEXT_MODIFICATION_REQUIRED(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUCP_send_BEARER_CONTEXT_MODIFICATION_CONFIRM(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUCP_handle_BEARER_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, - sctp_assoc_t assoc_id, - uint32_t stream, - E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUUP_handle_BEARER_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, - sctp_assoc_t assoc_id, - uint32_t stream, - E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} /* BEARER CONTEXT RELEASE */ @@ -534,14 +426,10 @@ int e1apCUUP_send_BEARER_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, const e return e1ap_encode_send(CPtype, assoc_id, pdu, 0, __func__); } -int e1apCUUP_send_BEARER_CONTEXT_RELEASE_REQUEST(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - int e1apCUUP_handle_BEARER_CONTEXT_RELEASE_COMMAND(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); + UNUSED(inst); e1ap_bearer_release_cmd_t release = {0}; if(!decode_e1_bearer_context_release_command(&release, pdu)) { free_e1_bearer_context_release_command(&release); @@ -553,6 +441,8 @@ int e1apCUUP_handle_BEARER_CONTEXT_RELEASE_COMMAND(sctp_assoc_t assoc_id, e1ap_u int e1apCUCP_handle_BEARER_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *e1_inst, const E1AP_E1AP_PDU_t *pdu) { + UNUSED(assoc_id); + UNUSED(e1_inst); e1ap_bearer_release_cplt_t bearerCxt = {0}; if(!decode_e1_bearer_context_release_complete(&bearerCxt, pdu)) { free_e1_bearer_context_release_complete(&bearerCxt); @@ -565,61 +455,6 @@ int e1apCUCP_handle_BEARER_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, e1ap_ return 0; } -int e1apCUCP_handle_BEARER_CONTEXT_RELEASE_REQUEST(instance_t instance, - sctp_assoc_t assoc_id, - uint32_t stream, - E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -/* -BEARER CONTEXT INACTIVITY NOTIFICATION - */ - -int e1apCUUP_send_BEARER_CONTEXT_INACTIVITY_NOTIFICATION(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUCP_handle_BEARER_CONTEXT_INACTIVITY_NOTIFICATION(instance_t instance, - sctp_assoc_t assoc_id, - uint32_t stream, - E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} -/* - DL DATA -*/ - -int e1apCUUP_send_DL_DATA_NOTIFICATION(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUUP_send_DATA_USAGE_REPORT(instance_t instance) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUCP_handle_DL_DATA_NOTIFICATION(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - -int e1apCUCP_handle_send_DATA_USAGE_REPORT(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, E1AP_E1AP_PDU_t *pdu) -{ - AssertFatal(false, "Not implemented yet\n"); - return -1; -} - static instance_t cuup_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) { openAddr_t tmp = {0}; @@ -775,6 +610,7 @@ static void e1apHandleTimer(instance_t myInstance) */ void *E1AP_CUCP_task(void *arg) { + UNUSED(arg); LOG_I(E1AP, "Starting E1AP at CU CP\n"); MessageDef *msg = NULL; e1ap_common_init(); @@ -859,6 +695,7 @@ void *E1AP_CUCP_task(void *arg) */ void *E1AP_CUUP_task(void *arg) { + UNUSED(arg); LOG_I(E1AP, "Starting E1AP at CU UP\n"); e1ap_common_init(); int result; diff --git a/openair2/E1AP/lib/e1ap_bearer_context_management.c b/openair2/E1AP/lib/e1ap_bearer_context_management.c index ff90f3bbb2..01bca3a1fa 100644 --- a/openair2/E1AP/lib/e1ap_bearer_context_management.c +++ b/openair2/E1AP/lib/e1ap_bearer_context_management.c @@ -1086,6 +1086,7 @@ bool eq_bearer_context_setup_response(const e1ap_bearer_setup_resp_t *a, const e */ void free_e1ap_context_setup_response(const e1ap_bearer_setup_resp_t *msg) { + UNUSED(msg); // Do nothing (no dynamic allocation) } @@ -1305,6 +1306,7 @@ e1ap_bearer_release_cmd_t cp_bearer_context_release_command(const e1ap_bearer_re /** @brief Bearer Context Release Command equality check */ void free_e1_bearer_context_release_command(const e1ap_bearer_release_cmd_t *msg) { + UNUSED(msg); // do nothing } @@ -1392,6 +1394,7 @@ e1ap_bearer_release_cplt_t cp_bearer_context_release_complete(const e1ap_bearer_ /** @brief Bearer Context Release Complete equality check */ void free_e1_bearer_context_release_complete(const e1ap_bearer_release_cplt_t *msg) { + UNUSED(msg); // No dynamic memory, do nothing } @@ -2662,5 +2665,6 @@ bool eq_E1_bearer_context_mod_failure(const e1ap_bearer_context_mod_failure_t *a /** @brief E1AP Bearer Context Modification Failure: free */ void free_E1_bearer_context_mod_failure(const e1ap_bearer_context_mod_failure_t *msg) { + UNUSED(msg); // do nothing } From 7cf76f69bda874fb52f3850837f8689c51c6cf0e Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 13 Mar 2026 18:37:15 +0100 Subject: [PATCH 09/37] further L2 cleanup for unused arguments in functions --- openair2/F1AP/f1ap_cu_interface_management.c | 4 +- openair2/F1AP/f1ap_cu_rrc_message_transfer.c | 1 + openair2/F1AP/f1ap_cu_task.c | 11 ++- openair2/F1AP/f1ap_cu_ue_context_management.c | 16 +++- openair2/F1AP/f1ap_du_interface_management.c | 18 ++++- openair2/F1AP/f1ap_du_rrc_message_transfer.c | 3 + openair2/F1AP/f1ap_du_task.c | 4 +- openair2/F1AP/f1ap_du_ue_context_management.c | 20 ++++- openair2/GNB_APP/gnb_app.c | 10 +-- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 2 - openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 5 +- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 14 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 3 - .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 6 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 16 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 21 ++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 25 ++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 11 ++- .../LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 7 +- openair2/LAYER2/NR_MAC_gNB/main.c | 8 +- openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c | 79 +++++++------------ openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 10 +-- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 10 +-- openair2/RRC/NR/MESSAGES/asn1_msg.c | 3 +- openair2/RRC/NR/MESSAGES/asn1_msg.h | 3 +- openair2/RRC/NR/mac_rrc_dl_direct.c | 1 + openair2/RRC/NR/mac_rrc_dl_f1ap.c | 1 + openair2/RRC/NR/nr_rrc_proto.h | 12 +-- openair2/RRC/NR/rrc_gNB.c | 73 +++++++++-------- openair2/RRC/NR/rrc_gNB_NGAP.c | 22 +++--- openair2/RRC/NR/rrc_gNB_NGAP.h | 10 +-- openair2/RRC/NR/rrc_gNB_cuup.c | 12 +-- openair2/RRC/NR/rrc_gNB_mobility.c | 24 +++--- openair2/RRC/NR/rrc_gNB_mobility.h | 7 +- openair2/RRC/NR/rrc_gNB_nsa.c | 2 +- openair2/RRC/NR/rrc_gNB_radio_bearers.c | 7 +- openair2/RRC/NR_UE/L2_interface_ue.c | 2 - openair2/RRC/NR_UE/L2_interface_ue.h | 2 - openair2/RRC/NR_UE/rrc_UE.c | 19 ++--- openair2/RRC/NR_UE/rrc_proto.h | 3 - openair2/RRC/NR_UE/rrc_sl_preconfig.c | 9 +-- openair2/SDAP/nr_sdap/nr_sdap.c | 11 +-- openair2/SDAP/nr_sdap/nr_sdap.h | 8 +- .../XNAP/lib/xnap_gNB_interface_management.c | 1 + 47 files changed, 253 insertions(+), 289 deletions(-) diff --git a/openair2/F1AP/f1ap_cu_interface_management.c b/openair2/F1AP/f1ap_cu_interface_management.c index 4770d0a967..d25e3499b9 100644 --- a/openair2/F1AP/f1ap_cu_interface_management.c +++ b/openair2/F1AP/f1ap_cu_interface_management.c @@ -12,7 +12,7 @@ int CU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { DevAssert(pdu != NULL); - + UNUSED(stream); f1ap_reset_ack_t ack = {0}; /* Decode */ if (!decode_f1ap_reset_ack(pdu, &ack)) { @@ -30,6 +30,8 @@ int CU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack) { + UNUSED(assoc_id); + UNUSED(ack); AssertFatal(1 == 0, "Not implemented yet\n"); } diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c index 32082c27a7..c28daa4263 100644 --- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c @@ -19,6 +19,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(stream); f1ap_initial_ul_rrc_message_t msg; if (!decode_initial_ul_rrc_message_transfer(pdu, &msg)) { LOG_E(F1AP, "cannot decode F1 initial UL RRC message Transfer\n"); diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index 362d4d280d..6b8ad48198 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -26,9 +26,7 @@ static instance_t cu_task_create_gtpu_instance(eth_params_t *IPaddrs) { return gtpv1Init(tmp); } -static void cu_task_handle_sctp_association_ind(instance_t instance, - sctp_new_association_ind_t *sctp_new_association_ind, - eth_params_t *IPaddrs) +static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind) { // save the assoc id f1ap_cudu_inst_t *f1ap_cu_data = getCxt(instance); @@ -80,7 +78,9 @@ static void cu_task_send_sctp_init_req(instance_t instance, char *my_addr) itti_send_msg_to_task(TASK_SCTP, instance, message_p); } -void *F1AP_CU_task(void *arg) { +void *F1AP_CU_task(void *arg) +{ + UNUSED(arg); MessageDef *received_msg = NULL; int result; LOG_I(F1AP, "Starting F1AP at CU\n"); @@ -113,8 +113,7 @@ void *F1AP_CU_task(void *arg) { switch (ITTI_MSG_ID(received_msg)) { case SCTP_NEW_ASSOCIATION_IND: cu_task_handle_sctp_association_ind(ITTI_MSG_ORIGIN_INSTANCE(received_msg), - &received_msg->ittiMsg.sctp_new_association_ind, - IPaddrs); + &received_msg->ittiMsg.sctp_new_association_ind); break; case SCTP_NEW_ASSOCIATION_RESP: diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index b7c853e66a..ff48873a5f 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -41,6 +41,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, const f1ap_ue_contex int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(stream); f1ap_ue_context_setup_resp_t resp = {0}; if (!decode_ue_context_setup_resp(pdu, &resp)) { LOG_E(F1AP, "cannot decode F1 UE Context Setup Resp\n"); @@ -57,11 +58,16 @@ int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_ int CU_handle_UE_CONTEXT_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); + UNUSED(pdu); AssertFatal(1==0,"Not implemented yet\n"); } int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(stream); f1ap_ue_context_rel_req_t req = {0}; if (!decode_ue_context_rel_req(pdu, &req)) { LOG_E(F1AP, "cannot decode F1 UE Context Release Request\n"); @@ -94,6 +100,7 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(sctp_assoc_t assoc_id, f1ap_ue_context_re int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(stream); f1ap_ue_context_rel_cplt_t cplt = {0}; if (!decode_ue_context_rel_cplt(pdu, &cplt)) { LOG_E(F1AP, "cannot decode F1 UE Context Release Complete\n"); @@ -126,6 +133,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, const f1ap_ue int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(stream); f1ap_ue_context_mod_resp_t resp = {0}; if (!decode_ue_context_mod_resp(pdu, &resp)) { LOG_E(F1AP, "cannot decode F1 UE Context Modification Response\n"); @@ -141,13 +149,17 @@ int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, sctp_assoc_t int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { - AssertFatal(1 == 0, "Not implemented yet\n"); + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); + UNUSED(pdu); + AssertFatal(1 == 0, "Not implemented yet\n"); } int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { DevAssert(pdu != NULL); - + UNUSED(stream); MessageDef *msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_UE_CONTEXT_MODIFICATION_REQUIRED); msg_p->ittiMsgHeader.originInstance = assoc_id; f1ap_ue_context_modif_required_t *required = &F1AP_UE_CONTEXT_MODIFICATION_REQUIRED(msg_p); diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c index 848e7ab02a..c2bbda1b69 100644 --- a/openair2/F1AP/f1ap_du_interface_management.c +++ b/openair2/F1AP/f1ap_du_interface_management.c @@ -14,6 +14,7 @@ int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); LOG_D(F1AP, "DU_handle_RESET\n");\ F1AP_Reset_t *container; F1AP_ResetIEs_t *ie; @@ -133,6 +134,9 @@ int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, const f1ap_setup_req_t *setu int DU_handle_F1_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); LOG_D(F1AP, "DU_handle_F1_SETUP_RESPONSE\n"); /* Decode */ f1ap_setup_resp_t resp = {0}; @@ -153,6 +157,9 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint */ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); f1ap_setup_failure_t fail; if (!decode_f1ap_setup_failure(pdu, &fail)) { LOG_E(F1AP, "Failed to decode F1AP Setup Failure\n"); @@ -189,6 +196,8 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_du_confi */ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(stream); LOG_D(F1AP, "DU_handle_gNB_CU_CONFIGURATION_UPDATE\n"); f1ap_gnb_cu_configuration_update_t in = {0}; if (!decode_f1ap_cu_configuration_update(pdu, &in)) { @@ -212,6 +221,9 @@ int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); // Decoding f1ap_gnb_du_configuration_update_acknowledge_t in = {0}; if (!decode_f1ap_du_configuration_update_acknowledge(pdu, &in)) { @@ -225,8 +237,10 @@ int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, return 0; } -int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id, - f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) { +int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id, + f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) +{ + UNUSED(assoc_id); AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n", GNBCUConfigurationUpdateFailure->cause); } diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c index 7d1811d212..e2439b4f42 100644 --- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c @@ -29,6 +29,9 @@ /* DL RRC Message Transfer */ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); f1ap_dl_rrc_message_t msg = {0}; if (!decode_dl_rrc_message_transfer(pdu, &msg)) { LOG_E(F1AP, "cannot decode F1 DL RRC message Transfer\n"); diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index 3d27f7db19..78117bd0c1 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -90,7 +90,9 @@ void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_dat AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); } -void *F1AP_DU_task(void *arg) { +void *F1AP_DU_task(void *arg) +{ + UNUSED(arg); //sctp_cu_init(); LOG_I(F1AP, "Starting F1AP at DU\n"); itti_mark_task_ready(TASK_DU_F1); diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c index 0c3eb853f8..9e620106c7 100644 --- a/openair2/F1AP/f1ap_du_ue_context_management.c +++ b/openair2/F1AP/f1ap_du_ue_context_management.c @@ -14,6 +14,9 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); f1ap_ue_context_setup_req_t req = {0}; if (!decode_ue_context_setup_req(pdu, &req)) { LOG_E(F1AP, "cannot decode F1 UE Context Setup Request\n"); @@ -45,6 +48,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_context_set int DU_send_UE_CONTEXT_SETUP_FAILURE(sctp_assoc_t assoc_id) { + UNUSED(assoc_id); AssertFatal(1==0,"Not implemented yet\n"); } @@ -66,6 +70,9 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_re int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); f1ap_ue_context_rel_cmd_t cmd = {0}; if (!decode_ue_context_rel_cmd(pdu, &cmd)) { LOG_E(F1AP, "cannot decode F1 UE Context Release Command\n"); @@ -96,6 +103,9 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, f1ap_ue_context_r int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); f1ap_ue_context_mod_req_t req = {0}; if (!decode_ue_context_mod_req(pdu, &req)) { LOG_E(F1AP, "cannot decode F1 UE Context Modification Request\n"); @@ -124,7 +134,9 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_cont return 0; } -int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(sctp_assoc_t assoc_id) { +int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(sctp_assoc_t assoc_id) +{ + UNUSED(assoc_id); AssertFatal(1==0,"Not implemented yet\n"); } @@ -250,6 +262,9 @@ int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(sctp_assoc_t assoc_id, f1ap_ue_cont int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); F1AP_UEContextModificationConfirm_t *container = &pdu->choice.successfulOutcome->value.choice.UEContextModificationConfirm; f1ap_ue_context_modif_confirm_t confirm = {0}; F1AP_UEContextModificationConfirmIEs_t *ie = NULL; @@ -326,6 +341,9 @@ int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, sctp_assoc_t int DU_handle_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu) { + UNUSED(instance); + UNUSED(assoc_id); + UNUSED(stream); F1AP_UEContextModificationRefuse_t *container = &pdu->choice.unsuccessfulOutcome->value.choice.UEContextModificationRefuse; f1ap_ue_context_modif_refuse_t refuse = {0}; F1AP_UEContextModificationRefuseIEs_t *ie = NULL; diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c index ae7ff9933b..040a549462 100644 --- a/openair2/GNB_APP/gnb_app.c +++ b/openair2/GNB_APP/gnb_app.c @@ -82,11 +82,11 @@ uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end) { void *gNB_app_task(void *args_p) { - - MessageDef *msg_p = NULL; - const char *msg_name = NULL; - instance_t instance; - int result; + UNUSED(args_p); + MessageDef *msg_p = NULL; + const char *msg_name = NULL; + instance_t instance; + int result; /* for no gcc warnings */ (void)instance; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index f4d6d6bda8..74adb9325f 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -37,14 +37,12 @@ void nr_ue_decode_mib(NR_UE_MAC_INST_t *mac, int cc_id); /**\brief decode SIB1 and other SIs pdus in NR_UE, from if_module dl_ind \param mac pointer to MAC instance - \param cc_id component carrier id \param gNB_index gNB index \param sibs_mask sibs mask \param pduP pointer to pdu \param pdu_length length of pdu \param frame,slot Received TTI*/ void nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac, - int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index 2937794ca3..8576028f9b 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -15,7 +15,7 @@ static NR_UE_MAC_INST_t *nr_ue_mac_inst[MAX_NUM_NR_UE_INST] = {0}; void send_srb0_rrc(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data) { AssertFatal(sdu_len > 0 && sdu_len < CCCH_SDU_SIZE, "invalid CCCH SDU size %d\n", sdu_len); - + UNUSED(data); MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_CCCH_DATA_IND); memset(NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu, 0, sdu_len); memcpy(NR_RRC_MAC_CCCH_DATA_IND(message_p).sdu, sdu, sdu_len); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index d6c49d3797..65dab84a0b 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -270,7 +270,6 @@ static void configure_ratematching_csi(fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsc } void nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac, - int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, @@ -281,7 +280,7 @@ void nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac, { if(ack_nack) { LOG_D(NR_MAC, "Decoding NR-BCCH-DL-SCH-Message (SIB1 or SI)\n"); - nr_mac_rrc_data_ind_ue(mac->ue_id, cc_id, gNB_index, hfn, frame, slot, 0, mac->physCellId, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len); + nr_mac_rrc_data_ind_ue(mac->ue_id, gNB_index, hfn, frame, slot, mac->physCellId, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len); if (mac->get_sib1) mac->get_sib1 = false; for (int i = 0; i < MAX_SI_GROUPS; i++) { @@ -298,7 +297,7 @@ void nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac, } else { LOG_E(NR_MAC, "Got NACK on NR-BCCH-DL-SCH-Message (%s)\n", mac->get_sib1 ? "SIB1" : "other SI"); - nr_mac_rrc_data_ind_ue(mac->ue_id, cc_id, gNB_index, hfn, frame, slot, 0, mac->physCellId, 0, NR_BCCH_DL_SCH, NULL, 0); + nr_mac_rrc_data_ind_ue(mac->ue_id, gNB_index, hfn, frame, slot, mac->physCellId, 0, NR_BCCH_DL_SCH, NULL, 0); } } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index e461459238..202590f9fc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -1213,7 +1213,7 @@ bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t bool res = add_connected_nr_ue(nrmac, UE); if (!res) { LOG_E(NR_MAC, "Error adding UE %04x\n", rnti); - delete_nr_ue_data(UE, NULL, &nrmac->UE_info.uid_allocator); + delete_nr_ue_data(UE, &nrmac->UE_info.uid_allocator); NR_SCHED_UNLOCK(&nrmac->sched_lock); return false; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 48fa4a3aca..ab2588a25b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -169,7 +169,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, slot_t slo } nr_measgap_scheduling(gNB, frame, slot); - nr_mac_update_timers(module_idP, frame, slot); + nr_mac_update_timers(module_idP); if (wait_prach_completed || get_softmodem_params()->phy_test) { // This schedules MIB diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 180c43b12a..6b2c9e23ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -24,7 +24,7 @@ #include -static void nr_fill_rar(uint8_t Mod_idP, NR_UE_info_t *UE, uint8_t *dlsch_buffer, nfapi_nr_pusch_pdu_t *pusch_pdu); +static void nr_fill_rar(NR_UE_info_t *UE, uint8_t *dlsch_buffer, nfapi_nr_pusch_pdu_t *pusch_pdu); static const float ssb_per_rach_occasion[8] = {0.125, 0.25, 0.5, 1, 2, 4, 8}; @@ -640,6 +640,7 @@ static uint8_t nr_get_msg3_tpc(uint32_t preamble_power) // in any case OAI L1 sets this as invalid // and Aerial report doesn't seem to be reliable (not matching preambleReceivedTargetPower) // so for now we feedback 0dB TPC + UNUSED(preamble_power); return 3; // it means 0dB } @@ -700,7 +701,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, UE = get_new_nr_ue_inst(&nr_mac->UE_info.uid_allocator, rnti, NULL, &nr_mac->radio_config); if (!add_new_UE_RA(nr_mac, UE)) { LOG_E(NR_MAC, "FAILURE: %4d.%2d initiating RA procedure for preamble index %d: no free RA process\n", frame, slot, preamble_index); - delete_nr_ue_data(UE, NULL, &nr_mac->UE_info.uid_allocator); + delete_nr_ue_data(UE, &nr_mac->UE_info.uid_allocator); NR_SCHED_UNLOCK(&nr_mac->sched_lock); return; } @@ -1176,7 +1177,7 @@ static void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, slot_ future_ul_tti_req->n_pdus += 1; // calling function to fill rar message - nr_fill_rar(module_idP, UE, RAR_pdu, pusch_pdu); + nr_fill_rar(UE, RAR_pdu, pusch_pdu); } static bool check_msg2_monitoring(const NR_SearchSpace_t *ss, int slots_per_frame, int current_frame, int current_slot) @@ -1260,7 +1261,6 @@ static void prepare_dl_pdus(gNB_MAC_INST *nr_mac, nr_rnti_type_t rnti_type, int aggregation_level, int CCEIndex, - int ndi, int current_harq_pid, int CC_id, int rnti, @@ -1574,7 +1574,6 @@ static void nr_generate_Msg2(module_id_t module_idP, aggregation_level, CCEIndex, 0, - 0, CC_id, ra->RA_rnti, 0, @@ -1867,7 +1866,6 @@ static void nr_generate_Msg4_MsgB(module_id_t module_idP, TYPE_TC_RNTI_, aggregation_level, CCEIndex, - harq->ndi, current_harq_pid, CC_id, rnti, @@ -1996,7 +1994,7 @@ bool nr_check_Msg4_MsgB_Ack(module_id_t module_id, frame_t frame, slot_t slot, N // - sending only 1 RAR subPDU // - UL Grant: hardcoded CSI, TPC, time alloc // - padding -static void nr_fill_rar(uint8_t Mod_idP, NR_UE_info_t *UE, uint8_t *dlsch_buffer, nfapi_nr_pusch_pdu_t *pusch_pdu) +static void nr_fill_rar(NR_UE_info_t *UE, uint8_t *dlsch_buffer, nfapi_nr_pusch_pdu_t *pusch_pdu) { NR_RA_t *ra = UE->ra; LOG_D(NR_MAC, @@ -2095,7 +2093,7 @@ void nr_release_ra_UE(gNB_MAC_INST *mac, rnti_t rnti) NR_UEs_t *UE_info = &mac->UE_info; NR_UE_info_t *UE = remove_UE_from_list(NR_NB_RA_PROC_MAX, UE_info->access_ue_list, rnti); if (UE) { - delete_nr_ue_data(UE, mac->common_channels, &UE_info->uid_allocator); + delete_nr_ue_data(UE, &UE_info->uid_allocator); } else { LOG_W(NR_MAC,"Call to release RA UE with rnti %04x, but not existing\n", rnti); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 894a829909..977c3d12a9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -328,7 +328,6 @@ static void nr_fill_nfapi_dl_SIB_pdu(gNB_MAC_INST *gNB_mac, int cce_index, nfapi_nr_dl_tti_request_body_t *dl_req, int pdu_index, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, bool is_sib1, int beam_index) { @@ -574,7 +573,6 @@ void schedule_nr_sib1(module_id_t module_idP, cce_index, dl_req, pdu_index, - type0_PDCCH_CSS_config, true, beam_index); @@ -710,7 +708,6 @@ static void other_sib_sched_control(module_id_t module_idP, cce_index, dl_req, pdu_index, - type0_PDCCH_CSS_config, false, beam_index); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 9bd6ecc686..d2f3b764d7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -577,7 +577,7 @@ static void ack_reconfig(gNB_MAC_INST *mac, NR_UE_info_t *UE) configure_UE_BWP(mac, scc, UE, false, NR_SearchSpace__searchSpaceType_PR_common, -1, -1); } -static bool dlsch_to_schedule(const NR_UE_sched_ctrl_t *sched_ctrl, int frame) +static bool dlsch_to_schedule(const NR_UE_sched_ctrl_t *sched_ctrl) { /* Check DL buffer, TA to be sent and beam switch needed*/ if (sched_ctrl->num_total_bytes > 0) @@ -686,7 +686,7 @@ static void pf_dl(gNB_MAC_INST *mac, update_dlsch_buffer(pp_pdsch->frame, pp_pdsch->slot, UE); - if (!dlsch_to_schedule(sched_ctrl, frame)) + if (!dlsch_to_schedule(sched_ctrl)) continue; /* Calculate coeff */ @@ -915,7 +915,7 @@ static void nr_dlsch_preprocessor(gNB_MAC_INST *mac, post_process_pdsch_t *pp_pd pf_dl(mac, pp_pdsch, UE_info->connected_ue_list, max_sched_ues, num_beams, n_rb_sched); } -nr_pp_impl_dl nr_init_dlsch_preprocessor(int CC_id) +nr_pp_impl_dl nr_init_dlsch_preprocessor() { return nr_dlsch_preprocessor; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 20e92f7130..9d267d4d2e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2509,7 +2509,7 @@ NR_UE_info_t *find_ra_UE(NR_UEs_t *UEs, rnti_t rntiP) return NULL; } -void delete_nr_ue_data(NR_UE_info_t *UE, NR_COMMON_channels_t *ccPtr, uid_allocator_t *uia) +void delete_nr_ue_data(NR_UE_info_t *UE, uid_allocator_t *uia) { ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup); ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->reconfigCellGroup); @@ -2553,7 +2553,7 @@ void free_transportBlock_buffer(byte_array_t *tb) free_byte_array(*tb); } -void set_max_fb_time(NR_UE_UL_BWP_t *UL_BWP, const NR_UE_DL_BWP_t *DL_BWP) +static void set_max_fb_time(NR_UE_UL_BWP_t *UL_BWP) { UL_BWP->max_fb_time = 8; // default value // take the maximum in dl_DataToUL_ACK list @@ -2955,7 +2955,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, create_dl_harq_list(sched_ctrl, sc_info, format_00_10); create_ul_harq_list(sched_ctrl, sc_info, format_00_10); - set_max_fb_time(UL_BWP, DL_BWP); + set_max_fb_time(UL_BWP); set_sched_pucch_list(sched_ctrl, UL_BWP, scc, &nr_mac->frame_structure); // Set MCS tables @@ -3073,7 +3073,7 @@ bool add_connected_nr_ue(gNB_MAC_INST *nr_mac, NR_UE_info_t *UE) bool success = add_UE_to_list(MAX_MOBILES_PER_GNB, UE_info->connected_ue_list, UE); if (!success) { LOG_E(NR_MAC,"Try to add UE %04x but the list is full\n", UE->rnti); - delete_nr_ue_data(UE, NULL, &UE_info->uid_allocator); + delete_nr_ue_data(UE, &UE_info->uid_allocator); return false; } @@ -3140,7 +3140,7 @@ void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti) NR_UEs_t *UE_info = &nr_mac->UE_info; NR_UE_info_t *UE = remove_UE_from_list(MAX_MOBILES_PER_GNB + 1, UE_info->connected_ue_list, rnti); if (UE) - delete_nr_ue_data(UE, nr_mac->common_channels, &UE_info->uid_allocator); + delete_nr_ue_data(UE, &UE_info->uid_allocator); else nr_release_ra_UE(nr_mac, rnti); } @@ -3606,7 +3606,7 @@ void beam_switching_procedure(gNB_MAC_INST *mac, NR_UE_info_t *UE, int new_beam_ nr_mac_trigger_reconfiguration(mac, UE, -1, true); } -void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot) +void nr_mac_update_timers(module_id_t module_id) { gNB_MAC_INST *mac = RC.nrmac[module_id]; @@ -3617,7 +3617,7 @@ void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot) UE_iterator(UE_info->connected_ue_list, UE) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; - if (nr_mac_check_release(sched_ctrl, UE->rnti)) { + if (nr_mac_check_release(sched_ctrl)) { // trigger release first as nr_mac_release_ue() invalidates UE ptr nr_mac_trigger_release_complete(mac, UE->rnti); nr_mac_release_ue(mac, UE->rnti); @@ -3886,7 +3886,7 @@ void nr_mac_trigger_release_timer(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierS sched_ctrl->release_timer = 100 << subcarrier_spacing; } -bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti) +bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl) { if (sched_ctrl->release_timer == 0) return false; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index b779489abd..a6f66d738a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -421,8 +421,7 @@ static uint8_t pickandreverse_bits(uint8_t *payload, uint16_t bitlen, uint8_t st return rev_bits; } -static void evaluate_sinr_report(gNB_MAC_INST *nrmac, - NR_UE_info_t *UE, +static void evaluate_sinr_report(NR_UE_info_t *UE, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t csi_report_id, uint8_t *payload, @@ -504,8 +503,7 @@ static void evaluate_sinr_report(gNB_MAC_INST *nrmac, LOG_D(MAC, "Reported SSB-SINR = %01f, dl_max_mcs %d\n", sinr_report->r[0].SINRx10 / 10.0, sched_ctrl->dl_max_mcs); } -static void evaluate_rsrp_report(gNB_MAC_INST *nrmac, - NR_UE_info_t *UE, +static void evaluate_rsrp_report(NR_UE_info_t *UE, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t csi_report_id, uint8_t *payload, @@ -741,7 +739,7 @@ static void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, LOG_D(MAC, "SFN/SF:%d/%d reportQuantity type = %d, type_r16 = %d\n", frame, slot, reportQuantity_type, reportQuantity_type_r16); if (reportQuantity_type_r16 == NR_CSI_ReportConfig__ext2__reportQuantity_r16_PR_cri_SINR_r16 || reportQuantity_type_r16 == NR_CSI_ReportConfig__ext2__reportQuantity_r16_PR_ssb_Index_SINR_r16) { - evaluate_sinr_report(nrmac, UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type_r16); + evaluate_sinr_report(UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type_r16); } else { // phy-test has hardcoded allocation, so no use to handle CSI reports except RSRP if (get_softmodem_params()->phy_test @@ -750,10 +748,10 @@ static void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, continue; switch (reportQuantity_type) { case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP: - evaluate_rsrp_report(nrmac, UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type); + evaluate_rsrp_report(UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type); break; case NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP: - evaluate_rsrp_report(nrmac, UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type); + evaluate_rsrp_report(UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type); new_bf_index = beam_selection_procedures(nrmac, UE); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI: @@ -1046,7 +1044,7 @@ static void set_pucch_allocation(const NR_UE_UL_BWP_t *ul_bwp, const int r_pucch } } -static bool test_pucch0_vrb_occupation(const NR_sched_pucch_t *pucch, uint16_t *vrb_map_UL, const int bwp_start, const int bwp_size) +static bool test_pucch0_vrb_occupation(const NR_sched_pucch_t *pucch, uint16_t *vrb_map_UL, const int bwp_start) { // We assume initial cyclic shift is always 0 so different pucch resources can't overlap @@ -1235,7 +1233,7 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac, } const int index = ul_buffer_index(pucch_frame, pucch_slot, n_slots_frame, mac->vrb_map_UL_size); uint16_t *vrb_map_UL = &mac->common_channels[CC_id].vrb_map_UL[beam.idx][index * MAX_BWP_SIZE]; - bool ret = test_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, bwp_start, bwp_size); + bool ret = test_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, bwp_start); if(!ret) { LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d PRB resources for this occasion are already occupied, move to the following occasion\n", @@ -1336,10 +1334,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, slot_t slot) const int bwp_start = ul_bwp->BWPStart; const int bwp_size = ul_bwp->BWPSize; set_pucch_allocation(ul_bwp, -1, bwp_size, curr_pucch); - bool ret = test_pucch0_vrb_occupation(curr_pucch, - vrb_map_UL, - bwp_start, - bwp_size); + bool ret = test_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, bwp_start); if (!ret) { LOG_E(NR_MAC,"Cannot schedule SR. PRBs not available\n"); continue; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 6a85cfb970..a223684741 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -339,7 +339,6 @@ static rnti_t lcid_crnti_lookahead(uint8_t *pdu, uint32_t pdu_len) static int nr_process_mac_pdu(instance_t module_idP, NR_UE_info_t *UE, - uint8_t CC_id, frame_t frameP, slot_t slot, uint8_t *pduP, @@ -640,13 +639,7 @@ static void abort_nr_ul_harq(NR_UE_info_t *UE, int8_t harq_pid) sched_ctrl->sched_ul_bytes = 0; } -static void handle_nr_ul_harq(gNB_MAC_INST *nrmac, - NR_UE_info_t *UE, - frame_t frame, - slot_t slot, - rnti_t rnti, - int crc_harq_id, - bool crc_status) +static void handle_nr_ul_harq(gNB_MAC_INST *nrmac, NR_UE_info_t *UE, rnti_t rnti, int crc_harq_id, bool crc_status) { if (nrmac->radio_config.disable_harq) { LOG_D(NR_MAC, "skipping UL feedback handling as HARQ is disabled\n"); @@ -756,7 +749,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, UE->UE_sched_ctrl.ta_frame = (frame + 100) % MAX_FRAME_NUMBER; if (!transition_ra_connected_nr_ue(mac, UE)) { LOG_E(NR_MAC, "cannot add UE %04x: list is full\n", UE->rnti); - delete_nr_ue_data(UE, NULL, &mac->UE_info.uid_allocator); + delete_nr_ue_data(UE, &mac->UE_info.uid_allocator); } else { LOG_A(NR_MAC, "(rnti 0x%04x) CFRA procedure succeeded!\n", UE->rnti); } @@ -869,7 +862,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, // Decode the entire MAC PDU // It may have multiple MAC subPDUs, for example, a MAC subPDU with LCID 1 caring a RRCReestablishmentComplete - nr_process_mac_pdu(mod_id, old_UE, CC_id, frame, slot, sdu, sdu_len, -1); + nr_process_mac_pdu(mod_id, old_UE, frame, slot, sdu, sdu_len, -1); return; } @@ -884,7 +877,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, // Decode MAC PDU // the function is only called to decode the contention resolution sub-header // harq_pid set a non-valid value because it is not used in this call - nr_process_mac_pdu(mod_id, UE, CC_id, frame, slot, sdu, sdu_len, -1); + nr_process_mac_pdu(mod_id, UE, frame, slot, sdu, sdu_len, -1); LOG_I(NR_MAC, "Activating scheduling %s for TC_RNTI 0x%04x (state %s)\n", @@ -982,7 +975,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, if (UE_scheduling_control->sched_ul_bytes < 0) UE_scheduling_control->sched_ul_bytes = 0; - nr_process_mac_pdu(gnb_mod_idP, UE, CC_idP, frameP, slotP, sduP, sdu_lenP, harq_pid); + nr_process_mac_pdu(gnb_mod_idP, UE, frameP, slotP, sduP, sdu_lenP, harq_pid); } else { if (ul_cqi == 0xff || ul_cqi <= 128) { UE->UE_sched_ctrl.pusch_consecutive_dtx_cnt++; @@ -1000,7 +993,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, nr_mac_trigger_ul_failure(&UE->UE_sched_ctrl, UE->current_UL_BWP.scs); } } - handle_nr_ul_harq(gNB_mac, UE, frameP, slotP, current_rnti, harq_pid, sduP == NULL); + handle_nr_ul_harq(gNB_mac, UE, current_rnti, harq_pid, sduP == NULL); } else { nr_rx_ra_sdu(gnb_mod_idP, CC_idP, frameP, slotP, current_rnti, sduP, sdu_lenP, harq_pid, timing_advance, ul_cqi, rssi); } @@ -1381,10 +1374,8 @@ static void get_precoder_matrix_coef(char *w, static int nr_srs_tpmi_estimation(const NR_PUSCH_Config_t *pusch_Config, const long transform_precoding, const uint8_t *channel_matrix, - const uint8_t normalized_iq_representation, const uint16_t num_gnb_antenna_elements, const uint16_t num_ue_srs_ports, - const uint16_t prg_size, const uint16_t num_prgs, const uint8_t ul_ri) { @@ -1593,10 +1584,8 @@ void handle_nr_srs_measurements(const module_id_t module_id, sched_ctrl->srs_feedback.tpmi = nr_srs_tpmi_estimation(current_BWP->pusch_Config, current_BWP->transform_precoding, nr_srs_channel_iq_matrix.channel_matrix, - nr_srs_channel_iq_matrix.normalized_iq_representation, nr_srs_channel_iq_matrix.num_gnb_antenna_elements, nr_srs_channel_iq_matrix.num_ue_srs_ports, - nr_srs_channel_iq_matrix.prg_size, nr_srs_channel_iq_matrix.num_prgs, sched_ctrl->srs_feedback.ul_ri); stop_meas(&nr_mac->nr_srs_tpmi_computation_timer); @@ -2642,7 +2631,7 @@ static void nr_ulsch_preprocessor(gNB_MAC_INST *nr_mac, post_process_pusch_t *pp } } -nr_pp_impl_ul nr_init_ulsch_preprocessor(int CC_id) +nr_pp_impl_ul nr_init_ulsch_preprocessor() { return nr_ulsch_preprocessor; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 433bb4aa32..0c62645318 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -26,7 +26,7 @@ int get_dl_slots_per_period(const frame_structure_t *fs); int get_full_ul_slots_per_period(const frame_structure_t *fs); int get_full_dl_slots_per_period(const frame_structure_t *fs); int get_ul_slot_offset(const frame_structure_t *fs, int idx, bool count_mixed); -void delete_nr_ue_data(NR_UE_info_t *UE, NR_COMMON_channels_t *ccPtr, uid_allocator_t *uia); +void delete_nr_ue_data(NR_UE_info_t *UE, uid_allocator_t *uia); void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, @@ -47,7 +47,7 @@ int nr_transmission_action_indicator_stop(gNB_MAC_INST *mac, NR_UE_info_t *UE_in void clear_nr_nfapi_information(gNB_MAC_INST *gNB, int CC_idP, frame_t frameP, slot_t slotP); -void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot); +void nr_mac_update_timers(module_id_t module_id); void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame_rxP, slot_t slot_rxP, NR_Sched_Rsp_t *sched_info); @@ -61,7 +61,7 @@ void nr_schedule_ue_spec(module_id_t module_id, nfapi_nr_tx_data_request_t *TX_req); /* \brief default DL preprocessor init routine, returns preprocessor to call */ -nr_pp_impl_dl nr_init_dlsch_preprocessor(int CC_id); +nr_pp_impl_dl nr_init_dlsch_preprocessor(); void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, @@ -85,7 +85,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, slot_t slotP, nfapi void nr_schedule_ulsch(module_id_t module_id, frame_t frame, slot_t slot, nfapi_nr_ul_dci_request_t *ul_dci_req); /* \brief default UL preprocessor init routine, returns preprocessor to call */ -nr_pp_impl_ul nr_init_ulsch_preprocessor(int CC_id); +nr_pp_impl_ul nr_init_ulsch_preprocessor(); /////// Random Access MAC-PHY interface functions and primitives /////// @@ -284,7 +284,6 @@ void remove_front_nr_list(NR_list_t *listP); void nr_release_ra_UE(gNB_MAC_INST *mac, rnti_t rnti); NR_UE_info_t * find_nr_UE(NR_UEs_t* UEs, rnti_t rntiP); NR_UE_info_t *find_ra_UE(NR_UEs_t *UEs, rnti_t rntiP); -void delete_nr_ue_data(NR_UE_info_t *UE, NR_COMMON_channels_t *ccPtr, uid_allocator_t *uia); void configure_UE_BWP(gNB_MAC_INST *nr_mac, NR_ServingCellConfigCommon_t *scc, NR_UE_info_t *UE, @@ -469,7 +468,7 @@ void finish_nr_dl_harq(NR_UE_sched_ctrl_t *sched_ctrl, int harq_pid); void abort_nr_dl_harq(NR_UE_info_t* UE, int8_t harq_pid); void nr_mac_trigger_release_timer(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing); -bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti); +bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl); void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti); void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti); bool nr_mac_request_release_ue(const gNB_MAC_INST *nrmac, int rnti); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index edb0eec898..64779bc250 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -74,6 +74,10 @@ bool DURecvCb(protocol_ctxt_t *ctxt_pP, const uint32_t *sourceL2Id, const uint32_t *destinationL2Id) { + UNUSED(confirmP); + UNUSED(modeP); + UNUSED(sourceL2Id); + UNUSED(destinationL2Id); // The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue uint8_t *sdu = malloc16(sdu_buffer_sizeP); memcpy(sdu, sdu_buffer_pP, sdu_buffer_sizeP); @@ -196,6 +200,7 @@ void f1_setup_response(const f1ap_setup_resp_t *resp) void f1_setup_failure(const f1ap_setup_failure_t *failure) { + UNUSED(failure); LOG_E(MAC, "the CU reported F1AP Setup Failure, is there a configuration mismatch?\n"); exit(1); } @@ -577,7 +582,7 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C DevAssert(res); } else { if (!add_new_UE_RA(mac, UE)) { - delete_nr_ue_data(UE, /*not used*/ NULL, &mac->UE_info.uid_allocator); + delete_nr_ue_data(UE, &mac->UE_info.uid_allocator); LOG_E(NR_MAC, "UE list full while creating new UE\n"); return NULL; } diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 405c7fa306..ca12c48c48 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -303,8 +303,8 @@ void mac_top_init_gNB(ngran_node_t node_type, RC.nrmac[i]->pre_processor_dl = nr_preprocessor_phytest; RC.nrmac[i]->pre_processor_ul = nr_ul_preprocessor_phytest; } else { - RC.nrmac[i]->pre_processor_dl = nr_init_dlsch_preprocessor(0); - RC.nrmac[i]->pre_processor_ul = nr_init_ulsch_preprocessor(0); + RC.nrmac[i]->pre_processor_dl = nr_init_dlsch_preprocessor(); + RC.nrmac[i]->pre_processor_ul = nr_init_ulsch_preprocessor(); } if (!IS_SOFTMODEM_NOSTATS) threadCreate(&RC.nrmac[i]->stats_thread, @@ -344,10 +344,10 @@ void mac_top_destroy_gNB(gNB_MAC_INST *mac) NR_UEs_t *UE_info = &mac->UE_info; for (int i = 0; i < sizeofArray(UE_info->connected_ue_list); ++i) if (UE_info->connected_ue_list[i]) - delete_nr_ue_data(UE_info->connected_ue_list[i], cc, &UE_info->uid_allocator); + delete_nr_ue_data(UE_info->connected_ue_list[i], &UE_info->uid_allocator); for (int i = 0; i < sizeofArray(UE_info->access_ue_list); ++i) if (UE_info->access_ue_list[i]) - delete_nr_ue_data(UE_info->access_ue_list[i], cc, &UE_info->uid_allocator); + delete_nr_ue_data(UE_info->access_ue_list[i], &UE_info->uid_allocator); if (mac->f1_config.setup_resp) free_f1ap_setup_response(mac->f1_config.setup_resp); free(mac->f1_config.setup_resp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c index c652dd927e..ad3b4997dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c +++ b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c @@ -662,8 +662,7 @@ static void set_dl_maxmimolayers(NR_PDSCH_ServingCellConfig_t *pdsch_servingcell *pdsch_servingcellconfig->ext1->maxMIMO_Layers = min(maxMIMO_layers, ue_supported_layers); } -static struct NR_SRS_Resource__resourceType__periodic *configure_periodic_srs(const NR_ServingCellConfigCommon_t *scc, - const int uid) +static struct NR_SRS_Resource__resourceType__periodic *configure_periodic_srs(const int uid) { frame_structure_t *fs = &RC.nrmac[0]->frame_structure; int offset = get_ul_slot_offset(fs, uid, false); // only full UL slots for SRS @@ -771,8 +770,7 @@ static NR_SRS_ResourceSet_t *get_srs_resourceset(const int resset_id, return srs_resset; } -static NR_SRS_Resource_t *get_srs_resource(const NR_ServingCellConfigCommon_t *scc, - const NR_UE_NR_Capability_t *uecap, +static NR_SRS_Resource_t *get_srs_resource(const NR_UE_NR_Capability_t *uecap, const int curr_bwp, const int uid, const int res_id, @@ -849,7 +847,7 @@ static NR_SRS_Resource_t *get_srs_resource(const NR_ServingCellConfigCommon_t *s srs_res->groupOrSequenceHopping = NR_SRS_Resource__groupOrSequenceHopping_neither; if (do_srs) { srs_res->resourceType.present = NR_SRS_Resource__resourceType_PR_periodic; - srs_res->resourceType.choice.periodic = configure_periodic_srs(scc, uid); + srs_res->resourceType.choice.periodic = configure_periodic_srs(uid); } else { srs_res->resourceType.present = NR_SRS_Resource__resourceType_PR_aperiodic; srs_res->resourceType.choice.aperiodic = calloc_or_fail(1, sizeof(*srs_res->resourceType.choice.aperiodic)); @@ -863,8 +861,7 @@ static NR_SRS_Resource_t *get_srs_resource(const NR_ServingCellConfigCommon_t *s return srs_res; } -static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_ServingCellConfigCommon_t *scc, - const NR_UE_NR_Capability_t *uecap, +static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_UE_NR_Capability_t *uecap, const int curr_bwp, const int uid, const int res_id, @@ -879,7 +876,7 @@ static NR_SetupRelease_SRS_Config_t *get_config_srs(const NR_ServingCellConfigCo srs_Config->srs_ResourceToAddModList = calloc_or_fail(1, sizeof(*srs_Config->srs_ResourceToAddModList)); NR_SRS_Resource_t *srs_res0 = - get_srs_resource(scc, uecap, curr_bwp, uid, res_id, maxMIMO_Layers, NR_SRS_Resource__transmissionComb_PR_n2, do_srs); + get_srs_resource(uecap, curr_bwp, uid, res_id, maxMIMO_Layers, NR_SRS_Resource__transmissionComb_PR_n2, do_srs); asn1cSeqAdd(&srs_Config->srs_ResourceToAddModList->list, srs_res0); srs_Config->srs_ResourceSetToAddModList = calloc_or_fail(1, sizeof(*srs_Config->srs_ResourceSetToAddModList)); @@ -1184,7 +1181,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay, i qsort(tda_list->list.array, tda_list->list.count, sizeof(tda_list->list.array), tda_cmp); } -static void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time, NR_SubcarrierSpacing_t subcarrierSpacing) +static void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time) { pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK)); long *delay[8]; @@ -1294,8 +1291,8 @@ static void config_pucch_resset1(const NR_ServingCellConfigCommon_t *scc, *pucchfmt2->simultaneousHARQ_ACK_CSI = NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true; } -void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) { - +static void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config) +{ pucch_Config->pucch_PowerControl = calloc(1,sizeof(*pucch_Config->pucch_PowerControl)); NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00)); p00->p0_PUCCH_Id = 1; @@ -1331,7 +1328,7 @@ void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) { asn1cSeqAdd(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial); } -static void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig, const NR_ServingCellConfigCommon_t *scc, int scs) +static void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig, int scs) { const frame_structure_t *fs = &RC.nrmac[0]->frame_structure; int sr_slot = 1; // in FDD SR in slot 1 @@ -1376,7 +1373,7 @@ static void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedul } } -static void scheduling_request_config(const NR_ServingCellConfigCommon_t *scc, NR_PUCCH_Config_t *pucch_Config, int scs) +static void scheduling_request_config(NR_PUCCH_Config_t *pucch_Config, int scs) { // format with <=2 bits in pucch resource set 0 NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[0]; @@ -1388,7 +1385,7 @@ static void scheduling_request_config(const NR_ServingCellConfigCommon_t *scc, N schedulingRequestResourceConfig->schedulingRequestResourceId = 1; schedulingRequestResourceConfig->schedulingRequestID = 0; - set_SR_periodandoffset(schedulingRequestResourceConfig, scc, scs); + set_SR_periodandoffset(schedulingRequestResourceConfig, scs); schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource)); *schedulingRequestResourceConfig->resource = *pucchressetid; @@ -1694,11 +1691,7 @@ static NR_PTRS_DownlinkConfig_t *config_dlptrs(const nr_ptrs_config_t *ptrs) return ptrs_config; } -static NR_SetupRelease_PDSCH_Config_t *config_pdsch(uint64_t ssb_bitmap, - int bwp_Id, - int dl_antenna_ports, - bool do_TCI, - nr_ptrs_config_t *ptrs) +static NR_SetupRelease_PDSCH_Config_t *config_pdsch(uint64_t ssb_bitmap, int bwp_Id, bool do_TCI, nr_ptrs_config_t *ptrs) { NR_SetupRelease_PDSCH_Config_t *setup_pdsch_Config = calloc(1,sizeof(*setup_pdsch_Config)); setup_pdsch_Config->present = NR_SetupRelease_PDSCH_Config_PR_setup; @@ -1752,7 +1745,6 @@ static NR_SetupRelease_PDSCH_Config_t *config_pdsch(uint64_t ssb_bitmap, static NR_BWP_Downlink_t *config_downlinkBWP(const NR_ServingCellConfigCommon_t *scc, const NR_UE_NR_Capability_t *uecap, - int dl_antenna_ports, bool force_256qam_off, bool is_SA, const nr_mac_config_t *configuration) @@ -1848,7 +1840,7 @@ static NR_BWP_Downlink_t *config_downlinkBWP(const NR_ServingCellConfigCommon_t asn1cSeqAdd(&bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list, ss3); bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToReleaseList = NULL; - bwp->bwp_Dedicated->pdsch_Config = config_pdsch(ssb_bitmap, bwp->bwp_Id, dl_antenna_ports, configuration->do_TCI, configuration->ptrs); + bwp->bwp_Dedicated->pdsch_Config = config_pdsch(ssb_bitmap, bwp->bwp_Id, configuration->do_TCI, configuration->ptrs); set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, force_256qam_off ? NULL : uecap, @@ -1904,14 +1896,13 @@ static NR_BWP_Uplink_t *config_uplinkBWP(bool is_SA, pucch_Config->resourceToReleaseList = NULL; config_pucch_resset0(scc, pucch_Config, uid, curr_bwp, uecap, &configuration->pdsch_AntennaPorts); config_pucch_resset1(scc, pucch_Config, uid, curr_bwp, uecap, &configuration->pdsch_AntennaPorts); - set_pucch_power_config(pucch_Config, configuration->do_CSIRS); - scheduling_request_config(scc, pucch_Config, ubwp->bwp_Common->genericParameters.subcarrierSpacing); - set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME, ubwp->bwp_Common->genericParameters.subcarrierSpacing); + set_pucch_power_config(pucch_Config); + scheduling_request_config(pucch_Config, ubwp->bwp_Common->genericParameters.subcarrierSpacing); + set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME); ubwp->bwp_Dedicated->pusch_Config = config_pusch(configuration, scc, uecap); - ubwp->bwp_Dedicated->srs_Config = get_config_srs(scc, - NULL, + ubwp->bwp_Dedicated->srs_Config = get_config_srs(NULL, curr_bwp, uid, ubwp->bwp_Id, @@ -3351,15 +3342,15 @@ static NR_BWP_UplinkDedicated_t *configure_initial_ul_bwp(const NR_ServingCellCo pucch_Config->resourceToReleaseList = NULL; config_pucch_resset0(scc, pucch_Config, id, curr_bwp, uecap, &configuration->pdsch_AntennaPorts); config_pucch_resset1(scc, pucch_Config, id, curr_bwp, uecap, &configuration->pdsch_AntennaPorts); - set_pucch_power_config(pucch_Config, configuration->do_CSIRS); + set_pucch_power_config(pucch_Config); initialUplinkBWP->pusch_Config = config_pusch(configuration, scc, uecap); // We are using do_srs = 0 here because the periodic SRS will only be enabled in update_cellGroupConfig() if do_srs == 1 - initialUplinkBWP->srs_Config = get_config_srs(scc, uecap, curr_bwp, id, 0, maxMIMO_Layers, configuration->minRXTXTIME, 0); + initialUplinkBWP->srs_Config = get_config_srs(uecap, curr_bwp, id, 0, maxMIMO_Layers, configuration->minRXTXTIME, 0); - scheduling_request_config(scc, pucch_Config, scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing); - set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME, genericParameters->subcarrierSpacing); + scheduling_request_config(pucch_Config, scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing); + set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME); return initialUplinkBWP; } @@ -3398,7 +3389,7 @@ static NR_BWP_DownlinkDedicated_t *configure_initial_dl_bwp(const NR_ServingCell asn1cSeqAdd(&pdcch_Config->searchSpacesToAddModList->list, ss2); bwp_Dedicated->pdcch_Config->choice.setup = pdcch_Config; - bwp_Dedicated->pdsch_Config = config_pdsch(bitmap, 0, pdsch_AntennaPorts, configuration->do_TCI, configuration->ptrs); + bwp_Dedicated->pdsch_Config = config_pdsch(bitmap, 0, configuration->do_TCI, configuration->ptrs); // we might call configuration of initial BWP for BWP switch when we already have UE capabilities set_dl_mcs_table(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing, configuration->force_256qam_off ? NULL : uecap, @@ -3576,12 +3567,7 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid, configDedicated->initialDownlinkBWP = configure_initial_dl_bwp(scc, pdsch_AntennaPorts, bitmap, NULL, configuration); } else { configDedicated->downlinkBWP_ToAddModList = calloc(1, sizeof(*configDedicated->downlinkBWP_ToAddModList)); - NR_BWP_Downlink_t *bwp = config_downlinkBWP(scc, - NULL, - 0, - false, - true, - configuration); + NR_BWP_Downlink_t *bwp = config_downlinkBWP(scc, NULL, false, true, configuration); asn1cSeqAdd(&configDedicated->downlinkBWP_ToAddModList->list, bwp); uplinkConfig->uplinkBWP_ToAddModList = calloc(1, sizeof(*uplinkConfig->uplinkBWP_ToAddModList)); NR_BWP_Uplink_t *ubwp = config_uplinkBWP(true, uid, maxMIMO_Layers, configuration, scc, NULL); @@ -3839,12 +3825,7 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t } else { if (!configDedicated->downlinkBWP_ToAddModList) configDedicated->downlinkBWP_ToAddModList = calloc_or_fail(1, sizeof(*configDedicated->downlinkBWP_ToAddModList)); - NR_BWP_Downlink_t *dl_bwp = config_downlinkBWP(scc, - uecap, - pdsch_AntennaPorts, - local_config.force_256qam_off, - true, - &local_config); + NR_BWP_Downlink_t *dl_bwp = config_downlinkBWP(scc, uecap, local_config.force_256qam_off, true, &local_config); asn1cSeqAdd(&configDedicated->downlinkBWP_ToAddModList->list, dl_bwp); if (!uplinkConfig->uplinkBWP_ToAddModList) @@ -3980,8 +3961,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, *pusch_Config->maxRank = maxMIMO_Layers; if (configuration->do_SRS) { ASN_STRUCT_FREE(asn_DEF_NR_SetupRelease_SRS_Config, ul_bwp_Dedicated->srs_Config); - ul_bwp_Dedicated->srs_Config = get_config_srs(scc, - uecap, + ul_bwp_Dedicated->srs_Config = get_config_srs(uecap, curr_bwp, uid, bwp_id, @@ -4043,8 +4023,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC int uid, int ssb_index) { - const nr_pdsch_AntennaPorts_t *pdschap = &configuration->pdsch_AntennaPorts; - const int dl_antenna_ports = pdschap->N1 * pdschap->N2 * pdschap->XP; AssertFatal(servingcellconfigcommon, "servingcellconfigcommon is null\n"); if (uecap == NULL) @@ -4084,8 +4062,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC configDedicated->initialDownlinkBWP = calloc(1, sizeof(*configDedicated->initialDownlinkBWP)); configDedicated->initialDownlinkBWP->pdcch_Config = NULL; - configDedicated->initialDownlinkBWP->pdsch_Config = - config_pdsch(bitmap, 0, dl_antenna_ports, configuration->do_TCI, configuration->ptrs); + configDedicated->initialDownlinkBWP->pdsch_Config = config_pdsch(bitmap, 0, configuration->do_TCI, configuration->ptrs); configDedicated->initialDownlinkBWP->sps_Config = NULL; // calloc(1,sizeof(struct NR_SetupRelease_SPS_Config)); configDedicated->initialDownlinkBWP->radioLinkMonitoringConfig = NULL; @@ -4105,8 +4082,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC long maxMIMO_Layers = set_ul_max_layers(configuration, uecap); int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - initialUplinkBWP->srs_Config = get_config_srs(servingcellconfigcommon, - NULL, + initialUplinkBWP->srs_Config = get_config_srs(NULL, curr_bwp, uid, 0, @@ -4119,7 +4095,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC configDedicated->downlinkBWP_ToAddModList = calloc(1, sizeof(*configDedicated->downlinkBWP_ToAddModList)); NR_BWP_Downlink_t *bwp = config_downlinkBWP(servingcellconfigcommon, uecap, - dl_antenna_ports, configuration->force_256qam_off, false, configuration); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 0214beee89..182f6f8d49 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -398,7 +398,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE ID/RNTI: %ld\n", size, ue->ue_id); // in NoS1 mode: the SDAP should write() packets to an FD (TUN interface), // so below, set is_gnb == 0 to do that - sdap_data_ind(entity->rb_id, 0, entity->has_sdap_rx, entity->pdusession_id, ue->ue_id, buf, size); + sdap_data_ind(entity->rb_id, 0, entity->pdusession_id, ue->ue_id, buf, size); } else{ for (i = 0; i < MAX_DRBS_PER_UE; i++) { @@ -414,13 +414,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, rb_found: { LOG_D(PDCP, "%s() (drb %d) sending message to SDAP size %d\n", __func__, rb_id, size); - sdap_data_ind(rb_id, - ue->drb[rb_id - 1]->is_gnb, - ue->drb[rb_id - 1]->has_sdap_rx, - ue->drb[rb_id - 1]->pdusession_id, - ue->ue_id, - buf, - size); + sdap_data_ind(rb_id, ue->drb[rb_id - 1]->is_gnb, ue->drb[rb_id - 1]->pdusession_id, ue->ue_id, buf, size); } } } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 61292048c4..21e95164e7 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -80,7 +80,6 @@ void print_ue_mac_stats(const module_id_t mod, const int frame_rx, const int slo // L2 Abstraction Layer static int handle_bcch_bch(NR_UE_MAC_INST_t *mac, - int cc_id, unsigned int gNB_index, uint8_t *pduP, unsigned int additional_bits, @@ -104,13 +103,12 @@ static int handle_bcch_bch(NR_UE_MAC_INST_t *mac, else mac->frequency_range = FR1; // fixed 3 bytes MIB PDU - nr_mac_rrc_data_ind_ue(mac->ue_id, cc_id, gNB_index, 0, 0, 0, 0, cell_id, ssb_arfcn, NR_BCCH_BCH, (uint8_t *) pduP, 3); + nr_mac_rrc_data_ind_ue(mac->ue_id, gNB_index, 0, 0, 0, cell_id, ssb_arfcn, NR_BCCH_BCH, (uint8_t *) pduP, 3); return 0; } // L2 Abstraction Layer static int handle_bcch_dlsch(NR_UE_MAC_INST_t *mac, - int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, @@ -119,7 +117,7 @@ static int handle_bcch_dlsch(NR_UE_MAC_INST_t *mac, int frame, int slot) { - nr_ue_decode_BCCH_DL_SCH(mac, cc_id, gNB_index, ack_nack, pduP, pdu_len, hfn, frame, slot); + nr_ue_decode_BCCH_DL_SCH(mac, gNB_index, ack_nack, pduP, pdu_len, hfn, frame, slot); return 0; } @@ -256,7 +254,6 @@ static uint32_t nr_ue_dl_processing(NR_UE_MAC_INST_t *mac, nr_downlink_indicatio mac); if(rx_indication_body.ssb_pdu.decoded_pdu) { ret_mask |= (handle_bcch_bch(mac, - dl_info->cc_id, dl_info->gNB_index, rx_indication_body.ssb_pdu.pdu, rx_indication_body.ssb_pdu.additional_bits, @@ -269,7 +266,6 @@ static uint32_t nr_ue_dl_processing(NR_UE_MAC_INST_t *mac, nr_downlink_indicatio break; case FAPI_NR_RX_PDU_TYPE_SIB: ret_mask |= (handle_bcch_dlsch(mac, - dl_info->cc_id, dl_info->gNB_index, rx_indication_body.pdsch_pdu.ack_nack, rx_indication_body.pdsch_pdu.pdu, @@ -396,7 +392,7 @@ static void handle_sl_bch(int ue_id, sl_mac->decoded_DFN = frame; sl_mac->decoded_slot = slot; - nr_mac_rrc_data_ind_ue(ue_id, 0, 0, hfn_rx, frame_rx, slot_rx, 0, rx_slss_id, 0, NR_SBCCH_SL_BCH, (uint8_t *)sl_mib, len); + nr_mac_rrc_data_ind_ue(ue_id, 0, hfn_rx, frame_rx, slot_rx, rx_slss_id, 0, NR_SBCCH_SL_BCH, (uint8_t *)sl_mib, len); return; } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index d12b627cd9..8d5d00c975 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1141,7 +1141,6 @@ static NR_MeasIdToAddMod_t *get_MeasId(NR_MeasId_t measId, NR_ReportConfigId_t r NR_MeasConfig_t *get_MeasConfig(const NR_MeasTiming_t *mt, int band, - int scs, int nr_pci, NR_ReportConfigToAddMod_t *rc_PER, NR_ReportConfigToAddMod_t *rc_A2, @@ -1444,7 +1443,7 @@ byte_array_t get_HandoverCommandMessage(nr_rrc_reconfig_param_t *params) * 2) encodes UE Capabilities from UE Context * 3) encodes AS context * 4) generates HO Preparation Info */ -byte_array_t get_HandoverPreparationInformation(nr_rrc_reconfig_param_t *params, int scell_pci) +byte_array_t get_HandoverPreparationInformation(nr_rrc_reconfig_param_t *params) { // Buffer to return byte_array_t buffer = {.buf = NULL, .len = 0}; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 543749d40d..7aeb2b4ed0 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -140,7 +140,6 @@ int do_RRCReestablishmentComplete(uint8_t *buffer, size_t buffer_size, int64_t r NR_MeasConfig_t *get_MeasConfig(const NR_MeasTiming_t *mt, int band, - int scs, int nr_pci, NR_ReportConfigToAddMod_t *rc_PER, NR_ReportConfigToAddMod_t *rc_A2, @@ -150,7 +149,7 @@ NR_MeasConfig_t *get_MeasConfig(const NR_MeasTiming_t *mt, void free_MeasConfig(NR_MeasConfig_t *mc); int do_NR_Paging(uint8_t Mod_id, uint8_t *buffer, uint32_t tmsi); -byte_array_t get_HandoverPreparationInformation(nr_rrc_reconfig_param_t *params, int scell_pci); +byte_array_t get_HandoverPreparationInformation(nr_rrc_reconfig_param_t *params); byte_array_t get_HandoverCommandMessage(nr_rrc_reconfig_param_t *params); void fill_removal_lists_from_source_measConfig(NR_MeasConfig_t *measConfig, byte_array_t prep_info); byte_array_t doRRCReconfiguration_from_HandoverCommand(byte_array_t handoverCommand); diff --git a/openair2/RRC/NR/mac_rrc_dl_direct.c b/openair2/RRC/NR/mac_rrc_dl_direct.c index 7f69afaa82..693e9ccbf4 100644 --- a/openair2/RRC/NR/mac_rrc_dl_direct.c +++ b/openair2/RRC/NR/mac_rrc_dl_direct.c @@ -19,6 +19,7 @@ static void f1_reset_cu_initiated_direct(sctp_assoc_t assoc_id, const f1ap_reset static void f1_reset_acknowledge_du_initiated_direct(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack) { + UNUSED(assoc_id); (void)ack; AssertFatal(false, "%s() not implemented yet\n", __func__); } diff --git a/openair2/RRC/NR/mac_rrc_dl_f1ap.c b/openair2/RRC/NR/mac_rrc_dl_f1ap.c index a102e30101..1385c3fd82 100644 --- a/openair2/RRC/NR/mac_rrc_dl_f1ap.c +++ b/openair2/RRC/NR/mac_rrc_dl_f1ap.c @@ -29,6 +29,7 @@ static void f1_reset_cu_initiated_f1ap(sctp_assoc_t assoc_id, const f1ap_reset_t static void f1_reset_acknowledge_du_initiated_f1ap(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack) { + UNUSED(assoc_id); (void)ack; AssertFatal(false, "%s() not implemented yet\n", __func__); } diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 4e9061138b..ad69ab19df 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -23,7 +23,7 @@ #define SRB2 2 void rrc_add_nsa_user(gNB_RRC_INST *rrc, x2ap_ENDC_sgnb_addition_req_t *m, sctp_assoc_t assoc_id); -void rrc_add_nsa_user_resp(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const f1ap_ue_context_setup_resp_t *resp); +void rrc_add_nsa_user_resp(gNB_RRC_UE_t *UE, const f1ap_ue_context_setup_resp_t *resp); void rrc_release_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context); void rrc_remove_nsa_user_context(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context); @@ -43,18 +43,18 @@ void rrc_gNB_generate_RRCRelease(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE); \param args_p Pointer on arguments to start the task. */ void *rrc_gnb_task(void *args_p); -int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int dl_bwp_id, const int ul_bwp_id); +int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p); NR_MeasConfig_t *nr_rrc_get_measconfig(const gNB_RRC_INST *rrc, uint64_t nr_cellid); -bool ue_associated_to_cuup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue); -sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue); +bool ue_associated_to_cuup(const gNB_RRC_UE_t *ue); +sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_UE_t *ue); sctp_assoc_t get_new_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue, int sst, int sd); int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, const e1ap_setup_req_t *req); bool is_cuup_associated(gNB_RRC_INST *rrc); /* Process indication of E1 connection loss on CU-CP */ -void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, e1ap_lost_connection_t *lc, sctp_assoc_t assoc_id); +void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, sctp_assoc_t assoc_id); void bearer_context_setup_direct(e1ap_bearer_setup_req_t *req, instance_t instance); @@ -91,7 +91,7 @@ void rrc_gNB_generate_UeContextModificationRequest(const gNB_RRC_INST *rrc, void free_RRCReconfiguration_params(nr_rrc_reconfig_param_t params); -byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params); +byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params); nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t srb_reest_bitmap, bool drb_reestablish); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2d876cce25..71054ac2fc 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -221,6 +221,9 @@ const NR_RedCapParameters_r17_t *get_redcapparam_r17(NR_UE_NR_Capability_t *UE_C static void rrc_deliver_ue_ctxt_release_cmd(void *deliver_pdu_data, ue_id_t ue_id, int srb_id, char *buf, int size, int sdu_id) { + UNUSED(ue_id); + UNUSED(srb_id); + UNUSED(sdu_id); DevAssert(deliver_pdu_data != NULL); deliver_ue_ctxt_release_data_t *data = deliver_pdu_data; byte_array_t rrc_cont = {.buf = (uint8_t *)buf, .len = size}; @@ -277,8 +280,11 @@ typedef struct deliver_dl_rrc_message_data_s { f1ap_dl_rrc_message_t *dl_rrc; sctp_assoc_t assoc_id; } deliver_dl_rrc_message_data_t; + static void rrc_deliver_dl_rrc_message(void *deliver_pdu_data, ue_id_t ue_id, int srb_id, char *buf, int size, int sdu_id) { + UNUSED(ue_id); + UNUSED(sdu_id); DevAssert(deliver_pdu_data != NULL); deliver_dl_rrc_message_data_t *data = (deliver_dl_rrc_message_data_t *)deliver_pdu_data; data->dl_rrc->rrc_container = (uint8_t *)buf; @@ -309,6 +315,8 @@ static void nr_rrc_transfer_protected_rrc_message(const gNB_RRC_INST *rrc, #ifdef E2_AGENT E2_AGENT_SIGNAL_DL_DCCH_RRC_MSG(buffer, size, message_id); +#else + UNUSED(message_id); #endif } @@ -551,7 +559,6 @@ static f1ap_ue_context_setup_req_t rrc_fill_f1_ue_context_setup(gNB_RRC_UE_t *ue //----------------------------------------------------------------------------- static void rrc_gNB_generate_RRCSetup(instance_t instance, - rnti_t rnti, rrc_gNB_ue_context_t *const ue_context_pP, const uint8_t *masterCellGroup, int masterCellGroup_len) @@ -759,7 +766,6 @@ NR_MeasConfig_t *nr_rrc_get_measconfig(const gNB_RRC_INST *rrc, uint64_t nr_cell seq_arr_init(&neigh_seq, sizeof(nr_neighbour_cell_t)); // Get cell info from the cell container - int scs = cell->info.mode == NR_MODE_TDD ? cell->info.tdd.dlul.scs : cell->info.fdd.dl.scs; int band = cell->info.mode == NR_MODE_TDD ? cell->info.tdd.dlul.band : cell->info.fdd.dl.band; const NR_MeasTimingList_t *mtlist = cell->mtc->criticalExtensions.choice.c1->choice.measTimingConf->measTiming; @@ -814,7 +820,7 @@ NR_MeasConfig_t *nr_rrc_get_measconfig(const gNB_RRC_INST *rrc, uint64_t nr_cell if (rrc->measurementConfiguration.a2_event) rc_A2 = prepare_a2_event_report(rrc->measurementConfiguration.a2_event); - NR_MeasConfig_t *result = get_MeasConfig(mt, band, scs, cell->info.pci, rc_PER, rc_A2, &rc_A3_seq, &neigh_seq, neigh_a3_id); + NR_MeasConfig_t *result = get_MeasConfig(mt, band, cell->info.pci, rc_PER, rc_A2, &rc_A3_seq, &neigh_seq, neigh_a3_id); // Clean up sequence arrays seq_arr_free(&rc_A3_seq, NULL); @@ -884,7 +890,7 @@ nr_rrc_reconfig_param_t get_RRCReconfiguration_params(gNB_RRC_INST *rrc, gNB_RRC return params; } -byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params) +byte_array_t rrc_gNB_encode_RRCReconfiguration(gNB_RRC_UE_t *UE, nr_rrc_reconfig_param_t params) { byte_array_t msg = do_RRCReconfiguration(¶ms); if (msg.len <= 0) { @@ -930,7 +936,7 @@ static void rrc_gNB_generate_dedicatedRRCReconfiguration(gNB_RRC_INST *rrc, gNB_ ue_p->xids[params.transaction_id] = params.n_drb_rel > 0 ? RRC_PDUSESSION_RELEASE : RRC_PDUSESSION_ESTABLISH; } - byte_array_t msg = rrc_gNB_encode_RRCReconfiguration(rrc, ue_p, params); + byte_array_t msg = rrc_gNB_encode_RRCReconfiguration(ue_p, params); if (msg.len <= 0) { LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration%s\n", @@ -1138,7 +1144,7 @@ static void cuup_notify_reestablishment(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p) .gNB_cu_up_ue_id = ue_p->rrc_ue_id, }; // Quit re-establishment notification if no CU-UP is associated - if (!is_cuup_associated(rrc) || !ue_associated_to_cuup(rrc, ue_p)) { + if (!is_cuup_associated(rrc) || !ue_associated_to_cuup(ue_p)) { return; } @@ -1158,7 +1164,7 @@ static void cuup_notify_reestablishment(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p) fill_security_info(rrc, ue_p, req.secInfo); /* Send E1 Bearer Context Modification Request (3GPP TS 38.463) */ - sctp_assoc_t assoc_id = get_existing_cuup_for_ue(rrc, ue_p); + sctp_assoc_t assoc_id = get_existing_cuup_for_ue(ue_p); rrc->cucp_cuup.bearer_context_mod(assoc_id, &req); free_e1ap_context_mod_request(&req); } @@ -1249,10 +1255,7 @@ static void rrc_gNB_generate_RRCReestablishment(rrc_gNB_ue_context_t *ue_context } /// @brief Function tha processes RRCReestablishmentComplete message sent by the UE, after RRCReestasblishment request. -static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, - gNB_RRC_UE_t *ue_p, - const uint8_t xid, - const sctp_assoc_t assoc_id) +static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const uint8_t xid) { LOG_I(NR_RRC, "UE %d Processing NR_RRCReestablishmentComplete from UE\n", ue_p->rrc_ue_id); @@ -1294,7 +1297,7 @@ static void rrc_gNB_process_RRCReestablishmentComplete(gNB_RRC_INST *rrc, } } -int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p, const int dl_bwp_id, const int ul_bwp_id) +int nr_rrc_reconfiguration_req(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue_p) { uint8_t xid = rrc_gNB_get_next_transaction_identifier(rrc->module_id); ue_p->xids[xid] = RRC_DEDICATED_RECONF; @@ -1405,7 +1408,7 @@ static void rrc_handle_RRCSetupRequest(gNB_RRC_INST *rrc, UE->ongoing_reconfiguration = false; UE->measConfig = nr_rrc_get_measconfig(rrc, msg->nr_cellid); activate_srb(UE, 1); - rrc_gNB_generate_RRCSetup(0, msg->crnti, ue_context_p, msg->du2cu_rrc_container, msg->du2cu_rrc_container_length); + rrc_gNB_generate_RRCSetup(0, ue_context_p, msg->du2cu_rrc_container, msg->du2cu_rrc_container_length); } static const char *get_reestab_cause(NR_ReestablishmentCause_t c) @@ -1671,7 +1674,7 @@ fallback_rrc_setup: activate_srb(&new->ue_context, 1); added = rrc_update_ue_pcell(&new->ue_context, current_cell); DevAssert(added); - rrc_gNB_generate_RRCSetup(0, msg->crnti, new, msg->du2cu_rrc_container, msg->du2cu_rrc_container_length); + rrc_gNB_generate_RRCSetup(0, new, msg->du2cu_rrc_container, msg->du2cu_rrc_container_length); return; } @@ -1791,7 +1794,7 @@ static void process_Event_Based_Measurement_Report(gNB_RRC_INST *rrc, // UE can send multiple neighbour cells A3 event report in 1 Meas Report. So, we need to find the best neighbour best_rsrp = neighbourCellRSRP; LOG_I(NR_RRC, "HO LOG: Serving Cell RSRP: %d - Best Neighbor RSRP: %d ! Trigger N2 HO\n", servingCellRSRP, best_rsrp); - nr_rrc_trigger_n2_ho(rrc, ue, scell_pci, neighbour); + nr_rrc_trigger_n2_ho(rrc, ue, neighbour); } LOG_D(NR_RRC, "HO LOG: Trigger N2 HO for the neighbour gnb: %u cell: %lu\n", neighbour->gNB_ID, neighbour->nrcell_id); } @@ -1868,9 +1871,7 @@ static void rrc_gNB_process_MeasurementReport(gNB_RRC_INST *rrc, gNB_RRC_UE_t *U static void handle_rrcReestablishmentComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, - const uint32_t gNB_DU_ue_id, - const NR_RRCReestablishmentComplete_t *cplt, - const sctp_assoc_t assoc_id) + const NR_RRCReestablishmentComplete_t *cplt) { NR_RRCReestablishmentComplete__criticalExtensions_PR p = cplt->criticalExtensions.present; if (p != NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete) { @@ -1878,7 +1879,7 @@ static void handle_rrcReestablishmentComplete(gNB_RRC_INST *rrc, return; } - rrc_gNB_process_RRCReestablishmentComplete(rrc, UE, cplt->rrc_TransactionIdentifier, assoc_id); + rrc_gNB_process_RRCReestablishmentComplete(rrc, UE, cplt->rrc_TransactionIdentifier); UE->ue_reestablishment_counter++; } @@ -2122,7 +2123,7 @@ static void handle_rrcReconfigurationComplete(gNB_RRC_INST *rrc, gNB_RRC_UE_t *U free(UE->initial_pdus); UE->initial_pdus = NULL; } else if (seq_arr_size(&UE->pduSessions) > 0) - rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(rrc, UE, xid); + rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(rrc, UE); else LOG_W(NR_RRC, "UE %d: RRC Reconfiguration Complete for PDU session establishment, but no PDU sessions were setup\n", @@ -2187,7 +2188,7 @@ static void rrc_gNB_generate_UECapabilityEnquiry(gNB_RRC_INST *rrc, gNB_RRC_UE_t nr_rrc_transfer_protected_rrc_message(rrc, ue, DL_SCH_LCID_DCCH, msg_id, buffer, size); } -static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *msg, const sctp_assoc_t assoc_id) +static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *msg) { /* we look up by CU UE ID! Do NOT change back to RNTI! */ rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, msg->gNB_CU_ue_id); @@ -2293,7 +2294,7 @@ static int rrc_gNB_decode_dcch(gNB_RRC_INST *rrc, const f1ap_ul_rrc_message_t *m case NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete: LOG_UE_UL_EVENT(UE, "Received RRCReestablishmentComplete\n"); const NR_RRCReestablishmentComplete_t *rc = ul_dcch_msg->message.choice.c1->choice.rrcReestablishmentComplete; - handle_rrcReestablishmentComplete(rrc, UE, msg->gNB_DU_ue_id, rc, assoc_id); + handle_rrcReestablishmentComplete(rrc, UE, rc); break; default: @@ -2453,7 +2454,7 @@ static void e1_send_bearer_modification_request(gNB_RRC_INST *rrc, gNB_RRC_UE_t req->secInfo = malloc_or_fail(sizeof(*req->secInfo)); fill_security_info(rrc, UE, req->secInfo); - sctp_assoc_t assoc_id = get_existing_cuup_for_ue(rrc, UE); + sctp_assoc_t assoc_id = get_existing_cuup_for_ue(UE); rrc->cucp_cuup.bearer_context_mod(assoc_id, req); } @@ -2607,7 +2608,7 @@ static void rrc_CU_process_ue_context_setup_response(MessageDef *msg_p, instance } if (!IS_SA_MODE(get_softmodem_params())) { - rrc_add_nsa_user_resp(rrc, UE, resp); + rrc_add_nsa_user_resp(UE, resp); return; } @@ -2804,7 +2805,7 @@ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, i DevAssert(source_ctx->old_rnti == UE->rnti); nr_rrc_apply_target_context(UE); /* Update cell association after handover */ - if (!nr_rrc_update_cell_assoc_after_ho(rrc, UE)) { + if (!nr_rrc_update_cell_assoc_after_ho(UE)) { return; } } @@ -2882,7 +2883,7 @@ static void rrc_CU_process_ue_modification_required(MessageDef *msg_p, instance_ /* trigger reconfiguration */ if (!UE->ongoing_reconfiguration) - nr_rrc_reconfiguration_req(rrc, UE, 0, 0); + nr_rrc_reconfiguration_req(rrc, UE); return; } LOG_W(RRC, @@ -3037,7 +3038,7 @@ static int fill_drb_to_be_setup_from_e1_resp(const gNB_RRC_INST *rrc, /** * @brief E1AP Bearer Context Setup Response processing on CU-CP */ -void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp, instance_t instance) +static void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp) { gNB_RRC_INST *rrc = RC.nrrrc[0]; rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_get_ue_context(rrc, resp->gNB_cu_cp_ue_id); @@ -3313,10 +3314,12 @@ static bool write_rrc_stats(const gNB_RRC_INST *rrc) return true; } -void *rrc_gnb_task(void *args_p) { +void *rrc_gnb_task(void *args_p) +{ + UNUSED(args_p); MessageDef *msg_p; - instance_t instance; - int result; + instance_t instance; + int result; long stats_timer_id = 1; if (!IS_SOFTMODEM_NOSTATS) { @@ -3367,12 +3370,12 @@ void *rrc_gnb_task(void *args_p) { /* Messages from PDCP */ /* From DU -> CU */ case F1AP_UL_RRC_MESSAGE: - rrc_gNB_decode_dcch(RC.nrrrc[instance], &F1AP_UL_RRC_MESSAGE(msg_p), msg_p->ittiMsgHeader.originInstance); + rrc_gNB_decode_dcch(RC.nrrrc[instance], &F1AP_UL_RRC_MESSAGE(msg_p)); free_ul_rrc_message_transfer(&F1AP_UL_RRC_MESSAGE(msg_p)); break; case NGAP_DOWNLINK_NAS: - rrc_gNB_process_NGAP_DOWNLINK_NAS(msg_p, instance, &rrc_gNB_mui); + rrc_gNB_process_NGAP_DOWNLINK_NAS(msg_p, instance); break; case NGAP_PDUSESSION_SETUP_REQ: @@ -3478,7 +3481,7 @@ void *rrc_gnb_task(void *args_p) { break; case E1AP_BEARER_CONTEXT_SETUP_RESP: - rrc_gNB_process_e1_bearer_context_setup_resp(&E1AP_BEARER_CONTEXT_SETUP_RESP(msg_p), instance); + rrc_gNB_process_e1_bearer_context_setup_resp(&E1AP_BEARER_CONTEXT_SETUP_RESP(msg_p)); free_e1ap_context_setup_response(&E1AP_BEARER_CONTEXT_SETUP_RESP(msg_p)); break; @@ -3501,7 +3504,7 @@ void *rrc_gnb_task(void *args_p) { break; case E1AP_LOST_CONNECTION: /* CUCP */ - rrc_gNB_process_e1_lost_connection(RC.nrrrc[0], &E1AP_LOST_CONNECTION(msg_p), msg_p->ittiMsgHeader.originInstance); + rrc_gNB_process_e1_lost_connection(RC.nrrrc[0], msg_p->ittiMsgHeader.originInstance); break; case NGAP_PAGING_IND: @@ -3509,7 +3512,7 @@ void *rrc_gnb_task(void *args_p) { break; case NGAP_HANDOVER_REQUEST: - rrc_gNB_process_Handover_Request(RC.nrrrc[instance], instance, &NGAP_HANDOVER_REQUEST(msg_p)); + rrc_gNB_process_Handover_Request(RC.nrrrc[instance], &NGAP_HANDOVER_REQUEST(msg_p)); rrc_gNB_free_Handover_Request(&NGAP_HANDOVER_REQUEST(msg_p)); // Free transfered NG message break; diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index f2971f199b..183e0f0088 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -466,9 +466,7 @@ int rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, instance_t /* Can not associate this message to an UE index, send a failure to NGAP and discard it! */ LOG_W(NR_RRC, "[gNB %ld] In NGAP_INITIAL_CONTEXT_SETUP_REQ: unknown UE from NGAP ids (%u)\n", instance, req->gNB_ue_ngap_id); ngap_cause_t cause = { .type = NGAP_CAUSE_RADIO_NETWORK, .value = NGAP_CAUSE_RADIO_NETWORK_UNKNOWN_LOCAL_UE_NGAP_ID}; - rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_FAIL(req->gNB_ue_ngap_id, - NULL, - cause); + rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_FAIL(req->gNB_ue_ngap_id, cause); return (-1); } gNB_RRC_UE_t *UE = &ue_context_p->ue_context; @@ -618,9 +616,7 @@ void rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_ itti_send_msg_to_task (TASK_NGAP, rrc->module_id, msg_p); } -void rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_FAIL(uint32_t gnb, - const rrc_gNB_ue_context_t *const ue_context_pP, - const ngap_cause_t causeP) +void rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_FAIL(uint32_t gnb, const ngap_cause_t causeP) { MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_INITIAL_CONTEXT_SETUP_FAIL); ngap_initial_context_setup_fail_t *fail = &NGAP_INITIAL_CONTEXT_SETUP_FAIL(msg_p); @@ -721,7 +717,7 @@ static void set_UE_security_algos(const gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, con } //------------------------------------------------------------------------------ -int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mui_t *rrc_gNB_mui) +int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance) //------------------------------------------------------------------------------ { ngap_downlink_nas_t *req = &NGAP_DOWNLINK_NAS(msg_p); @@ -779,7 +775,7 @@ void rrc_gNB_send_NGAP_UPLINK_NAS(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const NR_ itti_send_msg_to_task(TASK_NGAP, rrc->module_id, msg_p); } -void rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t xid) +void rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) { MessageDef *msg_p; int pdu_sessions_done = 0; @@ -1121,7 +1117,7 @@ void rrc_gNB_send_NGAP_HANDOVER_FAILURE(gNB_RRC_INST *rrc, ngap_handover_failure } /** @brief Process NG Handover Request message (8.4.2.2 3GPP TS 38.413) */ -int rrc_gNB_process_Handover_Request(gNB_RRC_INST *rrc, instance_t instance, ngap_handover_request_t *msg) +int rrc_gNB_process_Handover_Request(gNB_RRC_INST *rrc, ngap_handover_request_t *msg) { // Check if UE context already exists for this AMF UE NGAP ID rrc_gNB_ue_context_t *existing_ue_context = rrc_gNB_get_ue_context_by_amf_ue_ngap_id(rrc, msg->amf_ue_ngap_id); @@ -1374,8 +1370,8 @@ int rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(MessageDef *msg_p, instance_ /* a UE might not be associated to a CU-UP if it never requested a PDU * session (intentionally, or because of erros) */ - if (ue_associated_to_cuup(rrc, UE)) { - sctp_assoc_t assoc_id = get_existing_cuup_for_ue(rrc, UE); + if (ue_associated_to_cuup(UE)) { + sctp_assoc_t assoc_id = get_existing_cuup_for_ue(UE); e1ap_cause_t cause = {.type = E1AP_CAUSE_RADIO_NETWORK, .value = E1AP_RADIO_CAUSE_NORMAL_RELEASE}; e1ap_bearer_release_cmd_t cmd = { .gNB_cu_cp_ue_id = UE->rrc_ue_id, @@ -1613,7 +1609,7 @@ int rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(ngap_pdusession_release_comm if (req.numPDUSessionsRem == 0) { LOG_E(NR_RRC, "Received NG PDU Session Release Command but no PDU Sessions to release\n"); return -1; - } else if (!ue_associated_to_cuup(rrc, UE)) { + } else if (!ue_associated_to_cuup(UE)) { LOG_E(NR_RRC, "UE %d is not associated to CU-UP\n", UE->rrc_ue_id); // TODO handle, e.g., only trigger F1 release return 0; @@ -1625,7 +1621,7 @@ int rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(ngap_pdusession_release_comm LOG_I(NR_RRC, "Send F1 Bearer Context Modification Request with PDU Session release \n"); req.gNB_cu_cp_ue_id = UE->rrc_ue_id; req.gNB_cu_up_ue_id = UE->rrc_ue_id; - sctp_assoc_t assoc_id = get_existing_cuup_for_ue(rrc, UE); + sctp_assoc_t assoc_id = get_existing_cuup_for_ue(UE); rrc->cucp_cuup.bearer_context_mod(assoc_id, &req); } init_delayed_action(&UE->delayed_action); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.h b/openair2/RRC/NR/rrc_gNB_NGAP.h index ab5e637b2d..035e0a2036 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.h +++ b/openair2/RRC/NR/rrc_gNB_NGAP.h @@ -26,15 +26,13 @@ int rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, instance_t void rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE); -void rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_FAIL(uint32_t gnb, - const rrc_gNB_ue_context_t *const ue_context_pP, - const ngap_cause_t causeP); +void rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_FAIL(uint32_t gnb, const ngap_cause_t causeP); -int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mui_t *rrc_gNB_mui); +int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance); void rrc_gNB_send_NGAP_UPLINK_NAS(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const NR_UL_DCCH_Message_t *const ul_dcch_msg); -void rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, uint8_t xid); +void rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE); void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t instance); @@ -71,7 +69,7 @@ void rrc_gNB_send_NGAP_HANDOVER_REQUIRED(gNB_RRC_INST *rrc, void rrc_gNB_send_NGAP_HANDOVER_FAILURE(gNB_RRC_INST *rrc, ngap_handover_failure_t *msg); -int rrc_gNB_process_Handover_Request(gNB_RRC_INST *rrc, instance_t instance, ngap_handover_request_t *msg); +int rrc_gNB_process_Handover_Request(gNB_RRC_INST *rrc, ngap_handover_request_t *msg); void rrc_gNB_free_Handover_Request(ngap_handover_request_t *msg); void rrc_gNB_send_NGAP_HANDOVER_REQUEST_ACKNOWLEDGE(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, byte_array_t ho_command); diff --git a/openair2/RRC/NR/rrc_gNB_cuup.c b/openair2/RRC/NR/rrc_gNB_cuup.c index bfb78dc0d3..1757cf477a 100644 --- a/openair2/RRC/NR/rrc_gNB_cuup.c +++ b/openair2/RRC/NR/rrc_gNB_cuup.c @@ -90,13 +90,13 @@ bool is_cuup_associated(gNB_RRC_INST *rrc) return false; } -bool ue_associated_to_cuup(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue) +bool ue_associated_to_cuup(const gNB_RRC_UE_t *ue) { f1_ue_data_t ue_data = cu_get_f1_ue_data(ue->rrc_ue_id); return ue_data.e1_assoc_id != 0; } -sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_INST *rrc, const gNB_RRC_UE_t *ue) +sctp_assoc_t get_existing_cuup_for_ue(const gNB_RRC_UE_t *ue) { f1_ue_data_t ue_data = cu_get_f1_ue_data(ue->rrc_ue_id); AssertFatal(ue_data.e1_assoc_id != 0, "UE %d should be associated to CU-UP, but is not\n", ue->rrc_ue_id); @@ -178,7 +178,7 @@ static bool has_assoc_id(const void *vval, const void *vit) * that are in the process of connecting or that are on another DU might be * affected by that reset procedure as well; we suppose they will connect later * again. */ -static void remove_unassociated_e1_connections(gNB_RRC_INST *rrc, sctp_assoc_t e1_assoc_id) +static void remove_unassociated_e1_connections(gNB_RRC_INST *rrc) { seq_arr_t affected_du; seq_arr_init(&affected_du, sizeof(sctp_assoc_t)); @@ -189,7 +189,7 @@ static void remove_unassociated_e1_connections(gNB_RRC_INST *rrc, sctp_assoc_t e RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &rrc->rrc_ue_head) { gNB_RRC_UE_t *UE = &ue_context_p->ue_context; uint32_t ue_id = UE->rrc_ue_id; - if (ue_associated_to_cuup(rrc, UE)) + if (ue_associated_to_cuup(UE)) continue; f1_ue_data_t ue_data = cu_get_f1_ue_data(ue_id); elm_arr_t ret = find_if(&affected_du, &ue_data.du_assoc_id, has_assoc_id); @@ -268,7 +268,7 @@ int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, const e1ap_setup_req_t * RB_INSERT(rrc_cuup_tree, &rrc->cuups, cuup); rrc->num_cuups++; - remove_unassociated_e1_connections(rrc, assoc_id); + remove_unassociated_e1_connections(rrc); MessageDef *msg_p = itti_alloc_new_message(TASK_RRC_GNB, 0, E1AP_SETUP_RESP); msg_p->ittiMsgHeader.originInstance = assoc_id; @@ -300,7 +300,7 @@ static void invalidate_cuup_connections(gNB_RRC_INST *rrc, sctp_assoc_t e1_assoc /** * @brief RRC Processing of the indication of E1 connection loss on CU-CP */ -void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, e1ap_lost_connection_t *lc, sctp_assoc_t assoc_id) +void rrc_gNB_process_e1_lost_connection(gNB_RRC_INST *rrc, sctp_assoc_t assoc_id) { LOG_I(NR_RRC, "Received E1 connection loss indication on RRC\n"); AssertFatal(assoc_id != 0, "illegal assoc_id == 0: should be -1 (monolithic) or >0 (split)\n"); diff --git a/openair2/RRC/NR/rrc_gNB_mobility.c b/openair2/RRC/NR/rrc_gNB_mobility.c index f2296f0fdc..e36e6ee684 100644 --- a/openair2/RRC/NR/rrc_gNB_mobility.c +++ b/openair2/RRC/NR/rrc_gNB_mobility.c @@ -154,6 +154,9 @@ typedef struct { static void rrc_deliver_ue_ctxt_modif_req(void *deliver_pdu_data, ue_id_t ue_id, int srb_id, char *buf, int size, int sdu_id) { + UNUSED(ue_id); + UNUSED(srb_id); + UNUSED(sdu_id); DevAssert(deliver_pdu_data != NULL); deliver_ue_ctxt_modification_data_t *data = deliver_pdu_data; byte_array_t ba = {.buf = (uint8_t *) buf, .len = size}; @@ -199,7 +202,7 @@ static void nr_rrc_f1_ho_acknowledge(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) * in NR, do not re-establish PDCP */ nr_rrc_reconfig_param_t params = get_RRCReconfiguration_params(rrc, UE, (1 << SRB2), true); UE->xids[params.transaction_id] = RRC_DEDICATED_RECONF; - byte_array_t buffer = rrc_gNB_encode_RRCReconfiguration(rrc, UE, params); + byte_array_t buffer = rrc_gNB_encode_RRCReconfiguration(UE, params); free_RRCReconfiguration_params(params); if (!buffer.len) { LOG_E(NR_RRC, "UE %d: Failed to generate RRCReconfiguration\n", UE->rrc_ue_id); @@ -345,12 +348,12 @@ void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id) /** @brief Generate the HandoverPreparationInformation to be carried * in the RRC Container (9.3.1.29 of 3GPP TS 38.413) of the Source * NG-RAN Node to Target NG-RAN Node Transparent Container IE */ -static byte_array_t rrc_gNB_generate_HandoverPreparationInformation(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, int serving_pci) +static byte_array_t rrc_gNB_generate_HandoverPreparationInformation(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue) { nr_rrc_reconfig_param_t params = get_RRCReconfiguration_params(rrc, ue, 0, false); params.ue_cap = ue->ue_cap_buffer; - byte_array_t hoPrepInfo = get_HandoverPreparationInformation(¶ms, serving_pci); + byte_array_t hoPrepInfo = get_HandoverPreparationInformation(¶ms); free_RRCReconfiguration_params(params); if (hoPrepInfo.len < 0) { @@ -415,7 +418,7 @@ static byte_array_t rrc_gNB_encode_HandoverCommand(gNB_RRC_UE_t *UE, gNB_RRC_INS * - Source absent (inter-CU): N2 or Xn handover (target CU created new UE * on Handover Request). This UE context has no serving cells yet; add * target cell as first PCell. */ -bool nr_rrc_update_cell_assoc_after_ho(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) +bool nr_rrc_update_cell_assoc_after_ho(gNB_RRC_UE_t *UE) { DevAssert(UE->ho_context); DevAssert(UE->ho_context->target); @@ -471,7 +474,7 @@ static void nr_rrc_n2_ho_acknowledge(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE) /* Update cell association after handover */ nr_ho_target_cu_t *target = UE->ho_context->target; - if (!nr_rrc_update_cell_assoc_after_ho(rrc, UE)) { + if (!nr_rrc_update_cell_assoc_after_ho(UE)) { ngap_handover_failure_t fail = {.amf_ue_ngap_id = UE->amf_ue_ngap_id, .cause.type = NGAP_CAUSE_RADIO_NETWORK, .cause.value = NGAP_CAUSE_RADIO_NETWORK_HO_FAILURE_IN_TARGET_5GC_NGRAN_NODE_OR_TARGET_SYSTEM}; @@ -547,12 +550,9 @@ void nr_rrc_trigger_n2_ho_target(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue) /** @brief Trigger N2 handover on source gNB: * 1) Prepare RRC Container with HandoverPreparationInformation message * 2) send NGAP Handover Required message */ -void nr_rrc_trigger_n2_ho(gNB_RRC_INST *rrc, - gNB_RRC_UE_t *ue, - int serving_pci, - const nr_neighbour_cell_t *neighbour_config) +void nr_rrc_trigger_n2_ho(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, const nr_neighbour_cell_t *neighbour_config) { - byte_array_t hoPrepInfo = rrc_gNB_generate_HandoverPreparationInformation(rrc, ue, serving_pci); + byte_array_t hoPrepInfo = rrc_gNB_generate_HandoverPreparationInformation(rrc, ue); if (hoPrepInfo.len < 0) { free_byte_array(hoPrepInfo); LOG_E(NR_RRC, "Failed to trigger N2 handover on source gNB for UE %x\n", ue->rrc_ue_id); @@ -614,7 +614,7 @@ void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, uint32_t .plmn = pcell->info.plmn, .subcarrierSpacing = pcell->info.mode == NR_MODE_TDD ? pcell->info.tdd.dlul.scs : pcell->info.fdd.dl.scs, }; - nr_rrc_trigger_n2_ho(rrc, UE, neighbour_pci, &neighbourConfig); + nr_rrc_trigger_n2_ho(rrc, UE, &neighbourConfig); return; } @@ -635,7 +635,7 @@ void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, uint32_t return; } - nr_rrc_trigger_n2_ho(rrc, UE, pcell->info.pci, neighbour); + nr_rrc_trigger_n2_ho(rrc, UE, neighbour); } // This function detects if there are at least two different ssbFrequency values, and if so, returns meas_timing_config; diff --git a/openair2/RRC/NR/rrc_gNB_mobility.h b/openair2/RRC/NR/rrc_gNB_mobility.h index de4eabae64..eada8a6900 100644 --- a/openair2/RRC/NR/rrc_gNB_mobility.h +++ b/openair2/RRC/NR/rrc_gNB_mobility.h @@ -85,10 +85,7 @@ void nr_rrc_trigger_f1_ho(gNB_RRC_INST *rrc, void nr_rrc_finalize_ho(gNB_RRC_UE_t *ue); void nr_rrc_n2_ho_failure(gNB_RRC_INST *rrc, uint32_t gnb_ue_id, ngap_handover_failure_t *msg); -void nr_rrc_trigger_n2_ho(gNB_RRC_INST *rrc, - gNB_RRC_UE_t *ue, - int serving_pci, - const nr_neighbour_cell_t *neighbour_config); +void nr_rrc_trigger_n2_ho(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, const nr_neighbour_cell_t *neighbour_config); void rrc_gNB_trigger_reconfiguration_for_handover(gNB_RRC_INST *rrc, gNB_RRC_UE_t *ue, uint8_t *rrc_reconf, int rrc_reconf_len); @@ -98,6 +95,6 @@ byte_array_t *get_meas_timing_config(const NR_MeasurementTimingConfiguration_t * void nr_rrc_apply_target_context(gNB_RRC_UE_t *UE); -bool nr_rrc_update_cell_assoc_after_ho(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE); +bool nr_rrc_update_cell_assoc_after_ho(gNB_RRC_UE_t *UE); #endif /* RRC_GNB_MOBILITY_H_ */ diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 908956c0e9..44fd779605 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -435,7 +435,7 @@ static NR_CG_Config_t *generate_CG_Config(const NR_RRCReconfiguration_t *reconfi return cg_Config; } -void rrc_add_nsa_user_resp(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, const f1ap_ue_context_setup_resp_t *resp) +void rrc_add_nsa_user_resp(gNB_RRC_UE_t *UE, const f1ap_ue_context_setup_resp_t *resp) { DevAssert(resp->crnti != NULL); /* we did not fill any DU-related ID info in rrc_add_nsa_user() */ diff --git a/openair2/RRC/NR/rrc_gNB_radio_bearers.c b/openair2/RRC/NR/rrc_gNB_radio_bearers.c index de634d27a1..d10f50345e 100644 --- a/openair2/RRC/NR/rrc_gNB_radio_bearers.c +++ b/openair2/RRC/NR/rrc_gNB_radio_bearers.c @@ -63,7 +63,11 @@ nr_rrc_qos_t *add_qos(seq_arr_t *qos, const pdusession_level_qos_parameter_t *in } /** @brief Free QoS flows list items */ -static void free_qos(void *ptr) { /*nothing to do*/ } +static void free_qos(void *ptr) +{ + /*nothing to do*/ + UNUSED(ptr); +} /** @brief Free QoS flows list */ static void free_rrc_qos_list(seq_arr_t *seq) @@ -233,6 +237,7 @@ drb_t *get_drb(seq_arr_t *seq, int id) void free_drb(void *ptr) { // do nothing + UNUSED(ptr); } rrc_pdu_session_param_t *find_pduSession_from_drbId(gNB_RRC_UE_t *ue, int drb_id) diff --git a/openair2/RRC/NR_UE/L2_interface_ue.c b/openair2/RRC/NR_UE/L2_interface_ue.c index 9d921d2131..b0b3b501cd 100644 --- a/openair2/RRC/NR_UE/L2_interface_ue.c +++ b/openair2/RRC/NR_UE/L2_interface_ue.c @@ -33,12 +33,10 @@ void nr_mac_rrc_sync_ind(const module_id_t module_id, const frame_t frame, const } void nr_mac_rrc_data_ind_ue(const module_id_t module_id, - const int CC_id, const uint8_t gNB_index, const int hfn, const frame_t frame, const int slot, - const rnti_t rnti, const uint32_t cellid, const long arfcn, const channel_t channel, diff --git a/openair2/RRC/NR_UE/L2_interface_ue.h b/openair2/RRC/NR_UE/L2_interface_ue.h index eaac8290c9..09c7b7daae 100644 --- a/openair2/RRC/NR_UE/L2_interface_ue.h +++ b/openair2/RRC/NR_UE/L2_interface_ue.h @@ -10,12 +10,10 @@ typedef uint32_t channel_t; #define _L2_INTERFACE_UE_H_ void nr_mac_rrc_sync_ind(const module_id_t module_id, const frame_t frame, const bool in_sync); void nr_mac_rrc_data_ind_ue(const module_id_t module_id, - const int CC_id, const uint8_t gNB_index, const int hfn, const frame_t frame, const int slot, - const rnti_t rnti, const uint32_t cellid, const long arfcn, const channel_t channel, diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 0a4b1a7fb5..37bca1d45a 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2014,8 +2014,6 @@ static void nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(NR_UE_RRC_INST_t *rrc, const uint8_t gNB_index, uint8_t *const Sdu, const uint8_t Sdu_len, - const uint8_t rsrq, - const uint8_t rsrp, int hfn, int frame, int slot) @@ -3067,6 +3065,7 @@ static void nr_rrc_handle_meas_indication(NR_UE_RRC_INST_t *rrc, NRRrcMacMeasDat void *rrc_nrue_task(void *args_p) { + UNUSED(args_p); itti_mark_task_ready(TASK_RRC_NRUE); while (1) { rrc_nrue(NULL); @@ -3075,6 +3074,7 @@ void *rrc_nrue_task(void *args_p) void *rrc_nrue(void *notUsed) { + UNUSED(notUsed); MessageDef *msg_p = NULL; itti_receive_msg(TASK_RRC_NRUE, &msg_p); instance_t instance = ITTI_MSG_DESTINATION_INSTANCE(msg_p); @@ -3152,24 +3152,15 @@ void *rrc_nrue(void *notUsed) if (bcch->is_bch) nr_rrc_ue_decode_NR_BCCH_BCH_Message(rrc, bcch->gnb_index, bcch->phycellid, bcch->ssb_arfcn, bcch->sdu, bcch->sdu_size); else - nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(rrc, - bcch->gnb_index, - bcch->sdu, - bcch->sdu_size, - bcch->rsrq, - bcch->rsrp, - bcch->hfn, - bcch->frame, - bcch->slot); + nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(rrc, bcch->gnb_index, bcch->sdu, bcch->sdu_size, bcch->hfn, bcch->frame, bcch->slot); break; case NR_RRC_MAC_SBCCH_DATA_IND: LOG_D(NR_RRC, "[UE %ld] Received %s: gNB %d\n", instance, ITTI_MSG_NAME(msg_p), NR_RRC_MAC_SBCCH_DATA_IND(msg_p).gnb_index); NRRrcMacSBcchDataInd *sbcch = &NR_RRC_MAC_SBCCH_DATA_IND(msg_p); - - nr_rrc_ue_decode_NR_SBCCH_SL_BCH_Message(rrc, sbcch->gnb_index,sbcch->frame, sbcch->slot, sbcch->sdu, - sbcch->sdu_size, sbcch->rx_slss_id); + nr_rrc_ue_decode_NR_SBCCH_SL_BCH_Message(rrc, sbcch->sdu, sbcch->sdu_size, sbcch->rx_slss_id); break; + case NR_RRC_MAC_MEAS_DATA_IND: nr_rrc_handle_meas_indication(rrc, &NR_RRC_MAC_MEAS_DATA_IND(msg_p)); break; diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 02005d0986..5efd15306a 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -67,9 +67,6 @@ void start_sidelink(int instance); void rrc_ue_process_sidelink_Preconfiguration(NR_UE_RRC_INST_t *rrc_inst, int sync_ref); void nr_rrc_ue_decode_NR_SBCCH_SL_BCH_Message(NR_UE_RRC_INST_t *rrc, - const uint8_t gNB_index, - const frame_t frame, - const int slot, uint8_t* pduP, const sdu_size_t pdu_len, const uint16_t rx_slss_id); diff --git a/openair2/RRC/NR_UE/rrc_sl_preconfig.c b/openair2/RRC/NR_UE/rrc_sl_preconfig.c index 8bd5c37104..84f73df4a3 100644 --- a/openair2/RRC/NR_UE/rrc_sl_preconfig.c +++ b/openair2/RRC/NR_UE/rrc_sl_preconfig.c @@ -421,9 +421,7 @@ int configure_NR_SL_Preconfig(NR_UE_RRC_INST_t *rrc,int sync_source) } /*decode SL-BCH (SL-MIB) message*/ -static int8_t nr_sl_rrc_ue_decode_SL_MIB(const uint8_t gNB_index, - uint8_t *const bufferP, - const uint8_t buffer_len) +static int8_t nr_sl_rrc_ue_decode_SL_MIB(uint8_t *const bufferP, const uint8_t buffer_len) { NR_MasterInformationBlockSidelink_t *sl_mib = NULL; @@ -456,15 +454,12 @@ static int8_t nr_sl_rrc_ue_decode_SL_MIB(const uint8_t gNB_index, void nr_rrc_ue_decode_NR_SBCCH_SL_BCH_Message(NR_UE_RRC_INST_t *rrc, - const uint8_t gNB_index, - const frame_t frame, - const int slot, uint8_t* pduP, const sdu_size_t pdu_len, const uint16_t rx_slss_id) { - nr_sl_rrc_ue_decode_SL_MIB(gNB_index, (uint8_t*)pduP, pdu_len); + nr_sl_rrc_ue_decode_SL_MIB((uint8_t*)pduP, pdu_len); DevAssert(rrc->sl_preconfig); diff --git a/openair2/SDAP/nr_sdap/nr_sdap.c b/openair2/SDAP/nr_sdap/nr_sdap.c index e477764c45..c78fdca973 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap.c +++ b/openair2/SDAP/nr_sdap/nr_sdap.c @@ -63,18 +63,13 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p, return ret; } -void sdap_data_ind(int pdcp_entity, - int is_gnb, - bool has_sdap_rx, - int pdusession_id, - ue_id_t ue_id, - char *buf, - int size) { +void sdap_data_ind(int pdcp_entity, int is_gnb, int pdusession_id, ue_id_t ue_id, char *buf, int size) +{ nr_sdap_entity_t *sdap_entity; sdap_entity = nr_sdap_get_entity(ue_id, pdusession_id); if (sdap_entity == NULL) { - LOG_E(SDAP, "%s:%d:%s: Entity not found for ue rnti/ue_id: %lx and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ue_id, pdusession_id); + LOG_E(SDAP, "Entity not found for ue rnti/ue_id: %lx and pdusession id: %d\n", ue_id, pdusession_id); return; } diff --git a/openair2/SDAP/nr_sdap/nr_sdap.h b/openair2/SDAP/nr_sdap/nr_sdap.h index f66c954f2c..4275e1757a 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap.h +++ b/openair2/SDAP/nr_sdap/nr_sdap.h @@ -35,13 +35,7 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p, * Uplink - gNB * Downlink - nrUE */ -void sdap_data_ind(int pdcp_entity, - int is_gnb, - bool has_sdap_rx, - int pdusession_id, - ue_id_t ue_id, - char *buf, - int size); +void sdap_data_ind(int pdcp_entity, int is_gnb, int pdusession_id, ue_id_t ue_id, char *buf, int size); void start_sdap_tun_gnb_first_ue_default_pdu_session(ue_id_t ue_id, int pdu_session_id); void create_ue_ip_if(const char *ipv4, const char *ipv6, int ue_id, int pdu_session_id, bool is_default); diff --git a/openair2/XNAP/lib/xnap_gNB_interface_management.c b/openair2/XNAP/lib/xnap_gNB_interface_management.c index 6fb0985487..bcf2b5ee09 100644 --- a/openair2/XNAP/lib/xnap_gNB_interface_management.c +++ b/openair2/XNAP/lib/xnap_gNB_interface_management.c @@ -451,4 +451,5 @@ bool eq_xnap_setup_failure(const xnap_setup_failure_t *a, const xnap_setup_failu void free_xnap_setup_failure(xnap_setup_failure_t *msg) { // nothing to free + UNUSED(msg); } From 7732c30c1d133a817a448d3adce2b79b6c1f9ba8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 13 Mar 2026 16:44:26 +0100 Subject: [PATCH 10/37] moving unused check to upper folder in openair2 --- openair2/CMakeLists.txt | 1 + openair2/E1AP/CMakeLists.txt | 1 - openair2/F1AP/CMakeLists.txt | 1 - openair2/LAYER2/CMakeLists.txt | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/openair2/CMakeLists.txt b/openair2/CMakeLists.txt index 36186e8ade..8d1238c3e5 100644 --- a/openair2/CMakeLists.txt +++ b/openair2/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(E1AP) if(E2_AGENT) add_subdirectory(E2AP) diff --git a/openair2/E1AP/CMakeLists.txt b/openair2/E1AP/CMakeLists.txt index ed2942e3f2..ea7647e57f 100644 --- a/openair2/E1AP/CMakeLists.txt +++ b/openair2/E1AP/CMakeLists.txt @@ -1,6 +1,5 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 -add_compile_options(-Wunused-parameter) add_subdirectory(MESSAGES) add_subdirectory(lib) diff --git a/openair2/F1AP/CMakeLists.txt b/openair2/F1AP/CMakeLists.txt index bf38ec70e5..fc9d451f5b 100644 --- a/openair2/F1AP/CMakeLists.txt +++ b/openair2/F1AP/CMakeLists.txt @@ -1,6 +1,5 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 -add_compile_options(-Wunused-parameter) add_subdirectory(lib) add_subdirectory(MESSAGES) diff --git a/openair2/LAYER2/CMakeLists.txt b/openair2/LAYER2/CMakeLists.txt index 1c325288a8..d93e781891 100644 --- a/openair2/LAYER2/CMakeLists.txt +++ b/openair2/LAYER2/CMakeLists.txt @@ -1,6 +1,5 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 -add_compile_options(-Wunused-parameter) add_subdirectory(nr_rlc) add_subdirectory(nr_pdcp) add_subdirectory(NR_MAC_UE) From 2483b68ee4f7ebf557eea2d31c74d04aef070a39 Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 15 Mar 2026 11:35:44 +0100 Subject: [PATCH 11/37] add flag for unused function arguments in NAS CMakeLists --- openair3/NAS/CMakeLists.txt | 1 + .../IES/AuthenticationResponseParameter.c | 6 ++--- .../IES/AuthenticationResponseParameter.h | 2 +- .../NR_UE/5GS/5GMM/IES/FGSRegistrationType.c | 2 +- .../NR_UE/5GS/5GMM/IES/FGSRegistrationType.h | 2 +- .../5GS/5GMM/IES/NrUESecurityCapability.c | 5 +--- .../5GS/5GMM/IES/NrUESecurityCapability.h | 5 +--- .../NR_UE/5GS/5GMM/MSG/RegistrationRequest.c | 5 ++-- openair3/NAS/NR_UE/nr_nas_msg.c | 23 ++++++++++--------- openair3/NAS/UE/API/USIM/usim_api.c | 2 ++ 10 files changed, 25 insertions(+), 28 deletions(-) diff --git a/openair3/NAS/CMakeLists.txt b/openair3/NAS/CMakeLists.txt index 39bfc888dd..ff9a1bcf99 100644 --- a/openair3/NAS/CMakeLists.txt +++ b/openair3/NAS/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(COMMON) add_subdirectory(NR_UE) add_subdirectory(UE) diff --git a/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c b/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c index e2ebd90feb..6fd5722030 100644 --- a/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c +++ b/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.c @@ -32,7 +32,7 @@ int decode_authentication_response_parameter(AuthenticationResponseParameter *au decoded += decode_result; #if defined (NAS_DEBUG) - dump_authentication_response_parameter_xml(authenticationresponseparameter, iei); + dump_authentication_response_parameter_xml(authenticationresponseparameter); #endif return decoded; } @@ -47,7 +47,7 @@ int encode_authentication_response_parameter(const AuthenticationResponseParamet /* Checking IEI and pointer */ CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, AUTHENTICATION_RESPONSE_PARAMETER_MINIMUM_LENGTH, len); #if defined (NAS_DEBUG) - dump_authentication_response_parameter_xml(authenticationresponseparameter, iei); + dump_authentication_response_parameter_xml(authenticationresponseparameter); #endif if (iei > 0) { @@ -67,7 +67,7 @@ int encode_authentication_response_parameter(const AuthenticationResponseParamet return encoded; } -void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter, uint8_t iei) +void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter) { printf("\n"); dump_octet_string_xml(&authenticationresponseparameter->res); diff --git a/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h b/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h index 3ac57d7719..45339c3f10 100644 --- a/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h +++ b/openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h @@ -25,7 +25,7 @@ int encode_authentication_response_parameter(const AuthenticationResponseParamet int decode_authentication_response_parameter(AuthenticationResponseParameter *authenticationresponseparameter, uint8_t iei, uint8_t *buffer, uint32_t len); -void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter, uint8_t iei); +void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter); #endif /* AUTHENTICATION RESPONSE PARAMETER_H_ */ diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c index c147080993..6065a7a5da 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.c @@ -17,7 +17,7 @@ #define NO_FOLLOW_ON_REQUEST 0x0 #define FOLLOW_ON_REQUEST 0x08 -int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value, uint32_t len) +int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value) { int decoded = 0; uint8_t *buffer = &value; diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h index 6f8b3462b2..b11320356e 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/FGSRegistrationType.h @@ -28,6 +28,6 @@ typedef uint8_t FGSRegistrationType; int encode_5gs_registration_type(const FGSRegistrationType *fgsregistrationtype, bool follow_on_request); -int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value, uint32_t len); +int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value); #endif /* FGS_REGISTRATION_TYPE_H_*/ diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c b/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c index 7b3471dac6..4c155551d8 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.c @@ -10,10 +10,7 @@ #include "TLVDecoder.h" #include "NrUESecurityCapability.h" -int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability, - uint8_t iei, - uint8_t *buffer, - uint32_t len) +int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability, uint8_t iei, uint8_t *buffer) { int encoded = 0; if (iei) { diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h b/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h index 6d3e787452..e9da0b2751 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/NrUESecurityCapability.h @@ -20,9 +20,6 @@ typedef struct { uint8_t EIA; } NrUESecurityCapability; -int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability, - uint8_t iei, - uint8_t *buffer, - uint32_t len); +int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability, uint8_t iei, uint8_t *buffer); #endif /* NRUE_SECURITY_CAPABILITY_H_ */ diff --git a/openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c b/openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c index f7321cd684..6b99b75cd2 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c +++ b/openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationRequest.c @@ -23,7 +23,7 @@ int decode_registration_request(registration_request_msg *registration_request, /* Decoding mandatory fields */ if ((decoded_result = - decode_5gs_registration_type(®istration_request->fgsregistrationtype, 0, *(buffer + decoded) & 0x0f, len - decoded)) + decode_5gs_registration_type(®istration_request->fgsregistrationtype, 0, *(buffer + decoded) & 0x0f)) < 0) { LOG_FUNC_RETURN(decoded_result); } @@ -76,8 +76,7 @@ int encode_registration_request(const registration_request_msg *registration_req == REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT) { if ((encode_result = encode_nrue_security_capability(®istration_request->nruesecuritycapability, REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_IEI, - buffer + encoded, - len - encoded)) + buffer + encoded)) < 0) // Return in case of error return encode_result; diff --git a/openair3/NAS/NR_UE/nr_nas_msg.c b/openair3/NAS/NR_UE/nr_nas_msg.c index 7f94b2a747..e7762c0051 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg.c +++ b/openair3/NAS/NR_UE/nr_nas_msg.c @@ -222,11 +222,10 @@ static void nas_security_compute_mac(nr_ue_nas_t *nas, * @brief: Decrypt the payload of a NAS message. The buffer is modified in place * @param[in] nas The NAS context * @param[in] pdu_buffer The buffer containing the full (header + payload) NAS message - * @param[in] is_uplink True if the message is uplink, false Downlink * @param[in] is3gpp_access True if the message is 3GPP access, false otherwise * @param[in] pdu_length The length of the NAS message */ -static void nas_security_decrypt_payload(nr_ue_nas_t *nas, byte_array_t buffer, const bool is_uplink, const bool is3gpp_access) +static void nas_security_decrypt_payload(nr_ue_nas_t *nas, byte_array_t buffer, const bool is3gpp_access) { Security_header_t sec_hdr; @@ -380,7 +379,7 @@ static security_state_t nas_security_rx_process(nr_ue_nas_t *nas, byte_array_t b return NAS_SECURITY_INTEGRITY_FAILED; /* decipher */ - nas_security_decrypt_payload(nas, buffer, false, true); + nas_security_decrypt_payload(nas, buffer, true); /* update estimated DL Counter */ nas->security.nas_count_dl++; @@ -669,7 +668,7 @@ static FGSRegistrationType set_fgs_ksi(nr_ue_nas_t *nas) * @brief Set contents of 5GMM capability * @note Currently hardcoded, sending min length only (1 octet) */ -static FGMMCapability set_fgmm_capability(nr_ue_nas_t *nas) +static FGMMCapability set_fgmm_capability() { FGMMCapability cap = {0}; cap.iei = REGISTRATION_REQUEST_5GMM_CAPABILITY_IEI; @@ -794,7 +793,7 @@ void generateRegistrationRequest(as_nas_info_t *initialNasMsg, nr_ue_nas_t *nas, if (full_rr->fgsregistrationtype != PERIODIC_REGISTRATION_UPDATING) { cleartext_only = false; // The UE needs to send non-cleartext IE full_rr->presencemask |= REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT; - full_rr->fgmmcapability = set_fgmm_capability(nas); + full_rr->fgmmcapability = set_fgmm_capability(); FGMMCapability *cap = &full_rr->fgmmcapability; size_nct += sizeof(cap->length) + sizeof(cap->iei) + cap->length; } @@ -1022,7 +1021,7 @@ static void generateAuthenticationResp(nr_ue_nas_t *nas, as_nas_info_t *initialN /** @brief Send Authentication Failure message from the UE to the AMF to * indicate that authentication of the network has failed */ -static void generateAuthenticationFailure(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg, cause_id_t cause) +static void generateAuthenticationFailure(as_nas_info_t *initialNasMsg, cause_id_t cause) { int size = sizeof(fgmm_msg_header_t); fgmm_nas_message_plain_t plain = {0}; @@ -1066,7 +1065,7 @@ static void handle_fgmm_authentication_request(nr_ue_nas_t *nas, as_nas_info_t * /* If the ngKSI value received is already associated with one of the 5G security contexts stored in the UE, send failure message */ LOG_E(NAS, "Invalid NAS Key Set Identifier: send Authentication Failure\n"); - generateAuthenticationFailure(nas, initialNasMsg, ngKSI_already_in_use); + generateAuthenticationFailure(initialNasMsg, ngKSI_already_in_use); return; } generateAuthenticationResp(nas, initialNasMsg, buffer->buf); @@ -1078,7 +1077,7 @@ static void handle_fgmm_authentication_request(nr_ue_nas_t *nas, as_nas_info_t * * @todo The UE shall performs actions as per 5.4.1.3.5 of 3GPP TS 24.501, including * (1) Abort any ongoing 5GMM procedure (2) Stop all active timers: T3510, T3516, T3517, * T3519, T3520, T3521 (3) Delete stored SUCI. (4) handle EAP-failure message. */ -static void handle_authentication_reject(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg, uint8_t *pdu, int pdu_length) +static void handle_authentication_reject(nr_ue_nas_t *nas, uint8_t *pdu, int pdu_length) { LOG_E(NAS, "Received Authentication Reject message from the network\n"); uint8_t eap_msg[MAX_EAP_CONTENTS_LEN] = {0}; @@ -1574,7 +1573,7 @@ void handleDownlinkNASTransport(const nr_ue_nas_t *nas, uint8_t * pdu_buffer, in } } -static void generateDeregistrationRequest(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg, const nas_deregistration_req_t *req) +static void generateDeregistrationRequest(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg) { fgmm_nas_msg_security_protected_t sp_msg = {0}; fgs_nas_message_security_header_t *sp_header = &sp_msg.header; @@ -1802,6 +1801,7 @@ static int get_user_nssai_idx(nssai_t ch_nssai, const nr_nas_msg_snssai_t allowe void *nas_nrue_task(void *args_p) { + UNUSED(args_p); while (1) { nas_nrue(NULL); } @@ -1942,6 +1942,7 @@ static void handle_service_reject(nr_ue_nas_t *nas, const byte_array_t *buffer) void *nas_nrue(void *args_p) { + UNUSED(args_p); // Wait for a message or an event MessageDef *msg_p; itti_receive_msg(TASK_NAS_NRUE, &msg_p); @@ -2072,7 +2073,7 @@ void *nas_nrue(void *args_p) send_nas_detach_req(nas, true); } as_nas_info_t initialNasMsg = {0}; - generateDeregistrationRequest(nas, &initialNasMsg, req); + generateDeregistrationRequest(nas, &initialNasMsg); send_nas_uplink_data_req(nas, &initialNasMsg); } else { LOG_W(NAS, "No GUTI, cannot trigger deregistration request.\n"); @@ -2108,7 +2109,7 @@ void *nas_nrue(void *args_p) handle_fgmm_authentication_request(nas, &initialNasMsg, &buffer); break; case FGS_AUTHENTICATION_REJECT: - handle_authentication_reject(nas, &initialNasMsg, pdu_buffer, pdu_length); + handle_authentication_reject(nas, pdu_buffer, pdu_length); break; case FGS_SECURITY_MODE_COMMAND: handle_security_mode_command(nas, &initialNasMsg, pdu_buffer, pdu_length); diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c index 6151eef11f..9e801781aa 100644 --- a/openair3/NAS/UE/API/USIM/usim_api.c +++ b/openair3/NAS/UE/API/USIM/usim_api.c @@ -455,6 +455,8 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co static int _usim_api_check_sqn(uint32_t seq, uint8_t ind) { /* TODO */ + UNUSED(seq); + UNUSED(ind); return (RETURNok); } From 683d855d97952ed7a69c8043cb3e9a7c9216d3ee Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 16 Mar 2026 18:30:56 +0100 Subject: [PATCH 12/37] add flag for unused function arguments in common folder CMakeLists (not enforced because of fmtlog external dependency) --- common/config/config_common.c | 12 ++++----- common/config/config_common.h | 6 ++--- common/config/config_load_configmodule.c | 10 ++++--- common/config/config_userapi.c | 3 +++ common/config/yaml/config_yaml.cpp | 1 + common/utils/LOG/log.c | 14 ++++------ common/utils/T/T.c | 1 + common/utils/T/check_vcd.c | 4 +++ common/utils/T/tracer/enb.c | 2 +- common/utils/T/tracer/event.h | 1 + common/utils/T/tracer/filter/filter.c | 5 ++-- common/utils/T/tracer/filter/filter.h | 5 +--- common/utils/T/tracer/handler.c | 9 ++++--- common/utils/T/tracer/handler.h | 7 ++--- common/utils/T/tracer/macpdu2wireshark.c | 25 +++++++++--------- common/utils/T/tracer/packet-mac-lte.h | 6 ++--- common/utils/T/tracer/record.c | 3 ++- common/utils/T/tracer/record_db.cpp | 13 +++------- common/utils/T/tracer/ue.c | 2 +- common/utils/T/tracer/vcd.c | 2 +- common/utils/T/tracer/view/scrolltti.c | 1 + common/utils/T/tracer/view/stdout.c | 1 + common/utils/T/tracer/view/textlist.c | 7 +++-- common/utils/T/tracer/view/ticktime.c | 15 ++++++----- common/utils/T/tracer/view/time.c | 14 +++++----- common/utils/T/tracer/view/tti.c | 1 + common/utils/T/tracer/view/view.h | 13 ++++------ common/utils/T/tracer/view/xy.c | 1 + common/utils/ds/hashtable.c | 5 +++- common/utils/system.c | 8 ++---- common/utils/system.h | 6 +---- common/utils/telnetsrv/telnetsrv.c | 26 +++++++++++-------- common/utils/telnetsrv/telnetsrv_bearer.c | 3 +++ common/utils/telnetsrv/telnetsrv_ci.c | 10 +++++++ common/utils/telnetsrv/telnetsrv_ciUE.c | 16 ++++++++++++ common/utils/telnetsrv/telnetsrv_enb_phycmd.c | 4 +++ .../utils/telnetsrv/telnetsrv_measurements.c | 1 + common/utils/telnetsrv/telnetsrv_o1.c | 9 +++++++ common/utils/telnetsrv/telnetsrv_proccmd.c | 14 +++++----- common/utils/telnetsrv/telnetsrv_rrc.c | 3 +++ common/utils/time_manager/time_manager.c | 1 + common/utils/time_meas.c | 5 ++-- executables/lte-enb.c | 8 +++--- executables/lte-ru.c | 18 ++++++------- executables/lte-ue.c | 6 ++--- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 17 +++--------- openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 6 +---- .../LAYER2/PDCP_v10.1.0/pdcp_primitives.h | 7 +++-- openair2/LAYER2/rlc_v2/rlc_oai_api.c | 2 +- openair2/RRC/LTE/rrc_UE.c | 4 +-- openair2/RRC/LTE/rrc_eNB_S1AP.c | 2 -- 51 files changed, 203 insertions(+), 162 deletions(-) diff --git a/common/config/config_common.c b/common/config/config_common.c index 6646402a39..fef37ccd87 100644 --- a/common/config/config_common.c +++ b/common/config/config_common.c @@ -133,7 +133,7 @@ int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoption return status; } -int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix) +int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions) { int status = 0; @@ -193,7 +193,7 @@ int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgo return status; } -int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix) +int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions) { int status = 0; config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1); @@ -229,7 +229,7 @@ int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions return 0; } -int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix) +int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions) { int status = 0; @@ -333,13 +333,13 @@ int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoptio case TYPE_UINTARRAY: case TYPE_INTARRAY: - return config_setdefault_intlist(cfg, cfgoption, prefix); + return config_setdefault_intlist(cfg, cfgoption); case TYPE_DOUBLE: - return config_setdefault_double(cfg, cfgoption, prefix); + return config_setdefault_double(cfg, cfgoption); case TYPE_IPV4ADDR: - return config_setdefault_ipv4addr(cfg, cfgoption, prefix); + return config_setdefault_ipv4addr(cfg, cfgoption); case TYPE_LIST: // No default value for list type diff --git a/common/config/config_common.h b/common/config/config_common.h index db36f8bc6e..9e4e30794c 100644 --- a/common/config/config_common.h +++ b/common/config/config_common.h @@ -20,11 +20,11 @@ void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, /* functions to set a parameter to its default value */ int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); -int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); +int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions); int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); -int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); -int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix); +int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions); +int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions); void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree); void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val); int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, const char *prefix); diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index c8b1245c87..087c8f622d 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -123,6 +123,10 @@ int config_cmdlineonly_getlist(configmodule_interface_t *cfg, int numparams, const char *prefix) { + UNUSED(cfg); + UNUSED(params); + UNUSED(numparams); + UNUSED(prefix); ParamList->numelt = 0; return 0; } @@ -162,15 +166,15 @@ int config_cmdlineonly_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions case TYPE_UINTARRAY: case TYPE_INTARRAY: - defval = config_setdefault_intlist(cfg, &cfgoptions[i], prefix); + defval = config_setdefault_intlist(cfg, &cfgoptions[i]); break; case TYPE_DOUBLE: - defval = config_setdefault_double(cfg, &cfgoptions[i], prefix); + defval = config_setdefault_double(cfg, &cfgoptions[i]); break; case TYPE_IPV4ADDR: - defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i], prefix); + defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i]); break; default: diff --git a/common/config/config_userapi.c b/common/config/config_userapi.c index 6a7ad07b0f..76f9722d0a 100644 --- a/common/config/config_userapi.c +++ b/common/config/config_userapi.c @@ -177,6 +177,7 @@ void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokva int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param) { + UNUSED(cfg); if ( param == NULL ) { fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n"); return -1; @@ -212,6 +213,7 @@ int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param) { + UNUSED(cfg); if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) { return 0; } @@ -234,6 +236,7 @@ void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numok int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param) { + UNUSED(cfg); if ( param == NULL ) { fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n"); return -1; diff --git a/common/config/yaml/config_yaml.cpp b/common/config/yaml/config_yaml.cpp index 35a1ee00da..227548366d 100644 --- a/common/config/yaml/config_yaml.cpp +++ b/common/config/yaml/config_yaml.cpp @@ -158,6 +158,7 @@ extern "C" int config_yaml_init(configmodule_interface_t *cfg) extern "C" void config_yaml_end(configmodule_interface_t *cfg) { + UNUSED(cfg); delete config_yaml::config; } diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 8385ce6d8f..b8dbdef194 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -519,13 +519,7 @@ void logTerm(void) } #include -static inline int log_header(log_component_t *c, - char *log_buffer, - int buffsize, - const char *file, - const char *func, - int line, - int level) +static inline int log_header(log_component_t *c, char *log_buffer, int buffsize, const char *func, int line, int level) { int flag = g_log->flag; @@ -666,7 +660,7 @@ void log_dump(int component, if (wbuf != NULL) { va_start(args, format); - int pos=log_header(c, wbuf,MAX_LOG_TOTAL,"noFile","noFunc",0, OAILOG_INFO); + int pos = log_header(c, wbuf, MAX_LOG_TOTAL, "noFunc", 0, OAILOG_INFO); pos+=vsprintf(wbuf+pos,format, args); va_end(args); @@ -875,6 +869,8 @@ void flush_mem_to_file(void) static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args) { + UNUSED(comp); + UNUSED(file); //logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args) int len = 0; /* The main difference with the version above is the use of this local log_buffer. @@ -887,7 +883,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char * // make sure that for log trace the extra info is only printed once, reset when the level changes if (level < OAILOG_TRACE) { - int n = log_header(c, log_buffer+len, sizeof(log_buffer), file, func, line, level); + int n = log_header(c, log_buffer+len, sizeof(log_buffer), func, line, level); if (n > 0) { len += n; if (len > sizeof(log_buffer)) { diff --git a/common/utils/T/T.c b/common/utils/T/T.c index eba8d39b84..6285f7c10d 100644 --- a/common/utils/T/T.c +++ b/common/utils/T/T.c @@ -89,6 +89,7 @@ static int get_message(int s) static void *T_receive_thread(void *_) { + UNUSED(_); int err = 0; while (!err) err = get_message(T_socket); diff --git a/common/utils/T/check_vcd.c b/common/utils/T/check_vcd.c index ec90d368b0..c29a56a534 100644 --- a/common/utils/T/check_vcd.c +++ b/common/utils/T/check_vcd.c @@ -27,6 +27,10 @@ */ void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) { + UNUSED(file); + UNUSED(function); + UNUSED(line); + UNUSED(s); if (assert) { abort(); } else { diff --git a/common/utils/T/tracer/enb.c b/common/utils/T/tracer/enb.c index d7dd58f4ee..edbb726665 100644 --- a/common/utils/T/tracer/enb.c +++ b/common/utils/T/tracer/enb.c @@ -428,7 +428,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database, for (i = 0; i < 8; i++) timeline_set_subline_background_color(g, timeline_plot, i, new_color(g, i==0 || i==4 ? "#aaf" : "#eee")); - timeview = new_view_time(3600, 10, g, timeline_plot); + timeview = new_view_time(10, g, timeline_plot); /* DL tick logging */ timelog = new_timelog(h, database, "ENB_PHY_DL_TICK"); subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000); diff --git a/common/utils/T/tracer/event.h b/common/utils/T/tracer/event.h index 4e2e766f11..e488c0c703 100644 --- a/common/utils/T/tracer/event.h +++ b/common/utils/T/tracer/event.h @@ -7,6 +7,7 @@ #include "utils.h" #include "../T_defs.h" +#include "common/platform_types.h" #ifdef T_SEND_TIME #include #endif diff --git a/common/utils/T/tracer/filter/filter.c b/common/utils/T/tracer/filter/filter.c index 314e0e4e82..25d6abd320 100644 --- a/common/utils/T/tracer/filter/filter.c +++ b/common/utils/T/tracer/filter/filter.c @@ -41,6 +41,7 @@ int eval_eq(struct filter *f, event e) int eval_int(struct filter *f, event e) { + UNUSED(e); return f->v.v; } @@ -152,9 +153,9 @@ filter *filter_evarg(void *database, char *event_name, char *varname) return ret; } -filter *filter_evfun(void *database, int (*fun)(void *priv, int v), - void *priv, filter *x) +filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x) { + UNUSED(database); struct filter *ret = calloc(1, sizeof(struct filter)); if (ret == NULL) abort(); ret->eval = eval_evfun; diff --git a/common/utils/T/tracer/filter/filter.h b/common/utils/T/tracer/filter/filter.h index 6af523d130..4b8990dab6 100644 --- a/common/utils/T/tracer/filter/filter.h +++ b/common/utils/T/tracer/filter/filter.h @@ -13,11 +13,8 @@ filter *filter_and(filter *a, filter *b); filter *filter_eq(filter *a, filter *b); filter *filter_int(int v); filter *filter_evarg(void *database, char *event_name, char *varname); -filter *filter_evfun(void *database, int (*fun)(void *priv, int v), - void *priv, filter *x); - +filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x); int filter_eval(filter *f, event e); - void free_filter(filter *f); #endif /* _FILTER_H_ */ diff --git a/common/utils/T/tracer/handler.c b/common/utils/T/tracer/handler.c index 3321a21c52..e9d6f0e56d 100644 --- a/common/utils/T/tracer/handler.c +++ b/common/utils/T/tracer/handler.c @@ -52,8 +52,7 @@ event_handler *new_handler(void *database) return ret; } -unsigned long register_handler_function(event_handler *_h, int event_id, - void (*f)(void *, event), void *p) +unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p) { struct _event_handler *h = _h; unsigned long ret = h->next_id; @@ -78,9 +77,11 @@ unsigned long register_handler_function(event_handler *_h, int event_id, return ret; } -void remove_handler_function(event_handler *h, int event_id, - unsigned long handler_id) +void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id) { + UNUSED(h); + UNUSED(event_id); + UNUSED(handler_id); printf("%s:%d: TODO\n", __FILE__, __LINE__); abort(); } diff --git a/common/utils/T/tracer/handler.h b/common/utils/T/tracer/handler.h index 1a064da16f..7ccb64b1b6 100644 --- a/common/utils/T/tracer/handler.h +++ b/common/utils/T/tracer/handler.h @@ -11,10 +11,7 @@ typedef void event_handler; event_handler *new_handler(void *database); void handle_event(event_handler *h, event e); - -unsigned long register_handler_function(event_handler *_h, int event_id, - void (*f)(void *, event), void *p); -void remove_handler_function(event_handler *h, int event_id, - unsigned long handler_id); +unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p); +void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id); #endif /* _HANDLER_H_ */ diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index eaf9b03baa..9a931e2690 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -323,7 +323,7 @@ void dl(void *_d, event e) } trace_lte(e.sending_time, d, DIRECTION_DOWNLINK, - e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI, e.e[d->dl_rnti].i, + e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI_T, e.e[d->dl_rnti].i, e.e[d->dl_frame].i, e.e[d->dl_subframe].i, e.e[d->dl_data].b, e.e[d->dl_data].bsize, NO_PREAMBLE, NO_SR_RNTI); @@ -406,7 +406,7 @@ void sr(void *_d, event e) void trace_nr(struct timespec sending_time, ev_data *d, int direction, int rnti_type, int rnti, int frame, int slot, int harq_pid, void *buf, - int bufsize, int preamble) + int bufsize) { ssize_t ret; int i; @@ -475,7 +475,7 @@ void nr_ul(void *_d, event e) NR_C_RNTI, e.e[d->nr_ul_rnti].i, e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i, e.e[d->nr_ul_harq_pid].i, e.e[d->nr_ul_data].b, - e.e[d->nr_ul_data].bsize, NO_PREAMBLE); + e.e[d->nr_ul_data].bsize); } void nr_dl(void *_d, event e) @@ -494,7 +494,7 @@ void nr_dl(void *_d, event e) e.e[d->nr_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI, e.e[d->nr_dl_rnti].i, e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i, e.e[d->nr_dl_harq_pid].i, e.e[d->nr_dl_data].b, - e.e[d->nr_dl_data].bsize, NO_PREAMBLE); + e.e[d->nr_dl_data].bsize); } void nr_dl_retx(void *_d, event e) @@ -505,7 +505,7 @@ void nr_dl_retx(void *_d, event e) NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i, e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i, e.e[d->nr_dl_retx_harq_pid].i, e.e[d->nr_dl_retx_data].b, - e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE); + e.e[d->nr_dl_retx_data].bsize); } void nr_mib(void *_d, event e) @@ -520,7 +520,7 @@ void nr_mib(void *_d, event e) trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0, e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i, 0 /* harq pid */, - e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE); + e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize); } void nr_ue_mib(void *_d, event e) @@ -535,7 +535,7 @@ void nr_ue_mib(void *_d, event e) trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0, e.e[d->nr_ue_mib_frame].i, e.e[d->nr_ue_mib_slot].i, 0 /* harq pid */, - e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize, NO_PREAMBLE); + e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize); } void nr_rar(void *_d, event e) @@ -545,7 +545,7 @@ void nr_rar(void *_d, event e) trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_RA_RNTI, e.e[d->nr_rar_rnti].i, e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i, 0 /* harq pid */, - e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE); + e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize); } void nr_ue_ul(void *_d, event e) @@ -556,7 +556,7 @@ void nr_ue_ul(void *_d, event e) NR_C_RNTI, e.e[d->nr_ue_ul_rnti].i, e.e[d->nr_ue_ul_frame].i, e.e[d->nr_ue_ul_slot].i, e.e[d->nr_ue_ul_harq_pid].i, e.e[d->nr_ue_ul_data].b, - e.e[d->nr_ue_ul_data].bsize, NO_PREAMBLE); + e.e[d->nr_ue_ul_data].bsize); } void nr_ue_dl(void *_d, event e) @@ -575,7 +575,7 @@ void nr_ue_dl(void *_d, event e) e.e[d->nr_ue_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI, e.e[d->nr_ue_dl_rnti].i, e.e[d->nr_ue_dl_frame].i, e.e[d->nr_ue_dl_slot].i, e.e[d->nr_ue_dl_harq_pid].i, - e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize, NO_PREAMBLE); + e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize); } void nr_ue_rar(void *_d, event e) @@ -584,8 +584,7 @@ void nr_ue_rar(void *_d, event e) trace_nr(e.sending_time, d, DIRECTION_DOWNLINK, RA_RNTI, e.e[d->nr_ue_rar_rnti].i, e.e[d->nr_ue_rar_frame].i, e.e[d->nr_ue_rar_slot].i, 0, - e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize, - NO_PREAMBLE); + e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize); } /****************************************************************************/ @@ -961,7 +960,7 @@ static int sock = -1; void force_stop(int x) { - printf("\ngently quit...\n"); + printf("\ngently quit(%d)...\n", x); close(sock); sock = -1; run = 0; diff --git a/common/utils/T/tracer/packet-mac-lte.h b/common/utils/T/tracer/packet-mac-lte.h index 715bbb68d9..3df8d66314 100644 --- a/common/utils/T/tracer/packet-mac-lte.h +++ b/common/utils/T/tracer/packet-mac-lte.h @@ -27,12 +27,12 @@ /* rntiType */ #define NO_RNTI 0 -#define P_RNTI 1 +#define P_RNTI_T 1 #define RA_RNTI 2 #define C_RNTI 3 -#define SI_RNTI 4 +#define SI_RNTI_T 4 #define SPS_RNTI 5 -#define M_RNTI 6 +#define M_RNTI_T 6 #define SL_BCH_RNTI 7 #define SL_RNTI 8 #define SC_RNTI 9 diff --git a/common/utils/T/tracer/record.c b/common/utils/T/tracer/record.c index 8e222a660f..c636ba3457 100644 --- a/common/utils/T/tracer/record.c +++ b/common/utils/T/tracer/record.c @@ -11,6 +11,7 @@ #include "utils.h" #include "../T_defs.h" #include "configuration.h" +#include "common/platform_types.h" void usage(void) { @@ -39,7 +40,7 @@ static int socket = -1; void force_stop(int x) { - printf("\ngently quit...\n"); + printf("\ngently quit (%d)...\n", x); close(socket); socket = -1; run = 0; diff --git a/common/utils/T/tracer/record_db.cpp b/common/utils/T/tracer/record_db.cpp index de35d84375..0dc304e35a 100644 --- a/common/utils/T/tracer/record_db.cpp +++ b/common/utils/T/tracer/record_db.cpp @@ -249,7 +249,7 @@ static int socket_fd = -1; void force_stop(int x) { - logi("gently quit..."); + logi("gently quit %d", x); close(socket_fd); socket_fd = -1; run = 0; @@ -785,12 +785,7 @@ uint8_t should_insert(EventBuffer &buf) return 0; } -int insert_event(clickhouse_config_t *ch, - void *database, - int event_id, - const char *event_data, - int data_length, - std::chrono::high_resolution_clock::time_point t_start) +int insert_event(clickhouse_config_t *ch, int event_id, const char *event_data, int data_length) { auto t_fn_start = std::chrono::high_resolution_clock::now(); @@ -1270,14 +1265,12 @@ int main(int n, char **v) if (fullread(socket_fd, v + vpos, length) == -1) goto read_error; - auto t_start = std::chrono::high_resolution_clock::now(); - if (type == -1) { append_received_config_chunk(v + vpos, length); } else if (type == -2) { verify_config(); } else if (type >= 0 && type < number_of_events && is_on[type]) { - if (insert_event(&ch_config, database, type, v + vpos, length, t_start) != 0) { + if (insert_event(&ch_config, type, v + vpos, length) != 0) { loge("Failed to insert event type {}", type); } } diff --git a/common/utils/T/tracer/ue.c b/common/utils/T/tracer/ue.c index 336fb22ada..4c1221cafb 100644 --- a/common/utils/T/tracer/ue.c +++ b/common/utils/T/tracer/ue.c @@ -417,7 +417,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database, for (i = 0; i < 8; i++) timeline_set_subline_background_color(g, timeline_plot, i, new_color(g, i==0 || i==4 ? "#aaf" : "#eee")); - timeview = new_view_time(3600, 10, g, timeline_plot); + timeview = new_view_time(10, g, timeline_plot); /* DL tick logging */ timelog = new_timelog(h, database, "UE_PHY_DL_TICK"); subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000); diff --git a/common/utils/T/tracer/vcd.c b/common/utils/T/tracer/vcd.c index aca867661e..8e16a21878 100644 --- a/common/utils/T/tracer/vcd.c +++ b/common/utils/T/tracer/vcd.c @@ -100,7 +100,7 @@ static void vcd_main_gui(gui *g, event_handler *h, void *database) for (i = 0; i < nb_functions; i++) timeline_set_subline_background_color(g, w, i, new_color(g, i & 1 ? "#ddd" : "#eee")); - timeview = new_view_time(3600, 10, g, w); + timeview = new_view_time(10, g, w); i = 0; for (j = 0; j < n; j++) { if (strncmp(ids[j], "VCD_FUNCTION_", 13) != 0) continue; diff --git a/common/utils/T/tracer/view/scrolltti.c b/common/utils/T/tracer/view/scrolltti.c index 8847d123cd..975d4084f6 100644 --- a/common/utils/T/tracer/view/scrolltti.c +++ b/common/utils/T/tracer/view/scrolltti.c @@ -70,6 +70,7 @@ static void *scrolltti_thread(void *_this) static void clear(view *this) { /* TODO */ + UNUSED(this); } static void insert(struct scrolltti *this, double value) diff --git a/common/utils/T/tracer/view/stdout.c b/common/utils/T/tracer/view/stdout.c index bff093ef10..7f039cc3d7 100644 --- a/common/utils/T/tracer/view/stdout.c +++ b/common/utils/T/tracer/view/stdout.c @@ -15,6 +15,7 @@ struct stdout { static void clear(view *this) { /* do nothing */ + UNUSED(this); } static void append(view *_this, char *s) diff --git a/common/utils/T/tracer/view/textlist.c b/common/utils/T/tracer/view/textlist.c index d98d5db2d7..ff73c8b0f0 100644 --- a/common/utils/T/tracer/view/textlist.c +++ b/common/utils/T/tracer/view/textlist.c @@ -71,6 +71,7 @@ static void *textlist_thread(void *_this) static void clear(view *this) { /* TODO */ + UNUSED(this); } static void append(view *_this, char *s) @@ -120,9 +121,11 @@ static void scroll(void *private, gui *g, if (pthread_mutex_unlock(&this->lock)) abort(); } -static void click(void *private, gui *g, - char *notification, widget *w, void *notification_data) +static void click(void *private, gui *g, char *notification, widget *w, void *notification_data) { + UNUSED(notification); + UNUSED(g); + UNUSED(w); struct textlist *this = private; int *d = notification_data; int button = d[1]; diff --git a/common/utils/T/tracer/view/ticktime.c b/common/utils/T/tracer/view/ticktime.c index 9c79e3982f..a92348108d 100644 --- a/common/utils/T/tracer/view/ticktime.c +++ b/common/utils/T/tracer/view/ticktime.c @@ -164,9 +164,10 @@ static void *ticktime_thread(void *_this) return 0; } -static void scroll(void *private, gui *g, - char *notification, widget *w, void *notification_data) +static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data) { + UNUSED(g); + UNUSED(w); struct ticktime *this = private; int *d = notification_data; int x = d[0]; @@ -225,9 +226,11 @@ end: if (pthread_mutex_unlock(&this->lock)) abort(); } -static void click(void *private, gui *g, - char *notification, widget *w, void *notification_data) +static void click(void *private, gui *g, char *notification, widget *w, void *notification_data) { + UNUSED(g); + UNUSED(w); + UNUSED(notification); struct ticktime *this = private; int *d = notification_data; int button = *d; @@ -365,9 +368,9 @@ struct clock_ticktime { struct ticktime *parent; }; -static void clock_append(view *_this, struct timespec t, - int frame, int subframe) +static void clock_append(view *_this, struct timespec t, int frame, int subframe) { + UNUSED(t); struct clock_ticktime *this = (struct clock_ticktime *)_this; struct ticktime *tt = this->parent; int64_t diff; diff --git a/common/utils/T/tracer/view/time.c b/common/utils/T/tracer/view/time.c index 041d0d3a46..d3f52dfc83 100644 --- a/common/utils/T/tracer/view/time.c +++ b/common/utils/T/tracer/view/time.c @@ -156,9 +156,10 @@ static void *time_thread(void *_this) return 0; } -static void scroll(void *private, gui *g, - char *notification, widget *w, void *notification_data) +static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data) { + UNUSED(g); + UNUSED(w); struct time *this = private; int *d = notification_data; int x = d[0]; @@ -217,9 +218,11 @@ end: if (pthread_mutex_unlock(&this->lock)) abort(); } -static void click(void *private, gui *g, - char *notification, widget *w, void *notification_data) +static void click(void *private, gui *g, char *notification, widget *w, void *notification_data) { + UNUSED(g); + UNUSED(w); + UNUSED(notification); struct time *this = private; int *d = notification_data; int button = *d; @@ -228,8 +231,7 @@ static void click(void *private, gui *g, if (button == 1) this->autoscroll = 1; } -view *new_view_time(int number_of_seconds, float refresh_rate, - gui *g, widget *w) +view *new_view_time(float refresh_rate, gui *g, widget *w) { struct time *ret = calloc(1, sizeof(struct time)); if (ret == NULL) abort(); diff --git a/common/utils/T/tracer/view/tti.c b/common/utils/T/tracer/view/tti.c index d7238f0ca7..77fdcccc1f 100644 --- a/common/utils/T/tracer/view/tti.c +++ b/common/utils/T/tracer/view/tti.c @@ -94,6 +94,7 @@ static void *tti_thread(void *_this) static void clear(view *this) { /* TODO */ + UNUSED(this); } static void append(view *_this, int frame, int tick, double value) diff --git a/common/utils/T/tracer/view/view.h b/common/utils/T/tracer/view/view.h index acfc471e1f..1b4596119b 100644 --- a/common/utils/T/tracer/view/view.h +++ b/common/utils/T/tracer/view/view.h @@ -6,6 +6,7 @@ #define _VIEW_H_ #include "gui/gui.h" +#include "common/platform_types.h" /* defines the public API of views */ @@ -19,14 +20,10 @@ enum xy_mode { XY_LOOP_MODE, XY_FORCED_MODE }; view *new_view_stdout(void); view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w); -view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, - int color, enum xy_mode mode); -view *new_view_tti(float refresh_rate, gui *g, widget *w, int color, - int ticks_per_frame); -view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, - int color, widget *throughput_label, int ticks_per_frame); -view *new_view_time(int number_of_seconds, float refresh_rate, - gui *g, widget *w); +view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, int color, enum xy_mode mode); +view *new_view_tti(float refresh_rate, gui *g, widget *w, int color, int ticks_per_frame); +view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, int color, widget *throughput_label, int ticks_per_frame); +view *new_view_time(float refresh_rate, gui *g, widget *w); view *new_subview_time(view *time, int line, int color, int size); view *new_view_ticktime(float refresh_rate, gui *g, widget *w); view *new_subview_ticktime(view *ticktime, int line, int color, int size); diff --git a/common/utils/T/tracer/view/xy.c b/common/utils/T/tracer/view/xy.c index 9b938ae385..b5b93fe528 100644 --- a/common/utils/T/tracer/view/xy.c +++ b/common/utils/T/tracer/view/xy.c @@ -42,6 +42,7 @@ static void *xy_thread(void *_this) static void clear(view *this) { /* TODO */ + UNUSED(this); } static void append_loop(view *_this, float *x, float *y, int length) diff --git a/common/utils/ds/hashtable.c b/common/utils/ds/hashtable.c index 5fb3bbbd3b..c84d332973 100644 --- a/common/utils/ds/hashtable.c +++ b/common/utils/ds/hashtable.c @@ -45,7 +45,10 @@ char *hashtable_rc_code2string(hashtable_rc_t rcP) * hash_free_int_func() is used when this hashtable is used to store int values as data (pointer = value). */ -void hash_free_int_func(void *memoryP) {} +void hash_free_int_func(void *memoryP) +{ + UNUSED(memoryP); +} //------------------------------------------------------------------------------------------------------------------------------- /* diff --git a/common/utils/system.c b/common/utils/system.c index 9672cfd38e..cb6f914f95 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -284,12 +284,8 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, // Legacy, pthread_create + thread_top_init() should be replaced by threadCreate // threadCreate encapsulates the posix pthread api -void thread_top_init(char *thread_name, - int affinity, - uint64_t runtime, - uint64_t deadline, - uint64_t period) { - +void thread_top_init(char *thread_name) +{ int policy, s, j; struct sched_param sparam; char cpu_affinity[1024]; diff --git a/common/utils/system.h b/common/utils/system.h index 8cb856977c..5776971ef2 100644 --- a/common/utils/system.h +++ b/common/utils/system.h @@ -36,11 +36,7 @@ void threadCreate(pthread_t *t, void *(*func)(void *), void *param, char *name, #define OAI_PRIORITY_RT ((sched_get_priority_min(SCHED_OAI)+sched_get_priority_max(SCHED_OAI))/2) #define OAI_PRIORITY_RT_MAX sched_get_priority_max(SCHED_OAI)-2 -void thread_top_init(char *thread_name, - int affinity, - uint64_t runtime, - uint64_t deadline, - uint64_t period); +void thread_top_init(char *thread_name); /**************************************************** * Functions to check system at runtime. diff --git a/common/utils/telnetsrv/telnetsrv.c b/common/utils/telnetsrv/telnetsrv.c index aaf08ff0f7..10edfc6477 100644 --- a/common/utils/telnetsrv/telnetsrv.c +++ b/common/utils/telnetsrv/telnetsrv.c @@ -81,7 +81,6 @@ int get_phybsize(void) { }; int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd ); int setoutput(char *buff, int debug, telnet_printfunc_t prnt); -int wsetoutput(char *buff, int debug, telnet_printfunc_t prnt, ...); int setparam(char *buff, int debug, telnet_printfunc_t prnt); int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...); int history_cmd(char *buff, int debug, telnet_printfunc_t prnt); @@ -245,12 +244,9 @@ void redirstd(char *newfname,telnet_printfunc_t prnt ) { } } -int wsetoutput(char *buffer, int debug, telnet_printfunc_t prnt, ...) +int setoutput(char *buff, int debug, telnet_printfunc_t prnt) { - return 0; -} - -int setoutput(char *buff, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE]; char *logfname; char stdout_str[64]; @@ -288,10 +284,16 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) { int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...) { + UNUSED(buff); + UNUSED(debug); + UNUSED(prnt); return 0; } -int setparam(char *buff, int debug, telnet_printfunc_t prnt) { +int setparam(char *buff, int debug, telnet_printfunc_t prnt) +{ + UNUSED(debug); + UNUSED(prnt); char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE]; memset(cmds,0,sizeof(cmds)); sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] ); @@ -322,7 +324,9 @@ int setparam(char *buff, int debug, telnet_printfunc_t prnt) { return CMDSTATUS_NOTFOUND; } /* setparam */ -int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) { +int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) +{ + UNUSED(debug); char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE]; memset(cmds,0,sizeof(cmds)); sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] ); @@ -502,7 +506,7 @@ void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t pushNotifiedFIFO(cmd->qptr, msg); } -int process_command(char *buf, int iteration) +int process_command(char *buf) { int i,j,k; char modulename[TELNET_CMD_MAXSIZE]; @@ -581,7 +585,7 @@ int process_command(char *buf, int iteration) char tbuff[64]; client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n", get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount ); - process_command(buf + strlen("loop") + 1, lc); + process_command(buf + strlen("loop") + 1); errno=0; int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff)); @@ -710,7 +714,7 @@ void run_telnetsrv(void) { } if (strlen(buf) > 2 ) { - status = process_command(buf, 0); + status = process_command(buf); } else status=CMDSTATUS_NOCMD; diff --git a/common/utils/telnetsrv/telnetsrv_bearer.c b/common/utils/telnetsrv/telnetsrv_bearer.c index 81d52ea271..8628ff45d2 100644 --- a/common/utils/telnetsrv/telnetsrv_bearer.c +++ b/common/utils/telnetsrv/telnetsrv_bearer.c @@ -28,6 +28,7 @@ static int get_single_ue_rnti(void) int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (buf) ERROR_MSG_RET("no parameter allowed\n"); @@ -42,6 +43,7 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt) //void rrc_gNB_trigger_new_bearer(int rnti); int add_bearer(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); int rnti = -1; if (!buf) { rnti = get_single_ue_rnti(); @@ -67,6 +69,7 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt) //void rrc_gNB_trigger_release_bearer(int rnti); int release_bearer(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); int rnti = -1; if (!buf) { rnti = get_single_ue_rnti(); diff --git a/common/utils/telnetsrv/telnetsrv_ci.c b/common/utils/telnetsrv/telnetsrv_ci.c index 84a7abe686..5d92adfc47 100644 --- a/common/utils/telnetsrv/telnetsrv_ci.c +++ b/common/utils/telnetsrv/telnetsrv_ci.c @@ -47,6 +47,7 @@ static int get_single_ue_rnti_mac(void) int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (buf) ERROR_MSG_RET("no parameter allowed\n"); @@ -81,6 +82,7 @@ rrc_gNB_ue_context_t *get_single_rrc_ue(void) int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!RC.nrrrc) ERROR_MSG_RET("no RRC present, cannot list counts\n"); rrc_gNB_ue_context_t *ue = NULL; @@ -119,6 +121,7 @@ int fetch_rnti(char *buf, telnet_printfunc_t prnt) int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!RC.nrmac) ERROR_MSG_RET("no MAC/RLC present, cannot trigger reestablishment\n"); int rnti = fetch_rnti(buf, prnt); @@ -134,6 +137,7 @@ extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id); /** @brief Get connected DU by the UE ID */ int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!RC.nrrrc) ERROR_MSG_RET("no RRC present, cannot list counts\n"); @@ -169,6 +173,7 @@ extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id); */ int rrc_gNB_trigger_f1_ho(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!RC.nrrrc) ERROR_MSG_RET("no RRC present, cannot list counts\n"); rrc_gNB_ue_context_t *ue = NULL; @@ -198,6 +203,7 @@ extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, u * @return 0 on success, -1 on failure */ int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!RC.nrrrc) ERROR_MSG_RET("no RRC present, cannot list counts\n"); @@ -238,6 +244,7 @@ int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt) int force_ul_failure(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!RC.nrmac) ERROR_MSG_RET("no MAC/RLC present, force_ul_failure failed\n"); int rnti = fetch_rnti(buf, prnt); @@ -263,6 +270,7 @@ int force_ue_release(char *buf, int debug, telnet_printfunc_t prnt) static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); int rnti = fetch_rnti(buf, prnt); if (rnti < 0) ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n"); @@ -288,6 +296,7 @@ static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt) * @return 0 on success; negative value on error. */ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (buf == NULL) { ERROR_MSG_RET("Missing input. Usage: trigger_pdu_session_release [ue_id=gNB_ue_ngap_id(int,opt)],pdusession_id(int)[,pdusession_id(int)...]\n"); } @@ -360,6 +369,7 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu static int trigger_bwp_switch(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); char *sbwpId = strtok(buf, " "); int bwpId = atoi(sbwpId); char *srnti = strtok(NULL, " "); diff --git a/common/utils/telnetsrv/telnetsrv_ciUE.c b/common/utils/telnetsrv/telnetsrv_ciUE.c index ac39b4d4f3..650ffd6834 100644 --- a/common/utils/telnetsrv/telnetsrv_ciUE.c +++ b/common/utils/telnetsrv/telnetsrv_ciUE.c @@ -52,6 +52,7 @@ static int get_default_ue_id(void) */ int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); int ue_id = -1; if (!buf) { ERROR_MSG_RET("no UE ID provided to telnet command\n"); @@ -71,6 +72,9 @@ int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt) */ int force_rlf(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); + UNUSED(prnt); NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0); handle_rlf_detection(rrc); return 0; @@ -81,6 +85,9 @@ int force_rlf(char *buf, int debug, telnet_printfunc_t prnt) */ int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); + UNUSED(prnt); NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0); nr_rrc_going_to_IDLE(rrc, OTHER, NULL); return 0; @@ -89,6 +96,9 @@ int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt) /** @brief Trigger RA with Msg3 C-RNTI */ int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); + UNUSED(prnt); NR_UE_MAC_INST_t *mac = get_mac_inst(0); trigger_MAC_UE_RA(mac, NULL); return 0; @@ -96,6 +106,9 @@ int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt) static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); + UNUSED(prnt); MessageDef *msg = itti_alloc_new_message(TASK_NAS_NRUE, 0, NAS_DEREGISTRATION_REQ); NAS_DEREGISTRATION_REQ(msg).cause = AS_DETACH; itti_send_msg_to_task(TASK_NAS_NRUE, 0, msg); @@ -105,6 +118,8 @@ static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt) extern float get_prs_max_dl_toa(prs_meas_t *prs_meas); static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); // TODO multiple antennas, resources, gNBs? int gNB_id = 0; int rsc_id = 0; @@ -124,6 +139,7 @@ static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt) static int add_pdu_session(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); int ue_id = -1; int pdusession_id = -1; diff --git a/common/utils/telnetsrv/telnetsrv_enb_phycmd.c b/common/utils/telnetsrv/telnetsrv_enb_phycmd.c index f860f69a6c..fdcb5f8910 100644 --- a/common/utils/telnetsrv/telnetsrv_enb_phycmd.c +++ b/common/utils/telnetsrv/telnetsrv_enb_phycmd.c @@ -46,11 +46,15 @@ void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) { } void display_uestats(int debug, telnet_printfunc_t prnt, int ue) { + UNUSED(debug); + UNUSED(prnt); + UNUSED(ue); for (int cc=0; cc<1 ; cc++) { } } void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(buf); prnt(" DLSCH kb DLSCH kb/s\n"); dump_uestats(debug, prnt,0); } diff --git a/common/utils/telnetsrv/telnetsrv_measurements.c b/common/utils/telnetsrv/telnetsrv_measurements.c index c9bc48a1e5..08ed347746 100644 --- a/common/utils/telnetsrv/telnetsrv_measurements.c +++ b/common/utils/telnetsrv/telnetsrv_measurements.c @@ -206,6 +206,7 @@ int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt) { } void measurcmd_async_help(telnet_printfunc_t prnt) { + UNUSED(prnt); } int measurcmd_async(char *buf, int debug, telnet_printfunc_t prnt) { diff --git a/common/utils/telnetsrv/telnetsrv_o1.c b/common/utils/telnetsrv/telnetsrv_o1.c index 7bbbf6b15e..42922a5a8a 100644 --- a/common/utils/telnetsrv/telnetsrv_o1.c +++ b/common/utils/telnetsrv/telnetsrv_o1.c @@ -62,6 +62,7 @@ typedef struct ue_stat { static int get_stats(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (buf) ERROR_MSG_RET("no parameter allowed\n"); @@ -209,6 +210,7 @@ static int read_long(const char *buf, const char *end, const char *id, long *val bool running = true; // in the beginning, the softmodem is started automatically static int set_config(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (!buf) ERROR_MSG_RET("need param: o1 config param1 val1 [param2 val2 ...]\n"); if (running) @@ -271,6 +273,7 @@ static int set_config(char *buf, int debug, telnet_printfunc_t prnt) static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); if (running) ERROR_MSG_RET("cannot set parameters while L1 is running\n"); if (!buf) @@ -344,6 +347,8 @@ static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt) extern int stop_L1(module_id_t gnb_id); static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); if (!running) ERROR_MSG_RET("cannot stop, nr-softmodem not running\n"); @@ -366,6 +371,8 @@ static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt) extern int start_L1L2(module_id_t gnb_id); static int start_modem(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); if (running) ERROR_MSG_RET("cannot start, nr-softmodem already running\n"); start_L1L2(0); @@ -377,6 +384,8 @@ static int start_modem(char *buf, int debug, telnet_printfunc_t prnt) extern void du_clear_all_ue_states(); static int remove_mac_ues(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); du_clear_all_ue_states(); prnt("OK\n"); return 0; diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c index fd1d9bc92b..5a9fc0a0ab 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.c +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -36,6 +36,7 @@ void decode_procstat(char *record, int debug, telnet_printfunc_t prnt, webdatadef_t *tdata) { +UNUSED(debug); char prntline[160]; char *procfile_fields; char *strtokptr; @@ -169,10 +170,11 @@ char arecord[1024]; int nullprnt(char *fmt, ...) { + UNUSED(fmt); return 0; } -void proccmd_get_threaddata(char *buf, int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata) +void proccmd_get_threaddata(int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata) { char aname[256]; @@ -222,9 +224,9 @@ char aname[256]; closedir(proc_dir); } /* proccmd_get_threaddata */ -void print_threads(char *buf, int debug, telnet_printfunc_t prnt) +void print_threads(int debug, telnet_printfunc_t prnt) { - proccmd_get_threaddata(buf, debug, prnt, NULL); + proccmd_get_threaddata(debug, prnt, NULL); } #define FLAG_PRINT_DEBUG_DUMP(flag) \ @@ -349,7 +351,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun } } if (strcasestr(cmdbuff, "threadsched") != NULL) { - proccmd_get_threaddata(cmdbuff, debug, prnt, (webdatadef_t *)data); + proccmd_get_threaddata(debug, prnt, (webdatadef_t *)data); } } // show @@ -373,7 +375,7 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) if (debug > 0) prnt(" proccmd_show received %s\n",buf); if (strcasestr(buf,"thread") != NULL) { - print_threads(buf,debug,prnt); + print_threads(debug, prnt); } if (strcasestr(buf,"loglvl") != NULL) { prnt("\n component level enabled output\n"); @@ -466,7 +468,7 @@ if (buf == NULL) { prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2); if(res != 3) { - print_threads(buf, debug, prnt); + print_threads(debug, prnt); return 0; } diff --git a/common/utils/telnetsrv/telnetsrv_rrc.c b/common/utils/telnetsrv/telnetsrv_rrc.c index 8d81606eec..2a678291d7 100644 --- a/common/utils/telnetsrv/telnetsrv_rrc.c +++ b/common/utils/telnetsrv/telnetsrv_rrc.c @@ -53,6 +53,7 @@ static int get_single_ue_id(void) */ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); ue_id_t ue_id = -1; if (!buf) { @@ -91,6 +92,8 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt) */ int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt) { + UNUSED(debug); + UNUSED(buf); rrc_gNB_ue_context_t *ue_context_p = NULL; gNB_RRC_INST *rrc = RC.nrrrc[0]; diff --git a/common/utils/time_manager/time_manager.c b/common/utils/time_manager/time_manager.c index 14f6330ed1..384bcafff3 100644 --- a/common/utils/time_manager/time_manager.c +++ b/common/utils/time_manager/time_manager.c @@ -26,6 +26,7 @@ static int tick_functions_count; */ static void tick(void *unused) { + UNUSED(unused); for (int i = 0; i < tick_functions_count; i++) tick_functions[i](); } diff --git a/common/utils/time_meas.c b/common/utils/time_meas.c index c2ebe7fc00..8c5378ec99 100644 --- a/common/utils/time_meas.c +++ b/common/utils/time_meas.c @@ -35,10 +35,9 @@ double get_cpu_freq_GHz(void) -void print_meas_now(time_stats_t *ts, - const char *name, - FILE *file_name) +void print_meas_now(time_stats_t *ts, const char *name, FILE *file_name) { + UNUSED(name); if (cpu_meas_enabled) { //static double cpu_freq_GHz = 3.2; diff --git a/executables/lte-enb.c b/executables/lte-enb.c index cde96614a4..b62815b70a 100644 --- a/executables/lte-enb.c +++ b/executables/lte-enb.c @@ -259,7 +259,7 @@ static void *L1_thread_tx(void *param) { PHY_VARS_eNB *eNB = eNB_proc->eNB; char thread_name[100]; sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1); - thread_top_init(thread_name,1,470000,500000,500000); + thread_top_init(thread_name); int ret; //wait_sync("tx_thread"); @@ -342,7 +342,7 @@ static void *L1_thread( void *param ) { } } #else - thread_top_init(thread_name,1,470000,500000,500000); + thread_top_init(thread_name); #endif LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid)); @@ -699,7 +699,7 @@ static void *eNB_thread_prach( void *param ) { L1_proc_t *proc = &eNB->proc; // set default return value eNB_thread_prach_status = 0; - thread_top_init("eNB_thread_prach",1,500000,1000000,20000000); + thread_top_init("eNB_thread_prach"); //wait_sync("eNB_thread_prach"); @@ -732,7 +732,7 @@ static void *eNB_thread_prach_br( void *param ) { L1_proc_t *proc = &eNB->proc; // set default return value eNB_thread_prach_status = 0; - thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000); + thread_top_init("eNB_thread_prach_br"); while (!oai_exit) { if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break; diff --git a/executables/lte-ru.c b/executables/lte-ru.c index 708b363e21..91470d8f63 100644 --- a/executables/lte-ru.c +++ b/executables/lte-ru.c @@ -778,7 +778,7 @@ static void *ru_thread_asynch_rxtx( void *param ) { RU_t *ru = (RU_t *)param; RU_proc_t *proc = &ru->proc; int subframe=0, frame=0; - thread_top_init("ru_thread_asynch_rxtx",1,870000,1000000,1000000); + thread_top_init("ru_thread_asynch_rxtx"); // wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe wait_sync("ru_thread_asynch_rxtx"); // wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe @@ -869,7 +869,7 @@ void *ru_thread_prach( void *param ) { RU_proc_t *proc = (RU_proc_t *)&ru->proc; // set default return value ru_thread_prach_status = 0; - thread_top_init("ru_thread_prach",1,500000,1000000,20000000); + thread_top_init("ru_thread_prach"); //wait_sync("ru_thread_prach"); while (*ru->ru_mask>0 && ru->function!=eNodeB_3GPP) { @@ -919,7 +919,7 @@ void *ru_thread_prach_br( void *param ) { RU_proc_t *proc = (RU_proc_t *)&ru->proc; // set default return value ru_thread_prach_status = 0; - thread_top_init("ru_thread_prach_br",1,500000,1000000,20000000); + thread_top_init("ru_thread_prach_br"); //wait_sync("ru_thread_prach_br"); while (!oai_exit) { @@ -1411,7 +1411,7 @@ static void *ru_thread_tx( void *param ) { L1_rxtx_proc_t *L1_proc; cpu_set_t cpuset; CPU_ZERO(&cpuset); - thread_top_init("ru_thread_tx",1,400000,500000,500000); + thread_top_init("ru_thread_tx"); //CPU_SET(5, &cpuset); //pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); //wait_sync("ru_thread_tx"); @@ -1518,7 +1518,7 @@ static void *ru_thread( void *param ) { dlsch_ue_select_tbl_in_use = 1; #endif // set default return value - thread_top_init("ru_thread",1,400000,500000,500000); + thread_top_init("ru_thread"); //CPU_SET(1, &cpuset); //pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); pthread_setname_np( pthread_self(),"ru thread"); @@ -1799,7 +1799,7 @@ static void *ru_thread_synch(void *arg) { int64_t peak_val, avg; static int ru_thread_synch_status = 0; int cnt=0; - thread_top_init("ru_thread_synch",0,5000000,10000000,10000000); + thread_top_init("ru_thread_synch"); wait_sync("ru_thread_synch"); // initialize variables for PSS detection ru_sync_time_init(ru); //lte_sync_time_init(ru->frame_parms); @@ -1873,7 +1873,7 @@ void *pre_scd_thread( void *param ) { frame = 0; subframe = 4; - thread_top_init("pre_scd_thread",0,870000,1000000,1000000); + thread_top_init("pre_scd_thread"); while (!oai_exit) { if(oai_exit) { @@ -1933,7 +1933,7 @@ static void *eNB_thread_phy_tx( void *param ) { // set default return value eNB_thread_phy_tx_status = 0; int ret; - thread_top_init("eNB_thread_phy_tx",1,500000L,1000000L,20000000L); + thread_top_init("eNB_thread_phy_tx"); while (!oai_exit) { if (oai_exit) break; @@ -1988,7 +1988,7 @@ static void *rf_tx( void *param ) { RU_proc_t *proc = &ru->proc; // set default return value rf_tx_status = 0; - thread_top_init("rf_tx",1,500000L,1000000L,20000000L); + thread_top_init("rf_tx"); while (!oai_exit) { if (oai_exit) break; diff --git a/executables/lte-ue.c b/executables/lte-ue.c index ccdf2d5525..0b4eff8837 100644 --- a/executables/lte-ue.c +++ b/executables/lte-ue.c @@ -881,7 +881,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) { } } #else - thread_top_init("UE_phy_stub_thread_rxn_txnp4", 1, 870000L, 1000000L, 1000000L); + thread_top_init("UE_phy_stub_thread_rxn_txnp4"); #endif // for multipule UE's L2-emulator //module_id_t Mod_id = 0; @@ -1235,7 +1235,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) { static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) { #if 0 // TODO: doesn't currently compile, obviated by multi-ue proxy - thread_top_init("UE_phy_stub_thread_rxn_txnp4",1,870000L,1000000L,1000000L); + thread_top_init("UE_phy_stub_thread_rxn_txnp4"); // for multipule UE's L2-emulator //module_id_t Mod_id = 0; //int init_ra_UE = -1; // This counter is used to initiate the RA of each UE in different SFrames @@ -2227,7 +2227,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, //02/02/2018 static void *timer_thread( void *param ) { - thread_top_init("timer_thread",1,870000L,1000000L,1000000L); + thread_top_init("timer_thread"); timer_subframe =9; timer_frame =1023; //phy_stub_ticking = (SF_ticking*)malloc(sizeof(SF_ticking)); diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 93b7ad1074..4fa2d3539c 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -140,8 +140,9 @@ static bool pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP, uint8_t *const kRRCint_pP, uint8_t *const kUPenc_pP); -void *pdcp_stats_thread(void *param) { - +void *pdcp_stats_thread(void *param) +{ + UNUSED(param); FILE *fd; int old_byte_cnt[MAX_MOBILES_PER_ENB][NB_RB_MAX],old_byte_cnt_rx[MAX_MOBILES_PER_ENB][NB_RB_MAX]; for (int i=0;irnti); /* what to do in case of failure? for the moment: nothing */ } diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 3a7b453bd0..2587541622 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -88,8 +88,6 @@ static const float RSRQ_meas_mapping[35] = {-19, -18.5, -18, -17.5, -17, -16.5, extern void pdcp_config_set_security( const protocol_ctxt_t *const ctxt_pP, pdcp_t *const pdcp_pP, - const rb_id_t rb_idP, - const uint16_t lc_idP, const uint8_t security_modeP, uint8_t *const kRRCenc, uint8_t *const kRRCint, @@ -1514,7 +1512,7 @@ rrc_ue_process_securityModeCommand( derive_key_nas(UP_ENC_ALG, UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm, UE_rrc_inst[ctxt_pP->module_id].kenb, kUPenc); if (securityMode != 0xff) { - pdcp_config_set_security(ctxt_pP, pdcp_p, 0, 0, + pdcp_config_set_security(ctxt_pP, pdcp_p, UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm | (UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4), kRRCenc, kRRCint, kUPenc); diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index b07e50ac7d..7c1f9d5b5d 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -502,8 +502,6 @@ rrc_pdcp_config_security( pdcp_config_set_security( ctxt_pP, pdcp_p, - DCCH, - DCCH+2, (send_security_mode_command == true) ? 0 | (ue_context_pP->ue_context.integrity_algorithm << 4) : (ue_context_pP->ue_context.ciphering_algorithm ) | From b10864c2e89d172e5faed20542e2d7190cbe3c8f Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 16 Mar 2026 18:39:45 +0100 Subject: [PATCH 13/37] add flag for unused function arguments in openair3 folder CMakeLists --- openair3/CMakeLists.txt | 1 + openair3/NAS/CMakeLists.txt | 1 - openair3/NRPPA/nrppa_gNB.c | 2 ++ openair3/UICC/pdu_session.c | 1 + openair3/ocp-gtpu/gtp_itf.cpp | 22 ++++++++++++++-------- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/openair3/CMakeLists.txt b/openair3/CMakeLists.txt index c3b3756362..e31761006e 100644 --- a/openair3/CMakeLists.txt +++ b/openair3/CMakeLists.txt @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 +add_compile_options(-Wunused-parameter) add_subdirectory(LPP) add_subdirectory(ocp-gtpu) add_subdirectory(M3AP) diff --git a/openair3/NAS/CMakeLists.txt b/openair3/NAS/CMakeLists.txt index ff9a1bcf99..39bfc888dd 100644 --- a/openair3/NAS/CMakeLists.txt +++ b/openair3/NAS/CMakeLists.txt @@ -1,6 +1,5 @@ # SPDX-License-Identifier: LicenseRef-CSSL-1.0 -add_compile_options(-Wunused-parameter) add_subdirectory(COMMON) add_subdirectory(NR_UE) add_subdirectory(UE) diff --git a/openair3/NRPPA/nrppa_gNB.c b/openair3/NRPPA/nrppa_gNB.c index b315eacb37..4c11686b16 100644 --- a/openair3/NRPPA/nrppa_gNB.c +++ b/openair3/NRPPA/nrppa_gNB.c @@ -24,6 +24,7 @@ void nrppa_gNB_init(void) void *nrppa_gNB_process_itti_msg(void *notUsed) { + UNUSED(notUsed); MessageDef *received_msg = NULL; int result; itti_receive_msg(TASK_NRPPA, &received_msg); @@ -65,6 +66,7 @@ void *nrppa_gNB_process_itti_msg(void *notUsed) void *nrppa_gNB_task(void *arg) { + UNUSED(arg); nrppa_gNB_init(); while (1) { diff --git a/openair3/UICC/pdu_session.c b/openair3/UICC/pdu_session.c index 879eabebdf..7cc22ae054 100644 --- a/openair3/UICC/pdu_session.c +++ b/openair3/UICC/pdu_session.c @@ -42,6 +42,7 @@ static int config_check_dnn(configmodule_interface_t *cfg, paramdef_t *param) { + UNUSED(cfg); const char *dnn = *param->strptr; int dnn_len = strlen(dnn); if (dnn_len > 102) { diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 69ed55c0ae..78f48feac9 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -908,6 +908,9 @@ int gtpv1u_create_x2u_tunnel(const instance_t instanceP, const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP) { + UNUSED(instanceP); + UNUSED(create_tunnel_req_pP); + UNUSED(create_tunnel_resp_pP); AssertFatal(false, "to be developped\n"); } @@ -1002,6 +1005,8 @@ int gtpv1u_delete_all_s1u_tunnel(const instance_t instance, const rnti_t rnti) int gtpv1u_delete_x2u_tunnel(const instance_t instanceP, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + UNUSED(instanceP); + UNUSED(req_pP); LOG_E(GTPU, "x2 tunnel not implemented\n"); return 0; } @@ -1013,7 +1018,7 @@ static gtpv1u_bearer_t create_bearer(int socket, const struct sockaddr_in *addr, return bearer; } -static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, const struct sockaddr_in *addr) +static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, const struct sockaddr_in *addr) { Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *)msgBuf; @@ -1041,7 +1046,7 @@ static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, const 0); } -static int Gtpv1uHandleError(int h, uint8_t *msgBuf, uint32_t msgBufLen, const struct sockaddr_in *addr) +static int Gtpv1uHandleError(uint8_t *msgBuf, uint32_t msgBufLen) { if (msgBufLen < sizeof(Gtpv1uError)) LOG_E(GTPU, "Received GTP error indication with truncated size %u (mini size: %lu)\n", msgBufLen,sizeof(Gtpv1uError)+4); @@ -1063,7 +1068,7 @@ static int Gtpv1uHandleError(int h, uint8_t *msgBuf, uint32_t msgBufLen, const s return rc; } -static int Gtpv1uHandleSupportedExt(int h, uint8_t *msgBuf, uint32_t msgBufLen, const sockaddr_in *addr) +static int Gtpv1uHandleSupportedExt() { LOG_E(GTPU, "Supported extensions to be dev\n"); int rc = GTPNOK; @@ -1073,7 +1078,7 @@ static int Gtpv1uHandleSupportedExt(int h, uint8_t *msgBuf, uint32_t msgBufLen, // When end marker arrives, we notify the client with buffer size = 0 // The client will likely call "delete tunnel" // nevertheless we don't take the initiative -static int Gtpv1uHandleEndMarker(int h, uint8_t *msgBuf, uint32_t msgBufLen, const sockaddr_in *addr) +static int Gtpv1uHandleEndMarker(int h, uint8_t *msgBuf) { Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *)msgBuf; @@ -1302,19 +1307,19 @@ static bool gtpv1uReceiveHandleMessage(int h) break; case GTP_ECHO_REQ: - Gtpv1uHandleEchoReq(h, udpData, udpDataLen, &addr); + Gtpv1uHandleEchoReq(h, udpData, &addr); break; case GTP_ERROR_INDICATION: - Gtpv1uHandleError(h, udpData, udpDataLen, &addr); + Gtpv1uHandleError(udpData, udpDataLen); break; case GTP_SUPPORTED_EXTENSION_HEADER_INDICATION: - Gtpv1uHandleSupportedExt(h, udpData, udpDataLen, &addr); + Gtpv1uHandleSupportedExt(); break; case GTP_END_MARKER: - Gtpv1uHandleEndMarker(h, udpData, udpDataLen, &addr); + Gtpv1uHandleEndMarker(h, udpData); break; case GTP_GPDU: @@ -1351,6 +1356,7 @@ static void gtpv1uReceiverCancel(pthread_t t) void *gtpv1uTask(void *args) { + UNUSED(args); while (1) { /* Trying to fetch a message from the message queue. If the queue is empty, this function will block till a From 10d386ef7511de078547ec184e0264c888acafe0 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 19 Mar 2026 19:37:40 +0100 Subject: [PATCH 14/37] some more additional fix for unused arguments --- .../PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c | 7 +------ openair1/PHY/LTE_ESTIMATION/lte_estimation.h | 1 - .../PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c | 1 - openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c | 9 +-------- openair1/PHY/LTE_REFSIG/lte_refsig.h | 8 +------- openair1/PHY/LTE_TRANSPORT/dci_tools_common.c | 7 ------- openair1/PHY/LTE_TRANSPORT/transport_common_proto.h | 7 ------- openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c | 3 --- openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c | 7 ------- openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 7 ------- openair1/PHY/NR_UE_TRANSPORT/csi_rx.c | 2 -- openair1/SIMULATION/NR_PHY/nr_unitary_defs.h | 11 +---------- openair2/UTIL/OPT/probe.c | 4 +++- 13 files changed, 7 insertions(+), 67 deletions(-) diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index 3fb09e2ed7..6e2e515ac8 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -152,12 +152,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, } // generate pilot - lte_dl_cell_spec_rx(ue, - eNB_offset, - &pilot[p][0], - Ns, - (l==0)?0:1, - p); + lte_dl_cell_spec_rx(ue, eNB_offset, &pilot[p][0], Ns, (l == 0) ? 0 : 1); for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { c16_t *pil = (c16_t *)&pilot[p][0]; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h index 7d3d23d087..df9bcedb80 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h +++ b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h @@ -180,7 +180,6 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, c16_t **ul_ch_estimates, c16_t **ul_ch_estimates_time, c16_t **rxdataF_ext, - module_id_t UE_id, uint8_t l, uint8_t Ns); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 985a2a7f8a..55c08c8024 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -56,7 +56,6 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, c16_t **ul_ch_estimates, c16_t **ul_ch_estimates_time, c16_t **rxdataF_ext, - module_id_t UE_id, unsigned char l, unsigned char Ns) { diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c index 2bf7385cb3..6903a9987b 100644 --- a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c +++ b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c @@ -174,15 +174,8 @@ int lte_dl_cell_spec(PHY_VARS_eNB *eNB, return(0); } -int lte_dl_cell_spec_rx(PHY_VARS_UE *ue, - uint8_t eNB_offset, - int *output, - unsigned char Ns, - unsigned char l, - unsigned char p) +int lte_dl_cell_spec_rx(PHY_VARS_UE *ue, uint8_t eNB_offset, int *output, unsigned char Ns, unsigned char l) { - - unsigned char mprime,mprime_dword,mprime_qpsk_symb,m; unsigned short k=0; unsigned int qpsk[4]; diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 0521c9d3a5..77f91d0558 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -108,14 +108,8 @@ int lte_dl_mbsfn_khz_1dot25(PHY_VARS_eNB *phy_vars_eNB, int32_t *output, @param output Output vector for OFDM symbol (Frequency Domain) @param Ns Slot number (0..19) @param l symbol (0,1) - Note 1 means 3! -@param p antenna intex */ -int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue, - uint8_t eNB_offset, - int *output, - unsigned char Ns, - unsigned char l, - unsigned char p); +int lte_dl_cell_spec_rx(PHY_VARS_UE *ue, uint8_t eNB_offset, int *output, unsigned char Ns, unsigned char l); /*!\brief This function generates the ue-specific reference signal * sequence (36-211, Sec 6.10.3.1) for beamforming channel estimation upon reception diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c index 21e752c09b..b16c0a8022 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c @@ -834,13 +834,6 @@ void generate_RIV_tables(void) // n_tilde_PRB(2,3) = (3,5) // n_tilde_PRB(0,1) = (0,2) -uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci) -{ - - return(localRIV2alloc_LUT25[rb_alloc_dci]); - -} - uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t subframe) { uint8_t ret = 255; diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index 8bc71e5536..f8d64d0582 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -53,13 +53,6 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb); */ uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap); -/* \brief Return prb for a given vrb index - @param vrb_type VRB type (0=localized,1=distributed) - @param rb_alloc_dci rballoc field from DCI -*/ -uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci); - - /* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type @returns Transmission mode (1-7) */ diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c index ff456eed44..bc57ac5f81 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c @@ -384,7 +384,6 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, int32_t **rxdataF_comp, LTE_DL_FRAME_PARMS *frame_parms, uint8_t symbol, - uint8_t Qm, uint16_t nb_rb, uint8_t output_shift) { @@ -518,7 +517,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB, (c16_t **)eNB->pusch_vars[UE_id]->drs_ch_estimates, (c16_t **)eNB->pusch_vars[UE_id]->drs_ch_estimates_time, (c16_t **)eNB->pusch_vars[UE_id]->rxdataF_ext, - UE_id, l % (frame_parms->symbols_per_tti / 2), l / (frame_parms->symbols_per_tti / 2)); } @@ -599,7 +597,6 @@ void rx_ulsch(PHY_VARS_eNB *eNB, pusch_vars->rxdataF_comp, frame_parms, l, - Qm, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, log2_maxh); // log2_maxh+I0_shift diff --git a/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c index ce0ef00d11..f6ca3157d5 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c @@ -135,13 +135,6 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms, return(0); } -int generate_srs_tx_emul(PHY_VARS_UE *phy_vars_ue,uint8_t subframe) -{ - - LOG_D(PHY,"[UE] generate_srs_tx_emul for subframe %d\n",subframe); - return(0); -} - #ifdef MAIN main() { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index af1546a43e..2fe85fdf39 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -944,13 +944,6 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb); @return Transport block size */ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb); -/* \brief Return prb for a given vrb index - @param vrb_type VRB type (0=localized,1=distributed) - @param rb_alloc_dci rballoc field from DCI -*/ -uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci); - - /* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type @returns Transmission mode (1-7) */ diff --git a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c index 5d35e385e3..eba54c8e5f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c +++ b/openair1/PHY/NR_UE_TRANSPORT/csi_rx.c @@ -253,7 +253,6 @@ uint32_t calc_power_csirs(const uint16_t *x, const fapi_nr_dl_config_csirs_pdu_r static int nr_csi_rs_channel_estimation( const NR_DL_FRAME_PARMS *fp, - const UE_nr_rxtx_proc_t *proc, const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, const nr_csi_info_t *nr_csi_info, const c16_t **csi_rs_generated_signal, @@ -898,7 +897,6 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, // if we need to measure only RSRP no need to do channel estimation if (csirs_config_pdu->measurement_bitmap > 1) nr_csi_rs_channel_estimation(frame_parms, - proc, csirs_config_pdu, csi_info, (const c16_t **)csi_info->csi_rs_generated_signal, diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h index f70082fc86..09aec413e8 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h @@ -21,6 +21,7 @@ int oai_exit = 0; void exit_function(const char *file, const char *function, const int line, const char *s, const int assert) { + UNUSED(assert); const char *msg = s == NULL ? "no comment" : s; printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg); exit(-1); @@ -41,16 +42,6 @@ signed char quantize(double D, double x, unsigned char B) return ((char)qxd); } -int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) -{ - return (0); -} -// NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);} -int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) -{ - return (0); -} - void stop_nr_nfapi_vnf() { abort(); diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index eb522d4bd4..4190c8e106 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -189,7 +189,9 @@ static int PCAP_WritePDU(const uint8_t *PDU, return length; } -static void *opt_listener_thread(void *arg) { +static void *opt_listener_thread(void *arg) +{ + UNUSED(arg); ssize_t ret; struct sockaddr_in from_address; socklen_t socklen = sizeof(from_address); From 2cb9dc6bcde966ed2f690d21d7cc73c39d8e2f11 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 27 Mar 2026 09:49:36 +0100 Subject: [PATCH 15/37] handle unused sched_pusch in rx_sdu function --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index a223684741..a095c61ecb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -944,7 +944,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, UE_scheduling_control->ta_update = timing_advance; const NR_sched_pusch_t *sched_pusch = &UE_scheduling_control->ul_harq_processes[harq_pid].sched_pusch; - (void) sched_pusch; // avoids warnings of unused sched_pusch when compiling without T + UNUSED(sched_pusch); // avoids warnings of unused sched_pusch when compiling without T T(T_GNB_MAC_PUSCH_POWER_CONTROL, T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(pusch_snrx10), T_INT(UE_scheduling_control->ph), From 6556c8869427b4bfa325135fa91a97e369c9e654 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 2 Apr 2026 21:41:18 +0200 Subject: [PATCH 16/37] nr rlc: tolerate bogus data Some unfriendly entity may play with the RLC module and send bogus data to trigger funky behaviors here and there. A report sent by Dhanish, India, indentifies one such issue. From analyzing this report, a possible scenario is the following. Unfriendly entity sends an RLC PDU with: is_first=0 is_last=0 so=15 lenght of data, whatever, let's say 1. This PDU is put in the RX list. Then later it sends another PDU (for the same SN, obviously), with: is_first=1 is_last=1 so=0 (well, since is_first=1, necessarily so=0; it is not transmitted, see 38.322 6.2.2.3 for UM and 38.322 6.2.2.4 for AM) length=10, let's say. This PDU is also put in the RX list, before the previous one. Then the function sdu_full() returns 1, so reassemble_and_deliver() is called and the 'while (pdu)' loop is executed for both PDUs. When the second (bogus one) is processed, so==10 (after processing the first PDU) and the line: int len = pdu->size - (so - pdu->so) is: int len = 1 - (10 - 15) which is not good. So we detect the case 'pdu->so > so' and reject the SDU. We could label the other entity as bogus, since no standard RLC implementation will produce such a case, but let's remain friendly, even with unfriendly entities. (To be changed later if needed.) The problem was reported for RLC AM but is also present in RLC UM. (Not in RLC TM, where there is no segmentation.) Note: according to the report, this bug was found using a fuzzer described as 'AI-assisted custom 5G NR protocol fuzzer'. It had to be said. --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 6 ++++++ openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index f7ede089a5..62c1fa90c6 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -185,6 +185,12 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn) /* reassemble - free 'data' of each segment after processing */ while (pdu != NULL) { + if (pdu->so > so && !bad_sdu) { + /* pdu->so > so is possible when the other end sends bogus data */ + LOG_E(RLC, "%s:%d:%s: inconsistent SDU, discarding\n", + __FILE__, __LINE__, __FUNCTION__); + bad_sdu = 1; + } int len = pdu->size - (so - pdu->so); if (so + len > NR_SDU_MAX && !bad_sdu) { LOG_E(RLC, "%s:%d:%s: bad SDU, too big, discarding\n", diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c index b0ada2e514..a12c991f82 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_um.c @@ -139,6 +139,12 @@ static void reassemble_and_deliver(nr_rlc_entity_um_t *entity, int sn) /* reassemble - free 'data' of each segment after processing */ while (pdu != NULL && pdu->sn == sn) { + if (pdu->so > so && !bad_sdu) { + /* pdu->so > so is possible when the other end sends bogus data */ + LOG_E(RLC, "%s:%d:%s: inconsistent SDU, discarding\n", + __FILE__, __LINE__, __FUNCTION__); + bad_sdu = 1; + } int len = pdu->size - (so - pdu->so); if (so + len > NR_SDU_MAX && !bad_sdu) { LOG_E(RLC, "%s:%d:%s: bad SDU, too big, discarding\n", From 5d8e79521efacbcaad873ce538ed48c1954a1cf2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 17 Mar 2026 15:58:34 +0100 Subject: [PATCH 17/37] some cleanup and improvements for default PUCCH on gNB --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 42 +++++++------------ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 - 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 20e92f7130..c8979b338d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1287,13 +1287,6 @@ const int default_pucch_numbsymb[] = {2,2,2,2,4,4,4,4,10,10,10,10,14,14,14,14,1 const int default_pucch_prboffset[] = {0,0,3,0,0,2,4,0,0,2,4,0,0,2,4,-1}; const int default_pucch_csset[] = {2,3,3,2,4,4,4,2,4,4,4,2,4,4,4,4}; -int nr_get_default_pucch_res(int pucch_ResourceCommon) { - - AssertFatal(pucch_ResourceCommon>=0 && pucch_ResourceCommon < 16, "illegal pucch_ResourceCommon %d\n",pucch_ResourceCommon); - - return(default_pucch_csset[pucch_ResourceCommon]); -} - void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, NR_sched_pdcch_t *pdcch) { pdcch_pdu->BWPSize = pdcch->BWPSize; @@ -1543,13 +1536,17 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t *pucch_pdu, pucch_pdu->freq_hop_flag = 1; pucch_pdu->second_hop_prb = second_hop_prb; pucch_pdu->format_type = default_pucch_fmt[rsetindex]; - pucch_pdu->initial_cyclic_shift = r_pucch%default_pucch_csset[rsetindex]; - if (rsetindex==3||rsetindex==7||rsetindex==11) pucch_pdu->initial_cyclic_shift*=6; - else if (rsetindex==1||rsetindex==2) pucch_pdu->initial_cyclic_shift*=4; - else pucch_pdu->initial_cyclic_shift*=3; + int initial_cyclic_shift_idx = (r_pucch % 8) % default_pucch_csset[rsetindex]; + if (rsetindex == 3 || rsetindex == 7 || rsetindex == 11) + pucch_pdu->initial_cyclic_shift = initial_cyclic_shift_idx * 6; + else if (rsetindex == 1 || rsetindex == 2) + pucch_pdu->initial_cyclic_shift = initial_cyclic_shift_idx * 4; + else + pucch_pdu->initial_cyclic_shift = initial_cyclic_shift_idx * 3; pucch_pdu->nr_of_symbols = nr_of_symb; pucch_pdu->start_symbol_index = start_symb; - if (pucch_pdu->format_type == 1) pucch_pdu->time_domain_occ_idx = 0; // check this!! + if (pucch_pdu->format_type == 1) + pucch_pdu->time_domain_occ_idx = 0; // check this!! pucch_pdu->sr_flag = O_sr; pucch_pdu->prb_size=1; } @@ -1567,21 +1564,14 @@ void set_r_pucch_parms(int rsetindex, int *prb_start, int *second_hop_prb, int *nr_of_symbols, - int *start_symbol_index) { - + int *start_symbol_index) +{ // procedure described in 38.213 section 9.2.1 - - int prboffset = r_pucch/default_pucch_csset[rsetindex]; - int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex]; - - *prb_start = (r_pucch>>3)==0 ? - default_pucch_prboffset[rsetindex] + prboffset: - bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8; - - *second_hop_prb = (r_pucch>>3)==0? - bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset: - default_pucch_prboffset[rsetindex] + prboffsetm8; - + int prboffset = (r_pucch % 8) / default_pucch_csset[rsetindex]; + int offset1 = default_pucch_prboffset[rsetindex] + prboffset; + int offset2 = bwp_size - 1 - default_pucch_prboffset[rsetindex] - prboffset; + *prb_start = (r_pucch >> 3) == 0 ? offset1 : offset2; + *second_hop_prb = (r_pucch >> 3) == 0 ? offset2 : offset1; *nr_of_symbols = default_pucch_numbsymb[rsetindex]; *start_symbol_index = default_pucch_firstsymb[rsetindex]; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 433bb4aa32..69658709a7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -298,7 +298,6 @@ bool add_connected_nr_ue(gNB_MAC_INST *nr_mac, NR_UE_info_t *UE); bool nr_check_Msg4_MsgB_Ack(module_id_t module_id, frame_t frame, slot_t slot, NR_UE_info_t *UE, bool success); void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti); NR_UE_info_t *get_new_nr_ue_inst(uid_allocator_t *uia, rnti_t rnti, NR_CellGroupConfig_t *CellGroup, const nr_mac_config_t *config); -int nr_get_default_pucch_res(int pucch_ResourceCommon); nfapi_nr_pusch_pdu_t *prepare_pusch_pdu(nfapi_nr_ul_tti_request_t *future_ul_tti_req, const NR_UE_info_t *UE, const NR_ServingCellConfigCommon_t *scc, From f55e26a25e78dd3a41eb996eda6a59b11a8acc55 Mon Sep 17 00:00:00 2001 From: Karim Boutiba Date: Thu, 26 Mar 2026 14:42:50 +0100 Subject: [PATCH 18/37] Adding Microamp FR2 RU configuration file and updating documentation --- doc/ORAN_FHI7.2_Tutorial.md | 76 +++++ ....sa.band257.132prb.fhi72.2x2-microamp.conf | 281 ++++++++++++++++++ 2 files changed, 357 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md index b5f15ea9be..7ce6327006 100644 --- a/doc/ORAN_FHI7.2_Tutorial.md +++ b/doc/ORAN_FHI7.2_Tutorial.md @@ -627,6 +627,82 @@ eAXC_id 0 1 # set PRACH eAxC IDs ... ``` +#### MICROAMP FR2 + + +Interaction with RU is performed using `rucfg` utility provided by Microamp. + +To check PTP status, you can use `rucfg ptp`. the output should be similar to: +```bash +[INFO] Check if RU is available +[INFO] RU available +[INFO] Check SSH to RU available +[INFO] SSH to RU available +[INFO] Getting PTP status +[INFO] ptp4l status = +{ +Feb 12 16:26:02 bbv1 ptp4l[23822]: ptp4l[6280.658]: rms 0 max 1 freq +2 +/- 7 delay 1184 +/- 0 +Feb 12 16:26:00 bbv1 ptp4l[23822]: ptp4l[6279.535]: rms 0 max 1 freq -8 +/- 13 delay 1184 +/- 0 +Feb 12 16:25:59 bbv1 ptp4l[23822]: ptp4l[6278.413]: rms 1 max 1 freq -35 +/- 13 delay 1184 +/- 0 +Feb 12 16:25:58 bbv1 ptp4l[23822]: ptp4l[6277.290]: rms 0 max 1 freq -68 +/- 9 delay 1184 +/- 0 +Feb 12 16:25:57 bbv1 ptp4l[23822]: ptp4l[6276.167]: rms 1 max 1 freq -69 +/- 10 delay 1184 +/- 0 +Feb 12 16:25:56 bbv1 ptp4l[23822]: ptp4l[6275.044]: rms 0 max 1 freq -46 +/- 9 delay 1184 +/- 0 +Feb 12 16:25:55 bbv1 ptp4l[23822]: ptp4l[6273.921]: rms 1 max 1 freq -65 +/- 10 delay 1184 +/- 0 +Feb 12 16:25:54 bbv1 ptp4l[23822]: ptp4l[6272.800]: rms 0 max 1 freq -91 +/- 6 delay 1184 +/- 0 +Feb 12 16:25:53 bbv1 ptp4l[23822]: ptp4l[6271.677]: rms 4 max 17 freq -107 +/- 48 delay 1184 +/- 0 +Feb 12 16:25:52 bbv1 ptp4l[23822]: ptp4l[6270.554]: rms 6 max 17 freq +179 +/- 106 delay 1184 +/- 0 +Feb 12 16:25:50 bbv1 ptp4l[23822]: ptp4l[6269.431]: rms 1 max 2 freq +191 +/- 12 delay 1184 +/- 0 +Feb 12 16:25:49 bbv1 ptp4l[23822]: ptp4l[6268.308]: rms 1 max 1 freq +119 +/- 21 delay 1184 +/- 0 +Feb 12 16:25:48 bbv1 ptp4l[23822]: ptp4l[6267.186]: rms 1 max 1 freq +103 +/- 13 delay 1184 +/- 0 +Feb 12 16:25:47 bbv1 ptp4l[23822]: ptp4l[6266.063]: rms 7 max 17 freq -101 +/- 160 delay 1184 +/- 0 +Feb 12 16:25:46 bbv1 ptp4l[23822]: ptp4l[6264.940]: rms 7 max 17 freq -65 +/- 154 delay 1184 +/- 0 +Feb 12 16:25:45 bbv1 ptp4l[23822]: ptp4l[6263.817]: rms 1 max 2 freq +176 +/- 33 delay 1183 +/- 0 +Feb 12 16:25:44 bbv1 ptp4l[23822]: ptp4l[6262.695]: rms 0 max 1 freq +100 +/- 7 delay 1184 +/- 0 +Feb 12 16:25:43 bbv1 ptp4l[23822]: ptp4l[6261.572]: rms 1 max 2 freq +56 +/- 34 delay 1184 +/- 0 +Feb 12 16:25:41 bbv1 ptp4l[23822]: ptp4l[6260.449]: rms 1 max 1 freq -37 +/- 14 delay 1184 +/- 0 +Feb 12 16:25:40 bbv1 ptp4l[23822]: ptp4l[6259.326]: rms 7 max 16 freq +114 +/- 149 delay 1183 +/- 0 +} + +``` + +##### RU configuration + +You can use `rucfg show` to display the current RU configuration. + +The OAI configuration file [`gnb.sa.band257.132prb.fhi72.2x2-microamp.conf`](../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf) corresponds to the following RU configuration: + +```bash +[INFO] Check if RU is available +[INFO] RU available +[INFO] Check SSH to RU available +[INFO] SSH to RU available +[INFO] Downloading oran_autostart +[INFO] Downloading ructl_config.sh +[INFO] Downloading udc_pll_configurator_startup +[INFO] Downloaded Cellbox config = +{ + eCPRI Compression: True + RF Bandwidth: 200MHz + CC Bandwidth: 200MHz + CCs: 1 + LO frequency: 7.91642667e9 + UL compensation frequency: 28.04928e9 + DL compensation frequency: -28.04928e9 + RU MAC: 10:70:FD:B8:86:02 + DU MAC: 50:7C:6F:31:00:61 + TDD config: dddsu + RF Power level: -5 dB - relative to maximum + VLAN ORAN: Enabled, tag: 600 + VLAN PTP: Enabled, tag: 1 + VLAN MGMT: False + Beamforming: dynamic-mirrored-beam +} +``` + +Execute `rucfg config -h` to check how to configure the RU. + +You can also execute `rucfg stats` to show fronthaul statistics including on-time/late packet' counters. + #### VVDN LPRU **Version 3.x** diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf new file mode 100644 index 0000000000..c465b92b1a --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.132prb.fhi72.2x2-microamp.conf @@ -0,0 +1,281 @@ +# SPDX-License-Identifier: LicenseRef-CSSL-1.0 + +Active_gNBs = ( "eurecom-gnb"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe99; + cell_type = "CELL_MACRO_GNB"; + + gNB_name = "eurecom-gnb"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ mcc = 208; mnc = 99; mnc_length = 2; snssaiList = ( { sst = 1; }); }); + + nr_cellid = 1; + + ////////// Physical parameters: + + pdsch_AntennaPorts_XP = 2; + pusch_AntennaPorts = 2; + maxMIMO_layers = 2; + do_CSIRS = 1; + do_SRS = 0; + min_rxtxtime = 3; + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # center frequency = 28701.12 MHz + # selected SSB frequency = 28691.04 MHz + absoluteFrequencySSB = 2079739; + dl_frequencyBand = 257; + # frequency point A = 28653.6 MHz + dl_absoluteFrequencyPointA = 2078403; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 3; + dl_carrierBandwidth = 132; + #initialDownlinkBWP + #genericParameters + initialDLBWPlocationAndBandwidth = 36025; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 3; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 2; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 257; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 3; + ul_carrierBandwidth = 132; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 36025; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 3; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 135; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 15; + preambleReceivedTargetPower = -118; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 8; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 2; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#one (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 3, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + +# this is the offset between the last PRACH preamble power and the Msg3 PUSCH, 2 times the field value in dB + msg3_DeltaPreamble = 0; + p0_NominalWithGrant = -90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; + + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 1; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 3; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 3; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 1; + nrofDownlinkSlots = 3; + nrofDownlinkSymbols = 10; + nrofUplinkSlots = 1; + nrofUplinkSymbols = 2; + + ssPBCH_BlockPower = 5; + } + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ({ ipv4 = "172.21.6.5"; }); + + NETWORK_INTERFACES : + { + GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.18.51"; + GNB_IPV4_ADDRESS_FOR_NGU = "172.21.18.51"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + } +); + +MACRLCs = ( +{ + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 230; + pucch_TargetSNRx10 = 270; + pusch_FailureThres = 1000; + #ul_bler_target_upper =.02; + #ul_bler_target_lower =.01; + #dl_bler_target_upper =.15; + #dl_bler_target_lower =.05 + set_analog_beamforming = "lophy"; + beam_duration = 1; + beams_per_period = 1; + beam_weights = [0]; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 50; + pusch_dtx_threshold = -200; + max_ldpc_iterations = 10; + tx_amp_backoff_dB = 6; + L1_rx_thread_core = 37; + L1_tx_thread_core = 36; + phase_compensation = 0; + +} +); + +RUs = ( +{ + local_rf = "no"; + nb_tx = 2; + nb_rx = 2; + att_tx = 0 + att_rx = 0; + bands = [257]; + nr_scs_for_raster = 3; + max_pdschReferenceSignalPower = -40; + max_rxgain = 60; + #sf_extension = 0; + eNB_instances = [0]; + ru_thread_core = 35; + sl_ahead = 10; + tr_preference = "raw_if4p5"; + do_precoding = 0; +} +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level = "info"; + hw_log_level = "info"; + phy_log_level = "info"; + mac_log_level = "info"; + rlc_log_level = "info"; + pdcp_log_level = "info"; + rrc_log_level = "info"; + ngap_log_level = "info"; + f1ap_log_level = "info"; +}; + +fhi_72 = { + dpdk_devices = ("01:01.0","01:01.1"); # one VF can be used as well + system_core = 32; + io_core = 33; + worker_cores = (34); + ru_addr = ("10:70:FD:B8:86:02", "10:70:FD:B8:86:02"); + mtu = 9216; + fh_config = ({ + T1a_cp_dl = (100, 124); + T1a_cp_ul = (60, 70); + T1a_up = (35, 108); + Ta4 = (0, 45) + ru_config = { + iq_width = 9; + iq_width_prach = 16; + }; + prach_config = { + eAxC_offset = 0; + kbar = 4; + }; + }); +}; From bad2ae874e55d38cd4ea7035a22aae5a0bf160c3 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 22 Jun 2025 07:52:07 +0200 Subject: [PATCH 19/37] added thread-pool support for TX symbol processing removed warnings in nr_dlsch.c and changed return of do_onelayer Co-authored-by: Robert Schmidt --- executables/nr-gnb.c | 1 + openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 292 +++++++++++++++++---------- openair1/PHY/defs_gNB.h | 1 + openair1/SIMULATION/NR_PHY/dlsim.c | 1 + 4 files changed, 186 insertions(+), 109 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 74b6835e3f..04dcef34a4 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -311,6 +311,7 @@ void init_gNB_Tpool(int inst) gNB_L1_proc_t *proc = &gNB->proc; // PUSCH symbols per thread need to be calculated by how many threads we have gNB->num_pusch_symbols_per_thread = 1; + gNB->num_pdsch_symbols_per_thread = 1; // ULSCH decoding threadpool initTpool(get_softmodem_params()->threadPoolConfig, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE)); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 73ba4be4af..52bfedf86c 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -311,22 +311,22 @@ static inline void neg_dmrs(c16_t *in, c16_t *out, int sz) *out++ = i % 2 ? (c16_t){-in[i].r, -in[i].i} : in[i]; } -static inline int do_onelayer(NR_DL_FRAME_PARMS *frame_parms, - int slot, - const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15, - int layer, - c16_t *output, - c16_t *txl_start, - int start_sc, - int symbol_sz, - int l_symbol, - uint16_t dlPtrsSymPos, - int n_ptrs, - int amp, - int16_t amp_dmrs, - int l_prime, - nfapi_nr_dmrs_type_e dmrs_Type, - c16_t *dmrs_start) +static inline void do_onelayer(NR_DL_FRAME_PARMS *frame_parms, + int slot, + const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15, + int layer, + c16_t *output, + c16_t *txl_start, + int start_sc, + int symbol_sz, + int l_symbol, + uint16_t dlPtrsSymPos, + int n_ptrs, + int amp, + int16_t amp_dmrs, + int l_prime, + nfapi_nr_dmrs_type_e dmrs_Type, + c16_t *dmrs_start) { c16_t *txl = txl_start; const uint sz = rel15->rbSize * NR_NB_SC_PER_RB; @@ -408,7 +408,7 @@ static inline int do_onelayer(NR_DL_FRAME_PARMS *frame_parms, } else { // no PTRS or DMRS in this symbol txl += no_ptrs_dmrs_case(output + start_sc, txl, amp, sz); } // no DMRS/PTRS in symbol - return txl - txl_start; + return; } static inline void do_txdataF(c16_t **txdataF, @@ -472,28 +472,145 @@ static inline void do_txdataF(c16_t **txdataF, } // RB loop: while(rb < rel15->rbSize) } +typedef struct pdschSymbolProc_s { + PHY_VARS_gNB *gNB; + NR_DL_FRAME_PARMS *frame_parms; + const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15; + unsigned int slot; + unsigned int startSymbol; + unsigned int numSymbols; + task_ans_t *ans; + unsigned int layerSz2; + unsigned int dlPtrsSymPos; + unsigned int n_ptrs; + unsigned int beam_nb; + unsigned int re_beginning_of_symbol[14]; + c16_t *tx_layers[4]; +} pdschSymbolProc_t; + +static void nr_pdsch_symbol_processing(void *arg) +{ + pdschSymbolProc_t *rdata = (pdschSymbolProc_t *)arg; + + PHY_VARS_gNB *gNB = rdata->gNB; + NR_DL_FRAME_PARMS *frame_parms = rdata->frame_parms; + const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = rdata->rel15; + int slot = rdata->slot; + c16_t *tx_layers[rel15->nrOfLayers]; + for (int l = 0; l < rel15->nrOfLayers; l++) + tx_layers[l] = rdata->tx_layers[l]; + const int nb_re_dmrs = rel15->numDmrsCdmGrpsNoData * (rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); + const int n_dmrs = (rel15->BWPStart + rel15->rbStart + rel15->rbSize) * nb_re_dmrs; + // Loop Over OFDM symbols: + c16_t mod_dmrs[(n_dmrs + 63) & ~63] __attribute__((aligned(64))); + const int symbol_sz = frame_parms->ofdm_symbol_size; + + c16_t **txdataF = gNB->common_vars.txdataF[rdata->beam_nb]; + uint16_t start_sc = (rel15->rbStart + rel15->BWPStart) * NR_NB_SC_PER_RB; + +#ifdef DEBUG_DLSCH_MAPPING + printf("slot %d PDSCH resource mapping started (start SC %d\tstart symbol %d\tnum symbols %d\tN_PRB %d,nb_layers %d)\n", + rdata->slot, + start_sc, + rdata->startSymbol, + rdata->numSymbols, + rel15->rbSize, + rel15->nrOfLayers); +#endif + for (int l_symbol = rdata->startSymbol; l_symbol < rdata->startSymbol + rdata->numSymbols; l_symbol++) { + start_meas(&gNB->dlsch_resource_mapping_stats); + int l_prime = 0; // single symbol layer 0 + int l_overline = get_l0(rel15->dlDmrsSymbPos); + +#ifdef DEBUG_DLSCH_MAPPING + printf("PDSCH resource mapping symbol %d\n", l_symbol); +#endif + /// DMRS QPSK modulation + if ((rel15->dlDmrsSymbPos & (1 << l_symbol))) { // DMRS time occasion + // The reference point for is subcarrier -1 of the lowest-numbered resource block in CORESET 0 if the corresponding + // PDCCH is associated with CORESET -1 and Type0-PDCCH common search space and is addressed to SI-RNTI + // 2GPP TS 38.211 V15.8.0 Section 7.4.1.1.2 Mapping to physical resources + if (l_symbol == (l_overline + 1)) // take into account the double DMRS symbols + l_prime = 1; + else if (l_symbol > (l_overline + 1)) { // new DMRS pair + l_overline = l_symbol; + l_prime = 0; + } +#ifdef DEBUG_DLSCH_MAPPING + printf("dlDmrsScramblingId %d, SCID %d slot %d l_symbol %d\n", rel15->dlDmrsScramblingId, rel15->SCID, slot, l_symbol); +#endif + const uint32_t *gold = nr_gold_pdsch(frame_parms->N_RB_DL, + frame_parms->symbols_per_slot, + rel15->dlDmrsScramblingId, + rel15->SCID, + slot, + l_symbol); + // Qm = 1 as DMRS is QPSK modulated + nr_modulation(gold, n_dmrs * DMRS_MOD_ORDER, DMRS_MOD_ORDER, (int16_t *)mod_dmrs); + +#ifdef DEBUG_DLSCH_MAPPING + printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l_symbol, n_dmrs, dmrs_Type); + for (int i = 0; i < n_dmrs / 2; i += 8) { + for (int j = 0; j < 8; j++) { + printf("%d %d\t", mod_dmrs[i + j].r, mod_dmrs[i + j].i); + } + printf("\n"); + } +#endif + } + uint32_t dmrs_idx = rel15->rbStart; + if (rel15->refPoint == 0) + dmrs_idx += rel15->BWPStart; + dmrs_idx *= rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4; + c16_t txdataF_precoding[rel15->nrOfLayers][symbol_sz] __attribute__((aligned(64))); + for (int layer = 0; layer < rel15->nrOfLayers; layer++) { + do_onelayer(frame_parms, + slot, + rel15, + layer, + txdataF_precoding[layer], + tx_layers[layer] + rdata->re_beginning_of_symbol[l_symbol], + start_sc, + symbol_sz, + l_symbol, + rdata->dlPtrsSymPos, + rdata->n_ptrs, + gNB->TX_AMP, + min((double)gNB->TX_AMP * sqrt(rel15->numDmrsCdmGrpsNoData), INT16_MAX), + l_prime, + rel15->dmrsConfigType, + mod_dmrs + dmrs_idx); + } // layer loop + stop_meas(&gNB->dlsch_resource_mapping_stats); + + start_meas(&gNB->dlsch_precoding_stats); + for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) { + const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz; + do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol); + } + stop_meas(&gNB->dlsch_precoding_stats); + } + // Task running in // completed + completed_task_ans(rdata->ans); +} + static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSCH_t *dlsch, int slot) { - const int16_t amp = gNB->TX_AMP; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; time_stats_t *dlsch_scrambling_stats = &gNB->dlsch_scrambling_stats; time_stats_t *dlsch_modulation_stats = &gNB->dlsch_modulation_stats; const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu->pdsch_pdu_rel15; const int layerSz = frame_parms->N_RB_DL * frame_parms->symbols_per_slot * NR_NB_SC_PER_RB; - const int symbol_sz=frame_parms->ofdm_symbol_size; - const int dmrs_Type = rel15->dmrsConfigType; const int nb_re_dmrs = rel15->numDmrsCdmGrpsNoData * (rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); - const int16_t amp_dmrs = min((double)amp * sqrt(rel15->numDmrsCdmGrpsNoData), INT16_MAX); // 3GPP TS 38.214 Section 4.1: Table 4.1-1 LOG_D(PHY, "pdsch: BWPStart %d, BWPSize %d, rbStart %d, rbsize %d\n", rel15->BWPStart, rel15->BWPSize, rel15->rbStart, rel15->rbSize); - const int n_dmrs = (rel15->BWPStart + rel15->rbStart + rel15->rbSize) * nb_re_dmrs; + const int n_dmrs = rel15->rbSize * nb_re_dmrs; - const int dmrs_symbol_map = rel15->dlDmrsSymbPos; // single DMRS: 010000100 Double DMRS 110001100 const int xOverhead = 0; const int nb_re = (12 * rel15->NrOfSymbols - nb_re_dmrs * get_num_dmrs(rel15->dlDmrsSymbPos) - xOverhead) * rel15->rbSize * rel15->nrOfLayers; @@ -567,21 +684,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC start_meas(&gNB->dlsch_pdsch_generation_stats); /// Resource mapping // Non interleaved VRB to PRB mapping - uint16_t start_sc = (rel15->rbStart + rel15->BWPStart) * NR_NB_SC_PER_RB; - -#ifdef DEBUG_DLSCH_MAPPING - printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", - start_sc, - rel15->StartSymbolIndex, - rel15->rbSize, - nb_re, - rel15->nrOfLayers); -#endif AssertFatal(n_dmrs, "n_dmrs can't be 0\n"); // make a large enough tail to process all re with SIMD regardless a garbadge filler - c16_t mod_dmrs[(n_dmrs+63)&~63] __attribute__((aligned(64))); - unsigned int re_beginning_of_symbol = 0; start_meas(&gNB->dlsch_layer_mapping_stats); int layerSz2 = (layerSz + 63) & ~63; @@ -605,85 +710,54 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC slot, frame_parms->symbols_per_slot, bitmap); - - c16_t **txdataF = gNB->common_vars.txdataF[beam_nb]; stop_meas(&gNB->dlsch_layer_mapping_stats); - // Loop Over OFDM symbols: - for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols; l_symbol++) { - start_meas(&gNB->dlsch_resource_mapping_stats); - int l_prime = 0; // single symbol layer 0 - int l_overline = get_l0(rel15->dlDmrsSymbPos); -#ifdef DEBUG_DLSCH_MAPPING - printf("PDSCH resource mapping symbol %d\n", l_symbol); -#endif - /// DMRS QPSK modulation - if ((dmrs_symbol_map & (1 << l_symbol))) { // DMRS time occasion - // The reference point for is subcarrier -1 of the lowest-numbered resource block in CORESET 0 if the corresponding - // PDCCH is associated with CORESET -1 and Type0-PDCCH common search space and is addressed to SI-RNTI - // 2GPP TS 38.211 V15.8.0 Section 7.4.1.1.2 Mapping to physical resources - if (l_symbol == (l_overline + 1)) // take into account the double DMRS symbols - l_prime = 1; - else if (l_symbol > (l_overline + 1)) { // new DMRS pair - l_overline = l_symbol; - l_prime = 0; + // spawn symbol threads + + int nb_tasks = rel15->NrOfSymbols / gNB->num_pdsch_symbols_per_thread; + if ((rel15->NrOfSymbols % gNB->num_pdsch_symbols_per_thread) > 0) + nb_tasks++; + pdschSymbolProc_t arr[nb_tasks]; + task_ans_t ans; + init_task_ans(&ans, nb_tasks); + int sz_arr = 0; + unsigned int re_beginning_of_symbol = 0; + int res = 0; + for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols; + l_symbol += gNB->num_pdsch_symbols_per_thread) { + pdschSymbolProc_t *rdata = &arr[sz_arr]; + rdata->ans = &ans; + ++sz_arr; + + rdata->gNB = gNB; + rdata->frame_parms = frame_parms; + rdata->rel15 = rel15; + rdata->slot = slot; + rdata->startSymbol = l_symbol; + res = rel15->NrOfSymbols - (l_symbol - rel15->StartSymbolIndex); + if (res >= gNB->num_pdsch_symbols_per_thread) + rdata->numSymbols = gNB->num_pdsch_symbols_per_thread; + else + rdata->numSymbols = res; + rdata->layerSz2 = layerSz2; + rdata->dlPtrsSymPos = dlPtrsSymPos; + rdata->n_ptrs = n_ptrs; + rdata->beam_nb = beam_nb; + for (int s = 0; s < rdata->numSymbols; s++) { + rdata->re_beginning_of_symbol[l_symbol + s] = re_beginning_of_symbol; + re_beginning_of_symbol += rel15->rbSize * NR_NB_SC_PER_RB; + if (n_ptrs > 0 && is_ptrs_symbol(l_symbol, dlPtrsSymPos)) { + re_beginning_of_symbol -= n_ptrs; + } else if (rel15->dlDmrsSymbPos & (1 << l_symbol)) { + re_beginning_of_symbol -= n_dmrs; } -#ifdef DEBUG_DLSCH_MAPPING - printf("dlDmrsScramblingId %d, SCID %d slot %d l_symbol %d\n", rel15->dlDmrsScramblingId, rel15->SCID, slot, l_symbol); -#endif - const uint32_t *gold = nr_gold_pdsch(frame_parms->N_RB_DL, - frame_parms->symbols_per_slot, - rel15->dlDmrsScramblingId, - rel15->SCID, - slot, - l_symbol); - // Qm = 1 as DMRS is QPSK modulated - nr_modulation(gold, n_dmrs * DMRS_MOD_ORDER, DMRS_MOD_ORDER, (int16_t *)mod_dmrs); - -#ifdef DEBUG_DLSCH_MAPPING - printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l_symbol, n_dmrs, dmrs_Type); - for (int i = 0; i < n_dmrs / 2; i += 8) { - for (int j = 0; j < 8; j++) { - printf("%d %d\t", mod_dmrs[i + j].r, mod_dmrs[i + j].i); - } - printf("\n"); - } -#endif } - uint32_t dmrs_idx = rel15->rbStart; - if (rel15->refPoint == 0) - dmrs_idx += rel15->BWPStart; - dmrs_idx *= dmrs_Type == NFAPI_NR_DMRS_TYPE1 ? 6 : 4; - c16_t txdataF_precoding[rel15->nrOfLayers][symbol_sz] __attribute__((aligned(64))); - int layer_sz = 0; - for (int layer = 0; layer < rel15->nrOfLayers; layer++) { - layer_sz = do_onelayer(frame_parms, - slot, - rel15, - layer, - txdataF_precoding[layer], - tx_layers[layer] + re_beginning_of_symbol, - start_sc, - symbol_sz, - l_symbol, - dlPtrsSymPos, - n_ptrs, - amp, - amp_dmrs, - l_prime, - dmrs_Type, - mod_dmrs + dmrs_idx); - } // layer loop - re_beginning_of_symbol += layer_sz; - stop_meas(&gNB->dlsch_resource_mapping_stats); - - start_meas(&gNB->dlsch_precoding_stats); - for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) { - const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz; - do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol); - } - stop_meas(&gNB->dlsch_precoding_stats); + for (int l = 0; l < rel15->nrOfLayers; l++) + rdata->tx_layers[l] = tx_layers[l]; + task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata}; + pushTpool(&gNB->threadPool, t); } + join_task_ans(&ans); stop_meas(&gNB->dlsch_pdsch_generation_stats); /* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits) * should remain a multiple of 8 * 64 with enough offset to fit each dlsch diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index b9d4992d32..a6fb9d8890 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -485,6 +485,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t L1_rx_out; tpool_t threadPool; int num_pusch_symbols_per_thread; + int num_pdsch_symbols_per_thread; int dmrs_num_antennas_per_thread; pthread_t L1_rx_thread; int L1_rx_thread_core; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index c1fee991b9..c6fc036bf8 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -715,6 +715,7 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; + gNB->num_pdsch_symbols_per_thread = 1; NR_ServingCellConfigCommon_t *scc = calloc(1,sizeof(*scc));; prepare_scc(scc); From b875f855c78e7d40639911ab1900b6ceb07ebb3f Mon Sep 17 00:00:00 2001 From: Romain Beurdouche Date: Thu, 5 Feb 2026 10:33:13 +0000 Subject: [PATCH 20/37] fix(nr_dlsch): symbol offset calculation There was an indexing error in the calculation of the symbol offset `re_beginning_of_symbol`. The symbol was tested to hold PTRS or DMRS based on the index of the first symbol processed in the task and not based on the index of the symbol as it should be. Then PDSCH generation was not working properly for more than one symbol per task. --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 52bfedf86c..710dac1efb 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -743,12 +743,12 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC rdata->dlPtrsSymPos = dlPtrsSymPos; rdata->n_ptrs = n_ptrs; rdata->beam_nb = beam_nb; - for (int s = 0; s < rdata->numSymbols; s++) { - rdata->re_beginning_of_symbol[l_symbol + s] = re_beginning_of_symbol; + for (int s = l_symbol; s < l_symbol + rdata->numSymbols; s++) { + rdata->re_beginning_of_symbol[s] = re_beginning_of_symbol; re_beginning_of_symbol += rel15->rbSize * NR_NB_SC_PER_RB; - if (n_ptrs > 0 && is_ptrs_symbol(l_symbol, dlPtrsSymPos)) { + if (n_ptrs > 0 && is_ptrs_symbol(s, dlPtrsSymPos)) { re_beginning_of_symbol -= n_ptrs; - } else if (rel15->dlDmrsSymbPos & (1 << l_symbol)) { + } else if (rel15->dlDmrsSymbPos & (1 << s)) { re_beginning_of_symbol -= n_dmrs; } } From 1d42dfda660ba601f80966f60a6040d079adbd37 Mon Sep 17 00:00:00 2001 From: Romain Beurdouche Date: Thu, 26 Feb 2026 11:53:27 +0100 Subject: [PATCH 21/37] fix(nr_dlsch): time meas in TX symbol processing * Global timers were started and stopped in the TX symbol processing tasks which is not thread safe * gNBs nrL1_stats.log now shows PDSCH generation time rather than layer mapping and precoding times --- executables/nr-gnb.c | 6 ++---- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 04dcef34a4..dfb94d5ad9 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -208,8 +208,7 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output); output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output); output += print_meas_log(&gNB->dlsch_modulation_stats, "DLSCH modulation", NULL, NULL, output, end - output); - output += print_meas_log(&gNB->dlsch_resource_mapping_stats, "DLSCH resource mapping", NULL, NULL, output,end-output); - output += print_meas_log(&gNB->dlsch_precoding_stats, "DLSCH precoding", NULL, NULL, output,end-output); + output += print_meas_log(&gNB->dlsch_pdsch_generation_stats, "PDSCH generation", NULL, NULL, output, end - output); output += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output, end - output); output += print_meas_log(&gNB->ts_deinterleave, "UL segment deinterleaving", NULL, NULL, output, end - output); output += print_meas_log(&gNB->ts_rate_unmatch, "UL segment rate recovery", NULL, NULL, output, end - output); @@ -280,8 +279,7 @@ void *nrL1_stats_thread(void *param) { reset_meas(&gNB->rx_pusch_stats); reset_meas(&gNB->dlsch_scrambling_stats); reset_meas(&gNB->dlsch_modulation_stats); - reset_meas(&gNB->dlsch_resource_mapping_stats); - reset_meas(&gNB->dlsch_precoding_stats); + reset_meas(&gNB->dlsch_pdsch_generation_stats); while (!oai_exit) { sleep(1); if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) { diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 710dac1efb..8c73c4d2ed 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -486,6 +486,8 @@ typedef struct pdschSymbolProc_s { unsigned int beam_nb; unsigned int re_beginning_of_symbol[14]; c16_t *tx_layers[4]; + time_stats_t dlsch_resource_mapping_stats; + time_stats_t dlsch_precoding_stats; } pdschSymbolProc_t; static void nr_pdsch_symbol_processing(void *arg) @@ -518,7 +520,7 @@ static void nr_pdsch_symbol_processing(void *arg) rel15->nrOfLayers); #endif for (int l_symbol = rdata->startSymbol; l_symbol < rdata->startSymbol + rdata->numSymbols; l_symbol++) { - start_meas(&gNB->dlsch_resource_mapping_stats); + start_meas(&rdata->dlsch_resource_mapping_stats); int l_prime = 0; // single symbol layer 0 int l_overline = get_l0(rel15->dlDmrsSymbPos); @@ -581,14 +583,14 @@ static void nr_pdsch_symbol_processing(void *arg) rel15->dmrsConfigType, mod_dmrs + dmrs_idx); } // layer loop - stop_meas(&gNB->dlsch_resource_mapping_stats); + stop_meas(&rdata->dlsch_resource_mapping_stats); - start_meas(&gNB->dlsch_precoding_stats); + start_meas(&rdata->dlsch_precoding_stats); for (int ant = 0; ant < frame_parms->nb_antennas_tx; ant++) { const size_t txdataF_offset_per_symbol = l_symbol * symbol_sz; do_txdataF(txdataF, symbol_sz, txdataF_precoding, gNB, rel15, ant, start_sc, txdataF_offset_per_symbol); } - stop_meas(&gNB->dlsch_precoding_stats); + stop_meas(&rdata->dlsch_precoding_stats); } // Task running in // completed completed_task_ans(rdata->ans); @@ -752,12 +754,18 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC re_beginning_of_symbol -= n_dmrs; } } + reset_meas(&rdata->dlsch_resource_mapping_stats); + reset_meas(&rdata->dlsch_precoding_stats); for (int l = 0; l < rel15->nrOfLayers; l++) rdata->tx_layers[l] = tx_layers[l]; task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata}; pushTpool(&gNB->threadPool, t); } join_task_ans(&ans); + for (int i = 0; i < nb_tasks; i++) { + merge_meas(&gNB->dlsch_resource_mapping_stats, &arr[i].dlsch_resource_mapping_stats); + merge_meas(&gNB->dlsch_precoding_stats, &arr[i].dlsch_precoding_stats); + } stop_meas(&gNB->dlsch_pdsch_generation_stats); /* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits) * should remain a multiple of 8 * 64 with enough offset to fit each dlsch From f6693d41e341e0fcafe5406acd0fce87ec1c9119 Mon Sep 17 00:00:00 2001 From: Romain Beurdouche Date: Thu, 2 Apr 2026 16:25:20 +0200 Subject: [PATCH 22/37] fix(nr_dlsch): Remove DLSCH mapping debugs --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 47 ---------------------------- 1 file changed, 47 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 8c73c4d2ed..e6ae850093 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -17,8 +17,6 @@ #include "executables/softmodem-common.h" #include "SCHED_NR/sched_nr.h" -// #define DEBUG_DLSCH -// #define DEBUG_DLSCH_MAPPING #include #define USE128BIT @@ -46,21 +44,9 @@ static int do_ptrs_symbol(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15, /* check if cuurent RE is PTRS RE*/ uint16_t beta_ptrs = 1; txF[k] = c16mulRealShift(mod_ptrs[ptrs_idx], beta_ptrs * amp, 15); -#ifdef DEBUG_DLSCH_MAPPING - printf("ptrs_idx %d\t \t k %d \t \t txdataF: %d %d, mod_ptrs: %d %d\n", - ptrs_idx, - k, - txF[k].r, - txF[k].i, - mod_ptrs[ptrs_idx].r, - mod_ptrs[ptrs_idx].i); -#endif ptrs_idx++; } else { txF[k] = c16mulRealShift(*in++, amp, 15); -#ifdef DEBUG_DLSCH_MAPPING - printf("k %d \t txdataF: %d %d\n", k, txF[k].r, txF[k].i); -#endif } k++; } @@ -74,9 +60,6 @@ typedef union { static inline int interleave_with_0_signal_first(c16_t *output, c16_t *mod_dmrs, const int16_t amp_dmrs, int sz) { -#ifdef DEBUG_DLSCH_MAPPING - printf("doing DMRS pattern for port 0 : d0 0 d1 0 ... dNm2 0 dNm1 0 (ul %d, rr %d)\n", upper_limit, remaining_re); -#endif // add filler to process all as SIMD c16_t *out = output; int i = 0; @@ -126,9 +109,6 @@ static inline int interleave_with_0_signal_first(c16_t *output, c16_t *mod_dmrs, static inline int interleave_with_0_start_with_0(c16_t *output, c16_t *mod_dmrs, const int16_t amp_dmrs, int sz) { -#ifdef DEBUG_DLSCH_MAPPING - printf("doing DMRS pattern for port 2 : 0 d0 0 d1 ... 0 dNm2 0 dNm1\n"); -#endif c16_t *out = output; int i = 0; int end = sz / 2; @@ -177,9 +157,6 @@ static inline int interleave_with_0_start_with_0(c16_t *output, c16_t *mod_dmrs, static inline int interleave_signals(c16_t *output, c16_t *signal1, const int amp, c16_t *signal2, const int amp2, int sz) { -#ifdef DEBUG_DLSCH_MAPPING - printf("doing DMRS pattern for port 0 : d0 X0 d1 X1 ... dNm2 XNm2 dNm1 XNm1\n"); -#endif // add filler to process all as SIMD c16_t *out = output; int i = 0; @@ -510,23 +487,11 @@ static void nr_pdsch_symbol_processing(void *arg) c16_t **txdataF = gNB->common_vars.txdataF[rdata->beam_nb]; uint16_t start_sc = (rel15->rbStart + rel15->BWPStart) * NR_NB_SC_PER_RB; -#ifdef DEBUG_DLSCH_MAPPING - printf("slot %d PDSCH resource mapping started (start SC %d\tstart symbol %d\tnum symbols %d\tN_PRB %d,nb_layers %d)\n", - rdata->slot, - start_sc, - rdata->startSymbol, - rdata->numSymbols, - rel15->rbSize, - rel15->nrOfLayers); -#endif for (int l_symbol = rdata->startSymbol; l_symbol < rdata->startSymbol + rdata->numSymbols; l_symbol++) { start_meas(&rdata->dlsch_resource_mapping_stats); int l_prime = 0; // single symbol layer 0 int l_overline = get_l0(rel15->dlDmrsSymbPos); -#ifdef DEBUG_DLSCH_MAPPING - printf("PDSCH resource mapping symbol %d\n", l_symbol); -#endif /// DMRS QPSK modulation if ((rel15->dlDmrsSymbPos & (1 << l_symbol))) { // DMRS time occasion // The reference point for is subcarrier -1 of the lowest-numbered resource block in CORESET 0 if the corresponding @@ -538,9 +503,6 @@ static void nr_pdsch_symbol_processing(void *arg) l_overline = l_symbol; l_prime = 0; } -#ifdef DEBUG_DLSCH_MAPPING - printf("dlDmrsScramblingId %d, SCID %d slot %d l_symbol %d\n", rel15->dlDmrsScramblingId, rel15->SCID, slot, l_symbol); -#endif const uint32_t *gold = nr_gold_pdsch(frame_parms->N_RB_DL, frame_parms->symbols_per_slot, rel15->dlDmrsScramblingId, @@ -550,15 +512,6 @@ static void nr_pdsch_symbol_processing(void *arg) // Qm = 1 as DMRS is QPSK modulated nr_modulation(gold, n_dmrs * DMRS_MOD_ORDER, DMRS_MOD_ORDER, (int16_t *)mod_dmrs); -#ifdef DEBUG_DLSCH_MAPPING - printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l_symbol, n_dmrs, dmrs_Type); - for (int i = 0; i < n_dmrs / 2; i += 8) { - for (int j = 0; j < 8; j++) { - printf("%d %d\t", mod_dmrs[i + j].r, mod_dmrs[i + j].i); - } - printf("\n"); - } -#endif } uint32_t dmrs_idx = rel15->rbStart; if (rel15->refPoint == 0) From 6684ead115799681e70515e3784f91ac5603e78f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 6 Apr 2026 20:31:09 +0200 Subject: [PATCH 23/37] Correctly handle build_oai --build-lib option This fixes two problem: 1. an omitted --build-lib library could yield strange grep errors. For instance, calling build_oai --build-lib --cmake-opt OPTION passed "--cmake-opt" to grep, that does not know this option. Handle by explicitly separating options and search pattern through --. 2. Even with this fixed, set -e triggered an exit because grep exits with non-zero error code. Remove set -e to have the error handling code pass. With set -e removed, properly check that the build passes. Update a log line to make it clearer. Assisted-by: Claude:claude-sonnet-4-6 Signed-off-by: Robert Schmidt --- cmake_targets/build_oai | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index d8749ee39b..ebdce789cd 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -4,8 +4,6 @@ # file build_oai # brief OAI automated build tool that can be used to install, compile, run OAI. -set -e - # Include helper functions THIS_SCRIPT_PATH=$(dirname $(readlink -f "$0")) source "$THIS_SCRIPT_PATH"/tools/build_helper @@ -330,8 +328,8 @@ function main() { echo_info "Enabling build of all optional shared libraries ($OPTIONAL_LIBRARIES)" else for reqlib in $2; do - lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w $reqlib) # search given parameter in list - [[ $? -ne 0 ]] && echo_fatal "Unknown optional library in $reqlib, valid libraries are $OPTIONAL_LIBRARIES" + lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w -- $reqlib) # search given parameter in list + [[ $? -ne 0 ]] && echo_fatal "Unknown optional library \"$reqlib\", valid libraries are: $OPTIONAL_LIBRARIES" TARGET_LIST="$TARGET_LIST $lib" # will append the found library CMAKE_CMD="$CMAKE_CMD -DENABLE_${lib^^}=ON" echo_info "Enabling build of optional shared library $lib" @@ -441,11 +439,10 @@ function main() { # e.g., cmake_targets/ran_build/build, hence the ../../.. CMAKE_CMD="$CMAKE_CMD ../../.." echo_info "Running \"$CMAKE_CMD\"" - eval $CMAKE_CMD + eval $CMAKE_CMD || echo_fatal "cmake configuration failed" cmd="$CMAKE --build . --target ${TARGET_LIST} -- ${BUILD_TOOL_OPT}" echo_info "Running \"${cmd}\"" $green - eval $cmd - ret=$? + eval $cmd || echo_fatal "build failed" if [ "$UE" = 1 ] ; then echo_info "Generate LTE USIM default sim content UE specific part" From 57df1ede4b8ecada859f197704afb64c8eb350e6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 6 Apr 2026 20:33:43 +0200 Subject: [PATCH 24/37] Remove log directory creation: it's not used Signed-off-by: Robert Schmidt --- cmake_targets/build_oai | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index ebdce789cd..f59a9ebfc7 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -387,9 +387,6 @@ function main() { echo "Erased all previously producted files" fi - dlog=$OPENAIR_DIR/cmake_targets/log - mkdir -p $dlog - if [ "$INSTALL_EXTERNAL" = "1" ] ; then echo_info "Installing packages" check_install_oai_software From be9fc79f77dc686c5f35507204e96879ca8a0704 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 6 Apr 2026 20:40:09 +0200 Subject: [PATCH 25/37] harmonize build_oai -c/-C Both do practically the same. Harmonize them into one while guaranteeing backwards compatibility. Signed-off-by: Robert Schmidt --- cmake_targets/build_oai | 15 +++------------ cmake_targets/tools/build_helper | 6 ------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index f59a9ebfc7..de6caba969 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -130,12 +130,9 @@ function main() { --build-tool-opt) BUILD_TOOL_OPT+=" $2" shift 2;; - -c | --clean) + -c | --clean | -C | --clean-all) CLEAN=1 shift;; - -C | --clean-all) - CLEAN_ALL=1 - shift;; --clean-kernel) clean_kernel echo_info "Erased iptables config and removed modules from kernel" @@ -382,10 +379,8 @@ function main() { echo "OPENAIR_DIR = $OPENAIR_DIR" - if [ "$CLEAN_ALL" = "1" ] ; then - clean_all_files - echo "Erased all previously producted files" - fi + DIR=$OPENAIR_DIR/cmake_targets + [ "$CLEAN" = "1" ] && rm -rf "$DIR/$BUILD_DIR" if [ "$INSTALL_EXTERNAL" = "1" ] ; then echo_info "Installing packages" @@ -418,10 +413,6 @@ function main() { check_install_additional_tools fi - DIR=$OPENAIR_DIR/cmake_targets - - [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build - if [[ $TARGET_LIST != "" ]] && [[ -f $OPENAIR_DIR/CMakeLists.txt ]]; then # add some default libraries that should always be built # for eNB, gNB, UEs, simulators diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 32636a5bb2..37cccec18f 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -140,12 +140,6 @@ clean_kernel() { echo_info "Flushed iptables" } -clean_all_files() { - set_openair_env - dir=$OPENAIR_DIR/cmake_targets - rm -rf $dir/ran_build $dir/ran_build_noLOG -} - ############################################ # External packages installers ############################################ From 900fa704edf3638ea67f5948b4ce81ad55f81724 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 6 Apr 2026 20:56:39 +0200 Subject: [PATCH 26/37] bugfix run_asn1c: make make/ninja fail on error Functionality existed to print all output of asn1c on error, but the form asn1c || cat X makes the command exit with a 0 exit code (success). Fix by explicitly returning non-zero exit code in this case: asn1c || ( cat X && false ) Signed-off-by: Robert Schmidt --- cmake_targets/macros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/macros.cmake b/cmake_targets/macros.cmake index 169ef600ce..c19eb285ef 100644 --- a/cmake_targets/macros.cmake +++ b/cmake_targets/macros.cmake @@ -83,7 +83,7 @@ function(run_asn1c ASN1C_GRAMMAR ASN1C_PREFIX) get_filename_component(GRAMMAR_FILE ${ASN1C_GRAMMAR} NAME) set(LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/${GRAMMAR_FILE}.log") add_custom_command(OUTPUT ${ASN1C_OUTPUT} - COMMAND ASN1C_PREFIX=${ASN1C_PREFIX} ${ASN1C_EXEC} ${ASN1C_OPTIONS} -D ${CMAKE_CURRENT_BINARY_DIR} ${ASN1C_GRAMMAR} > ${LOGFILE} 2>&1 || cat ${LOGFILE} + COMMAND ASN1C_PREFIX=${ASN1C_PREFIX} ${ASN1C_EXEC} ${ASN1C_OPTIONS} -D ${CMAKE_CURRENT_BINARY_DIR} ${ASN1C_GRAMMAR} > ${LOGFILE} 2>&1 || ( cat ${LOGFILE} && false ) DEPENDS ${ASN1C_GRAMMAR} COMMENT "Generating ${ASN1C_COMMENT} from ${GRAMMAR_FILE}" ) From d63dc3a3216c909e6bf938c5ee6e0fafc4e3a776 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 7 Apr 2026 15:02:50 +0200 Subject: [PATCH 27/37] Remove build_oai --clean-kernel option This option is potentially dangerous as it might override custom user options. Signed-off-by: Robert Schmidt --- cmake_targets/build_oai | 4 ---- cmake_targets/tools/build_helper | 20 -------------------- 2 files changed, 24 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index de6caba969..ca387cda32 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -133,10 +133,6 @@ function main() { -c | --clean | -C | --clean-all) CLEAN=1 shift;; - --clean-kernel) - clean_kernel - echo_info "Erased iptables config and removed modules from kernel" - shift;; --cmake-opt) CMAKE_CMD="$CMAKE_CMD $2" shift 2;; diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 37cccec18f..2a18a0524e 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -120,26 +120,6 @@ handler_EXIT() { trap handler_EXIT EXIT -########################### -# Cleaners -########################### - -clean_kernel() { - $SUDO modprobe ip_tables - $SUDO modprobe x_tables - $SUDO iptables -P INPUT ACCEPT - $SUDO iptables -F INPUT - $SUDO iptables -P OUTPUT ACCEPT - $SUDO iptables -F OUTPUT - $SUDO iptables -P FORWARD ACCEPT - $SUDO iptables -F FORWARD - $SUDO iptables -t nat -F - $SUDO iptables -t mangle -F - $SUDO iptables -t filter -F - $SUDO iptables -t raw -F - echo_info "Flushed iptables" -} - ############################################ # External packages installers ############################################ From 447c0b211e83214bc27c75e50c5b67ff370396c1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 7 Apr 2026 21:05:43 +0200 Subject: [PATCH 28/37] gNB_scheduler_ulsch: make functions static --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 6a85cfb970..8e208e1806 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -146,12 +146,12 @@ bwp_info_t get_pusch_bwp_start_size(NR_UE_info_t *UE) return bwp_info; } -float compute_ph_rb_factor(int mu, int rb) +static float compute_ph_rb_factor(int mu, int rb) { return roundf(10 * log10(rb << mu)); } -float compute_ph_mcs_factor(const NR_sched_pusch_t *pusch) +static float compute_ph_mcs_factor(const NR_sched_pusch_t *pusch) { // 38.213 7.1.1 // if the PUSCH transmission is over more than one layer delta_tf = 0 @@ -252,7 +252,7 @@ static int estimate_ul_buffer_long_bsr(const NR_BSR_LONG *bsr) // return: length of subPdu header // 3GPP TS 38.321 Section 6 -uint8_t decode_ul_mac_sub_pdu_header(uint8_t *pduP, uint8_t *lcid, uint16_t *length) +static uint8_t decode_ul_mac_sub_pdu_header(uint8_t *pduP, uint8_t *lcid, uint16_t *length) { uint16_t mac_subheader_len = 1; *lcid = pduP[0] & 0x3F; From 466c9b5eee4362985ce73f06287e8e8a237dca94 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 8 Apr 2026 02:02:55 +0200 Subject: [PATCH 29/37] Increase reliability of ltebox start The existing ltebox startup sequence on nepes occasionally fails. Running sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss' \ && sleep 1 && sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw \ & sleep 1 && ip a show dev tun1 Reliably shows that no tun1 interface is created, because that takes around 1s itself. Increasing the second sleep to 2 reliably deploys it correctly. Do the same for sabox and ltebox on nano for consistency. Signed-off-by: Robert Schmidt --- ci-scripts/ci_infra.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/ci_infra.yaml b/ci-scripts/ci_infra.yaml index 02d5ae1d78..b82c755850 100644 --- a/ci-scripts/ci_infra.yaml +++ b/ci-scripts/ci_infra.yaml @@ -143,7 +143,7 @@ ltebox-nano: - "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'" - "sleep 1" - "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &" - - "sleep 1" + - "sleep 2" Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen" LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%" @@ -154,7 +154,7 @@ sabox-nepes: - "sudo su -c 'screen -dm -S simulated_5g_hss /opt/hss_sim0609/start_5g_hss'" - "sleep 1" - "sudo /opt/ltebox/tools/start_sabox < /dev/null &> /dev/null" - - "sleep 1" + - "sleep 2" LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{amfLog.0,ngapcLog.0,ngapcommonLog.0,ngapsLog.0,xGwLog.0,upfLog.0} %%log_dir%%" Undeploy: "sudo /opt/ltebox/tools/stop_sabox; sudo killall screen" @@ -165,7 +165,7 @@ ltebox-nepes: - "sudo su -c 'screen -dm -S simulated_hss /opt/hss_sim0609/starthss'" - "sleep 1" - "sudo /opt/ltebox/tools/start_mme && sudo /opt/ltebox/tools/start_xGw &" - - "sleep 1" + - "sleep 2" Undeploy: "sudo /opt/ltebox/tools/stop_xGw; sudo /opt/ltebox/tools/stop_mme; sudo killall screen" LogCollect: "cp /opt/hss_sim0609/hss.log /opt/ltebox/var/log/{mmeLog.0,s1apcLog.0,s1apsLog.0,s11cLog.0,libLog.0,xGwLog.0} %%log_dir%%" From edd761185433d578de45b5309f0f32eb21d1cf3b Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 17 Mar 2026 17:03:37 +0100 Subject: [PATCH 30/37] pre-store pucch_ResourceCommon to avoid segfault in scheduling PUCCH at UE (the field in some scenarios was erased by RRCSetup before being used for ACK of MSG4, storing it in advance prevents the segfault) --- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 1 + openair2/LAYER2/NR_MAC_UE/mac_proto.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 2 ++ openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 11 ++++++----- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 224887252d..8029235fac 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -293,6 +293,7 @@ typedef struct { int n_CCE; int N_CCE; int initial_pucch_id; + int pucch_ResourceCommon; } PUCCH_sched_t; typedef struct { diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index f4d6d6bda8..e9d8b1b890 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -237,7 +237,7 @@ void nr_ra_succeeded(NR_UE_MAC_INST_t *mac, const frame_t frame, const int slot) void nr_ra_backoff_setting(RA_config_t *ra); void nr_get_RA_window(NR_UE_MAC_INST_t *mac); void prepare_msg4_msgb_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack); -void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind); +void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind, long *pucch_ResourceCommon); void release_PUCCH_SRS(NR_UE_MAC_INST_t *mac); void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac, bool reconf); void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int cc_id, const fapi_nr_synch_request_t *sync_req); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 78083f8907..8be86c95ad 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -1199,6 +1199,8 @@ void prepare_msg4_msgb_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack) .n_harq = 1}; current_harq->active = false; current_harq->ack_received = false; + const NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP; + configure_initial_pucch(&pucch, current_harq->pucch_resource_indicator, current_UL_BWP->pucch_ConfigCommon->pucch_ResourceCommon); RA_config_t *ra = &mac->ra; ra->ra_pucch = calloc_or_fail(1, sizeof(*ra->ra_pucch)); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index d6c49d3797..199d364d80 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1540,8 +1540,7 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, // configure pucch from Table 9.2.1-1 // only for ack/nack if (pucch->initial_pucch_id > -1 && pucch->pucch_resource == NULL) { - const int idx = *current_UL_BWP->pucch_ConfigCommon->pucch_ResourceCommon; - const initial_pucch_resource_t pucch_resourcecommon = get_initial_pucch_resource(idx); + const initial_pucch_resource_t pucch_resourcecommon = get_initial_pucch_resource(pucch->pucch_ResourceCommon); pucch_pdu->format_type = pucch_resourcecommon.format; pucch_pdu->start_symbol_index = pucch_resourcecommon.startingSymbolIndex; pucch_pdu->nr_of_symbols = pucch_resourcecommon.nrofSymbols; @@ -1551,7 +1550,7 @@ int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, pucch_pdu->prb_size = 1; // format 0 or 1 int RB_BWP_offset; - if (pucch->initial_pucch_id == 15) + if (pucch->pucch_ResourceCommon == 15) RB_BWP_offset = pucch_pdu->bwp_size >> 2; else RB_BWP_offset = pucch_resourcecommon.PRB_offset; @@ -2269,7 +2268,7 @@ void multiplex_pucch_resource(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *pucch, int n } } -void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind) +void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind, long *pucch_ResourceCommon) { /* see TS 38.213 9.2.1 PUCCH Resource Sets */ int delta_PRI = res_ind; @@ -2280,6 +2279,8 @@ void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind) int r_PUCCH = ((2 * n_CCE_0) / N_CCE_0) + (2 * delta_PRI); pucch->initial_pucch_id = r_PUCCH; pucch->pucch_resource = NULL; + AssertFatal(pucch_ResourceCommon, "pucch_ResourceCommon NULL\n"); + pucch->pucch_ResourceCommon = *pucch_ResourceCommon; } /******************************************************************* @@ -2468,7 +2469,7 @@ bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sche NR_PUCCH_Config_t *pucch_Config = current_UL_BWP ? current_UL_BWP->pucch_Config : NULL; if (!(pucch_Config && pucch_Config->resourceSetToAddModList && pucch_Config->resourceSetToAddModList->list.array[0])) - configure_initial_pucch(pucch, res_ind); + configure_initial_pucch(pucch, res_ind, current_UL_BWP->pucch_ConfigCommon->pucch_ResourceCommon); else { int resource_set_id = find_pucch_resource_set(pucch_Config, O_ACK); int n_list = pucch_Config->resourceSetToAddModList->list.count; From dfed62bd24c8255d22f2061e716fff957fe8a6c5 Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Mon, 30 Mar 2026 10:29:32 +0200 Subject: [PATCH 31/37] Better stubs for test_nr_ue_ra_procedures --- .../LAYER2/NR_MAC_UE/tests/CMakeLists.txt | 2 +- .../tests/test_nr_ue_ra_procedures.cpp | 63 ++++++++++++++----- 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/tests/CMakeLists.txt b/openair2/LAYER2/NR_MAC_UE/tests/CMakeLists.txt index 6dcad6fad8..406129c0aa 100644 --- a/openair2/LAYER2/NR_MAC_UE/tests/CMakeLists.txt +++ b/openair2/LAYER2/NR_MAC_UE/tests/CMakeLists.txt @@ -8,7 +8,7 @@ add_test(NAME test_nr_ue_power_procedures COMMAND ./test_nr_ue_power_procedures) add_executable(test_nr_ue_ra_procedures test_nr_ue_ra_procedures.cpp) -target_link_libraries(test_nr_ue_ra_procedures PRIVATE nr_ue_ra_procedures nr_ue_power_procedures GTest::gtest minimal_lib) +target_link_libraries(test_nr_ue_ra_procedures PRIVATE nr_ue_ra_procedures nr_ue_power_procedures GTest::gtest minimal_lib MAC_UE_NR) add_dependencies(tests test_nr_ue_ra_procedures) add_test(NAME test_nr_ue_ra_procedures COMMAND ./test_nr_ue_ra_procedures) diff --git a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp index 47c7ad4027..ae79c87aee 100644 --- a/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp +++ b/openair2/LAYER2/NR_MAC_UE/tests/test_nr_ue_ra_procedures.cpp @@ -6,6 +6,8 @@ extern "C" { #include "openair2/LAYER2/NR_MAC_UE/mac_proto.h" #include "executables/softmodem-common.h" +#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h" +#include "common/utils/ocp_itti/intertask_interface.h" static softmodem_params_t softmodem_params; softmodem_params_t *get_softmodem_params(void) @@ -18,7 +20,13 @@ void nr_mac_rrc_ra_ind(const module_id_t mod_id, bool success) void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti, bool prepare_payload) { } -tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP, +void nr_mac_rlc_status_ind(uint16_t ue_id, frame_t frame, int n_ch, const logical_chan_id_t *ch, mac_rlc_status_resp_t *ret) +{ +} +void nr_mac_rrc_inactivity_timer_ind(const module_id_t mod_id) +{ +} +tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP, const uint16_t ue_id, const bool gnb_flagP, const logical_chan_id_t channel_idP, @@ -27,32 +35,55 @@ tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP, { return 0; } -fapi_nr_ul_config_request_pdu_t *lockGet_ul_config(NR_UE_MAC_INST_t *mac, frame_t frame_tx, int slot_tx, uint8_t pdu_type) -{ - return nullptr; -} -void release_ul_config(fapi_nr_ul_config_request_pdu_t *configPerSlot, bool clearIt) +void nr_mac_rlc_data_ind(const module_id_t module_idP, + const uint16_t ue_id, + const bool gnb_flagP, + const nr_rlc_data_ind_t *data, + int num_data) { } -void remove_ul_config_last_item(fapi_nr_ul_config_request_pdu_t *pdu) + +bool nr_rlc_activate_srb0(int ue_id, + void *data, + void (*send_initial_ul_rrc_message)(int ue_id, const uint8_t *sdu, sdu_size_t sdu_len, void *data)) { + return true; } -int nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac, - int slot, - frame_t frame, - uint16_t rnti, - PUCCH_sched_t *pucch, - fapi_nr_ul_config_pucch_pdu *pucch_pdu) +int nr_rlc_module_init(nr_rlc_op_mode_t mode) { return 0; } -NR_UE_DL_BWP_t *get_dl_bwp_structure(NR_UE_MAC_INST_t *mac, int bwp_id, bool setup) +MessageDef *itti_alloc_new_message(task_id_t origin_task_id, instance_t originInstance, MessagesIds message_id) { return NULL; } -NR_UE_UL_BWP_t *get_ul_bwp_structure(NR_UE_MAC_INST_t *mac, int bwp_id, bool setup) +int itti_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message) +{ + return 0; +} +typedef uint32_t channel_t; +int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, + const int CC_id, + const uint8_t gNB_index, + const int hfn, + const frame_t frame, + const int slot, + const rnti_t rnti, + const uint32_t cellid, + const long arfcn, + const channel_t channel, + const uint8_t *pduP, + const sdu_size_t pdu_len) +{ + return 0; +} +void nr_mac_rrc_meas_ind_ue(module_id_t module_id, + uint32_t gNB_index, + uint16_t Nid_cell, + bool csi_meas, + bool is_neighboring_cell, + int rsrp_dBm) { - return NULL; } } #include From d93b0e13d2a02b5b9dd9bf34da5ec9fca4613eb8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 7 Apr 2026 21:16:08 +0200 Subject: [PATCH 32/37] Prevent infinite loop on HARQ PID=-1 and Single Entry PHR When receiving single-entry PHR with HARQ PID -1 (nr_mac_process_mac_pdu() is called with such parameter in at least two places), the error handling path calls continue skipping the accounting of the current sub-pdu (pduP and pdu_len). This results in an infinite loop. Fix by moving functionality into a separate function. Fixes: 2e0493632d35 ("RLC data ind: single call for complete TB at gNB") Signed-off-by: Robert Schmidt --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 74 ++++++++++--------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 8e208e1806..a9a48884dd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -226,6 +226,45 @@ static int estimate_ul_buffer_long_bsr(const NR_BSR_LONG *bsr) return estim_size; } +static void handle_single_entry_phr(const NR_UE_UL_BWP_t *ul_bwp, + NR_UE_sched_ctrl_t *sched_ctrl, + int harq_pid, + const NR_SINGLE_ENTRY_PHR_MAC_CE *phr) +{ + if (harq_pid < 0) { + LOG_E(NR_MAC, "Invalid HARQ PID %d\n", harq_pid); + return; + } + NR_sched_pusch_t *sched_pusch = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch; + + /* Save the phr info */ + int PH; + const int PCMAX = phr->PCMAX; + /* 38.133 Table10.1.17.1-1 */ + if (phr->PH < 55) { + PH = phr->PH - 32; + } else if (phr->PH < 63) { + PH = 24 + (phr->PH - 55) * 2; + } else { + PH = 38; + } + // in sched_ctrl we set normalized PH wrt MCS and PRBs + sched_ctrl->ph = PH + compute_ph_rb_factor(ul_bwp->scs, sched_pusch->rbSize); + bool hasDeltaMCS = ul_bwp->pusch_Config && ul_bwp->pusch_Config->pusch_PowerControl->deltaMCS; + if (hasDeltaMCS) + sched_ctrl->ph += compute_ph_mcs_factor(sched_pusch); + /* 38.133 Table10.1.18.1-1 */ + sched_ctrl->pcmax = PCMAX - 29; + LOG_D(NR_MAC, + "SINGLE ENTRY PHR %d PH %d (%d dB) R2 %d PCMAX %d (%d dBm)\n", + phr->R1, + PH, + sched_ctrl->ph, + phr->R2, + PCMAX, + sched_ctrl->pcmax); +} + // For both UL-SCH except: // - UL-SCH: fixed-size MAC CE(known by LCID) // - UL-SCH: padding @@ -510,43 +549,10 @@ static int nr_process_mac_pdu(instance_t module_idP, break; case UL_SCH_LCID_SINGLE_ENTRY_PHR: - if (harq_pid < 0) { - LOG_E(NR_MAC, "Invalid HARQ PID %d\n", harq_pid); - continue; - } - NR_sched_pusch_t *sched_pusch = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch; - /* Extract SINGLE ENTRY PHR elements for PHR calculation */ ce_ptr = &pduP[mac_subheader_len]; NR_SINGLE_ENTRY_PHR_MAC_CE *phr = (NR_SINGLE_ENTRY_PHR_MAC_CE *)ce_ptr; - /* Save the phr info */ - int PH; - const int PCMAX = phr->PCMAX; - /* 38.133 Table10.1.17.1-1 */ - if (phr->PH < 55) { - PH = phr->PH - 32; - } else if (phr->PH < 63) { - PH = 24 + (phr->PH - 55) * 2; - } else { - PH = 38; - } - // in sched_ctrl we set normalized PH wrt MCS and PRBs - sched_ctrl->ph = PH + compute_ph_rb_factor(ul_bwp->scs, sched_pusch->rbSize); - bool hasDeltaMCS = ul_bwp->pusch_Config && ul_bwp->pusch_Config->pusch_PowerControl->deltaMCS; - if (hasDeltaMCS) - sched_ctrl->ph += compute_ph_mcs_factor(sched_pusch); - /* 38.133 Table10.1.18.1-1 */ - sched_ctrl->pcmax = PCMAX - 29; - LOG_D(NR_MAC, - "SINGLE ENTRY PHR %d.%d R1 %d PH %d (%d dB) R2 %d PCMAX %d (%d dBm)\n", - frameP, - slot, - phr->R1, - PH, - sched_ctrl->ph, - phr->R2, - PCMAX, - sched_ctrl->pcmax); + handle_single_entry_phr(ul_bwp, sched_ctrl, harq_pid, phr); break; case UL_SCH_LCID_C_RNTI: From 176521e6ecce10397376d3b4db2ce88af0a1556a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 7 Apr 2026 21:24:39 +0200 Subject: [PATCH 33/37] call nr_process_mac_pdu() with current HARQ PID There is no real reason not to from what I can see. Signed-off-by: Robert Schmidt --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index a9a48884dd..a7e3ff9583 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -875,7 +875,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, // Decode the entire MAC PDU // It may have multiple MAC subPDUs, for example, a MAC subPDU with LCID 1 caring a RRCReestablishmentComplete - nr_process_mac_pdu(mod_id, old_UE, CC_id, frame, slot, sdu, sdu_len, -1); + nr_process_mac_pdu(mod_id, old_UE, CC_id, frame, slot, sdu, sdu_len, harq_pid); return; } @@ -888,9 +888,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id, memcpy(ra->cont_res_id, &sdu[1], sizeof(uint8_t) * 6); // Decode MAC PDU - // the function is only called to decode the contention resolution sub-header - // harq_pid set a non-valid value because it is not used in this call - nr_process_mac_pdu(mod_id, UE, CC_id, frame, slot, sdu, sdu_len, -1); + nr_process_mac_pdu(mod_id, UE, CC_id, frame, slot, sdu, sdu_len, harq_pid); LOG_I(NR_MAC, "Activating scheduling %s for TC_RNTI 0x%04x (state %s)\n", From 87402f4959cd34cad3775f5059eabfca1cd96a0f Mon Sep 17 00:00:00 2001 From: Romain Beurdouche Date: Thu, 5 Feb 2026 12:31:38 +0000 Subject: [PATCH 34/37] feat(nr_dlsch): option to provide the number of symbols per thread * Add option `--L1s.L1_num_tx_sym_per_thread` for the softmodems and `-Y` for `nr_dlsim` to provide the number of symbols processed per thread. It defaults to 0 which makes that every symbols are processed in one thread. * The last symbol processing task is processed in the L1 TX thread. --- executables/nr-gnb.c | 3 --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 26 ++++++++++++++++++-------- openair1/SIMULATION/NR_PHY/dlsim.c | 9 ++++++++- openair2/GNB_APP/L1_nr_paramdef.h | 6 ++++++ openair2/GNB_APP/gnb_config.c | 3 +++ 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index dfb94d5ad9..abbfa05df1 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -307,9 +307,6 @@ void init_gNB_Tpool(int inst) PHY_VARS_gNB *gNB; gNB = RC.gNB[inst]; gNB_L1_proc_t *proc = &gNB->proc; - // PUSCH symbols per thread need to be calculated by how many threads we have - gNB->num_pusch_symbols_per_thread = 1; - gNB->num_pdsch_symbols_per_thread = 1; // ULSCH decoding threadpool initTpool(get_softmodem_params()->threadPoolConfig, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE)); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index e6ae850093..d227148353 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -669,9 +669,15 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC // spawn symbol threads - int nb_tasks = rel15->NrOfSymbols / gNB->num_pdsch_symbols_per_thread; - if ((rel15->NrOfSymbols % gNB->num_pdsch_symbols_per_thread) > 0) - nb_tasks++; + int nb_tasks = 1; + int num_pdsch_symbols_per_task = rel15->NrOfSymbols; + if (gNB->num_pdsch_symbols_per_thread > 0) { + // symbol processing in thread pool enabled + num_pdsch_symbols_per_task = gNB->num_pdsch_symbols_per_thread; + nb_tasks = rel15->NrOfSymbols / num_pdsch_symbols_per_task; + if ((rel15->NrOfSymbols % num_pdsch_symbols_per_task) > 0) + nb_tasks++; + } pdschSymbolProc_t arr[nb_tasks]; task_ans_t ans; init_task_ans(&ans, nb_tasks); @@ -679,7 +685,7 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC unsigned int re_beginning_of_symbol = 0; int res = 0; for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols; - l_symbol += gNB->num_pdsch_symbols_per_thread) { + l_symbol += num_pdsch_symbols_per_task) { pdschSymbolProc_t *rdata = &arr[sz_arr]; rdata->ans = &ans; ++sz_arr; @@ -690,8 +696,8 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC rdata->slot = slot; rdata->startSymbol = l_symbol; res = rel15->NrOfSymbols - (l_symbol - rel15->StartSymbolIndex); - if (res >= gNB->num_pdsch_symbols_per_thread) - rdata->numSymbols = gNB->num_pdsch_symbols_per_thread; + if (res >= num_pdsch_symbols_per_task) + rdata->numSymbols = num_pdsch_symbols_per_task; else rdata->numSymbols = res; rdata->layerSz2 = layerSz2; @@ -711,8 +717,12 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC reset_meas(&rdata->dlsch_precoding_stats); for (int l = 0; l < rel15->nrOfLayers; l++) rdata->tx_layers[l] = tx_layers[l]; - task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata}; - pushTpool(&gNB->threadPool, t); + if (l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols - num_pdsch_symbols_per_task) { + task_t t = {.func = &nr_pdsch_symbol_processing, .args = rdata}; + pushTpool(&gNB->threadPool, t); + } else { + nr_pdsch_symbol_processing(rdata); + } } join_task_ans(&ans); for (int i = 0; i < nb_tasks; i++) { diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index c6fc036bf8..2c08ab3b6e 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -382,6 +382,8 @@ int main(int argc, char **argv) uint8_t dlsch_threads = 0; int chest_type[2] = {0}; uint8_t max_ldpc_iterations = 5; + // number of PDSCH symbols per thread = 0 means do not use thread pool + int num_pdsch_symbols_per_thread = 0; if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == 0) { exit_fun("[NR_DLSIM] Error, configuration module init failed\n"); } @@ -583,6 +585,10 @@ int main(int argc, char **argv) gNBthreads[sizeof(gNBthreads)-1]=0; break; + case 'Y': + num_pdsch_symbols_per_thread = atoi(optarg); + break; + case 'Z' : filename_csv = strdup(optarg); AssertFatal(filename_csv != NULL, "strdup() error: errno %d\n", errno); @@ -657,6 +663,7 @@ int main(int argc, char **argv) printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n"); printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); printf("-X gNB thread pool configuration, n => no threads\n"); + printf("-Y Number of symbols processed per PDSCH generation thread\n"); printf("-Z Output filename (.csv format) for stats\n"); exit (-1); break; @@ -715,7 +722,7 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; - gNB->num_pdsch_symbols_per_thread = 1; + gNB->num_pdsch_symbols_per_thread = num_pdsch_symbols_per_thread; NR_ServingCellConfigCommon_t *scc = calloc(1,sizeof(*scc));; prepare_scc(scc); diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 1faa03c475..9e33c57795 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -28,6 +28,10 @@ #define L1_MAX_LDPC_ITERATIONS "max_ldpc_iterations" #define L1_RX_THREAD_CORE "L1_rx_thread_core" #define L1_TX_THREAD_CORE "L1_tx_thread_core" +#define L1_NUM_RX_SYM_PER_THREAD "L1_num_rx_sym_per_thread" +#define HLP_L1_NUM_RX_SYM_PER_THREAD "number of symbols processed per PUSCH generation thread" +#define L1_NUM_TX_SYM_PER_THREAD "L1_num_tx_sym_per_thread" +#define HLP_L1_NUM_TX_SYM_PER_THREAD "number of symbols processed per PDSCH generation thread" #define HLP_TP_SIZ "thread_pool_size paramter removed, please use --thread-pool" #define L1_TX_AMP_BACKOFF_dB "tx_amp_backoff_dB" #define HLP_L1TX_BO "Backoff from full-scale output at the L1 entity(frequency domain), ex. 12 would corresponding to 14-bit input level (6 dB/bit). Default 36 dBFS for OAI RU entity" @@ -58,6 +62,8 @@ {L1_MAX_LDPC_ITERATIONS, NULL, 0, .uptr=NULL, .defintval=8, TYPE_UINT, 0}, \ {L1_RX_THREAD_CORE, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \ {L1_TX_THREAD_CORE, NULL, 0, .iptr=NULL, .defintval=-1, TYPE_INT, 0}, \ + {L1_NUM_RX_SYM_PER_THREAD, HLP_L1_NUM_RX_SYM_PER_THREAD, 0, .iptr=NULL, .defintval=1, TYPE_INT, 0}, \ + {L1_NUM_TX_SYM_PER_THREAD, HLP_L1_NUM_TX_SYM_PER_THREAD, 0, .iptr=NULL, .defintval=0, TYPE_INT, 0}, \ {L1_TX_AMP_BACKOFF_dB, HLP_L1TX_BO,0, .uptr=NULL, .defintval=36, TYPE_UINT, 0}, \ {L1_PHASE_COMP, HLP_L1_PHASE_COMP,PARAMFLAG_BOOL, .uptr=NULL,.defintval=1, TYPE_UINT, 0}, \ {L1_NUM_ANTENNAS_PER_THREAD, HLP_NUM_ARX,0, .uptr=NULL, .defintval=1, TYPE_UINT, 0}, \ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 4928d98183..a73a77b0ee 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -841,6 +841,9 @@ void RCconfig_NR_L1(void) gNB->L1_rx_thread_core = *gpd(params, np, L1_RX_THREAD_CORE)->iptr; gNB->L1_tx_thread_core = *gpd(params, np, L1_TX_THREAD_CORE)->iptr; LOG_I(NR_PHY, "thread cores for L1_RX %d L1_TX %d\n", gNB->L1_rx_thread_core, gNB->L1_tx_thread_core); + // PUSCH symbols per thread need to be calculated by how many threads we have + gNB->num_pusch_symbols_per_thread = *gpd(params, np, L1_NUM_RX_SYM_PER_THREAD)->iptr; + gNB->num_pdsch_symbols_per_thread = *gpd(params, np, L1_NUM_TX_SYM_PER_THREAD)->iptr; gNB->TX_AMP = min(32767.0 / pow(10.0, .05 * (double)(*gpd(params, np, L1_TX_AMP_BACKOFF_dB)->uptr)), INT16_MAX); LOG_I(NR_PHY, "TX_AMP = %d (-%d dBFS)\n", gNB->TX_AMP, *gpd(params, np, L1_TX_AMP_BACKOFF_dB)->uptr); AssertFatal(gNB->TX_AMP > 300, "TX_AMP is too small, must be larger than 300 (is %d)\n", gNB->TX_AMP); From 51d84419275439b1738ef4db24d52b3ba7cbe417 Mon Sep 17 00:00:00 2001 From: Sagar Arora Date: Wed, 8 Apr 2026 03:37:44 +0200 Subject: [PATCH 35/37] doc(record_db): explain how to use record_db Signed-off-by: Sagar Arora Reviewed-by: Nick Hedberg Reviewed-by: Robert Schmidt Assisted-by: gpt-5.4 --- common/utils/T/DOC/T.md | 1 + common/utils/T/DOC/T/record_db.md | 177 ++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 common/utils/T/DOC/T/record_db.md diff --git a/common/utils/T/DOC/T.md b/common/utils/T/DOC/T.md index 12a4ba42cf..a4ef5e99c3 100644 --- a/common/utils/T/DOC/T.md +++ b/common/utils/T/DOC/T.md @@ -14,6 +14,7 @@ It is made of two main parts: * [Basic usage](./T/basic.md) * [Record](./T/record.md) +* [Record to ClickHouse](./T/record_db.md) * [Replay](./T/replay.md) * [Multiple tracers](./T/multi.md) * [MAC PDUs and wireshark](./T/wireshark.md) diff --git a/common/utils/T/DOC/T/record_db.md b/common/utils/T/DOC/T/record_db.md new file mode 100644 index 0000000000..2c3825252f --- /dev/null +++ b/common/utils/T/DOC/T/record_db.md @@ -0,0 +1,177 @@ + + +# Record to ClickHouse + +This document describes the database-backed T tracer. Unlike [`record`](./record.md), +which writes a `.raw` file, `record_db` writes T tracer events +directly into a [ClickHouse database](https://clickhouse.com/docs/intro). + +## What `record_db` does + +`record_db` connects to a running OAI softmodem instance through +the standard T tracer TCP interface and: + +- Enables the selected events +- Creates one ClickHouse table per enabled event +- Batches received rows and inserts them into ClickHouse + +Each table always contains: + +- `TsSwNs`: software receive timestamp created by `record_db` + +If an event has both `frame` and `slot` (or `subframe`) fields, the +tool also adds: + +- `TsTxUtcNs`: transmission timestamp reconstructed from frame/slot + +The remaining columns come from the event definition in +`T_messages.txt`. + +## Build + +`record_db` pulls external dependencies (`clickhouse-cpp` and `fmtlog`). +Also make sure you have `libzstd-dev` version > 1.5.X. + +From the repository using build_oai: + +```shell +cd cmake_targets +./build_oai --gNB --nrUE --cmake-opt -DT_RECORD_DB=ON +``` + +Or, from an existing build directory using cmake: + +```shell +cd cmake_targets/ran_build/build +cmake -DT_RECORD_DB=ON . +make T_tools +``` + +The binary is then available in: + +```shell +cmake_targets/ran_build/build/common/utils/T/tracer/record_db +``` + +## Prerequisites + +- a running ClickHouse server reachable from `record_db` +- an OAI softmodem started with T tracer enabled, typically with `--T_stdout 2` +- the tracer message description file, usually `common/utils/T/T_messages.txt` + +By default `record_db` connects to: + +- T tracer endpoint: `127.0.0.1:2021` +- ClickHouse native endpoint: `localhost:9000` +- ClickHouse database: `oai` + +## Start the softmodem + +Start the gNB or UE with T tracer enabled as described in +[basic usage](./basic.md). For example: + +```shell +cd cmake_targets/ran_build/build +sudo ./nr-softmodem -O --T_stdout 2 --T_nowait +``` + +Use `--T_port ` on the softmodem side if you want a port other +than `2021`, and pass the same value to `record_db` with `-p`. + +## Basic example + +To enable all events except the most verbose groups and write them to +ClickHouse: + +```shell +cd cmake_targets/ran_build/build/common/utils/T/tracer +./record_db -d ../T_messages.txt \ + -ON \ + -off VCD \ + -off HEAVY \ + -off LEGACY_GROUP_TRACE \ + -off LEGACY_GROUP_DEBUG +``` + +To stop recording, press `Ctrl-C`. The tool flushes pending buffered +rows before exiting. + +## Select specific events + +The event selection rules are the same as for [`record`](./record.md): + +- `-ON` enables all events +- `-OFF` disables all events +- `-on ` enables one group or one event +- `-off ` disables one group or one event + +These options are processed in order. For example: + +```shell +./record_db -d ../T_messages.txt -OFF -on GNB_PHY_UL_FD_PUSCH_IQ -on GNB_PHY_UL_PAYLOAD_RX_BITS +``` + +This starts from everything disabled and enables only the two listed +events. + +## ClickHouse options + +`record_db` accepts the following database-related options: + +```shell +-ch-host ClickHouse host, default `localhost` +-ch-port ClickHouse native port, default `9000` +-ch-db database name, default `oai` +-ch-user optional ClickHouse user +-ch-pass optional ClickHouse password +-ch-droptables drop the target database before starting +-debug enable debug logging +``` + +Example using a remote ClickHouse instance: + +```shell +./record_db -d ../T_messages.txt \ + -ON -off HEAVY \ + -ip 192.168.1.10 -p 2021 \ + -ch-host 192.168.1.20 -ch-port 9000 -ch-db oai_traces +``` + +## Inspect the data + +Once `record_db` is running, connect to ClickHouse and inspect the +generated tables: + +```shell +clickhouse-client --host localhost --port 9000 --query "SHOW TABLES FROM oai" +``` + +Count rows in one event table: + +```shell +clickhouse-client --host localhost --port 9000 --query "SELECT count(*) FROM oai.GNB_PHY_UL_FD_PUSCH_IQ" +``` + +Inspect the latest samples: + +```shell +clickhouse-client --host localhost --port 9000 --query "SELECT * FROM oai.GNB_PHY_UL_FD_PUSCH_IQ ORDER BY TsSwNs DESC LIMIT 5" +``` + +## Important behavior + +- Tables are created only for enabled events. +- Table names match the event names from `T_messages.txt`. +- The current implementation creates tables with ClickHouse + `ENGINE = Memory()`. +- Because of that engine choice, recorded data remains available while + ClickHouse is running, but is not persistent across a ClickHouse + restart. +- If `-ch-droptables` is used, the whole target database is dropped and + recreated before capture starts. + +## Get the full option list + +```shell +./record_db -h +``` From 83ffa53ccc1791eba4ee66da43b55e7eab2d8a5f Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Thu, 9 Apr 2026 16:30:42 +0200 Subject: [PATCH 36/37] fix compilation of T tracers with 'make' Modification required after !3977 is merged. --- common/utils/T/tracer/event.h | 1 - common/utils/T/tracer/logger/textlog.c | 2 +- common/utils/T/tracer/macpdu2wireshark.c | 2 +- common/utils/T/tracer/packet-mac-lte.h | 6 +++--- common/utils/T/tracer/record.c | 1 - common/utils/T/tracer/utils.h | 2 ++ common/utils/T/tracer/view/stdout.c | 1 + common/utils/T/tracer/view/view.h | 1 - 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/utils/T/tracer/event.h b/common/utils/T/tracer/event.h index e488c0c703..4e2e766f11 100644 --- a/common/utils/T/tracer/event.h +++ b/common/utils/T/tracer/event.h @@ -7,7 +7,6 @@ #include "utils.h" #include "../T_defs.h" -#include "common/platform_types.h" #ifdef T_SEND_TIME #include #endif diff --git a/common/utils/T/tracer/logger/textlog.c b/common/utils/T/tracer/logger/textlog.c index 2009bc5a32..34422e5e29 100644 --- a/common/utils/T/tracer/logger/textlog.c +++ b/common/utils/T/tracer/logger/textlog.c @@ -7,7 +7,7 @@ #include "handler.h" #include "database.h" #include "view/view.h" -#include "utils.h" +#include "../utils.h" #include "filter/filter.h" #include #include diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index 9a931e2690..b2b5b23204 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -323,7 +323,7 @@ void dl(void *_d, event e) } trace_lte(e.sending_time, d, DIRECTION_DOWNLINK, - e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI_T, e.e[d->dl_rnti].i, + e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI, e.e[d->dl_rnti].i, e.e[d->dl_frame].i, e.e[d->dl_subframe].i, e.e[d->dl_data].b, e.e[d->dl_data].bsize, NO_PREAMBLE, NO_SR_RNTI); diff --git a/common/utils/T/tracer/packet-mac-lte.h b/common/utils/T/tracer/packet-mac-lte.h index 3df8d66314..715bbb68d9 100644 --- a/common/utils/T/tracer/packet-mac-lte.h +++ b/common/utils/T/tracer/packet-mac-lte.h @@ -27,12 +27,12 @@ /* rntiType */ #define NO_RNTI 0 -#define P_RNTI_T 1 +#define P_RNTI 1 #define RA_RNTI 2 #define C_RNTI 3 -#define SI_RNTI_T 4 +#define SI_RNTI 4 #define SPS_RNTI 5 -#define M_RNTI_T 6 +#define M_RNTI 6 #define SL_BCH_RNTI 7 #define SL_RNTI 8 #define SC_RNTI 9 diff --git a/common/utils/T/tracer/record.c b/common/utils/T/tracer/record.c index c636ba3457..0e4611fab3 100644 --- a/common/utils/T/tracer/record.c +++ b/common/utils/T/tracer/record.c @@ -11,7 +11,6 @@ #include "utils.h" #include "../T_defs.h" #include "configuration.h" -#include "common/platform_types.h" void usage(void) { diff --git a/common/utils/T/tracer/utils.h b/common/utils/T/tracer/utils.h index 8a4915a19f..ebe595b2ec 100644 --- a/common/utils/T/tracer/utils.h +++ b/common/utils/T/tracer/utils.h @@ -5,6 +5,8 @@ #ifndef _UTILS_H_ #define _UTILS_H_ +#define UNUSED(x) (void)x + void new_thread(void *(*f)(void *), void *data); void sleepms(int ms); void bps(char *out, float v, char *suffix); diff --git a/common/utils/T/tracer/view/stdout.c b/common/utils/T/tracer/view/stdout.c index 7f039cc3d7..f9b39b6e46 100644 --- a/common/utils/T/tracer/view/stdout.c +++ b/common/utils/T/tracer/view/stdout.c @@ -3,6 +3,7 @@ */ #include "view.h" +#include "../utils.h" #include #include #include diff --git a/common/utils/T/tracer/view/view.h b/common/utils/T/tracer/view/view.h index 1b4596119b..a7c3eb3711 100644 --- a/common/utils/T/tracer/view/view.h +++ b/common/utils/T/tracer/view/view.h @@ -6,7 +6,6 @@ #define _VIEW_H_ #include "gui/gui.h" -#include "common/platform_types.h" /* defines the public API of views */ From 03350ab21b118f2794667eea11f2b398a3ecb0cb Mon Sep 17 00:00:00 2001 From: Romain Beurdouche Date: Thu, 19 Feb 2026 09:57:08 +0000 Subject: [PATCH 37/37] doc(tuning_and_security): extend the performance tuning section Extend the performance tuning section of documentation to include explanation on the `--L1s.L1_num_tx_sym_per_thread` option and on the AMD EPYC core complex behavior --- doc/NR_SA_Tutorial_COTS_UE.md | 1 + doc/tuning_and_security.md | 103 ++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) diff --git a/doc/NR_SA_Tutorial_COTS_UE.md b/doc/NR_SA_Tutorial_COTS_UE.md index 7f73be72f0..b6b8d4e235 100644 --- a/doc/NR_SA_Tutorial_COTS_UE.md +++ b/doc/NR_SA_Tutorial_COTS_UE.md @@ -193,6 +193,7 @@ sudo ethtool -G enp1s0f0 tx 4096 rx 4096 - Enable Performance Mode `sudo cpupower idle-set -D 0` - If you get real-time problems on heavy UL traffic, reduce the maximum UL MCS using an additional command-line switch: `--MACRLCs.[0].ul_max_mcs 14`. - You can also reduce the number of LDPC decoder iterations, which will make the LDPC decoder take less time: `--L1s.[0].max_ldpc_iterations 4`. +- Read more on system tuning in the [dedicated document on performance tuning](./tuning_and_security.md#performance-tuning). ### 6.3 Uplink issues related with noise on the DC carriers diff --git a/doc/tuning_and_security.md b/doc/tuning_and_security.md index af8e77c0f6..11e07b6e9b 100644 --- a/doc/tuning_and_security.md +++ b/doc/tuning_and_security.md @@ -69,6 +69,109 @@ sudo sysctl -n -e -q -w net.core.wmem_default=134217728 sudo sysctl -n -e -q -w net.core.wmem_max=134217728 ``` +### System tuning +In order to get an optimal real-time behavior, a few tunings can be performed on the host system: +- The use of isolated cores for the softmodem prevents competitions on the usage of core between the softmodem and other processes. + Core isolation is enabled through the kernel command line. + **Warning: modifying the kernel command line can harm the OS behavior. Proceed with caution.** + Refer to the [OAI 7.2 Fronthaul Interface Tutorial](./ORAN_FHI7.2_Tutorial.md) for examples. + +### Softmodem tuning +The way the NR softmodem uses the computing ressource can be configured. +It can have a significant effect on the performance and real-time behavior: +- The L1 TX and L1 RX threads are the two main threads + executing the L1 RX and L1 TX pipelines. + These threads are ideally assigned to two dedicated cores. + To be dedicated, the cores should be isolated in the + kernel parameters and not be assigned elsewhere. + They can be assigned to specified cores with options + `--L1s.[0].L1_tx_thread_core` and `--L1s.[0].L1_rx_thread_core` + followed by a core id. +- The thread pool is a group of processor cores over which + some baseband processing worker cores execute. + It is configured by providing a list of core ids + after option `--thread-pool`. + `-1` can also be passed instead of a core id + in order to use a floating core. + By default, the thread pool is 8 floating cores. +- PDSCH generation (i.e., layer mapping and precoding) is by default executed + in the L1 TX thread but can be multithreaded using the thread pool. + This is enabled by option `--L1s.[0].L1_num_tx_sym_per_thread` followed + by the number of symbols that should be processed in each thread. + This option can also be set in the gNB configuration file in field + `L1_num_tx_sym_per_thread` in the `L1s` section. + +### Workarounds +If the real-time performance remains bad after tuning the system and softmodem, +some workarounds allow to lower the computing demand +at the cost of lower network performance: +- If you get real-time problems on heavy UL traffic, + reduce the maximum UL MCS using an additional + command-line switch: `--MACRLCs.[0].ul_max_mcs 14`. + This comes at the cost of a lower spectral efficiency + (i.e., less data for the same radio resource). +- You can also reduce the number of LDPC decoder iterations, + which will make the LDPC decoder take less time: + `--L1s.[0].max_ldpc_iterations 4`. + The default number of LDPC iterations is 8. + Lowering the number of iteration comes at the cost + of more unsuccessful transmissions. + OAI offers multiple implementation of LDPC coding, + including offloading to an accelerator, + the number of LDPC iteration should be chosen accordingly. + +### Known hardware behaviors +Here is a **non-exhaustive** list of known behaviors related to hardware architecture: +- On some AMD EPYC series processors with Zen architecture + (at least every Zen4, Zen4c, Zen5 and Zen5c based processors + experience this behavior), + the processor is made of multiple dies holding one or multiple + core complexes which are groups of cores with an L3 cache. + This means that cores from different core complexes + do not share the same L3 cache and communication between + these cores implies inter L3 cache communication + within a die or, even worse, between dies, + which has a cost in term of latency. + Depending on the system configuration, + the NUMA topology may reflect this physical topology, + which can induce even further latency for + inter core complex communication. + The softmodem is sensitive to this latency and its performance + can be harmed if it uses cores across the border of dies or core complexes, + especially when multithreading of PDSCH generation is enabled + (argument of `--L1s.[0].L1_num_tx_sym_per_thread` is superior to 0). + **Solution**: We recommend to use only one core complex + or one die for allocating cores to nr-softmodem process. +- NUMA architecture: Make sure you don't assign cores to nr-softmodem from + different numa nodes. Cores from different numa cores can induce latency. + It is preferred to use the cores from numa node + which is used by the Fronthaul NIC. + +**Example**: How to assign cores to `nr-softmodem` process for gNB/DU connected to an o-ran 7.2 O-RU on EPYC 9575F (64 Zen5) +assuming that we have configured `L1s.[0].L1_num_tx_sym_per_thread = 1` + +There are 8 cores per core complex and one core complex per die. You can visulize this topology using + +```bash +# Ubuntu 25.04 +for X in $(seq 0 63); do echo -n "cpu$X -> die "; cat /sys/devices/system/cpu/cpu$X/topology/die_id; done +``` + +A 100MHz 4x4 FR1 gNB/DU with FHI 7.2 can be executed with full capabilities (4DL and 2UL layers) +on a single core complex (cpus 0-7 in this example) by folowing the instructions of the +[OAI 7.2 Fronthaul Interface Tutorial](./ORAN_FHI7.2_Tutorial.md) +with the following core assignment: + +- `L1s.[0].L1_tx_thread_core = 0` +- `L1s.[0].L1_rx_thread_core = 1` +- `RUs.[0].ru_thread_core = 2` +- `fhi_72.system_core = 3` +- `fhi_72.io_core = 4` +- `fhi_72.worker_cores.[0] = 5` (minimum 1 core) +- `thread-pool: 2,3,6,7` + (thread pool can overlap with `RUs.[0].ru_thread_core` and `fhi_72.system_core`) + + ## Capabilities Historically, all softmodems are executed as `root`, typically using `sudo`.