Commit b1bb36a3 authored by Victor Souza's avatar Victor Souza

added bap_address support for du_gnb.conf type files and added new gNB node type (ngran_gNB_DU_IAB)

parent 2dc0a8d7
...@@ -354,6 +354,7 @@ configmodule_interface_t *load_configmodule(int argc, ...@@ -354,6 +354,7 @@ configmodule_interface_t *load_configmodule(int argc,
if (i == 0) { if (i == 0) {
printf("[CONFIG] config module %s loaded\n",cfgmode); printf("[CONFIG] config module %s loaded\n",cfgmode);
// Continue/Read from this
int idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_DEBUGFLAGS); int idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_DEBUGFLAGS);
Config_Params[idx].uptr = &(cfgptr->rtflags); Config_Params[idx].uptr = &(cfgptr->rtflags);
idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_TMPDIR); idx = config_paramidx_fromname(Config_Params, sizeofArray(Config_Params), CONFIGP_TMPDIR);
......
...@@ -126,6 +126,12 @@ int config_get(configmodule_interface_t *cfgif, paramdef_t *params, int numparam ...@@ -126,6 +126,12 @@ int config_get(configmodule_interface_t *cfgif, paramdef_t *params, int numparam
if (cfgif != NULL) { if (cfgif != NULL) {
ret = cfgif->get(cfgif, params, numparams, prefix); ret = cfgif->get(cfgif, params, numparams, prefix);
/* testing
printf("Num params: %d\n", numparams);
for (int i = 0; i < numparams; i++){
printf("%d, %s\n", i, params[i].optname);
}
end testing */
if (ret >= 0) { if (ret >= 0) {
config_process_cmdline(cfgif, params, numparams, prefix); config_process_cmdline(cfgif, params, numparams, prefix);
......
...@@ -44,7 +44,8 @@ typedef enum { ...@@ -44,7 +44,8 @@ typedef enum {
ngran_gNB_DU = 7, ngran_gNB_DU = 7,
ngran_eNB_MBMS_STA = 8, ngran_eNB_MBMS_STA = 8,
ngran_gNB_CUCP = 9, ngran_gNB_CUCP = 9,
ngran_gNB_CUUP = 10 ngran_gNB_CUUP = 10,
ngran_gNB_DU_IAB = 11,
} ngran_node_t; } ngran_node_t;
typedef enum { CPtype = 0, UPtype } E1_t; typedef enum { CPtype = 0, UPtype } E1_t;
...@@ -52,6 +53,7 @@ typedef enum { CPtype = 0, UPtype } E1_t; ...@@ -52,6 +53,7 @@ typedef enum { CPtype = 0, UPtype } E1_t;
#define NODE_IS_MONOLITHIC(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB || (nOdE_TyPe) == ngran_ng_eNB || (nOdE_TyPe) == ngran_gNB) #define NODE_IS_MONOLITHIC(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB || (nOdE_TyPe) == ngran_ng_eNB || (nOdE_TyPe) == ngran_gNB)
#define NODE_IS_CU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_CU || (nOdE_TyPe) == ngran_ng_eNB_CU || (nOdE_TyPe) == ngran_gNB_CU || (nOdE_TyPe) == ngran_gNB_CUCP || (nOdE_TyPe) == ngran_gNB_CUUP) #define NODE_IS_CU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_CU || (nOdE_TyPe) == ngran_ng_eNB_CU || (nOdE_TyPe) == ngran_gNB_CU || (nOdE_TyPe) == ngran_gNB_CUCP || (nOdE_TyPe) == ngran_gNB_CUUP)
#define NODE_IS_DU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_DU || (nOdE_TyPe) == ngran_gNB_DU) #define NODE_IS_DU(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_DU || (nOdE_TyPe) == ngran_gNB_DU)
#define NODE_IS_DU_IAB(nOdE_TyPe) ((nOdE_TyPe) == ngran_gNB_DU_IAB)
#define NODE_IS_MBMS(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_MBMS_STA) #define NODE_IS_MBMS(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_MBMS_STA)
#define GTPV1_U_PORT_NUMBER (2152) #define GTPV1_U_PORT_NUMBER (2152)
......
...@@ -317,7 +317,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -317,7 +317,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
init_pdcp(); init_pdcp();
} }
if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(node_type) if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(node_type), or DU_IAB
LOG_I(X2AP, "X2AP enabled \n"); LOG_I(X2AP, "X2AP enabled \n");
__attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end); __attribute__((unused)) uint32_t x2_register_gnb_pending = gNB_app_register_x2 (gnb_id_start, gnb_id_end);
} }
...@@ -325,7 +325,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -325,7 +325,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info /* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
* can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/ * can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/
if ((get_softmodem_params()->sa || is_x2ap_enabled()) && if ((get_softmodem_params()->sa || is_x2ap_enabled()) &&
!NODE_IS_DU(node_type)) { !NODE_IS_DU(node_type) && !NODE_IS_DU_IAB(node_type)) {
/* Try to register each gNB */ /* Try to register each gNB */
//registered_gnb = 0; //registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end); __attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
...@@ -347,7 +347,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -347,7 +347,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
} }
if (get_softmodem_params()->sa && if (get_softmodem_params()->sa &&
!NODE_IS_DU(node_type)) { !NODE_IS_DU(node_type) && !NODE_IS_DU_IAB(node_type)) {
char* gnb_ipv4_address_for_NGU = NULL; char* gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0; uint32_t gnb_port_for_NGU = 0;
...@@ -381,7 +381,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf ...@@ -381,7 +381,7 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
return -1; return -1;
} }
if (!NODE_IS_DU(node_type)) { if (!NODE_IS_DU(node_type) && !NODE_IS_DU_IAB(node_type)) {
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) { if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n"); LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
return -1; return -1;
...@@ -553,7 +553,7 @@ void init_pdcp(void) { ...@@ -553,7 +553,7 @@ void init_pdcp(void) {
PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT: PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT:
LINK_ENB_PDCP_TO_GTPV1U_BIT; LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (!NODE_IS_DU(get_node_type())) { if (!NODE_IS_DU(get_node_type()) && !NODE_IS_DU_IAB(get_node_type())) {
nr_pdcp_layer_init(get_node_type() == ngran_gNB_CUCP); nr_pdcp_layer_init(get_node_type() == ngran_gNB_CUCP);
nr_pdcp_module_init(pdcp_initmask, 0); nr_pdcp_module_init(pdcp_initmask, 0);
} }
...@@ -673,7 +673,7 @@ int main( int argc, char **argv ) { ...@@ -673,7 +673,7 @@ int main( int argc, char **argv ) {
if (RC.nb_nr_L1_inst > 0) if (RC.nb_nr_L1_inst > 0)
RCconfig_NR_L1(); RCconfig_NR_L1();
if (NFAPI_MODE != NFAPI_MODE_PNF) { if (NFAPI_MODE != NFAPI_MODE_PNF) {
int ret = create_gNB_tasks(node_type, uniqCfg); int ret = create_gNB_tasks(node_type, uniqCfg);
AssertFatal(ret == 0, "cannot create ITTI tasks\n"); AssertFatal(ret == 0, "cannot create ITTI tasks\n");
...@@ -744,7 +744,7 @@ int main( int argc, char **argv ) { ...@@ -744,7 +744,7 @@ int main( int argc, char **argv ) {
} }
// wait for F1 Setup Response before starting L1 for real // wait for F1 Setup Response before starting L1 for real
if (NODE_IS_DU(node_type) || NODE_IS_MONOLITHIC(node_type)) if (NODE_IS_DU(node_type) || NODE_IS_MONOLITHIC(node_type) || NODE_IS_DU_IAB(node_type))
wait_f1_setup_response(); wait_f1_setup_response();
if (RC.nb_RU > 0) if (RC.nb_RU > 0)
......
...@@ -158,13 +158,13 @@ void *gNB_app_task(void *args_p) ...@@ -158,13 +158,13 @@ void *gNB_app_task(void *args_p)
AssertFatal(false, "To run CU-UP use executable nr-cuup\n"); AssertFatal(false, "To run CU-UP use executable nr-cuup\n");
} }
if (NODE_IS_DU(node_type)) { if (NODE_IS_DU(node_type) || NODE_IS_DU_IAB(node_type)) {
if (itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL) < 0) { if (itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL) < 0) {
LOG_E(F1AP, "Create task for F1AP DU failed\n"); LOG_E(F1AP, "Create task for F1AP DU failed\n");
AssertFatal(1==0,"exiting"); AssertFatal(1==0,"exiting");
} }
} }
if (NODE_IS_DU(node_type) || NODE_IS_MONOLITHIC(node_type)) { if (NODE_IS_DU(node_type) || NODE_IS_MONOLITHIC(node_type) || NODE_IS_DU_IAB(node_type)) {
// need to check SA? // need to check SA?
nr_mac_send_f1_setup_req(); nr_mac_send_f1_setup_req();
} }
...@@ -236,6 +236,7 @@ void *gNB_app_task(void *args_p) ...@@ -236,6 +236,7 @@ void *gNB_app_task(void *args_p)
case F1AP_GNB_CU_CONFIGURATION_UPDATE: case F1AP_GNB_CU_CONFIGURATION_UPDATE:
AssertFatal(NODE_IS_DU(node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n"); AssertFatal(NODE_IS_DU(node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n");
AssertFatal(NODE_IS_DU_IAB(node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n");
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p), LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).gNB_CU_name,F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate); F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).gNB_CU_name,F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate);
......
...@@ -707,7 +707,16 @@ void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type) ...@@ -707,7 +707,16 @@ void RCconfig_verify(configmodule_interface_t *cfg, ngran_node_t node_type)
verify_section_notset(cfg, GNB_CONFIG_STRING_GNB_LIST ".", GNB_CONFIG_STRING_AMF_IP_ADDRESS); verify_section_notset(cfg, GNB_CONFIG_STRING_GNB_LIST ".", GNB_CONFIG_STRING_AMF_IP_ADDRESS);
verify_section_notset(cfg, NULL, CONFIG_STRING_SECURITY); verify_section_notset(cfg, NULL, CONFIG_STRING_SECURITY);
} // else nothing to be checked } else if (NODE_IS_DU_IAB(node_type)) {
// Equal to normal DU, but might change in the future
verify_gnb_param_notset(gnbp, GNB_ENABLE_SDAP_IDX, GNB_CONFIG_STRING_ENABLE_SDAP);
verify_gnb_param_notset(gnbp, GNB_DRBS, GNB_CONFIG_STRING_DRBS);
verify_section_notset(cfg, GNB_CONFIG_STRING_GNB_LIST ".", GNB_CONFIG_STRING_AMF_IP_ADDRESS);
verify_section_notset(cfg, NULL, CONFIG_STRING_SECURITY);
}
// else nothing to be checked
/* other possible verifications: PNF, VNF, CU-CP, CU-UP, ...? */ /* other possible verifications: PNF, VNF, CU-CP, CU-UP, ...? */
} }
...@@ -1035,9 +1044,11 @@ static NR_ServingCellConfig_t *get_scd_config(configmodule_interface_t *cfg) ...@@ -1035,9 +1044,11 @@ static NR_ServingCellConfig_t *get_scd_config(configmodule_interface_t *cfg)
static int read_du_cell_info(configmodule_interface_t *cfg, static int read_du_cell_info(configmodule_interface_t *cfg,
bool separate_du, bool separate_du,
bool separate_iab_du,
uint32_t *gnb_id, uint32_t *gnb_id,
uint64_t *gnb_du_id, uint64_t *gnb_du_id,
char **name, char **name,
uint16_t *bap_address,
f1ap_served_cell_info_t *info, f1ap_served_cell_info_t *info,
int max_cell_info) int max_cell_info)
{ {
...@@ -1078,6 +1089,10 @@ static int read_du_cell_info(configmodule_interface_t *cfg, ...@@ -1078,6 +1089,10 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
if (separate_du) { 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); 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);
*gnb_du_id = *GNBParamList.paramarray[0][GNB_GNB_DU_ID_IDX].u64ptr; *gnb_du_id = *GNBParamList.paramarray[0][GNB_GNB_DU_ID_IDX].u64ptr;
} else if (separate_iab_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);
*gnb_du_id = *GNBParamList.paramarray[0][GNB_GNB_DU_ID_IDX].u64ptr;
*bap_address = *GNBParamList.paramarray[0][GNB_BAP_ADDRESS_IDX].u16ptr;
} else { } else {
AssertFatal(!config_isparamset(GNBParamList.paramarray[0], GNB_GNB_DU_ID_IDX), AssertFatal(!config_isparamset(GNBParamList.paramarray[0], GNB_GNB_DU_ID_IDX),
"%s should not be defined in configuration file for monolithic gNB\n", "%s should not be defined in configuration file for monolithic gNB\n",
...@@ -1103,8 +1118,10 @@ static int read_du_cell_info(configmodule_interface_t *cfg, ...@@ -1103,8 +1118,10 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
return 1; return 1;
} }
static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id, static f1ap_setup_req_t *RC_read_F1Setup(bool is_iab_du,
uint64_t id,
const char *name, const char *name,
uint16_t bap_address,
const f1ap_served_cell_info_t *info, const f1ap_served_cell_info_t *info,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
NR_BCCH_BCH_Message_t *mib, NR_BCCH_BCH_Message_t *mib,
...@@ -1114,9 +1131,26 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id, ...@@ -1114,9 +1131,26 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
AssertFatal(req != NULL, "out of memory\n"); AssertFatal(req != NULL, "out of memory\n");
req->gNB_DU_id = id; req->gNB_DU_id = id;
req->gNB_DU_name = strdup(name); req->gNB_DU_name = strdup(name);
if(is_iab_du){
req->bap_address = bap_address;
}
req->num_cells_available = 1; req->num_cells_available = 1;
req->cell[0].info = *info; req->cell[0].info = *info;
LOG_I(GNB_APP,
if (is_iab_du){
LOG_I(GNB_APP,
"F1AP: gNB idx %d gNB_DU_id %ld, gNB_DU_name %s, bap_address %d, TAC %d MCC/MNC/length %d/%d/%d cellID %ld\n",
0,
req->gNB_DU_id,
req->gNB_DU_name,
req->bap_address,
*req->cell[0].info.tac,
req->cell[0].info.plmn.mcc,
req->cell[0].info.plmn.mnc,
req->cell[0].info.plmn.mnc_digit_length,
req->cell[0].info.nr_cellid);
}else{
LOG_I(GNB_APP,
"F1AP: gNB idx %d gNB_DU_id %ld, gNB_DU_name %s, TAC %d MCC/MNC/length %d/%d/%d cellID %ld\n", "F1AP: gNB idx %d gNB_DU_id %ld, gNB_DU_name %s, TAC %d MCC/MNC/length %d/%d/%d cellID %ld\n",
0, 0,
req->gNB_DU_id, req->gNB_DU_id,
...@@ -1126,6 +1160,7 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id, ...@@ -1126,6 +1160,7 @@ static f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
req->cell[0].info.plmn.mnc, req->cell[0].info.plmn.mnc,
req->cell[0].info.plmn.mnc_digit_length, req->cell[0].info.plmn.mnc_digit_length,
req->cell[0].info.nr_cellid); req->cell[0].info.nr_cellid);
}
req->cell[0].info.nr_pci = *scc->physCellId; req->cell[0].info.nr_pci = *scc->physCellId;
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL; struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
...@@ -1327,8 +1362,9 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) ...@@ -1327,8 +1362,9 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
uint64_t gnb_du_id = 0; uint64_t gnb_du_id = 0;
uint32_t gnb_id = 0; uint32_t gnb_id = 0;
char *name = NULL; char *name = NULL;
uint16_t bap_address = 0;
f1ap_served_cell_info_t info; f1ap_served_cell_info_t info;
read_du_cell_info(cfg, NODE_IS_DU(node_type), &gnb_id, &gnb_du_id, &name, &info, 1); read_du_cell_info(cfg, NODE_IS_DU(node_type), NODE_IS_DU_IAB(node_type) , &gnb_id, &gnb_du_id, &name, &bap_address, &info, 1);
if (get_softmodem_params()->sa) if (get_softmodem_params()->sa)
nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac); nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac);
...@@ -1337,7 +1373,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) ...@@ -1337,7 +1373,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg)
// and store it at MAC for sending later // and store it at MAC for sending later
NR_BCCH_BCH_Message_t *mib = RC.nrmac[0]->common_channels[0].mib; NR_BCCH_BCH_Message_t *mib = RC.nrmac[0]->common_channels[0].mib;
const NR_BCCH_DL_SCH_Message_t *sib1 = RC.nrmac[0]->common_channels[0].sib1; const NR_BCCH_DL_SCH_Message_t *sib1 = RC.nrmac[0]->common_channels[0].sib1;
f1ap_setup_req_t *req = RC_read_F1Setup(gnb_du_id, name, &info, scc, mib, sib1); f1ap_setup_req_t *req = RC_read_F1Setup(NODE_IS_DU_IAB(node_type), gnb_du_id, name, bap_address, &info, scc, mib, sib1);
AssertFatal(req != NULL, "could not read F1 Setup information\n"); AssertFatal(req != NULL, "could not read F1 Setup information\n");
RC.nrmac[0]->f1_config.setup_req = req; RC.nrmac[0]->f1_config.setup_req = req;
RC.nrmac[0]->f1_config.gnb_id = gnb_id; RC.nrmac[0]->f1_config.gnb_id = gnb_id;
...@@ -2254,7 +2290,11 @@ ngran_node_t get_node_type(void) ...@@ -2254,7 +2290,11 @@ ngran_node_t get_node_type(void)
RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt; RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt;
for (int j = 0; j < RC.nb_nr_macrlc_inst; j++) { 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) { 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 if (*GNBParamList.paramarray[0][GNB_BAP_ADDRESS_IDX].u16ptr == 0){
return ngran_gNB_DU; // MACRLCs present in config: it must be a DU
}else{
return ngran_gNB_DU_IAB;
}
} }
} }
} }
......
...@@ -103,6 +103,7 @@ typedef enum { ...@@ -103,6 +103,7 @@ typedef enum {
#define GNB_CONFIG_STRING_GNB_ID "gNB_ID" #define GNB_CONFIG_STRING_GNB_ID "gNB_ID"
#define GNB_CONFIG_STRING_CELL_TYPE "cell_type" #define GNB_CONFIG_STRING_CELL_TYPE "cell_type"
#define GNB_CONFIG_STRING_GNB_NAME "gNB_name" #define GNB_CONFIG_STRING_GNB_NAME "gNB_name"
#define GNB_CONFIG_STRING_BAP_ADDRESS "bap_address"
#define GNB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" #define GNB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code"
#define GNB_CONFIG_STRING_MOBILE_COUNTRY_CODE_OLD "mobile_country_code" #define GNB_CONFIG_STRING_MOBILE_COUNTRY_CODE_OLD "mobile_country_code"
#define GNB_CONFIG_STRING_MOBILE_NETWORK_CODE_OLD "mobile_network_code" #define GNB_CONFIG_STRING_MOBILE_NETWORK_CODE_OLD "mobile_network_code"
...@@ -173,6 +174,7 @@ typedef enum { ...@@ -173,6 +174,7 @@ typedef enum {
{GNB_CONFIG_STRING_DRBS, GNB_CONFIG_HLP_STRING_DRBS, 0, .iptr=NULL, .defintval=1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DRBS, GNB_CONFIG_HLP_STRING_DRBS, 0, .iptr=NULL, .defintval=1, TYPE_INT, 0}, \
{GNB_CONFIG_STRING_GNB_DU_ID, GNB_CONFIG_HLP_GNB_DU_ID, 0, .u64ptr=NULL, .defint64val=1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_GNB_DU_ID, GNB_CONFIG_HLP_GNB_DU_ID, 0, .u64ptr=NULL, .defint64val=1, TYPE_UINT64, 0}, \
{GNB_CONFIG_STRING_GNB_CU_UP_ID, GNB_CONFIG_HLP_GNB_CU_UP_ID, 0, .u64ptr=NULL, .defint64val=1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_GNB_CU_UP_ID, GNB_CONFIG_HLP_GNB_CU_UP_ID, 0, .u64ptr=NULL, .defint64val=1, TYPE_UINT64, 0}, \
{GNB_CONFIG_STRING_BAP_ADDRESS, NULL, 0, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
} }
// clang-format on // clang-format on
...@@ -205,8 +207,10 @@ typedef enum { ...@@ -205,8 +207,10 @@ typedef enum {
#define GNB_FORCE256QAMOFF_IDX 25 #define GNB_FORCE256QAMOFF_IDX 25
#define GNB_ENABLE_SDAP_IDX 26 #define GNB_ENABLE_SDAP_IDX 26
#define GNB_DRBS 27 #define GNB_DRBS 27
#define GNB_GNB_DU_ID_IDX 28 #define GNB_GNB_DU_ID_IDX 28
#define GNB_GNB_CU_UP_ID_IDX 29 #define GNB_GNB_CU_UP_ID_IDX 29
// [IAB] bap_address
#define GNB_BAP_ADDRESS_IDX 30
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
#define GNBPARAMS_CHECK { \ #define GNBPARAMS_CHECK { \
......
...@@ -194,6 +194,10 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type) ...@@ -194,6 +194,10 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type)
case ngran_gNB_DU: case ngran_gNB_DU:
mac_rrc_ul_f1ap_init(&mac->mac_rrc); mac_rrc_ul_f1ap_init(&mac->mac_rrc);
break; break;
// [IAB] Temporary solution, maybe?
case ngran_gNB_DU_IAB:
mac_rrc_ul_f1ap_init(&mac->mac_rrc);
break;
case ngran_gNB: case ngran_gNB:
mac_rrc_ul_direct_init(&mac->mac_rrc); mac_rrc_ul_direct_init(&mac->mac_rrc);
break; break;
......
...@@ -472,7 +472,7 @@ rb_found: ...@@ -472,7 +472,7 @@ rb_found:
// return; // return;
// } // }
if (NODE_IS_DU(type)) { if (NODE_IS_DU(type) || NODE_IS_DU_IAB(type)) {
if(is_srb) { if(is_srb) {
MessageDef *msg; MessageDef *msg;
msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE); msg = itti_alloc_new_message(TASK_RLC_ENB, 0, F1AP_UL_RRC_MESSAGE);
......
...@@ -399,6 +399,7 @@ typedef struct gNB_RRC_INST_s { ...@@ -399,6 +399,7 @@ typedef struct gNB_RRC_INST_s {
ngran_node_t node_type; ngran_node_t node_type;
uint32_t node_id; uint32_t node_id;
char *node_name; char *node_name;
uint16_t bap_address;
int module_id; int module_id;
eth_params_t eth_params_s; eth_params_t eth_params_s;
rrc_gNB_carrier_data_t carrier; rrc_gNB_carrier_data_t carrier;
......
...@@ -268,7 +268,7 @@ static int get_ssb_arfcn(const f1ap_served_cell_info_t *cell_info, const NR_MIB_ ...@@ -268,7 +268,7 @@ static int get_ssb_arfcn(const f1ap_served_cell_info_t *cell_info, const NR_MIB_
static void init_NR_SI(gNB_RRC_INST *rrc) static void init_NR_SI(gNB_RRC_INST *rrc)
{ {
if (!NODE_IS_DU(rrc->node_type)) { if (!NODE_IS_DU(rrc->node_type) && !NODE_IS_DU_IAB(rrc->node_type)) {
rrc->carrier.SIB23 = (uint8_t *) malloc16(100); rrc->carrier.SIB23 = (uint8_t *) malloc16(100);
AssertFatal(rrc->carrier.SIB23 != NULL, "cannot allocate memory for SIB"); AssertFatal(rrc->carrier.SIB23 != NULL, "cannot allocate memory for SIB");
rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier); rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier);
...@@ -309,6 +309,8 @@ static void rrc_gNB_CU_DU_init(gNB_RRC_INST *rrc) ...@@ -309,6 +309,8 @@ static void rrc_gNB_CU_DU_init(gNB_RRC_INST *rrc)
* soon as this is not the case anymore, we can add the AssertFatal() */ * soon as this is not the case anymore, we can add the AssertFatal() */
//AssertFatal(1==0,"nothing to do for DU\n"); //AssertFatal(1==0,"nothing to do for DU\n");
break; break;
case ngran_gNB_DU_IAB:
break;
default: default:
AssertFatal(0 == 1, "Unknown node type %d\n", rrc->node_type); AssertFatal(0 == 1, "Unknown node type %d\n", rrc->node_type);
break; break;
...@@ -622,6 +624,7 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co ...@@ -622,6 +624,7 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co
LOG_I(NR_RRC, "UE %d: Generate RRCReconfiguration (bytes %d, xid %d)\n", ue_p->rrc_ue_id, size, xid); LOG_I(NR_RRC, "UE %d: Generate RRCReconfiguration (bytes %d, xid %d)\n", ue_p->rrc_ue_id, size, xid);
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n"); AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
AssertFatal(!NODE_IS_DU_IAB(rrc->node_type), "illegal node type DU!\n");
nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size); nr_rrc_transfer_protected_rrc_message(rrc, ue_p, DCCH, buffer, size);
} }
...@@ -2490,6 +2493,7 @@ void *rrc_gnb_task(void *args_p) { ...@@ -2490,6 +2493,7 @@ void *rrc_gnb_task(void *args_p) {
/* Messages from F1AP task */ /* Messages from F1AP task */
case F1AP_SETUP_REQ: case F1AP_SETUP_REQ:
AssertFatal(!NODE_IS_DU(RC.nrrrc[instance]->node_type), "should not receive F1AP_SETUP_REQUEST in DU!\n"); AssertFatal(!NODE_IS_DU(RC.nrrrc[instance]->node_type), "should not receive F1AP_SETUP_REQUEST in DU!\n");
AssertFatal(!NODE_IS_DU_IAB(RC.nrrrc[instance]->node_type), "should not receive F1AP_SETUP_REQUEST in DU-IAB!\n");
rrc_gNB_process_f1_setup_req(&F1AP_SETUP_REQ(msg_p), msg_p->ittiMsgHeader.originInstance); rrc_gNB_process_f1_setup_req(&F1AP_SETUP_REQ(msg_p), msg_p->ittiMsgHeader.originInstance);
break; break;
...@@ -2620,6 +2624,7 @@ rrc_gNB_generate_SecurityModeCommand( ...@@ -2620,6 +2624,7 @@ rrc_gNB_generate_SecurityModeCommand(
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n"); AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
AssertFatal(!NODE_IS_DU_IAB(rrc->node_type), "illegal node type DU-IAB!\n");
cu_to_du_rrc_information_t cu2du = {0}; cu_to_du_rrc_information_t cu2du = {0};
cu_to_du_rrc_information_t *cu2du_p = NULL; cu_to_du_rrc_information_t *cu2du_p = NULL;
...@@ -2679,6 +2684,7 @@ rrc_gNB_generate_UECapabilityEnquiry( ...@@ -2679,6 +2684,7 @@ rrc_gNB_generate_UECapabilityEnquiry(
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id]; gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n"); AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
AssertFatal(!NODE_IS_DU_IAB(rrc->node_type), "illegal node type DU_IAB!\n");
nr_rrc_transfer_protected_rrc_message(rrc, ue, DCCH, buffer, size); nr_rrc_transfer_protected_rrc_message(rrc, ue, DCCH, buffer, size);
} }
......
...@@ -702,6 +702,7 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu ...@@ -702,6 +702,7 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu
* switch UL or DL NAS message without RRC piggybacked to SRB2 if active. * switch UL or DL NAS message without RRC piggybacked to SRB2 if active.
*/ */
AssertFatal(!NODE_IS_DU(RC.nrrrc[ctxt.module_id]->node_type), "illegal node type DU: receiving NGAP messages at this node\n"); AssertFatal(!NODE_IS_DU(RC.nrrrc[ctxt.module_id]->node_type), "illegal node type DU: receiving NGAP messages at this node\n");
AssertFatal(!NODE_IS_DU_IAB(RC.nrrrc[ctxt.module_id]->node_type), "illegal node type DU: receiving NGAP messages at this node\n");
/* Transfer data to PDCP */ /* Transfer data to PDCP */
rb_id_t srb_id = UE->Srb[2].Active ? DCCH1 : DCCH; rb_id_t srb_id = UE->Srb[2].Active ? DCCH1 : DCCH;
nr_rrc_transfer_protected_rrc_message(RC.nrrrc[instance], UE, srb_id, buffer, length); nr_rrc_transfer_protected_rrc_message(RC.nrrrc[instance], UE, srb_id, buffer, length);
......
...@@ -248,6 +248,9 @@ typedef struct ngap_gNB_instance_s { ...@@ -248,6 +248,9 @@ typedef struct ngap_gNB_instance_s {
/* Tracking area code */ /* Tracking area code */
uint32_t tac; uint32_t tac;
/* [IAB] donor-DU bap address */
uint16_t bap_address;
/* gNB NGAP IP address */ /* gNB NGAP IP address */
net_ip_address_t gNB_ng_ip; net_ip_address_t gNB_ng_ip;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment