Merge remote-tracking branch 'origin/nr-gnb-config-refactor' into integration_2025_w16 (!3293)
Cleanup and refactor initial gNB configuration This is follow-up on !3048 (merged). Major changes in this MR: - Add config functions to reduce redundant code repeated in multiple places in the file - Add macros to reduce redundant code in gNB configuration - Refactor RCconfig_NR_NG - Cleanup obsolete and commented out code - Refactor includes in executables/nr-gnb.c - Introduce platform type plmn_id_t for consistency across the stack: F1AP, NGAP can now use the same struct type - And other minor formatting
This commit is contained in:
@@ -24,6 +24,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct plmn_id_s {
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
} plmn_id_t;
|
||||
|
||||
typedef struct nssai_s {
|
||||
uint8_t sst;
|
||||
uint32_t sd;
|
||||
|
||||
@@ -167,4 +167,20 @@ typedef struct paramlist_def {
|
||||
int numelt ;
|
||||
} paramlist_def_t;
|
||||
|
||||
/* Macros to get parameters with the config module API */
|
||||
#define GET_PARAMS(param_def, param_desc, prefix) \
|
||||
printf("Reading '%s' section from the config file\n", #param_def); \
|
||||
paramdef_t param_def[] = param_desc; \
|
||||
config_get(config_get_if(), param_def, sizeofArray(param_def), prefix);
|
||||
|
||||
/* Macros to get params lists with the config module API */
|
||||
#define GET_PARAMS_LIST(param_list, param_def, param_desc, list_name, prefix, ...) \
|
||||
paramdef_t param_def[] = param_desc; \
|
||||
paramlist_def_t param_list = {list_name, NULL, 0}; \
|
||||
__VA_OPT__(checkedparam_t config_check_##param_def[] = __VA_ARGS__; \
|
||||
static_assert(sizeofArray(config_check_##param_def) == sizeofArray(param_def), \
|
||||
"param_def_t array and corresponding checkedparam_t array should have the same size"); \
|
||||
for (int i = 0; i < sizeofArray(param_def); ++i) param_def[i].chkPptr = &(config_check_##param_def[i]);) \
|
||||
config_getlist(config_get_if(), ¶m_list, param_def, sizeofArray(param_def), prefix);
|
||||
|
||||
#endif /* INCLUDE_CONFIG_PARAMDESC_H */
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
#define NB_RAB_MAX 11 /* from LTE_maxDRB in LTE_asn_constant.h */
|
||||
#define RAB_OFFSET 0x000F
|
||||
|
||||
#define MAX_NUM_SLICES 1024
|
||||
|
||||
// RLC Entity
|
||||
#define RLC_TX_MAXSIZE 10000000
|
||||
#define RLC_RX_MAXSIZE 10000000
|
||||
|
||||
+31
-40
@@ -31,54 +31,45 @@
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <pthread.h>
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
#include "assertions.h"
|
||||
#include <common/utils/LOG/log.h>
|
||||
#include <common/utils/system.h>
|
||||
|
||||
#include "PHY/types.h"
|
||||
|
||||
#include <fcntl.h> // for SEEK_SET
|
||||
#include <pthread.h> // for pthread_join
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/system.h"
|
||||
#include "PHY/NR_ESTIMATION/nr_ul_estimation.h"
|
||||
#include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "openair1/PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "PHY/INIT/nr_phy_init.h"
|
||||
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
#include "PHY/defs_RU.h"
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/nr_sched_response.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
#include "radio/COMMON/common_lib.h"
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
#include "assertions.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/OTG/otg_tx.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "gnb_paramdef.h"
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
#include "T.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include <nfapi/oai_integration/nfapi_pnf.h>
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_ulsch.h>
|
||||
#include <openair1/PHY/NR_TRANSPORT/nr_dlsch.h>
|
||||
#include <PHY/NR_ESTIMATION/nr_ul_estimation.h>
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "notified_fifo.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/nr_sched_response.h"
|
||||
#include "thread-pool.h"
|
||||
#include "time_meas.h"
|
||||
#include "utils.h"
|
||||
|
||||
// #define USRP_DEBUG 1
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
//#define TICK_TO_US(ts) (ts.diff)
|
||||
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
|
||||
#define L1STATSSTRLEN 16384
|
||||
static void rx_func(processingData_L1_t *param);
|
||||
|
||||
@@ -518,9 +518,9 @@ static void initialize_agent(ngran_node_t node_type, e2_agent_args_t oai_args)
|
||||
const gNB_RRC_INST* rrc = RC.nrrrc[0];
|
||||
assert(rrc != NULL && "rrc cannot be NULL");
|
||||
|
||||
const int mcc = rrc->configuration.mcc[0];
|
||||
const int mnc = rrc->configuration.mnc[0];
|
||||
const int mnc_digit_len = rrc->configuration.mnc_digit_length[0];
|
||||
const int mcc = rrc->configuration.plmn[0].mcc;
|
||||
const int mnc = rrc->configuration.plmn[0].mnc;
|
||||
const int mnc_digit_len = rrc->configuration.plmn[0].mnc_digit_length;
|
||||
// const ngran_node_t node_type = rrc->node_type;
|
||||
int nb_id = 0;
|
||||
int cu_du_id = 0;
|
||||
@@ -597,8 +597,6 @@ int main( int argc, char **argv ) {
|
||||
char *pckg = strdup(OAI_PACKAGE_VERSION);
|
||||
LOG_I(HW, "Version: %s\n", pckg);
|
||||
|
||||
// don't create if node doesn't connect to RRC/S1/GTP
|
||||
const ngran_node_t node_type = get_node_type();
|
||||
// Init RAN context
|
||||
if (!(CONFIG_ISFLAGSET(CONFIG_ABORT)))
|
||||
NRRCConfig();
|
||||
@@ -613,6 +611,9 @@ int main( int argc, char **argv ) {
|
||||
RCconfig_nr_prs();
|
||||
}
|
||||
|
||||
// don't create if node doesn't connect to RRC/S1/GTP
|
||||
const ngran_node_t node_type = get_node_type();
|
||||
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
int ret = create_gNB_tasks(node_type, uniqCfg);
|
||||
AssertFatal(ret == 0, "cannot create ITTI tasks\n");
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/sctp.h>
|
||||
#include "common/5g_platform_types.h"
|
||||
#include "common/platform_constants.h"
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Defines to access message fields.
|
||||
@@ -92,12 +93,6 @@ typedef struct f1ap_net_config_t {
|
||||
uint16_t DUport;
|
||||
} f1ap_net_config_t;
|
||||
|
||||
typedef struct f1ap_plmn_t {
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
} f1ap_plmn_t;
|
||||
|
||||
typedef struct f1ap_cp_tnl_s {
|
||||
in_addr_t tl_address; // currently only IPv4 supported
|
||||
uint16_t port;
|
||||
@@ -129,7 +124,7 @@ typedef struct f1ap_tdd_info_t {
|
||||
|
||||
typedef struct f1ap_served_cell_info_t {
|
||||
// NR CGI
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid; // NR Global Cell Id
|
||||
|
||||
// NR Physical Cell Ids
|
||||
@@ -140,7 +135,7 @@ typedef struct f1ap_served_cell_info_t {
|
||||
|
||||
// Number of slice support items (max 16, could be increased to as much as 1024)
|
||||
uint16_t num_ssi;
|
||||
nssai_t nssai[16];
|
||||
nssai_t nssai[MAX_NUM_SLICES];
|
||||
|
||||
f1ap_mode_t mode;
|
||||
union {
|
||||
@@ -192,7 +187,7 @@ typedef struct f1ap_sib_msg_t {
|
||||
} f1ap_sib_msg_t;
|
||||
|
||||
typedef struct served_cells_to_activate_s {
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
// NR Global Cell Id
|
||||
uint64_t nr_cellid;
|
||||
/// NRPCI [int 0..1007]
|
||||
@@ -239,7 +234,7 @@ typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
|
||||
uint16_t num_cells_failed_to_be_activated;
|
||||
struct {
|
||||
// NR CGI
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid;
|
||||
uint16_t cause;
|
||||
} cells_failed_to_be_activated[F1AP_MAX_NB_CELLS];
|
||||
@@ -256,7 +251,7 @@ typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
|
||||
struct {
|
||||
uint32_t gNB_CU_ue_id;
|
||||
// NR CGI
|
||||
f1ap_plmn_t ue_plmn;
|
||||
plmn_id_t ue_plmn;
|
||||
uint64_t ue_nr_cellid;
|
||||
} dedicatedSIDeliveryNeededUEs[F1AP_MAX_NO_UE_ID];
|
||||
} f1ap_gnb_cu_configuration_update_acknowledge_t;
|
||||
@@ -283,7 +278,7 @@ typedef struct f1ap_gnb_du_configuration_update_s {
|
||||
/// int cells_to_modify
|
||||
uint16_t num_cells_to_modify;
|
||||
struct {
|
||||
f1ap_plmn_t old_plmn;
|
||||
plmn_id_t old_plmn;
|
||||
uint64_t old_nr_cellid; // NR Global Cell Id
|
||||
f1ap_served_cell_info_t info;
|
||||
f1ap_gnb_du_system_info_t *sys_info;
|
||||
@@ -293,7 +288,7 @@ typedef struct f1ap_gnb_du_configuration_update_s {
|
||||
uint16_t num_cells_to_delete;
|
||||
struct {
|
||||
// NR CGI
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid; // NR Global Cell Id
|
||||
} cell_to_delete[F1AP_MAX_NB_CELLS];
|
||||
/// gNB-DU unique ID, at least within a gNB-CU (0 .. 2^36 - 1)
|
||||
@@ -333,7 +328,7 @@ typedef struct f1ap_dl_rrc_message_s {
|
||||
|
||||
typedef struct f1ap_initial_ul_rrc_message_s {
|
||||
uint32_t gNB_DU_ue_id;
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
/// nr cell id
|
||||
uint64_t nr_cellid;
|
||||
/// crnti
|
||||
@@ -475,7 +470,7 @@ typedef struct f1ap_ue_context_setup_s {
|
||||
uint32_t gNB_CU_ue_id;
|
||||
uint32_t gNB_DU_ue_id;
|
||||
// SpCell Info
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid;
|
||||
uint8_t servCellIndex;
|
||||
uint8_t *cellULConfigured;
|
||||
@@ -549,7 +544,7 @@ typedef struct f1ap_paging_ind_s {
|
||||
uint16_t ueidentityindexvalue;
|
||||
uint64_t fiveg_s_tmsi;
|
||||
uint8_t fiveg_s_tmsi_length;
|
||||
f1ap_plmn_t plmn;
|
||||
plmn_id_t plmn;
|
||||
uint64_t nr_cellid;
|
||||
uint8_t paging_drx;
|
||||
} f1ap_paging_ind_t;
|
||||
|
||||
@@ -435,10 +435,8 @@ typedef enum ngap_paging_ind_present_s {
|
||||
} ngap_paging_ind_present_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t mcc;
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
uint8_t num_nssai;
|
||||
plmn_id_t plmn;
|
||||
uint16_t num_nssai;
|
||||
nssai_t s_nssai[8];
|
||||
} ngap_plmn_t;
|
||||
|
||||
|
||||
@@ -416,9 +416,7 @@ typedef struct NbIoTRrcConfigurationReq_s {
|
||||
// gNB: GNB_APP -> RRC messages
|
||||
typedef struct NRRrcConfigurationReq_s {
|
||||
uint32_t tac;
|
||||
uint16_t mcc[PLMN_LIST_MAX_SIZE];
|
||||
uint16_t mnc[PLMN_LIST_MAX_SIZE];
|
||||
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
|
||||
plmn_id_t plmn[PLMN_LIST_MAX_SIZE];
|
||||
uint8_t num_plmn;
|
||||
|
||||
bool um_on_default_drb;
|
||||
|
||||
+19
-34
@@ -36,19 +36,18 @@ static void get_NGU_S1U_addr(char **addr, uint16_t *port)
|
||||
uint32_t gnb_port_for_NGU = 0;
|
||||
char *gnb_ipv4_address_for_S1U = NULL;
|
||||
uint32_t gnb_port_for_S1U = 0;
|
||||
char gtpupath[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
|
||||
LOG_I(GTPU, "Configuring GTPu\n");
|
||||
|
||||
/* get number of active eNodeBs */
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
// get gNB params
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal(num_gnbs > 0, "Failed to parse config file no active gNodeBs in %s \n", GNB_CONFIG_STRING_ACTIVE_GNBS);
|
||||
|
||||
// Config GTPu
|
||||
char gtpupath[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
LOG_I(GTPU, "Configuring GTPu\n");
|
||||
sprintf(gtpupath, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
config_get(config_get_if(), NETParams, sizeofArray(NETParams), gtpupath);
|
||||
GET_PARAMS(NETParams, GNBNETPARAMS_DESC, gtpupath);
|
||||
|
||||
char *address;
|
||||
if (NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr != NULL) {
|
||||
LOG_I(GTPU, "SA mode \n");
|
||||
@@ -84,15 +83,14 @@ MessageDef *RCconfig_NR_CU_E1(const E1_t *entity)
|
||||
if (!msgConfig)
|
||||
return NULL;
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0};
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal(num_gnbs == 1, "Support only one gNB per process\n");
|
||||
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
|
||||
paramdef_t *gnbParms = GNBParamList.paramarray[0];
|
||||
e1ap_setup_req_t *e1Setup = &E1AP_REGISTER_REQ(msgConfig).setup_req;
|
||||
|
||||
@@ -104,17 +102,8 @@ MessageDef *RCconfig_NR_CU_E1(const E1_t *entity)
|
||||
// Only 5GC supported
|
||||
e1Setup->cn_support = cn_support_5GC;
|
||||
|
||||
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
|
||||
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_PLMNParams[] = PLMNPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_PLMNParams) == sizeofArray(PLMNParams),
|
||||
"config_check_PLMNParams and PLMNParams should have the same size");
|
||||
|
||||
for (int I = 0; I < sizeofArray(PLMNParams); ++I)
|
||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||
|
||||
config_getlist(config_get_if(), &PLMNParamList, PLMNParams, sizeofArray(PLMNParams), aprefix);
|
||||
// get and config PLMN params
|
||||
GET_PARAMS_LIST(PLMNParamList, PLMNParams, GNBPLMNPARAMS_DESC, GNB_CONFIG_STRING_PLMN_LIST, aprefix, PLMNPARAMS_CHECK);
|
||||
int numPLMNs = PLMNParamList.numelt;
|
||||
e1Setup->supported_plmns = numPLMNs;
|
||||
|
||||
@@ -123,14 +112,12 @@ MessageDef *RCconfig_NR_CU_E1(const E1_t *entity)
|
||||
e1Setup->plmn[I].id.mnc = *PLMNParamList.paramarray[I][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
e1Setup->plmn[I].id.mnc_digit_length = *PLMNParamList.paramarray[I][GNB_MNC_DIGIT_LENGTH].uptr;
|
||||
|
||||
// get and config SNSSAI params
|
||||
char snssaistr[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(snssaistr, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_PLMN_LIST, I);
|
||||
paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
|
||||
paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
|
||||
config_getlist(config_get_if(), &SNSSAIParamList, SNSSAIParams, sizeof(SNSSAIParams) / sizeof(paramdef_t), snssaistr);
|
||||
GET_PARAMS_LIST(SNSSAIParamList, SNSSAIParams, GNBSNSSAIPARAMS_DESC, GNB_CONFIG_STRING_SNSSAI_LIST, snssaistr);
|
||||
e1Setup->plmn[I].supported_slices = SNSSAIParamList.numelt;
|
||||
e1Setup->plmn[I].slice = calloc(SNSSAIParamList.numelt, sizeof(*e1Setup->plmn[I].slice));
|
||||
AssertFatal(e1Setup->plmn[I].slice != NULL, "out of memory\n");
|
||||
e1Setup->plmn[I].slice = calloc_or_fail(SNSSAIParamList.numelt, sizeof(*e1Setup->plmn[I].slice));
|
||||
for (int s = 0; s < SNSSAIParamList.numelt; ++s) {
|
||||
e1ap_nssai_t *slice = &e1Setup->plmn[I].slice[s];
|
||||
slice->sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
|
||||
@@ -150,9 +137,7 @@ MessageDef *RCconfig_NR_CU_E1(const E1_t *entity)
|
||||
E1AP_REGISTER_REQ(msgConfig).gnb_id = gnb_id;
|
||||
|
||||
if (entity != NULL) {
|
||||
paramlist_def_t GNBE1ParamList = {GNB_CONFIG_STRING_E1_PARAMETERS, NULL, 0};
|
||||
paramdef_t GNBE1Params[] = GNBE1PARAMS_DESC;
|
||||
config_getlist(config_get_if(), &GNBE1ParamList, GNBE1Params, sizeofArray(GNBE1Params), aprefix);
|
||||
GET_PARAMS_LIST(GNBE1ParamList, GNBE1Params, GNBE1PARAMS_DESC, GNB_CONFIG_STRING_E1_PARAMETERS, aprefix);
|
||||
paramdef_t *e1Parms = GNBE1ParamList.paramarray[0];
|
||||
strcpy(e1ap_nc->CUCP_e1_ip_address.ipv4_address, *(e1Parms[GNB_CONFIG_E1_IPV4_ADDRESS_CUCP].strptr));
|
||||
e1ap_nc->CUCP_e1_ip_address.ipv4 = 1;
|
||||
|
||||
@@ -1423,7 +1423,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
&served_cells_to_modify_item_ies->value.choice.Served_Cells_To_Modify_Item;
|
||||
|
||||
F1AP_NRCGI_t *oldNRCGI = &served_cells_to_modify_item->oldNRCGI;
|
||||
const f1ap_plmn_t *old_plmn = &msg->cell_to_modify[i].old_plmn;
|
||||
const plmn_id_t *old_plmn = &msg->cell_to_modify[i].old_plmn;
|
||||
MCC_MNC_TO_PLMNID(old_plmn->mcc, old_plmn->mnc, old_plmn->mnc_digit_length, &oldNRCGI->pLMN_Identity);
|
||||
NR_CELL_ID_TO_BIT_STRING(msg->cell_to_modify[i].old_nr_cellid, &oldNRCGI->nRCellIdentity);
|
||||
|
||||
@@ -1449,7 +1449,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
F1AP_Served_Cells_To_Delete_Item_t *served_cells_to_delete_item =
|
||||
&served_cells_to_delete_item_ies->value.choice.Served_Cells_To_Delete_Item;
|
||||
F1AP_NRCGI_t *oldNRCGI = &served_cells_to_delete_item->oldNRCGI;
|
||||
const f1ap_plmn_t *plmn = &msg->cell_to_delete[i].plmn;
|
||||
const plmn_id_t *plmn = &msg->cell_to_delete[i].plmn;
|
||||
MCC_MNC_TO_PLMNID(plmn->mcc, plmn->mnc, plmn->mnc_digit_length, &(oldNRCGI->pLMN_Identity));
|
||||
NR_CELL_ID_TO_BIT_STRING(msg->cell_to_delete[i].nr_cellid, &(oldNRCGI->nRCellIdentity));
|
||||
}
|
||||
@@ -1519,7 +1519,7 @@ bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du
|
||||
->value.choice.Served_Cells_To_Modify_Item;
|
||||
/* Old NR CGI (M) */
|
||||
F1AP_NRCGI_t *oldNRCGI = &served_cells_item->oldNRCGI;
|
||||
f1ap_plmn_t *old_plmn = &out->cell_to_modify[i].old_plmn;
|
||||
plmn_id_t *old_plmn = &out->cell_to_modify[i].old_plmn;
|
||||
PLMNID_TO_MCC_MNC(&oldNRCGI->pLMN_Identity, old_plmn->mcc, old_plmn->mnc, old_plmn->mnc_digit_length);
|
||||
/* Old NR CGI Cell ID */
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&oldNRCGI->nRCellIdentity, out->cell_to_modify[i].old_nr_cellid);
|
||||
@@ -1542,7 +1542,7 @@ bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du
|
||||
&((F1AP_Served_Cells_To_Delete_ItemIEs_t *)ie->value.choice.Served_Cells_To_Delete_List.list.array[i])
|
||||
->value.choice.Served_Cells_To_Delete_Item;
|
||||
F1AP_NRCGI_t *oldNRCGI = &served_cells_item->oldNRCGI;
|
||||
f1ap_plmn_t *plmn = &out->cell_to_delete[i].plmn;
|
||||
plmn_id_t *plmn = &out->cell_to_delete[i].plmn;
|
||||
/* Old NR CGI (M) */
|
||||
PLMNID_TO_MCC_MNC(&(oldNRCGI->pLMN_Identity), plmn->mcc, plmn->mnc, plmn->mnc_digit_length);
|
||||
// NR cellID
|
||||
@@ -1833,7 +1833,7 @@ F1AP_F1AP_PDU_t *encode_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_
|
||||
p1->cause.present = F1AP_Cause_PR_radioNetwork;
|
||||
p1->cause.choice.radioNetwork = msg->cells_failed_to_be_activated[i].cause;
|
||||
// NR CGI (M)
|
||||
const f1ap_plmn_t *plmn = &msg->cells_failed_to_be_activated[i].plmn;
|
||||
const plmn_id_t *plmn = &msg->cells_failed_to_be_activated[i].plmn;
|
||||
MCC_MNC_TO_PLMNID(plmn->mcc, plmn->mnc, plmn->mnc_digit_length, &(p1->nRCGI.pLMN_Identity));
|
||||
printf("plmn->mcc %d %d %d %ld \n",
|
||||
p1->nRCGI.pLMN_Identity.buf[0], p1->nRCGI.pLMN_Identity.buf[1], p1->nRCGI.pLMN_Identity.buf[2], p1->nRCGI.pLMN_Identity.size);
|
||||
@@ -1880,7 +1880,7 @@ bool decode_f1ap_cu_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
(F1AP_Cells_Failed_to_be_Activated_List_ItemIEs_t *)cell_fail_list->list.array[j];
|
||||
const F1AP_Cells_Failed_to_be_Activated_List_Item_t *item = &itemIE->value.choice.Cells_Failed_to_be_Activated_List_Item;
|
||||
// NR CGI (M)
|
||||
f1ap_plmn_t *plmn = &out->cells_failed_to_be_activated[j].plmn;
|
||||
plmn_id_t *plmn = &out->cells_failed_to_be_activated[j].plmn;
|
||||
PLMNID_TO_MCC_MNC(&(item->nRCGI.pLMN_Identity), plmn->mcc, plmn->mnc, plmn->mnc_digit_length);
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&item->nRCGI.nRCellIdentity, out->cells_failed_to_be_activated[j].nr_cellid);
|
||||
// Cause (M)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "common/utils/assertions.h"
|
||||
#include "common/utils/utils.h"
|
||||
|
||||
bool eq_f1ap_plmn(const f1ap_plmn_t *a, const f1ap_plmn_t *b)
|
||||
bool eq_f1ap_plmn(const plmn_id_t *a, const plmn_id_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->mcc, b->mcc);
|
||||
_F1_EQ_CHECK_INT(a->mnc, b->mnc);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
#include "common/5g_platform_types.h"
|
||||
|
||||
#include "F1AP_Cause.h"
|
||||
#include "f1ap_messages_types.h"
|
||||
@@ -71,8 +72,7 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
struct f1ap_plmn_t;
|
||||
bool eq_f1ap_plmn(const struct f1ap_plmn_t *a, const struct f1ap_plmn_t *b);
|
||||
bool eq_f1ap_plmn(const plmn_id_t *a, const plmn_id_t *b);
|
||||
struct f1ap_served_cell_info_t;
|
||||
bool eq_f1ap_cell_info(const struct f1ap_served_cell_info_t *a, const struct f1ap_served_cell_info_t *b);
|
||||
struct f1ap_gnb_du_system_info_t;
|
||||
|
||||
@@ -80,7 +80,7 @@ static void f1ap_msg_free(F1AP_F1AP_PDU_t *pdu)
|
||||
*/
|
||||
static void test_initial_ul_rrc_message_transfer(void)
|
||||
{
|
||||
f1ap_plmn_t plmn = { .mcc = 208, .mnc = 95, .mnc_digit_length = 2 };
|
||||
plmn_id_t plmn = {.mcc = 208, .mnc = 95, .mnc_digit_length = 2};
|
||||
uint8_t rrc[] = "RRC Container";
|
||||
uint8_t du2cu[] = "DU2CU Container";
|
||||
f1ap_initial_ul_rrc_message_t orig = {
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
{GNB_CONFIG_STRING_PRACHMSG1FDM,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM,.defint64val=NR_RACH_ConfigGeneric__msg1_FDM_one,TYPE_INT64,0/*72*/},\
|
||||
{GNB_CONFIG_STRING_PRACHMSG1FREQUENCYSTART,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart,.defint64val=0,TYPE_INT64,0/*73*/},\
|
||||
{GNB_CONFIG_STRING_ZEROCORRELATIONZONECONFIG,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig,.defint64val=13,TYPE_INT64,0/*74*/},\
|
||||
{GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower,.defintval=-118,TYPE_INT64,0/*75*/},\
|
||||
{GNB_CONFIG_STRING_PREAMBLERECEIVEDTARGETPOWER,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower,.defint64val=-118,TYPE_INT64,0/*75*/},\
|
||||
{GNB_CONFIG_STRING_PREAMBLETRANSMAX,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax,.defint64val=NR_RACH_ConfigGeneric__preambleTransMax_n10,TYPE_INT64,0/*76*/},\
|
||||
{GNB_CONFIG_STRING_POWERRAMPINGSTEP,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep,.defint64val=NR_RACH_ConfigGeneric__powerRampingStep_dB2,TYPE_INT64,0/*77*/},\
|
||||
{GNB_CONFIG_STRING_RARESPONSEWINDOW,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow,.defint64val=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20,TYPE_INT64,0/*78*/},\
|
||||
@@ -234,15 +234,15 @@
|
||||
{GNB_CONFIG_STRING_RSRPTHRESHOLDSSB,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB,.defint64val=19,TYPE_INT64,0/*82*/},\
|
||||
{GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR,NULL,0,.uptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present,.defuintval=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139,TYPE_UINT,0/*83*/},\
|
||||
{GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,.defint64val=0,TYPE_INT64,0/*84*/},\
|
||||
{GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,.defintval=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \
|
||||
{GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,.defintval=1,TYPE_INT64,0/*86*/}, \
|
||||
{GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,.defint64val=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \
|
||||
{GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,.defint64val=1,TYPE_INT64,0/*86*/}, \
|
||||
{GNB_CONFIG_STRING_MSG3DELTAPREABMLE, NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble,.defint64val=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_P0NOMINALWITHGRANT, NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant,.defint64val=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,.defint64val=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_HOPPINGID, NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId,.defint64val=40,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_P0NOMINAL, NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal,.defint64val=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_PUCCHRES, NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon,.defint64val=0,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURST,NULL,0,.u64ptr=&ssb_bitmap,.defintval=0xff,TYPE_UINT64,0}, \
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURST,NULL,0,.u64ptr=&ssb_bitmap,.defint64val=0xff,TYPE_UINT64,0}, \
|
||||
{GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING,NULL,0,.i64ptr=&scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing,.defint64val=NR_SubcarrierSpacing_kHz30,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY,NULL,0,.i64ptr=&scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity,.defint64val=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms0p5,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDOWNLINKSLOTS,NULL,0,.i64ptr=&scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,.defint64val=7,TYPE_INT64,0},\
|
||||
@@ -259,7 +259,7 @@
|
||||
{GNB_CONFIG_STRING_EPHEMERIS_VELOCITY_VZ,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ephemerisInfo_r17->choice.positionVelocity_r17->velocityVZ_r17,.defint64val=LONG_MAX,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_TA_COMMON,NULL,0,.i64ptr=&scc->ext2->ntn_Config_r17->ta_Info_r17->ta_Common_r17,.defint64val=-1,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_TA_COMMONDRIFT,NULL,0,.i64ptr=scc->ext2->ntn_Config_r17->ta_Info_r17->ta_CommonDrift_r17,.defint64val=0,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing,.defintval=-1,TYPE_INT64,0}}
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing,.defint64val=-1,TYPE_INT64,0}}
|
||||
|
||||
#define SCC_PATTERN2_STRING_CONFIG "pattern2"
|
||||
|
||||
@@ -323,20 +323,20 @@
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
#define MSGASCCPARAMS_DESC(scc) { \
|
||||
{GNB_CONFIG_STRING_MSGBRESPONSEWINDOW_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.rach_ConfigGenericTwoStepRA_r16.msgB_ResponseWindow_r16,.defintval=-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGARSRPTHRESHOLD_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.msgA_RSRP_Threshold_r16,.defintval=19,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGAMCS_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->msgA_MCS_r16,.defintval=2,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFSLOTSMSGAPUSCH_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofSlotsMsgA_PUSCH_r16,.defintval=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFMSGAPOPERSLOT_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofMsgA_PO_PerSlot_r16,.defintval=NR_MsgA_PUSCH_Resource_r16__nrofMsgA_PO_PerSlot_r16_one,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGAPUSCHTIMEDOMAINOFFSET_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->msgA_PUSCH_TimeDomainOffset_r16,.defintval=0,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_STARTSYMBOLANDLENGTHMSGA_PO_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->startSymbolAndLengthMsgA_PO_r16,.defintval=38,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MAPPINGTYPEMSGAPUSCH_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->mappingTypeMsgA_PUSCH_r16,.defintval=0,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_GUARDBANDMSGAPUSCH_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->guardBandMsgA_PUSCH_r16,.defintval=0,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_FREQUENCYSTARTMSGAPUSCH_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->frequencyStartMsgA_PUSCH_r16,.defintval=0,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_NROFPRBSPERMSGAPO_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofPRBs_PerMsgA_PO_r16,.defintval=8,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_NROFMSGAPOFDM_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofMsgA_PO_FDM_r16,.defintval=NR_MsgA_PUSCH_Resource_r16__nrofMsgA_PO_FDM_r16_one,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_MSGAPUSCHNROFPORTS_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->msgA_DMRS_Config_r16.msgA_PUSCH_NrofPorts_r16,.defintval=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDMRSSEQUENCES_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofDMRS_Sequences_r16,.defintval=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGATRANSFORMPRECODER_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_TransformPrecoder_r16,.defintval=NR_MsgA_PUSCH_Config_r16__msgA_TransformPrecoder_r16_disabled,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGACBPREAMBLESPERSHAREDRO_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.msgA_CB_PreamblesPerSSB_PerSharedRO_r16,.defintval=1,TYPE_INT64,0}}
|
||||
{GNB_CONFIG_STRING_MSGBRESPONSEWINDOW_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.rach_ConfigGenericTwoStepRA_r16.msgB_ResponseWindow_r16,.defint64val=-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGARSRPTHRESHOLD_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.msgA_RSRP_Threshold_r16,.defint64val=19,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGAMCS_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->msgA_MCS_r16,.defint64val=2,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFSLOTSMSGAPUSCH_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofSlotsMsgA_PUSCH_r16,.defint64val=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFMSGAPOPERSLOT_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofMsgA_PO_PerSlot_r16,.defint64val=NR_MsgA_PUSCH_Resource_r16__nrofMsgA_PO_PerSlot_r16_one,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGAPUSCHTIMEDOMAINOFFSET_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->msgA_PUSCH_TimeDomainOffset_r16,.defint64val=0,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_STARTSYMBOLANDLENGTHMSGA_PO_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->startSymbolAndLengthMsgA_PO_r16,.defint64val=38,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MAPPINGTYPEMSGAPUSCH_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->mappingTypeMsgA_PUSCH_r16,.defint64val=0,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_GUARDBANDMSGAPUSCH_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->guardBandMsgA_PUSCH_r16,.defint64val=0,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_FREQUENCYSTARTMSGAPUSCH_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->frequencyStartMsgA_PUSCH_r16,.defint64val=0,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_NROFPRBSPERMSGAPO_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofPRBs_PerMsgA_PO_r16,.defint64val=8,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_NROFMSGAPOFDM_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofMsgA_PO_FDM_r16,.defint64val=NR_MsgA_PUSCH_Resource_r16__nrofMsgA_PO_FDM_r16_one,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_MSGAPUSCHNROFPORTS_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->msgA_DMRS_Config_r16.msgA_PUSCH_NrofPorts_r16,.defint64val=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFDMRSSEQUENCES_R16,NULL,0,.i64ptr=&scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_PUSCH_ResourceGroupA_r16->nrofDMRS_Sequences_r16,.defint64val=1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGATRANSFORMPRECODER_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->msgA_PUSCH_Config_r16->msgA_TransformPrecoder_r16,.defint64val=NR_MsgA_PUSCH_Config_r16__msgA_TransformPrecoder_r16_disabled,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_MSGACBPREAMBLESPERSHAREDRO_R16,NULL,0,.i64ptr=scc->uplinkConfigCommon->initialUplinkBWP->ext1->msgA_ConfigCommon_r16->choice.setup->rach_ConfigCommonTwoStepRA_r16.msgA_CB_PreamblesPerSSB_PerSharedRO_r16,.defint64val=1,TYPE_INT64,0}}
|
||||
#endif
|
||||
|
||||
@@ -181,43 +181,6 @@ void *gNB_app_task(void *args_p)
|
||||
case NGAP_REGISTER_GNB_CNF:
|
||||
LOG_I(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name,
|
||||
NGAP_REGISTER_GNB_CNF(msg_p).nb_amf);
|
||||
/*
|
||||
DevAssert(register_gnb_pending > 0);
|
||||
register_gnb_pending--;
|
||||
|
||||
// Check if at least gNB is registered with one AMF
|
||||
if (NGAP_REGISTER_GNB_CNF(msg_p).nb_amf > 0) {
|
||||
registered_gnb++;
|
||||
}
|
||||
|
||||
// Check if all register gNB requests have been processed
|
||||
if (register_gnb_pending == 0) {
|
||||
if (registered_gnb == gnb_nb) {
|
||||
// If all gNB are registered, start L2L1 task
|
||||
MessageDef *msg_init_p;
|
||||
|
||||
msg_init_p = itti_alloc_new_message (TASK_GNB_APP, 0, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
|
||||
} else {
|
||||
uint32_t not_associated = gnb_nb - registered_gnb;
|
||||
|
||||
LOG_W(GNB_APP, " %d gNB %s not associated with a AMF, retrying registration in %d seconds ...\n",
|
||||
not_associated, not_associated > 1 ? "are" : "is", GNB_REGISTER_RETRY_DELAY);
|
||||
|
||||
// Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds
|
||||
if (timer_setup (GNB_REGISTER_RETRY_DELAY, 0, TASK_GNB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
NULL, &gnb_register_retry_timer_id) < 0) {
|
||||
LOG_E(GNB_APP, " Can not start gNB register retry timer, use \"sleep\" instead!\n");
|
||||
|
||||
sleep(GNB_REGISTER_RETRY_DELAY);
|
||||
// Restart the registration process
|
||||
registered_gnb = 0;
|
||||
register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
break;
|
||||
|
||||
case F1AP_SETUP_RESP:
|
||||
@@ -247,13 +210,6 @@ void *gNB_app_task(void *args_p)
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
LOG_I(GNB_APP, " Received %s: timer_id %ld\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
|
||||
//if (TIMER_HAS_EXPIRED (msg_p).timer_id == gnb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
// registered_gnb = 0;
|
||||
// register_gnb_pending = gNB_app_register(gnb_id_start, gnb_id_end);//, gnb_properties_p);
|
||||
//}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
+197
-385
@@ -98,6 +98,45 @@ static int DEFRUTPCORES[] = {-1,-1,-1,-1};
|
||||
(element)->choice.setup = CALLOC(1, sizeof(*((element)->choice.setup))); \
|
||||
} while (0)
|
||||
|
||||
static uint16_t set_snssai_config(nssai_t *nssai, const int max_num_ssi, uint8_t k, uint8_t l)
|
||||
{
|
||||
char snssaistr[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(snssaistr, sizeof(snssaistr), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_PLMN_LIST, l);
|
||||
GET_PARAMS_LIST(SNSSAIParamList,
|
||||
SNSSAIParams,
|
||||
GNBSNSSAIPARAMS_DESC,
|
||||
GNB_CONFIG_STRING_SNSSAI_LIST,
|
||||
snssaistr,
|
||||
SNSSAIPARAMS_CHECK);
|
||||
uint16_t num_ssi = SNSSAIParamList.numelt;
|
||||
AssertFatal(num_ssi < max_num_ssi, "S-NSSAI size %d exceeds the max array size %d", num_ssi, max_num_ssi);
|
||||
for (int s = 0; s < num_ssi; ++s) {
|
||||
nssai[s].sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
|
||||
// SD is optional
|
||||
// 0xffffff is "no SD", see 23.003 Sec 28.4.2
|
||||
nssai[s].sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr;
|
||||
AssertFatal(nssai[s].sd <= 0xffffff, "SD cannot be bigger than 0xffffff, but is %d\n", nssai[s].sd);
|
||||
}
|
||||
return num_ssi;
|
||||
}
|
||||
|
||||
static uint8_t set_plmn_config(plmn_id_t *p, uint8_t idx)
|
||||
{
|
||||
char gnbpath[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(gnbpath, sizeof(gnbpath), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, idx);
|
||||
GET_PARAMS_LIST(PLMNParamList, PLMNParams, GNBPLMNPARAMS_DESC, GNB_CONFIG_STRING_PLMN_LIST, gnbpath, PLMNPARAMS_CHECK);
|
||||
uint8_t num_plmn = PLMNParamList.numelt;
|
||||
AssertFatal(num_plmn >= 1 && num_plmn <= 6, "The number of PLMN IDs must be in [1,6], but is %d\n", num_plmn);
|
||||
for (int l = 0; l < num_plmn; ++l) {
|
||||
plmn_id_t *plmn = &p[l];
|
||||
plmn->mcc = *PLMNParamList.paramarray[l][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
plmn->mnc = *PLMNParamList.paramarray[l][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
plmn->mnc_digit_length = *PLMNParamList.paramarray[l][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
AssertFatal((plmn->mnc_digit_length == 2) || (plmn->mnc_digit_length == 3), "BAD MNC DIGIT LENGTH %d", plmn->mnc_digit_length);
|
||||
}
|
||||
return num_plmn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate memory and initialize ServingCellConfigCommon struct members
|
||||
*/
|
||||
@@ -780,7 +819,7 @@ void fix_scd(NR_ServingCellConfig_t *scd) {
|
||||
static void verify_gnb_param_notset(paramdef_t *params, int paramidx, const char *paramname)
|
||||
{
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
AssertFatal(!config_isparamset(params, paramidx),
|
||||
"Option \"%s." GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON
|
||||
".%s\" is not allowed in this config, please remove it\n",
|
||||
@@ -796,13 +835,10 @@ static void verify_section_notset(configmodule_interface_t *cfg, char *aprefix,
|
||||
}
|
||||
void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type)
|
||||
{
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
config_get(cfg, GNBSParams, sizeof(GNBSParams) / sizeof(paramdef_t), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal(num_gnbs == 1, "need to have a " GNB_CONFIG_STRING_GNB_LIST " section, but %d found\n", num_gnbs);
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0};
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
config_getlist(cfg, &GNBParamList, GNBParams, sizeof(GNBParams) / sizeof(paramdef_t), NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL, GNBPARAMS_CHECK);
|
||||
paramdef_t *gnbp = GNBParamList.paramarray[0];
|
||||
|
||||
if (NODE_IS_CU(node_type)) {
|
||||
@@ -847,9 +883,7 @@ void RCconfig_nr_prs(void)
|
||||
|
||||
AssertFatal(RC.gNB != NULL, "gNB context is null, cannot complete PRS configuration\n");
|
||||
|
||||
paramdef_t PRS_Params[] = PRS_PARAMS_DESC;
|
||||
paramlist_def_t PRS_ParamList = {CONFIG_STRING_PRS_CONFIG,NULL,0};
|
||||
config_getlist(config_get_if(), &PRS_ParamList, PRS_Params, sizeofArray(PRS_Params), NULL);
|
||||
GET_PARAMS_LIST(PRS_ParamList, PRS_Params, PRS_PARAMS_DESC, CONFIG_STRING_PRS_CONFIG, NULL);
|
||||
|
||||
if (PRS_ParamList.numelt > 0) {
|
||||
for (j = 0; j < RC.nb_nr_L1_inst; j++) {
|
||||
@@ -959,6 +993,13 @@ static int get_prb_blacklist(uint8_t instance, uint16_t *prbbl)
|
||||
return num_prbbl;
|
||||
}
|
||||
|
||||
static void set_antenna_ports(paramlist_def_t *p, int *N1, int *N2, int *XP)
|
||||
{
|
||||
*N1 = *p->paramarray[0][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr;
|
||||
*N2 = *p->paramarray[0][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr;
|
||||
*XP = *p->paramarray[0][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
|
||||
}
|
||||
|
||||
void RCconfig_NR_L1(void)
|
||||
{
|
||||
LOG_I(NR_PHY, "Initializing NR L1: RC.nb_nr_L1_inst = %d\n", RC.nb_nr_L1_inst);
|
||||
@@ -968,17 +1009,10 @@ void RCconfig_NR_L1(void)
|
||||
AssertFatal(RC.gNB[j] != NULL, "gNB L1 instance is null at index %d, cannot complete L1 configuration\n", j);
|
||||
// gNB params
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0};
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal(num_gnbs > 0, "Failed to parse config file, no GNBs found in field %s \n", GNB_CONFIG_STRING_ACTIVE_GNBS);
|
||||
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
int N1 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr;
|
||||
int N2 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr;
|
||||
int XP = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
|
||||
// PRB Blacklist
|
||||
uint16_t prbbl[MAX_BWP_SIZE] = {0};
|
||||
@@ -990,15 +1024,12 @@ void RCconfig_NR_L1(void)
|
||||
}
|
||||
|
||||
// Antenna ports
|
||||
gNB->ap_N1 = N1;
|
||||
gNB->ap_N2 = N2;
|
||||
gNB->ap_XP = XP;
|
||||
set_antenna_ports(&GNBParamList, &gNB->ap_N1, &gNB->ap_N2, &gNB->ap_XP);
|
||||
}
|
||||
|
||||
// L1 params
|
||||
paramdef_t L1_Params[] = L1PARAMS_DESC;
|
||||
paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST, NULL, 0};
|
||||
config_getlist(config_get_if(), &L1_ParamList, L1_Params, sizeofArray(L1_Params), NULL);
|
||||
GET_PARAMS_LIST(L1_ParamList, L1_Params, L1PARAMS_DESC, CONFIG_STRING_L1_LIST, NULL);
|
||||
|
||||
if (L1_ParamList.numelt > 0) {
|
||||
AssertFatal(*L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr == 2022,
|
||||
"thread_pool_size removed, please use --thread-pool\n");
|
||||
@@ -1059,27 +1090,30 @@ static NR_ServingCellConfigCommon_t *get_scc_config(configmodule_interface_t *cf
|
||||
NR_ServingCellConfigCommon_t *scc = calloc_or_fail(1, sizeof(*scc));
|
||||
uint64_t ssb_bitmap=0xff;
|
||||
prepare_scc(scc);
|
||||
paramdef_t SCCsParams[] = SCCPARAMS_DESC(scc);
|
||||
prepare_msgA_scc(scc);
|
||||
paramdef_t MsgASCCsParams[] = MSGASCCPARAMS_DESC(scc);
|
||||
paramlist_def_t SCCsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, NULL, 0};
|
||||
paramlist_def_t MsgASCCsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, NULL, 0};
|
||||
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
config_getlist(cfg, &SCCsParamList, NULL, 0, aprefix);
|
||||
config_getlist(cfg, &MsgASCCsParamList, NULL, 0, aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
GET_PARAMS_LIST(SCCsParamList, SCCsParams, SCCPARAMS_DESC(scc), GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, aprefix);
|
||||
GET_PARAMS_LIST(MsgASCCsParamList, MsgASCCsParams, MSGASCCPARAMS_DESC(scc), GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, aprefix);
|
||||
|
||||
if (SCCsParamList.numelt > 0 || MsgASCCsParamList.numelt > 0) {
|
||||
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, 0);
|
||||
config_get(cfg, SCCsParams, sizeofArray(SCCsParams), aprefix);
|
||||
config_get(cfg, MsgASCCsParams, sizeofArray(MsgASCCsParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, 0);
|
||||
GET_PARAMS(SCCsParams, SCCPARAMS_DESC(scc), aprefix);
|
||||
GET_PARAMS(MsgASCCsParams, MSGASCCPARAMS_DESC(scc), aprefix);
|
||||
// NR_TDD-UL-DL-ConfigCommon pattern2 (optional IE)
|
||||
// fetch params
|
||||
struct NR_TDD_UL_DL_Pattern p2;
|
||||
paramdef_t pattern2Params[] = SCC_PATTERN2_PARAMS_DESC(p2);
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[%i].%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, 0, SCC_PATTERN2_STRING_CONFIG);
|
||||
snprintf(aprefix,
|
||||
sizeof(aprefix),
|
||||
"%s.[%i].%s.[%i].%s",
|
||||
GNB_CONFIG_STRING_GNB_LIST,
|
||||
0,
|
||||
GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON,
|
||||
0,
|
||||
SCC_PATTERN2_STRING_CONFIG);
|
||||
config_get(config_get_if(), pattern2Params, sizeofArray(pattern2Params), aprefix);
|
||||
// check validity
|
||||
bool is_pattern2 = false;
|
||||
@@ -1165,15 +1199,14 @@ static NR_ServingCellConfig_t *get_scd_config(configmodule_interface_t *cfg)
|
||||
{
|
||||
NR_ServingCellConfig_t *scd = calloc(1, sizeof(*scd));
|
||||
prepare_scd(scd);
|
||||
paramdef_t SCDsParams[] = SCDPARAMS_DESC(scd);
|
||||
paramlist_def_t SCDsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, NULL, 0};
|
||||
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
config_getlist(cfg, &SCDsParamList, NULL, 0, aprefix);
|
||||
GET_PARAMS_LIST(SCDsParamList, SCDsParams, SCDPARAMS_DESC(scd), GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, aprefix);
|
||||
|
||||
if (SCDsParamList.numelt > 0) {
|
||||
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, 0);
|
||||
config_get(cfg, SCDsParams, sizeof(SCDsParams) / sizeof(paramdef_t), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGDEDICATED, 0);
|
||||
GET_PARAMS(SCDsParams, SCDPARAMS_DESC(scd), aprefix);
|
||||
const NR_BWP_UplinkDedicated_t *bwp_Dedicated = scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated;
|
||||
const NR_PTRS_UplinkConfig_t *setup =
|
||||
bwp_Dedicated->pusch_Config->choice.setup->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->phaseTrackingRS->choice.setup;
|
||||
@@ -1206,15 +1239,11 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
|
||||
AssertFatal(max_cell_info == 1, "only one cell supported\n");
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
config_get(cfg, GNBSParams, sizeof(GNBSParams) / sizeof(paramdef_t), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal(num_gnbs == 1, "cannot configure DU: required config section \"gNBs\" missing\n");
|
||||
|
||||
// Output a list of all eNBs.
|
||||
config_getlist(cfg, &GNBParamList, GNBParams, sizeof(GNBParams) / sizeof(paramdef_t), NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
|
||||
// read the gNB-ID. The DU itself only needs the gNB-DU ID, but some (e.g.,
|
||||
// E2 agent) need the gNB-ID as well if it is running in a separate process
|
||||
@@ -1226,20 +1255,6 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
|
||||
GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[0],
|
||||
*GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr);
|
||||
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[0]", GNB_CONFIG_STRING_GNB_LIST);
|
||||
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_PLMNParams[] = PLMNPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_PLMNParams) == sizeofArray(PLMNParams),
|
||||
"config_check_PLMNParams and PLMNParams should have the same size");
|
||||
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
|
||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||
config_getlist(cfg, &PLMNParamList, PLMNParams, sizeof(PLMNParams) / sizeof(paramdef_t), aprefix);
|
||||
AssertFatal(PLMNParamList.numelt > 0, "need to have a PLMN in PLMN section\n");
|
||||
AssertFatal(PLMNParamList.numelt == 1, "cannot have more than one PLMN\n");
|
||||
|
||||
// if fronthaul is F1, require gNB_DU_ID, else use gNB_ID
|
||||
if (separate_du) {
|
||||
AssertFatal(config_isparamset(GNBParamList.paramarray[0], GNB_GNB_DU_ID_IDX), "%s is not defined in configuration file\n", GNB_CONFIG_STRING_GNB_DU_ID);
|
||||
@@ -1255,30 +1270,15 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
|
||||
info->tac = malloc(sizeof(*info->tac));
|
||||
AssertFatal(info->tac != NULL, "out of memory\n");
|
||||
*info->tac = *GNBParamList.paramarray[0][GNB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
info->plmn.mcc = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
info->plmn.mnc = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
info->plmn.mnc_digit_length = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
AssertFatal((info->plmn.mnc_digit_length == 2) || (info->plmn.mnc_digit_length == 3),
|
||||
"BAD MNC DIGIT LENGTH %d",
|
||||
info->plmn.mnc_digit_length);
|
||||
|
||||
// PLMN
|
||||
plmn_id_t p[PLMN_LIST_MAX_SIZE] = {0};
|
||||
set_plmn_config(p, 0);
|
||||
info->plmn = p[0];
|
||||
info->nr_cellid = (uint64_t) * (GNBParamList.paramarray[0][GNB_NRCELLID_IDX].u64ptr);
|
||||
|
||||
paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
|
||||
paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
|
||||
checkedparam_t config_check_SNSSAIParams[] = SNSSAIPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_SNSSAIParams) == sizeofArray(SNSSAIParams),
|
||||
"config_check_SNSSAIParams and SNSSAIParams should have the same size");
|
||||
for (int J = 0; J < sizeofArray(SNSSAIParams); ++J)
|
||||
SNSSAIParams[J].chkPptr = &(config_check_SNSSAIParams[J]);
|
||||
char snssaistr[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(snssaistr, "%s.[0].%s.[0]", GNB_CONFIG_STRING_GNB_LIST, GNB_CONFIG_STRING_PLMN_LIST);
|
||||
config_getlist(config_get_if(), &SNSSAIParamList, SNSSAIParams, sizeofArray(SNSSAIParams), snssaistr);
|
||||
info->num_ssi = SNSSAIParamList.numelt;
|
||||
for (int s = 0; s < info->num_ssi; ++s) {
|
||||
info->nssai[s].sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
|
||||
info->nssai[s].sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr;
|
||||
AssertFatal(info->nssai[s].sd <= 0xffffff, "SD cannot be bigger than 0xffffff, but is %d\n", info->nssai[s].sd);
|
||||
}
|
||||
// SNSSAI
|
||||
info->num_ssi = set_snssai_config(info->nssai, MAX_NUM_SLICES, 0, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -1403,7 +1403,7 @@ static nr_redcap_config_t *get_redcap_config(int gnb_idx)
|
||||
{
|
||||
paramdef_t RedCap_Params[] = GNB_REDCAP_PARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_REDCAP);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_REDCAP);
|
||||
int ret = config_get(config_get_if(), RedCap_Params, sizeofArray(RedCap_Params), aprefix);
|
||||
|
||||
if (ret <= 0) {
|
||||
@@ -1459,37 +1459,19 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
{
|
||||
int j = 0;
|
||||
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0};
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
config_get(cfg, GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL, GNBPARAMS_CHECK);
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal(num_gnbs == 1,
|
||||
"Failed to parse config file: number of gnbs for gNB %s is %d != 1\n",
|
||||
GNB_CONFIG_STRING_ACTIVE_GNBS,
|
||||
num_gnbs);
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_GNBParams[] = GNBPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_GNBParams) == sizeofArray(GNBParams),
|
||||
"config_check_GNBParams and GNBParams should have the same size");
|
||||
for (int i = 0; i < sizeofArray(GNBParams); ++i)
|
||||
GNBParams[i].chkPptr = &(config_check_GNBParams[i]);
|
||||
config_getlist(cfg, &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
|
||||
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
|
||||
paramlist_def_t MacRLC_ParamList = {CONFIG_STRING_MACRLC_LIST, NULL, 0};
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_MacRLCParams[] = MACRLCPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_MacRLCParams) == sizeofArray(MacRLC_Params),
|
||||
"config_check_MacRLCParams and MacRLC_Params should have the same size");
|
||||
for (int i = 0; i < sizeofArray(MacRLC_Params); ++i)
|
||||
MacRLC_Params[i].chkPptr = &(config_check_MacRLCParams[i]);
|
||||
config_getlist(config_get_if(), &MacRLC_ParamList, MacRLC_Params, sizeofArray(MacRLC_Params), NULL);
|
||||
|
||||
// MAC / RLC
|
||||
GET_PARAMS_LIST(MacRLC_ParamList, MacRLC_Params, MACRLCPARAMS_DESC, CONFIG_STRING_MACRLC_LIST, NULL, MACRLCPARAMS_CHECK);
|
||||
nr_mac_config_t config = {0};
|
||||
config.pdsch_AntennaPorts.N1 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr;
|
||||
config.pdsch_AntennaPorts.N2 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr;
|
||||
config.pdsch_AntennaPorts.XP = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
|
||||
nr_pdsch_AntennaPorts_t *p = &config.pdsch_AntennaPorts;
|
||||
set_antenna_ports(&GNBParamList, &p->N1, &p->N2, &p->XP);
|
||||
config.pusch_AntennaPorts = *GNBParamList.paramarray[0][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
|
||||
LOG_I(GNB_APP,
|
||||
"pdsch_AntennaPorts N1 %d N2 %d XP %d pusch_AntennaPorts %d\n",
|
||||
@@ -1498,9 +1480,8 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
config.pdsch_AntennaPorts.XP,
|
||||
config.pusch_AntennaPorts);
|
||||
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST, NULL, 0};
|
||||
config_getlist(config_get_if(), &RUParamList, RUParams, sizeofArray(RUParams), NULL);
|
||||
// RU
|
||||
GET_PARAMS_LIST(RUParamList, RUParams, RUPARAMS_DESC, CONFIG_STRING_RU_LIST, NULL);
|
||||
int num_tx = 0;
|
||||
if (RUParamList.numelt > 0) {
|
||||
for (int i = 0; i < RUParamList.numelt; i++)
|
||||
@@ -1543,10 +1524,9 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
|
||||
|
||||
config.redcap = get_redcap_config(0);
|
||||
|
||||
paramdef_t Timers_Params[] = GNB_TIMERS_PARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
sprintf(aprefix, "%s.[0].%s", GNB_CONFIG_STRING_GNB_LIST, GNB_CONFIG_STRING_TIMERS_CONFIG);
|
||||
config_get(config_get_if(), Timers_Params, sizeofArray(Timers_Params), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_TIMERS_CONFIG);
|
||||
GET_PARAMS(Timers_Params, GNB_TIMERS_PARAMS_DESC, aprefix);
|
||||
|
||||
config.timer_config.sr_ProhibitTimer = *Timers_Params[GNB_TIMERS_SR_PROHIBIT_TIMER_IDX].iptr;
|
||||
config.timer_config.sr_TransMax = *Timers_Params[GNB_TIMERS_SR_TRANS_MAX_IDX].iptr;
|
||||
@@ -1910,12 +1890,14 @@ static seq_arr_t *fill_cu_sibs(paramdef_t *GNBparamarray)
|
||||
static void fill_neighbour_cell_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc)
|
||||
{
|
||||
char gnbpath[MAX_OPTNAME_SIZE + 8];
|
||||
sprintf(gnbpath, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, gnb_idx);
|
||||
snprintf(gnbpath, sizeof(gnbpath), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, gnb_idx);
|
||||
|
||||
paramdef_t neighbour_list_params[] = GNB_NEIGHBOUR_LIST_PARAM_LIST;
|
||||
paramlist_def_t neighbour_list_param_list = {GNB_CONFIG_STRING_NEIGHBOUR_LIST, NULL, 0};
|
||||
GET_PARAMS_LIST(neighbour_list_param_list,
|
||||
neighbour_list_params,
|
||||
GNB_NEIGHBOUR_LIST_PARAM_LIST,
|
||||
GNB_CONFIG_STRING_NEIGHBOUR_LIST,
|
||||
gnbpath);
|
||||
|
||||
config_getlist(config_get_if(), &neighbour_list_param_list, neighbour_list_params, sizeofArray(neighbour_list_params), gnbpath);
|
||||
if (neighbour_list_param_list.numelt < 1)
|
||||
return;
|
||||
|
||||
@@ -1928,10 +1910,12 @@ static void fill_neighbour_cell_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc
|
||||
cell->nr_cell_id = (uint64_t)*neighbour_list_param_list.paramarray[elm][0].u64ptr;
|
||||
|
||||
char neighbourpath[MAX_OPTNAME_SIZE + 8];
|
||||
sprintf(neighbourpath, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_NEIGHBOUR_LIST, elm);
|
||||
paramdef_t NeighbourCellParams[] = GNBNEIGHBOURCELLPARAMS_DESC;
|
||||
paramlist_def_t NeighbourCellParamList = {GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST, NULL, 0};
|
||||
config_getlist(config_get_if(), &NeighbourCellParamList, NeighbourCellParams, sizeofArray(NeighbourCellParams), neighbourpath);
|
||||
snprintf(neighbourpath, sizeof(neighbourpath), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_NEIGHBOUR_LIST, elm);
|
||||
GET_PARAMS_LIST(NeighbourCellParamList,
|
||||
NeighbourCellParams,
|
||||
GNBNEIGHBOURCELLPARAMS_DESC,
|
||||
GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST,
|
||||
neighbourpath);
|
||||
LOG_D(GNB_APP, "HO LOG: For the Cell: %ld Neighbour Cell ELM NUM: %d\n", cell->nr_cell_id, NeighbourCellParamList.numelt);
|
||||
if (NeighbourCellParamList.numelt < 1)
|
||||
continue;
|
||||
@@ -1950,15 +1934,14 @@ static void fill_neighbour_cell_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc
|
||||
neighbourCell->tac = *NeighbourCellParamList.paramarray[l][GNB_CONFIG_N_CELL_TAC_IDX].uptr;
|
||||
|
||||
char neighbour_plmn_path[CONFIG_MAXOPTLENGTH];
|
||||
sprintf(neighbour_plmn_path,
|
||||
"%s.%s.[%i].%s",
|
||||
neighbourpath,
|
||||
GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST,
|
||||
l,
|
||||
GNB_CONFIG_STRING_NEIGHBOUR_PLMN);
|
||||
|
||||
paramdef_t NeighbourPlmn[] = GNBPLMNPARAMS_DESC;
|
||||
config_get(config_get_if(), NeighbourPlmn, sizeofArray(NeighbourPlmn), neighbour_plmn_path);
|
||||
snprintf(neighbour_plmn_path,
|
||||
sizeof(neighbour_plmn_path),
|
||||
"%s.%s.[%i].%s",
|
||||
neighbourpath,
|
||||
GNB_CONFIG_STRING_NEIGHBOUR_CELL_LIST,
|
||||
l,
|
||||
GNB_CONFIG_STRING_NEIGHBOUR_PLMN);
|
||||
GET_PARAMS(NeighbourPlmn, GNBPLMNPARAMS_DESC, neighbour_plmn_path);
|
||||
|
||||
neighbourCell->plmn.mcc = *NeighbourPlmn[GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
neighbourCell->plmn.mnc = *NeighbourPlmn[GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
@@ -1978,19 +1961,20 @@ static void fill_neighbour_cell_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc
|
||||
static void fill_measurement_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc)
|
||||
{
|
||||
char measurement_path[MAX_OPTNAME_SIZE + 8];
|
||||
sprintf(measurement_path, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION);
|
||||
snprintf(measurement_path, sizeof(measurement_path), "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION);
|
||||
|
||||
nr_measurement_configuration_t *measurementConfig = &rrc->measurementConfiguration;
|
||||
// Periodical Event Configuration
|
||||
char periodic_event_path[MAX_OPTNAME_SIZE + 8];
|
||||
sprintf(periodic_event_path,
|
||||
"%s.[%i].%s.%s",
|
||||
GNB_CONFIG_STRING_GNB_LIST,
|
||||
gnb_idx,
|
||||
GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION,
|
||||
MEASUREMENT_EVENTS_PERIODICAL);
|
||||
paramdef_t Periodical_EventParams[] = MEASUREMENT_PERIODICAL_GLOBALPARAMS_DESC;
|
||||
config_get(config_get_if(), Periodical_EventParams, sizeofArray(Periodical_EventParams), periodic_event_path);
|
||||
snprintf(periodic_event_path,
|
||||
sizeof(periodic_event_path),
|
||||
"%s.[%i].%s.%s",
|
||||
GNB_CONFIG_STRING_GNB_LIST,
|
||||
gnb_idx,
|
||||
GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION,
|
||||
MEASUREMENT_EVENTS_PERIODICAL);
|
||||
GET_PARAMS(Periodical_EventParams, MEASUREMENT_PERIODICAL_GLOBALPARAMS_DESC, periodic_event_path);
|
||||
|
||||
if (*Periodical_EventParams[MEASUREMENT_EVENTS_ENABLE_IDX].i64ptr) {
|
||||
nr_per_event_t *periodic_event = (nr_per_event_t *)calloc(1, sizeof(nr_per_event_t));
|
||||
periodic_event->includeBeamMeasurements = *Periodical_EventParams[MEASUREMENT_EVENTS_INCLUDE_BEAM_MEAS_IDX].i64ptr;
|
||||
@@ -2001,14 +1985,9 @@ static void fill_measurement_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc)
|
||||
|
||||
// A2 Event Configuration
|
||||
char a2_path[MAX_OPTNAME_SIZE + 8];
|
||||
sprintf(a2_path,
|
||||
"%s.[%i].%s.%s",
|
||||
GNB_CONFIG_STRING_GNB_LIST,
|
||||
gnb_idx,
|
||||
GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION,
|
||||
MEASUREMENT_EVENTS_A2);
|
||||
paramdef_t A2_EventParams[] = MEASUREMENT_A2_GLOBALPARAMS_DESC;
|
||||
config_get(config_get_if(), A2_EventParams, sizeofArray(A2_EventParams), a2_path);
|
||||
snprintf(a2_path, sizeof(a2_path), "%s.[%i].%s.%s", GNB_CONFIG_STRING_GNB_LIST, gnb_idx, GNB_CONFIG_STRING_MEASUREMENT_CONFIGURATION, MEASUREMENT_EVENTS_A2);
|
||||
GET_PARAMS(A2_EventParams, MEASUREMENT_A2_GLOBALPARAMS_DESC, a2_path);
|
||||
|
||||
if (*A2_EventParams[MEASUREMENT_EVENTS_ENABLE_IDX].i64ptr) {
|
||||
nr_a2_event_t *a2_event = (nr_a2_event_t *)calloc(1, sizeof(nr_a2_event_t));
|
||||
a2_event->threshold_RSRP = *A2_EventParams[MEASUREMENT_EVENTS_A2_THRESHOLD_IDX].i64ptr;
|
||||
@@ -2017,9 +1996,8 @@ static void fill_measurement_configuration(uint8_t gnb_idx, gNB_RRC_INST *rrc)
|
||||
measurementConfig->a2_event = a2_event;
|
||||
}
|
||||
// A3 Event Configuration
|
||||
paramlist_def_t A3_EventList = {MEASUREMENT_EVENTS_A3, NULL, 0};
|
||||
paramdef_t A3_EventParams[] = MEASUREMENT_A3_GLOBALPARAMS_DESC;
|
||||
config_getlist(config_get_if(), &A3_EventList, A3_EventParams, sizeofArray(A3_EventParams), measurement_path);
|
||||
GET_PARAMS_LIST(A3_EventList, A3_EventParams, MEASUREMENT_A3_GLOBALPARAMS_DESC, MEASUREMENT_EVENTS_A3, measurement_path);
|
||||
|
||||
LOG_D(GNB_APP, "HO LOG: A3 Configuration Exists: %d\n", A3_EventList.numelt);
|
||||
|
||||
if (A3_EventList.numelt < 1)
|
||||
@@ -2057,29 +2035,17 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
gNB_RRC_INST *rrc = calloc(1, sizeof(*rrc));
|
||||
|
||||
int num_gnbs = 0;
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
int32_t gnb_id = 0;
|
||||
int k = 0;
|
||||
int i = 0;
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
////////// Identification parameters
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
|
||||
////////// Physical parameters
|
||||
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal (i < num_gnbs,"Failed to parse config file no %dth element in %s \n", i, GNB_CONFIG_STRING_ACTIVE_GNBS);
|
||||
AssertFatal(num_gnbs == 1, "required section \"gNBs\" not in config!\n");
|
||||
|
||||
if (num_gnbs > 0) {
|
||||
|
||||
// Output a list of all gNBs. ////////// Identification parameters
|
||||
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
if (GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr == NULL) {
|
||||
// Calculate a default gNB ID
|
||||
if (IS_SA_MODE(get_softmodem_params())) {
|
||||
@@ -2093,17 +2059,15 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
gnb_id = *(GNBParamList.paramarray[i][GNB_GNB_ID_IDX].uptr);
|
||||
}
|
||||
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
|
||||
LOG_D(GNB_APP, "NRRRC %d: Southbound Transport %s\n", i, *(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr));
|
||||
|
||||
rrc->node_type = get_node_type();
|
||||
rrc->node_id = gnb_id;
|
||||
|
||||
if (NODE_IS_CU(rrc->node_type)) {
|
||||
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix,"%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, i, GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, i, GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
GET_PARAMS(SCTPParams, GNBSCTPPARAMS_DESC, aprefix);
|
||||
LOG_I(GNB_APP,"F1AP: gNB_CU_id[%d] %d\n", k, rrc->node_id);
|
||||
rrc->node_name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr));
|
||||
LOG_I(GNB_APP,"F1AP: gNB_CU_name[%d] %s\n", k, rrc->node_name);
|
||||
@@ -2116,8 +2080,6 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
rrc->eth_params_s.transp_preference = ETH_UDP_MODE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
rrc->nr_cellid = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr);
|
||||
|
||||
if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
@@ -2138,9 +2100,6 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
gNB_RrcConfigurationReq nrrrc_config = {0};
|
||||
for (k=0; k <num_gnbs ; k++) {
|
||||
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[k], *(GNBParamList.paramarray[i][GNB_GNB_NAME_IDX].strptr) )== 0) {
|
||||
|
||||
char gnbpath[MAX_OPTNAME_SIZE + 8];
|
||||
sprintf(gnbpath,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
|
||||
|
||||
fill_neighbour_cell_configuration(k, rrc);
|
||||
|
||||
@@ -2148,17 +2107,6 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
|
||||
rrc->SIBs = fill_cu_sibs(GNBParamList.paramarray[i]);
|
||||
|
||||
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
|
||||
|
||||
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_PLMNParams) == sizeofArray(PLMNParams),
|
||||
"config_check_PLMNParams and PLMNParams should have the same size");
|
||||
|
||||
for (int I = 0; I < sizeofArray(PLMNParams); ++I)
|
||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||
|
||||
nrrrc_config.tac = *GNBParamList.paramarray[i][GNB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
AssertFatal(!GNBParamList.paramarray[i][GNB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
|
||||
&& !GNBParamList.paramarray[i][GNB_MOBILE_NETWORK_CODE_IDX_OLD].strptr,
|
||||
@@ -2169,23 +2117,8 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
"to\n"
|
||||
" tracking_area_code = 1; // no string!!\n"
|
||||
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
|
||||
config_getlist(config_get_if(), &PLMNParamList, PLMNParams, sizeofArray(PLMNParams), gnbpath);
|
||||
|
||||
if (PLMNParamList.numelt < 1 || PLMNParamList.numelt > 6)
|
||||
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
||||
PLMNParamList.numelt);
|
||||
|
||||
nrrrc_config.num_plmn = PLMNParamList.numelt;
|
||||
|
||||
for (int l = 0; l < PLMNParamList.numelt; ++l) {
|
||||
|
||||
nrrrc_config.mcc[l] = *PLMNParamList.paramarray[l][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
nrrrc_config.mnc[l] = *PLMNParamList.paramarray[l][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
nrrrc_config.mnc_digit_length[l] = *PLMNParamList.paramarray[l][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
AssertFatal((nrrrc_config.mnc_digit_length[l] == 2) ||
|
||||
(nrrrc_config.mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d",
|
||||
nrrrc_config.mnc_digit_length[l]);
|
||||
}
|
||||
nrrrc_config.num_plmn = set_plmn_config(nrrrc_config.plmn, k);
|
||||
nrrrc_config.enable_sdap = *GNBParamList.paramarray[i][GNB_ENABLE_SDAP_IDX].iptr;
|
||||
LOG_I(GNB_APP, "SDAP layer is %s\n", nrrrc_config.enable_sdap ? "enabled" : "disabled");
|
||||
nrrrc_config.drbs = *GNBParamList.paramarray[i][GNB_DRBS].iptr;
|
||||
@@ -2202,32 +2135,17 @@ gNB_RRC_INST *RCconfig_NRRRC()
|
||||
return rrc;
|
||||
}
|
||||
|
||||
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
|
||||
|
||||
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i)
|
||||
{
|
||||
int j,k = 0;
|
||||
int gnb_id;
|
||||
int32_t my_int;
|
||||
const char* active_gnb[MAX_GNB];
|
||||
char *address = NULL;
|
||||
char *cidr = NULL;
|
||||
|
||||
// for no gcc warnings
|
||||
|
||||
(void) my_int;
|
||||
|
||||
memset((char*)active_gnb,0,MAX_GNB* sizeof(char*));
|
||||
char* gnb_ipv4_address_for_NGU = NULL;
|
||||
uint32_t gnb_port_for_NGU = 0;
|
||||
char* gnb_ipv4_address_for_S1U = NULL;
|
||||
uint32_t gnb_port_for_S1U = 0;
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
AssertFatal (i<GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt,
|
||||
"Failed to parse config file %s, %uth attribute %s \n",
|
||||
RC.config_file_name, i, GNB_CONFIG_STRING_ACTIVE_GNBS);
|
||||
@@ -2235,7 +2153,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
|
||||
|
||||
if (GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt>0) {
|
||||
// Output a list of all gNBs.
|
||||
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
if (GNBParamList.numelt > 0) {
|
||||
for (k = 0; k < GNBParamList.numelt; k++) {
|
||||
if (GNBParamList.paramarray[k][GNB_GNB_ID_IDX].uptr == NULL) {
|
||||
@@ -2256,31 +2174,8 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
|
||||
// search if in active list
|
||||
for (j=0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) {
|
||||
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) {
|
||||
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
|
||||
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||
paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
|
||||
paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_PLMNParams) == sizeofArray(PLMNParams),
|
||||
"config_check_PLMNParams and PLMNParams should have the same size");
|
||||
checkedparam_t config_check_SNSSAIParams [] = SNSSAIPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_SNSSAIParams) == sizeofArray(SNSSAIParams),
|
||||
"config_check_SNSSAIParams and SNSSAIParams should have the same size");
|
||||
|
||||
for (int I = 0; I < sizeofArray(PLMNParams); ++I)
|
||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||
for (int J = 0; J < sizeofArray(SNSSAIParams); ++J)
|
||||
SNSSAIParams[J].chkPptr = &(config_check_SNSSAIParams[J]);
|
||||
|
||||
paramdef_t NGParams[] = GNBNGPARAMS_DESC;
|
||||
paramlist_def_t NGParamList = {GNB_CONFIG_STRING_AMF_IP_ADDRESS,NULL,0};
|
||||
|
||||
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
|
||||
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k);
|
||||
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).gNB_id = gnb_id;
|
||||
|
||||
if (strcmp(*(GNBParamList.paramarray[k][GNB_CELL_TYPE_IDX].strptr), "CELL_MACRO_GNB") == 0) {
|
||||
@@ -2304,108 +2199,57 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
|
||||
"to\n"
|
||||
" tracking_area_code = 1; // no string!!\n"
|
||||
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
|
||||
config_getlist(config_get_if(), &PLMNParamList, PLMNParams, sizeofArray(PLMNParams), aprefix);
|
||||
|
||||
if (PLMNParamList.numelt < 1 || PLMNParamList.numelt > 6)
|
||||
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
||||
PLMNParamList.numelt);
|
||||
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).num_plmn = PLMNParamList.numelt;
|
||||
|
||||
for (int l = 0; l < PLMNParamList.numelt; ++l) {
|
||||
char snssaistr[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(snssaistr, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_PLMN_LIST, l);
|
||||
config_getlist(config_get_if(), &SNSSAIParamList, SNSSAIParams, sizeofArray(SNSSAIParams), snssaistr);
|
||||
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].mcc = *PLMNParamList.paramarray[l][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].mnc = *PLMNParamList.paramarray[l][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].mnc_digit_length = *PLMNParamList.paramarray[l][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).default_drx = 0;
|
||||
AssertFatal((NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].mnc_digit_length == 2)
|
||||
|| (NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].mnc_digit_length == 3),
|
||||
"BAD MNC DIGIT LENGTH %d",
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].mnc_digit_length);
|
||||
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].num_nssai = SNSSAIParamList.numelt;
|
||||
for (int s = 0; s < SNSSAIParamList.numelt; ++s) {
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].s_nssai[s].sst =
|
||||
*SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
|
||||
// SD is optional
|
||||
// 0xffffff is "no SD", see 23.003 Sec 28.4.2
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].s_nssai[s].sd =
|
||||
(*SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr & 0xffffff);
|
||||
}
|
||||
// PLMN
|
||||
plmn_id_t p[PLMN_LIST_MAX_SIZE] = {0};
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).num_plmn = set_plmn_config(p, 0);
|
||||
for (int l = 0; l < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++l) {
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].plmn = p[l];
|
||||
// SNSSAI
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].num_nssai = set_snssai_config(NGAP_REGISTER_GNB_REQ(msg_p).plmn[l].s_nssai, 8, k, l);
|
||||
}
|
||||
sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
|
||||
config_getlist(config_get_if(), &NGParamList, NGParams, sizeofArray(NGParams), aprefix);
|
||||
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).default_drx = 0;
|
||||
// NG
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k);
|
||||
GET_PARAMS_LIST(NGParamList, NGParams, GNBNGPARAMS_DESC, GNB_CONFIG_STRING_AMF_IP_ADDRESS, aprefix);
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).nb_amf = 0;
|
||||
|
||||
for (int l = 0; l < NGParamList.numelt; l++) {
|
||||
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).nb_amf += 1;
|
||||
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[l].ipv4_address,*(NGParamList.paramarray[l][GNB_AMF_IPV4_ADDRESS_IDX].strptr));
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv4 = 1;
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv6 = 0;
|
||||
|
||||
/* not in configuration yet ...
|
||||
if (NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].iptr)
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].numelt;
|
||||
else
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = 0;
|
||||
|
||||
AssertFatal(NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] <= NGAP_REGISTER_GNB_REQ(msg_p).num_plmn,
|
||||
"List of broadcast PLMN to be sent to AMF can not be longer than actual "
|
||||
"PLMN list (max %d, but is %d)\n",
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).num_plmn,
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l]);
|
||||
|
||||
for (int el = 0; el < NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l]; ++el) {
|
||||
// UINTARRAY gets mapped to int, see config_libconfig.c:223
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] = NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].iptr[el];
|
||||
AssertFatal(NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] >= 0
|
||||
&& NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn,
|
||||
"index for AMF's MCC/MNC (%d) is an invalid index for the registered PLMN IDs (%d)\n",
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el],
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).num_plmn);
|
||||
}
|
||||
*/
|
||||
|
||||
/* if no broadcasst_plmn array is defined, fill default values */
|
||||
if (NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] == 0) {
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = NGAP_REGISTER_GNB_REQ(msg_p).num_plmn;
|
||||
|
||||
for (int el = 0; el < NGAP_REGISTER_GNB_REQ(msg_p).num_plmn; ++el)
|
||||
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_index[l][el] = el;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// SCTP SETTING
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
|
||||
if (IS_SA_MODE(get_softmodem_params())) {
|
||||
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
GET_PARAMS(SCTPParams, GNBSCTPPARAMS_DESC, aprefix);
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
|
||||
}
|
||||
|
||||
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
// NETWORK_INTERFACES
|
||||
config_get(config_get_if(), NETParams, sizeofArray(NETParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%d].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
GET_PARAMS(NETParams, GNBNETPARAMS_DESC, aprefix);
|
||||
if (NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr != NULL) {
|
||||
char *cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr);
|
||||
char *save = NULL;
|
||||
char *address = strtok_r(cidr, "/", &save);
|
||||
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4_address, address);
|
||||
LOG_I(GNB_APP, "Parsed IPv4 address for NG AMF: %s\n", address);
|
||||
}
|
||||
|
||||
// NGAP_REGISTER_GNB_REQ (msg_p).enb_interface_name_for_NGU = strdup(enb_interface_name_for_NGU);
|
||||
cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr);
|
||||
char *save = NULL;
|
||||
address = strtok_r(cidr, "/", &save);
|
||||
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv6 = 0;
|
||||
NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4 = 1;
|
||||
|
||||
strcpy(NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4_address, address);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2434,8 +2278,7 @@ void NRRCConfig(void)
|
||||
|
||||
memset((void *)&RC, 0, sizeof(RC));
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
|
||||
// Set num of gNBs instances
|
||||
RC.nb_nr_inst = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
@@ -2482,23 +2325,16 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
int J, l;
|
||||
char *address = NULL;
|
||||
char *cidr = NULL;
|
||||
//int num_gnbs = 0;
|
||||
//int num_component_carriers = 0;
|
||||
int j,k = 0;
|
||||
int32_t gnb_id = 0;
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
////////// Identification parameters
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
|
||||
GET_PARAMS(GNBSParams, GNBSPARAMS_DESC, NULL);
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = calloc_or_fail(1, sizeof(*scc));
|
||||
uint64_t ssb_bitmap=0xff;
|
||||
memset((void*)scc,0,sizeof(NR_ServingCellConfigCommon_t));
|
||||
prepare_scc(scc);
|
||||
paramdef_t SCCsParams[] = SCCPARAMS_DESC(scc);
|
||||
paramlist_def_t SCCsParamList = {GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, NULL, 0};
|
||||
|
||||
AssertFatal(i < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt,
|
||||
"Failed to parse config file %s, %uth attribute %s \n",
|
||||
@@ -2506,7 +2342,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
|
||||
if (GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt > 0) {
|
||||
// Output a list of all gNBs.
|
||||
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
|
||||
if (GNBParamList.numelt > 0) {
|
||||
for (k = 0; k < GNBParamList.numelt; k++) {
|
||||
@@ -2526,29 +2362,13 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
// search if in active list
|
||||
for (j = 0; j < GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; j++) {
|
||||
if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[j], *(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr)) == 0) {
|
||||
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
|
||||
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
|
||||
static_assert(sizeofArray(config_check_PLMNParams) == sizeofArray(PLMNParams),
|
||||
"config_check_PLMNParams and PLMNParams should have the same size");
|
||||
|
||||
for (int I = 0; I < sizeofArray(PLMNParams); ++I)
|
||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||
char* gnb_ipv4_address_for_NGU = NULL;
|
||||
uint32_t gnb_port_for_NGU = 0;
|
||||
char* gnb_ipv4_address_for_S1U = NULL;
|
||||
uint32_t gnb_port_for_S1U = 0;
|
||||
|
||||
paramdef_t X2Params[] = X2PARAMS_DESC;
|
||||
paramlist_def_t X2ParamList = {ENB_CONFIG_STRING_TARGET_ENB_X2_IP_ADDRESS,NULL,0};
|
||||
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
|
||||
char* gnb_ipv4_address_for_NGU = NULL;
|
||||
uint32_t gnb_port_for_NGU = 0;
|
||||
char* gnb_ipv4_address_for_S1U = NULL;
|
||||
uint32_t gnb_port_for_S1U = 0;
|
||||
|
||||
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
|
||||
/* TODO: fix the size - if set lower we have a crash (MAX_OPTNAME_SIZE was 64 when this code was written) */
|
||||
/* this is most probably a problem with the config module */
|
||||
char aprefix[MAX_OPTNAME_SIZE*80 + 8];
|
||||
sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
|
||||
/* Some default/random parameters */
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).eNB_id = gnb_id;
|
||||
|
||||
@@ -2562,29 +2382,26 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(*(GNBParamList.paramarray[k][GNB_GNB_NAME_IDX].strptr));
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).tac = *GNBParamList.paramarray[k][GNB_TRACKING_AREA_CODE_IDX].uptr;
|
||||
config_getlist(config_get_if(), &PLMNParamList, PLMNParams, sizeofArray(PLMNParams), aprefix);
|
||||
|
||||
if (PLMNParamList.numelt < 1 || PLMNParamList.numelt > 6)
|
||||
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
||||
PLMNParamList.numelt);
|
||||
|
||||
if (PLMNParamList.numelt > 1)
|
||||
// PLMN
|
||||
plmn_id_t p[PLMN_LIST_MAX_SIZE];
|
||||
uint8_t num_plmn = set_plmn_config(p, k);
|
||||
if (num_plmn > 1)
|
||||
LOG_W(X2AP, "X2AP currently handles only one PLMN, ignoring the others!\n");
|
||||
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).mcc = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).mnc = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr;
|
||||
X2AP_REGISTER_ENB_REQ(msg_p).mcc = p[0].mcc;
|
||||
X2AP_REGISTER_ENB_REQ(msg_p).mnc = p[0].mnc;
|
||||
X2AP_REGISTER_ENB_REQ(msg_p).mnc_digit_length = p[0].mnc_digit_length;
|
||||
AssertFatal(X2AP_REGISTER_ENB_REQ(msg_p).mnc_digit_length == 3
|
||||
|| X2AP_REGISTER_ENB_REQ(msg_p).mnc < 100,
|
||||
"MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n",
|
||||
X2AP_REGISTER_ENB_REQ(msg_p).mnc);
|
||||
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
|
||||
config_getlist(config_get_if(), &SCCsParamList, NULL, 0, aprefix);
|
||||
char aprefix[MAX_OPTNAME_SIZE * 80 + 8];
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
GET_PARAMS_LIST(SCCsParamList, SCCsParams, SCCPARAMS_DESC(scc), GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, aprefix);
|
||||
if (SCCsParamList.numelt > 0) {
|
||||
sprintf(aprefix, "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST,0,GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, 0);
|
||||
config_get(config_get_if(), SCCsParams, sizeofArray(SCCsParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i].%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON, 0);
|
||||
GET_PARAMS(SCCsParams, SCCPARAMS_DESC(scc), aprefix);
|
||||
fix_scc(scc,ssb_bitmap);
|
||||
}
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).num_cc = SCCsParamList.numelt;
|
||||
@@ -2604,8 +2421,9 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).num_cc);
|
||||
}
|
||||
|
||||
sprintf(aprefix,"%s.[%i]",GNB_CONFIG_STRING_GNB_LIST,k);
|
||||
config_getlist(config_get_if(), &X2ParamList, X2Params, sizeofArray(X2Params), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, k);
|
||||
GET_PARAMS_LIST(X2ParamList, X2Params, X2PARAMS_DESC, ENB_CONFIG_STRING_TARGET_ENB_X2_IP_ADDRESS, aprefix);
|
||||
|
||||
AssertFatal(X2ParamList.numelt <= X2AP_MAX_NB_ENB_IP_ADDRESS,
|
||||
"value of X2ParamList.numelt %d must be lower than X2AP_MAX_NB_ENB_IP_ADDRESS %d value: reconsider to increase X2AP_MAX_NB_ENB_IP_ADDRESS\n",
|
||||
X2ParamList.numelt,X2AP_MAX_NB_ENB_IP_ADDRESS);
|
||||
@@ -2650,15 +2468,15 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
|
||||
|
||||
if (IS_SA_MODE(get_softmodem_params())) {
|
||||
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_SCTP_CONFIG);
|
||||
GET_PARAMS(SCTPParams, GNBSCTPPARAMS_DESC, aprefix);
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
|
||||
}
|
||||
|
||||
sprintf(aprefix,"%s.[%i].%s",GNB_CONFIG_STRING_GNB_LIST,k,GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
// NETWORK_INTERFACES
|
||||
config_get(config_get_if(), NETParams, sizeofArray(NETParams), aprefix);
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, k, GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
GET_PARAMS(NETParams, GNBNETPARAMS_DESC, aprefix);
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).enb_port_for_X2C = (uint32_t)*(NETParams[GNB_PORT_FOR_X2C_IDX].uptr);
|
||||
|
||||
//temp out
|
||||
@@ -2702,7 +2520,7 @@ void wait_f1_setup_response(void)
|
||||
}
|
||||
NR_SCHED_UNLOCK(&mac->sched_lock);
|
||||
}
|
||||
static bool check_plmn_identity(const f1ap_plmn_t *check_plmn, const f1ap_plmn_t *plmn)
|
||||
static bool check_plmn_identity(const plmn_id_t *check_plmn, const plmn_id_t *plmn)
|
||||
{
|
||||
return plmn->mcc == check_plmn->mcc && plmn->mnc_digit_length == check_plmn->mnc_digit_length && plmn->mnc == check_plmn->mnc;
|
||||
}
|
||||
@@ -2766,28 +2584,22 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
|
||||
|
||||
ngran_node_t get_node_type(void)
|
||||
{
|
||||
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
|
||||
paramlist_def_t MacRLC_ParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0};
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
paramdef_t GNBE1Params[] = GNBE1PARAMS_DESC;
|
||||
paramlist_def_t GNBE1ParamList = {GNB_CONFIG_STRING_E1_PARAMETERS, NULL, 0};
|
||||
|
||||
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeofArray(GNBParams), NULL);
|
||||
|
||||
GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL);
|
||||
if (GNBParamList.numelt == 0) // We have no valid configuration, let's return a default
|
||||
return ngran_gNB;
|
||||
|
||||
config_getlist(config_get_if(), &MacRLC_ParamList, MacRLC_Params, sizeofArray(MacRLC_Params), NULL);
|
||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(aprefix, "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
config_getlist(config_get_if(), &GNBE1ParamList, GNBE1Params, sizeofArray(GNBE1Params), aprefix);
|
||||
for (int j = 0; j < MacRLC_ParamList.numelt; j++) {
|
||||
// MAC/RLC params
|
||||
GET_PARAMS_LIST(MacRLC_ParamList, MacRLC_Params, MACRLCPARAMS_DESC, CONFIG_STRING_MACRLC_LIST, NULL);
|
||||
for (int j = 0; j < RC.nb_nr_macrlc_inst; j++) {
|
||||
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
return ngran_gNB_DU; // MACRLCs present in config: it must be a DU
|
||||
}
|
||||
}
|
||||
|
||||
// E1 params
|
||||
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
|
||||
snprintf(aprefix, sizeof(aprefix), "%s.[%i]", GNB_CONFIG_STRING_GNB_LIST, 0);
|
||||
GET_PARAMS_LIST(GNBE1ParamList, GNBE1Params, GNBE1PARAMS_DESC, GNB_CONFIG_STRING_E1_PARAMETERS, aprefix);
|
||||
if (strcmp(*(GNBParamList.paramarray[0][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "f1") == 0) {
|
||||
if ( GNBE1ParamList.paramarray == NULL || GNBE1ParamList.numelt == 0 )
|
||||
return ngran_gNB_CU;
|
||||
|
||||
@@ -46,51 +46,15 @@
|
||||
}\
|
||||
} while (0);
|
||||
|
||||
/** @defgroup _enb_app ENB APP
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
|
||||
// Hard to find a defined value for max enb...
|
||||
#define MAX_GNB 16
|
||||
|
||||
/*
|
||||
typedef struct mme_ip_address_s {
|
||||
unsigned ipv4:1;
|
||||
unsigned ipv6:1;
|
||||
unsigned active:1;
|
||||
char *ipv4_address;
|
||||
char *ipv6_address;
|
||||
} mme_ip_address_t;
|
||||
|
||||
typedef struct ru_config_s {
|
||||
// indicates if local or remote rf is used (1 == LOCAL)
|
||||
unsigned local_rf:1;
|
||||
// indicates if UDP socket is used
|
||||
unsigned udp:1;
|
||||
// indicates if RAW socket is used
|
||||
unsigned raw:1;
|
||||
char *ru_if_name;
|
||||
char *local_address;
|
||||
char *remote_address;
|
||||
uint16_t local_port;
|
||||
uint16_t remote_port;
|
||||
uint8_t udpif4p5;
|
||||
uint8_t rawif4p5;
|
||||
uint8_t rawif5_mobipass;
|
||||
uint8_t if_compress;
|
||||
} ru_config_t;
|
||||
*/
|
||||
|
||||
void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type);
|
||||
extern void RCconfig_nr_prs(void);
|
||||
extern void RCconfig_NR_L1(void);
|
||||
extern void RCconfig_nr_macrlc(configmodule_interface_t *cfg);
|
||||
extern void NRRCConfig(void);
|
||||
|
||||
//void enb_config_display(void);
|
||||
//void ru_config_display(void);
|
||||
|
||||
gNB_RRC_INST *RCconfig_NRRRC();
|
||||
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
|
||||
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
|
||||
|
||||
@@ -958,7 +958,7 @@ void prepare_du_configuration_update(gNB_MAC_INST *mac,
|
||||
mac->mac_rrc.gnb_du_configuration_update(&update);
|
||||
}
|
||||
|
||||
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac)
|
||||
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const plmn_id_t *plmn, uint64_t cellID, int tac)
|
||||
{
|
||||
AssertFatal(IS_SA_MODE(get_softmodem_params()), "error: SIB1 only applicable for SA\n");
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ void mac_top_init_gNB(ngran_node_t node_type,
|
||||
void nr_mac_send_f1_setup_req(void);
|
||||
|
||||
void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *mac_config);
|
||||
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac);
|
||||
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const plmn_id_t *plmn, uint64_t cellID, int tac);
|
||||
bool nr_mac_configure_other_sib(gNB_MAC_INST *nrmac, int num_cu_sib, const f1ap_sib_msg_t cu_sib[num_cu_sib]);
|
||||
bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup);
|
||||
bool nr_mac_prepare_ra_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup);
|
||||
|
||||
@@ -94,7 +94,7 @@ bool DURecvCb(protocol_ctxt_t *ctxt_pP,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool check_plmn_identity(const f1ap_plmn_t *check_plmn, const f1ap_plmn_t *plmn)
|
||||
static bool check_plmn_identity(const plmn_id_t *check_plmn, const plmn_id_t *plmn)
|
||||
{
|
||||
return plmn->mcc == check_plmn->mcc && plmn->mnc_digit_length == check_plmn->mnc_digit_length && plmn->mnc == check_plmn->mnc;
|
||||
}
|
||||
|
||||
@@ -2463,7 +2463,7 @@ static bool is_ntn_band(int band)
|
||||
}
|
||||
|
||||
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc,
|
||||
const f1ap_plmn_t *plmn,
|
||||
const plmn_id_t *plmn,
|
||||
uint64_t cellID,
|
||||
int tac,
|
||||
const nr_mac_config_t *mac_config)
|
||||
|
||||
@@ -79,7 +79,7 @@ void free_MeasurementTimingConfiguration(struct NR_MeasurementTimingConfiguratio
|
||||
|
||||
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1
|
||||
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const NR_ServingCellConfigCommon_t *scc,
|
||||
const f1ap_plmn_t *plmn,
|
||||
const plmn_id_t *plmn,
|
||||
uint64_t cellID,
|
||||
int tac,
|
||||
const nr_mac_config_t *mac_config);
|
||||
|
||||
@@ -2894,9 +2894,9 @@ void rrc_gNB_generate_UeContextSetupRequest(const gNB_RRC_INST *rrc,
|
||||
f1ap_ue_context_setup_t ue_context_setup_req = {
|
||||
.gNB_CU_ue_id = ue_p->rrc_ue_id,
|
||||
.gNB_DU_ue_id = ue_data.secondary_ue,
|
||||
.plmn.mcc = rrc->configuration.mcc[0],
|
||||
.plmn.mnc = rrc->configuration.mnc[0],
|
||||
.plmn.mnc_digit_length = rrc->configuration.mnc_digit_length[0],
|
||||
.plmn.mcc = rrc->configuration.plmn[0].mcc,
|
||||
.plmn.mnc = rrc->configuration.plmn[0].mnc,
|
||||
.plmn.mnc_digit_length = rrc->configuration.plmn[0].mnc_digit_length,
|
||||
.nr_cellid = rrc->nr_cellid,
|
||||
.servCellId = 0, /* TODO: correct value? */
|
||||
.srbs_to_be_setup_length = nb_srb,
|
||||
@@ -2938,9 +2938,9 @@ void rrc_gNB_generate_UeContextModificationRequest(const gNB_RRC_INST *rrc,
|
||||
f1ap_ue_context_modif_req_t ue_context_modif_req = {
|
||||
.gNB_CU_ue_id = ue_p->rrc_ue_id,
|
||||
.gNB_DU_ue_id = ue_data.secondary_ue,
|
||||
.plmn.mcc = rrc->configuration.mcc[0],
|
||||
.plmn.mnc = rrc->configuration.mnc[0],
|
||||
.plmn.mnc_digit_length = rrc->configuration.mnc_digit_length[0],
|
||||
.plmn.mcc = rrc->configuration.plmn[0].mcc,
|
||||
.plmn.mnc = rrc->configuration.plmn[0].mnc,
|
||||
.plmn.mnc_digit_length = rrc->configuration.plmn[0].mnc_digit_length,
|
||||
.nr_cellid = rrc->nr_cellid,
|
||||
.servCellId = 0, /* TODO: correct value? */
|
||||
.drbs_to_be_setup_length = n_drbs,
|
||||
|
||||
@@ -1454,18 +1454,18 @@ int rrc_gNB_process_PAGING_IND(MessageDef *msg_p, instance_t instance)
|
||||
for (uint16_t tai_size = 0; tai_size < NGAP_PAGING_IND(msg_p).tai_size; tai_size++) {
|
||||
LOG_I(NR_RRC,"[gNB %ld] In NGAP_PAGING_IND: MCC %d, MNC %d, TAC %d\n", instance, NGAP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc,
|
||||
NGAP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc, NGAP_PAGING_IND(msg_p).tac[tai_size]);
|
||||
|
||||
for (uint8_t j = 0; j < RC.nrrrc[instance]->configuration.num_plmn; j++) {
|
||||
if (RC.nrrrc[instance]->configuration.mcc[j] == NGAP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc
|
||||
&& RC.nrrrc[instance]->configuration.mnc[j] == NGAP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc
|
||||
&& RC.nrrrc[instance]->configuration.tac == NGAP_PAGING_IND(msg_p).tac[tai_size]) {
|
||||
gNB_RrcConfigurationReq *req = &RC.nrrrc[instance]->configuration;
|
||||
for (uint8_t j = 0; j < req->num_plmn; j++) {
|
||||
plmn_id_t *plmn = &req->plmn[j];
|
||||
if (plmn->mcc == NGAP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc
|
||||
&& plmn->mnc == NGAP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc && req->tac == NGAP_PAGING_IND(msg_p).tac[tai_size]) {
|
||||
for (uint8_t CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
AssertFatal(false, "to be implemented properly\n");
|
||||
if (NODE_IS_CU(RC.nrrrc[instance]->node_type)) {
|
||||
MessageDef *m = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_PAGING_IND);
|
||||
F1AP_PAGING_IND(m).plmn.mcc = RC.nrrrc[j]->configuration.mcc[0];
|
||||
F1AP_PAGING_IND(m).plmn.mnc = RC.nrrrc[j]->configuration.mnc[0];
|
||||
F1AP_PAGING_IND(m).plmn.mnc_digit_length = RC.nrrrc[j]->configuration.mnc_digit_length[0];
|
||||
F1AP_PAGING_IND(m).plmn.mcc = RC.nrrrc[j]->configuration.plmn[0].mcc;
|
||||
F1AP_PAGING_IND(m).plmn.mnc = RC.nrrrc[j]->configuration.plmn[0].mnc;
|
||||
F1AP_PAGING_IND(m).plmn.mnc_digit_length = RC.nrrrc[j]->configuration.plmn[0].mnc_digit_length;
|
||||
F1AP_PAGING_IND (m).nr_cellid = RC.nrrrc[j]->nr_cellid;
|
||||
F1AP_PAGING_IND (m).ueidentityindexvalue = (uint16_t)(NGAP_PAGING_IND(msg_p).ue_paging_identity.s_tmsi.m_tmsi%1024);
|
||||
F1AP_PAGING_IND (m).fiveg_s_tmsi = NGAP_PAGING_IND(msg_p).ue_paging_identity.s_tmsi.m_tmsi;
|
||||
|
||||
@@ -263,13 +263,13 @@ int rrc_gNB_process_e1_setup_req(sctp_assoc_t assoc_id, const e1ap_setup_req_t *
|
||||
|
||||
for (int i = 0; i < req->supported_plmns; i++) {
|
||||
const PLMN_ID_t *id = &req->plmn[i].id;
|
||||
if (rrc->configuration.mcc[i] != id->mcc || rrc->configuration.mnc[i] != id->mnc) {
|
||||
if (rrc->configuration.plmn[i].mcc != id->mcc || rrc->configuration.plmn[i].mnc != id->mnc) {
|
||||
LOG_E(NR_RRC,
|
||||
"PLMNs received from CUUP (mcc:%d, mnc:%d) did not match with PLMNs in RRC (mcc:%d, mnc:%d)\n",
|
||||
id->mcc,
|
||||
id->mnc,
|
||||
rrc->configuration.mcc[i],
|
||||
rrc->configuration.mnc[i]);
|
||||
rrc->configuration.plmn[i].mcc,
|
||||
rrc->configuration.plmn[i].mnc);
|
||||
e1ap_cause_t cause = { .type = E1AP_CAUSE_RADIO_NETWORK, .value = E1AP_RADIO_CAUSE_OTHER};
|
||||
e1ap_setup_failure(assoc_id, req->transac_id, cause);
|
||||
return -1;
|
||||
|
||||
@@ -99,8 +99,7 @@ static bool rrc_gNB_plmn_matches(const gNB_RRC_INST *rrc, const f1ap_served_cell
|
||||
{
|
||||
const gNB_RrcConfigurationReq *conf = &rrc->configuration;
|
||||
return conf->num_plmn == 1 // F1 supports only one
|
||||
&& conf->mcc[0] == info->plmn.mcc
|
||||
&& conf->mnc[0] == info->plmn.mnc;
|
||||
&& conf->plmn[0].mcc == info->plmn.mcc && conf->plmn[0].mnc == info->plmn.mnc;
|
||||
}
|
||||
|
||||
static bool extract_sys_info(const f1ap_gnb_du_system_info_t *sys_info, NR_MIB_t **mib, NR_SIB1_t **sib1)
|
||||
@@ -309,9 +308,9 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
|
||||
if (!rrc_gNB_plmn_matches(rrc, cell_info)) {
|
||||
LOG_E(NR_RRC,
|
||||
"PLMN mismatch: CU %03d.%0*d, DU %03d%0*d\n",
|
||||
rrc->configuration.mcc[0],
|
||||
rrc->configuration.mnc_digit_length[0],
|
||||
rrc->configuration.mnc[0],
|
||||
rrc->configuration.plmn[0].mcc,
|
||||
rrc->configuration.plmn[0].mnc_digit_length,
|
||||
rrc->configuration.plmn[0].mnc,
|
||||
cell_info->plmn.mcc,
|
||||
cell_info->plmn.mnc_digit_length,
|
||||
cell_info->plmn.mnc);
|
||||
|
||||
@@ -227,9 +227,7 @@ static void rrc_gNB_trigger_reconfiguration_for_handover(gNB_RRC_INST *rrc, gNB_
|
||||
f1ap_ue_context_modif_req_t ue_context_modif_req = {
|
||||
.gNB_CU_ue_id = ue->rrc_ue_id,
|
||||
.gNB_DU_ue_id = ue_data.secondary_ue,
|
||||
.plmn.mcc = rrc->configuration.mcc[0],
|
||||
.plmn.mnc = rrc->configuration.mnc[0],
|
||||
.plmn.mnc_digit_length = rrc->configuration.mnc_digit_length[0],
|
||||
.plmn = rrc->configuration.plmn[0],
|
||||
.nr_cellid = rrc->nr_cellid, // TODO target cell ID
|
||||
.servCellId = 0, // TODO: correct value?
|
||||
.ReconfigComplOutcome = RRCreconf_success,
|
||||
|
||||
@@ -158,8 +158,8 @@ void ngap_gNB_handle_register_gNB(instance_t instance, ngap_register_gnb_req_t *
|
||||
DevCheck(new_instance->tac == ngap_register_gNB->tac, new_instance->tac, ngap_register_gNB->tac, 0);
|
||||
|
||||
for (int i = 0; i < new_instance->num_plmn; i++) {
|
||||
ngap_plmn_t *exist_plmn = &new_instance->plmn[i];
|
||||
ngap_plmn_t *new_plmn = &ngap_register_gNB->plmn[i];
|
||||
plmn_id_t *exist_plmn = &new_instance->plmn[i].plmn;
|
||||
plmn_id_t *new_plmn = &ngap_register_gNB->plmn[i].plmn;
|
||||
DevCheck(exist_plmn->mcc == new_plmn->mcc, exist_plmn->mcc, new_plmn->mcc, 0);
|
||||
DevCheck(exist_plmn->mnc == new_plmn->mnc, exist_plmn->mnc, new_plmn->mnc, 0);
|
||||
DevCheck(exist_plmn->mnc_digit_length == new_plmn->mnc_digit_length,
|
||||
@@ -185,9 +185,9 @@ void ngap_gNB_handle_register_gNB(instance_t instance, ngap_register_gnb_req_t *
|
||||
sizeof(ngap_register_gNB->gnb_ip_address));
|
||||
|
||||
for (int i = 0; i < ngap_register_gNB->num_plmn; i++) {
|
||||
new_instance->plmn[i].mcc = ngap_register_gNB->plmn[i].mcc;
|
||||
new_instance->plmn[i].mnc = ngap_register_gNB->plmn[i].mnc;
|
||||
new_instance->plmn[i].mnc_digit_length = ngap_register_gNB->plmn[i].mnc_digit_length;
|
||||
new_instance->plmn[i].plmn.mcc = ngap_register_gNB->plmn[i].plmn.mcc;
|
||||
new_instance->plmn[i].plmn.mnc = ngap_register_gNB->plmn[i].plmn.mnc;
|
||||
new_instance->plmn[i].plmn.mnc_digit_length = ngap_register_gNB->plmn[i].plmn.mnc_digit_length;
|
||||
|
||||
new_instance->plmn[i].num_nssai = ngap_register_gNB->plmn[i].num_nssai;
|
||||
memcpy(&new_instance->plmn[i].s_nssai, &ngap_register_gNB->plmn[i].s_nssai, sizeof(ngap_register_gNB->plmn[i].s_nssai));
|
||||
@@ -421,9 +421,10 @@ static int ngap_gNB_generate_ng_setup_request(
|
||||
ie->value.present = NGAP_NGSetupRequestIEs__value_PR_GlobalRANNodeID;
|
||||
ie->value.choice.GlobalRANNodeID.present = NGAP_GlobalRANNodeID_PR_globalGNB_ID;
|
||||
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID = CALLOC(1, sizeof(struct NGAP_GlobalGNB_ID));
|
||||
MCC_MNC_TO_PLMNID(instance_p->plmn[ngap_amf_data_p->broadcast_plmn_index[0]].mcc,
|
||||
instance_p->plmn[ngap_amf_data_p->broadcast_plmn_index[0]].mnc,
|
||||
instance_p->plmn[ngap_amf_data_p->broadcast_plmn_index[0]].mnc_digit_length,
|
||||
plmn_id_t *plmn_id = &instance_p->plmn[ngap_amf_data_p->broadcast_plmn_index[0]].plmn;
|
||||
MCC_MNC_TO_PLMNID(plmn_id->mcc,
|
||||
plmn_id->mnc,
|
||||
plmn_id->mnc_digit_length,
|
||||
&(ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->pLMNIdentity));
|
||||
ie->value.choice.GlobalRANNodeID.choice.globalGNB_ID->gNB_ID.present = NGAP_GNB_ID_PR_gNB_ID;
|
||||
MACRO_GNB_ID_TO_BIT_STRING(instance_p->gNB_id,
|
||||
@@ -458,7 +459,8 @@ static int ngap_gNB_generate_ng_setup_request(
|
||||
for (int i = 0; i < ngap_amf_data_p->broadcast_plmn_num; ++i) {
|
||||
plmn = (NGAP_BroadcastPLMNItem_t *)calloc(1, sizeof(NGAP_BroadcastPLMNItem_t));
|
||||
ngap_plmn_t *plmn_req = &instance_p->plmn[ngap_amf_data_p->broadcast_plmn_index[i]];
|
||||
MCC_MNC_TO_TBCD(plmn_req->mcc, plmn_req->mnc, plmn_req->mnc_digit_length, &plmn->pLMNIdentity);
|
||||
plmn_id_t *plmn_id = &instance_p->plmn[ngap_amf_data_p->broadcast_plmn_index[i]].plmn;
|
||||
MCC_MNC_TO_TBCD(plmn_id->mcc, plmn_id->mnc, plmn_id->mnc_digit_length, &plmn->pLMNIdentity);
|
||||
|
||||
for (int si = 0; si < plmn_req->num_nssai; si++) {
|
||||
ssi = (NGAP_SliceSupportItem_t *)calloc(1, sizeof(NGAP_SliceSupportItem_t));
|
||||
|
||||
@@ -123,15 +123,14 @@ int ngap_gNB_handle_nas_first_req(instance_t instance, ngap_nas_first_req_t *UEf
|
||||
amf_desc_p = ngap_gNB_nnsf_select_amf_by_amf_setid(instance_p, UEfirstReq->establishment_cause, UEfirstReq->selected_plmn_identity, UEfirstReq->ue_identity.s_tmsi.amf_set_id);
|
||||
|
||||
if (amf_desc_p) {
|
||||
NGAP_INFO(
|
||||
"UE %d: Chose AMF '%s' (assoc_id %d) through S-TMSI AMFSI %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
UEfirstReq->gNB_ue_ngap_id,
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id,
|
||||
UEfirstReq->ue_identity.s_tmsi.amf_set_id,
|
||||
UEfirstReq->selected_plmn_identity,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].mcc,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].mnc);
|
||||
NGAP_INFO("UE %d: Chose AMF '%s' (assoc_id %d) through S-TMSI AMFSI %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||
UEfirstReq->gNB_ue_ngap_id,
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id,
|
||||
UEfirstReq->ue_identity.s_tmsi.amf_set_id,
|
||||
UEfirstReq->selected_plmn_identity,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].plmn.mcc,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].plmn.mnc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,8 +147,8 @@ int ngap_gNB_handle_nas_first_req(instance_t instance, ngap_nas_first_req_t *UEf
|
||||
amf_desc_p->amf_name,
|
||||
amf_desc_p->assoc_id,
|
||||
UEfirstReq->selected_plmn_identity,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].mcc,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].mnc);
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].plmn.mcc,
|
||||
instance_p->plmn[UEfirstReq->selected_plmn_identity].plmn.mnc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,16 +221,16 @@ int ngap_gNB_handle_nas_first_req(instance_t instance, ngap_nas_first_req_t *UEf
|
||||
MACRO_GNB_ID_TO_CELL_IDENTITY(instance_p->gNB_id,
|
||||
0, // Cell ID
|
||||
&userinfo_nr_p->nR_CGI.nRCellIdentity);
|
||||
MCC_MNC_TO_TBCD(instance_p->plmn[ue_desc_p->selected_plmn_identity].mcc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].mnc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].mnc_digit_length,
|
||||
MCC_MNC_TO_TBCD(instance_p->plmn[ue_desc_p->selected_plmn_identity].plmn.mcc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].plmn.mnc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].plmn.mnc_digit_length,
|
||||
&userinfo_nr_p->nR_CGI.pLMNIdentity);
|
||||
|
||||
/* Set TAI */
|
||||
INT24_TO_OCTET_STRING(instance_p->tac, &userinfo_nr_p->tAI.tAC);
|
||||
MCC_MNC_TO_PLMNID(instance_p->plmn[ue_desc_p->selected_plmn_identity].mcc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].mnc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].mnc_digit_length,
|
||||
MCC_MNC_TO_PLMNID(instance_p->plmn[ue_desc_p->selected_plmn_identity].plmn.mcc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].plmn.mnc,
|
||||
instance_p->plmn[ue_desc_p->selected_plmn_identity].plmn.mnc_digit_length,
|
||||
&userinfo_nr_p->tAI.pLMNIdentity);
|
||||
}
|
||||
|
||||
@@ -454,16 +453,16 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_
|
||||
MACRO_GNB_ID_TO_CELL_IDENTITY(ngap_gNB_instance_p->gNB_id,
|
||||
0, // Cell ID
|
||||
&userinfo_nr_p->nR_CGI.nRCellIdentity);
|
||||
MCC_MNC_TO_TBCD(ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].mcc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].mnc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].mnc_digit_length,
|
||||
MCC_MNC_TO_TBCD(ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].plmn.mcc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].plmn.mnc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].plmn.mnc_digit_length,
|
||||
&userinfo_nr_p->nR_CGI.pLMNIdentity);
|
||||
|
||||
/* Set TAI */
|
||||
INT24_TO_OCTET_STRING(ngap_gNB_instance_p->tac, &userinfo_nr_p->tAI.tAC);
|
||||
MCC_MNC_TO_PLMNID(ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].mcc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].mnc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].mnc_digit_length,
|
||||
MCC_MNC_TO_PLMNID(ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].plmn.mcc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].plmn.mnc,
|
||||
ngap_gNB_instance_p->plmn[ue_context_p->selected_plmn_identity].plmn.mnc_digit_length,
|
||||
&userinfo_nr_p->tAI.pLMNIdentity);
|
||||
}
|
||||
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
||||
|
||||
@@ -135,8 +135,8 @@ ngap_gNB_nnsf_select_amf_by_plmn_id(ngap_gNB_instance_t *instance_p,
|
||||
/* Looking for served GUAMI PLMN Identity selected matching the one provided by the UE */
|
||||
STAILQ_FOREACH(guami_p, &amf_data_p->served_guami, next) {
|
||||
STAILQ_FOREACH(served_plmn_p, &guami_p->served_plmns, next) {
|
||||
if ((served_plmn_p->mcc == instance_p->plmn[selected_plmn_identity].mcc)
|
||||
&& (served_plmn_p->mnc == instance_p->plmn[selected_plmn_identity].mnc)) {
|
||||
if ((served_plmn_p->mcc == instance_p->plmn[selected_plmn_identity].plmn.mcc)
|
||||
&& (served_plmn_p->mnc == instance_p->plmn[selected_plmn_identity].plmn.mnc)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -207,8 +207,8 @@ ngap_gNB_nnsf_select_amf_by_amf_setid(ngap_gNB_instance_t *instance_p,
|
||||
struct plmn_identity_s *served_plmn_p = NULL;
|
||||
|
||||
STAILQ_FOREACH(served_plmn_p, &guami_p->served_plmns, next) {
|
||||
if ((served_plmn_p->mcc == instance_p->plmn[selected_plmn_identity].mcc)
|
||||
&& (served_plmn_p->mnc == instance_p->plmn[selected_plmn_identity].mnc)) {
|
||||
if ((served_plmn_p->mcc == instance_p->plmn[selected_plmn_identity].plmn.mcc)
|
||||
&& (served_plmn_p->mnc == instance_p->plmn[selected_plmn_identity].plmn.mnc)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user