Commit 74dcd3c9 authored by root's avatar root

changes-4 may3

parent dfde5dc3
......@@ -118,7 +118,7 @@ static void cu_task_send_sctp_init_req(instance_t instance, char *my_addr) {
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void cu_register_xn(uint32_t gnb_id_num,f1ap_served_cell_info_t *cell)
void cu_register_xn(uint32_t gnb_id_num,f1ap_served_cell_info_t *cell , xnap_net_config_t nc)
{
MessageDef *msg;
......@@ -126,37 +126,37 @@ void cu_register_xn(uint32_t gnb_id_num,f1ap_served_cell_info_t *cell)
msg = itti_alloc_new_message(TASK_CU_F1, 0, XNAP_REGISTER_GNB_REQ);
LOG_I(XNAP, "GNB_ID: %d \n", gnb_id);
uint64_t id;
char *name = NULL;
xnap_register_gnb_req_t *req = &XNAP_REGISTER_GNB_REQ(msg);
req->setup_req.info.tac = cell->tac;
req->setup_req.info.plmn = cell->plmn;
req->setup_req.info.plmn.mcc = cell->plmn.mcc;
req->setup_req.info.plmn.mnc = cell->plmn.mnc;
req->setup_req.info.plmn.mnc_digit_length = cell->plmn.mnc_digit_length;
req->setup_req.info.nr_cellid = cell->nr_cellid;
req->setup_req.info.nr_pci = cell->nr_pci;
if (cell->mode == F1AP_MODE_TDD) {
req->setup_req.info.mode = XNAP_MODE_TDD;
req->setup_req.info.tdd = cell->tdd;
/*tdd->freqinfo.arfcn = frequencyInfoDL->absoluteFrequencyPointA;
tdd->tbw.scs = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
tdd->tbw.nrb = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
tdd->freqinfo.band = *frequencyInfoDL->frequencyBandList.list.array[0];*/
req->setup_req.info.tdd.freqinfo.arfcn = cell->tdd.freqinfo.arfcn;
req->setup_req.info.tdd.tbw.scs = cell->tdd.tbw.scs;
req->setup_req.info.tdd.tbw.nrb = cell->tdd.tbw.nrb;
req->setup_req.info.tdd.freqinfo.band = cell->tdd.freqinfo.band;
} else {
req->setup_req.info.mode = XNAP_MODE_FDD;
req->setup_req.info.fdd = cell->fdd;
/*fdd->dl_freqinfo.arfcn = frequencyInfoDL->absoluteFrequencyPointA;
fdd->ul_freqinfo.arfcn = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
fdd->dl_tbw.scs = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
fdd->ul_tbw.scs = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
fdd->dl_tbw.nrb = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
fdd->ul_tbw.nrb = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
fdd->dl_freqinfo.band = *frequencyInfoDL->frequencyBandList.list.array[0];
fdd->ul_freqinfo.band = *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0];*/
req->setup_req.info.fdd.dl_freqinfo.arfcn = cell->fdd.dl_freqinfo.arfcn;
req->setup_req.info.fdd.ul_freqinfo.arfcn = cell->fdd.ul_freqinfo.arfcn;
req->setup_req.info.fdd.dl_tbw.scs = cell->fdd.ul_tbw.scs;
req->setup_req.info.fdd.ul_tbw.scs = cell->fdd.ul_tbw.scs;
req->setup_req.info.fdd.dl_tbw.nrb = cell->fdd.dl_tbw.nrb;
req->setup_req.info.fdd.ul_tbw.nrb = cell->fdd.ul_tbw.nrb;
req->setup_req.info.fdd.dl_freqinfo.band = cell->fdd.dl_freqinfo.band;
req->setup_req.info.fdd.ul_freqinfo.band = cell->fdd.ul_freqinfo.band;
}
req->setup_req.info.measurement_timing_information = cell->measurement_timing_information;
gNB_RRC_INST *rrc = RC.nrrrc[0];
req->setup_req.gNB_id = rrc->node_id;
req->setup_req.tai_support = cell->tac;
req->setup_req.plmn_support = cell->plmn;
req->setup_req.plmn_support.mcc = cell->plmn.mcc;
req->setup_req.plmn_support.mnc = cell->plmn.mnc;
req->setup_req.plmn_support.mnc_digit_length = cell->plmn.mnc_digit_length;
req->net_config = nc;
req->gNB_name = rrc->node_name;
......
......@@ -22,6 +22,7 @@
#ifndef F1AP_CU_TASK_H_
#define F1AP_CU_TASK_H_
void cu_register_xn(uint32_t gnb_id_num,f1ap_served_cell_info_t *cell , xnap_net_config_t nc);
void *F1AP_CU_task(void *arg);
#endif /* F1AP_CU_TASK_H_ */
......@@ -53,6 +53,7 @@
#include "openair2/E1AP/e1ap.h"
#include "gnb_config.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/XNAP/xnap_gNB_task.h"
extern unsigned char NB_gNB_INST;
......@@ -155,7 +156,7 @@ void *gNB_app_task(void *args_p)
}
if (is_xnap_enabled()) {
if (itti_create_task(TASK_CU_XNAP, xnap_task, NULL) < 0) {
if (itti_create_task(TASK_XNAP, xnap_task, NULL) < 0) {
LOG_E(XNAP, "Create task for XNAP failed\n");
}
} else {
......
......@@ -131,6 +131,7 @@ typedef enum {
#define GNB_CONFIG_STRING_GNB_DU_ID "gNB_DU_ID"
#define GNB_CONFIG_STRING_GNB_CU_UP_ID "gNB_CU_UP_ID"
#define GNB_CONFIG_STRING_XN "enable_xn"
#define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n"
#define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support"
#define GNB_CONFIG_HLP_STRING_DRBS "Number of total DRBs to establish, including the mandatory for PDU SEssion (default=1)\n"
......@@ -345,6 +346,8 @@ typedef enum {
#define GNB_PORT_FOR_NGU_IDX 4
#define GNB_IPV4_ADDR_FOR_X2C_IDX 5
#define GNB_PORT_FOR_X2C_IDX 6
#define GNB_IPV4_ADDR_FOR_XNC_IDX 7
#define GNB_PORT_FOR_XNC_IDX 8
/* S1 interface configuration parameters names */
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME "GNB_INTERFACE_NAME_FOR_S1_MME"
......@@ -363,6 +366,10 @@ typedef enum {
#define GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C "GNB_IPV4_ADDRESS_FOR_X2C"
#define GNB_CONFIG_STRING_ENB_PORT_FOR_X2C "GNB_PORT_FOR_X2C"
/* Xn interface configuration parameters names */
#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_XNC "GNB_IPV4_ADDRESS_FOR_XNC"
#define GNB_CONFIG_STRING_GNB_PORT_FOR_XNC "GNB_PORT_FOR_XNC"
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
/* S1 interface configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
......@@ -375,6 +382,8 @@ typedef enum {
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, .uptr=&gnb_port_for_NGU, .defintval=2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, .uptr=NULL, .defintval=0L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_XNC, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_XNC, NULL, 0, .uptr=NULL, .defintval=0L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1U, NULL, 0, .strptr=&gnb_ipv4_address_for_S1U, .defstrval="127.0.0.1",TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, .uptr=&gnb_port_for_S1U, .defintval=2152L, TYPE_UINT, 0} \
......@@ -382,6 +391,29 @@ typedef enum {
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Xn configuration parameters section name */
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS "target_gnb_xn_ip_address"
/* Xn configuration parameters names */
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV4_ADDRESS "ipv4"
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV6_ADDRESS "ipv6"
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS_PREFERENCE "preference"
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* Xn configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define XnPARAMS_DESC { \
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV4_ADDRESS, NULL, 0, .uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV6_ADDRESS, NULL, 0, .uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS_PREFERENCE, NULL, 0, .uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
}
#define GNB_Xn_IPV4_ADDRESS_IDX 0
#define GNB_Xn_IPV6_ADDRESS_IDX 1
#define GNB_Xn_IP_ADDRESS_PREFERENCE_IDX 2
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* E1 configuration section */
#define GNB_CONFIG_STRING_E1_PARAMETERS "E1_INTERFACE"
......
......@@ -26,7 +26,8 @@
#include "openair2/F1AP/f1ap_common.h"
#include "openair2/F1AP/f1ap_ids.h"
#include "executables/softmodem-common.h"
#include "openair2/XNAP/xnap_gNB_defs.h"
#include "openair2/XNAP/xnap_gNB_management_procedures.h"
static int du_compare(const nr_rrc_du_container_t *a, const nr_rrc_du_container_t *b)
{
......@@ -177,11 +178,13 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
AssertFatal(num == 3, "could not read RRC version string %s\n", TO_STRING(NR_RRC_VERSION));
if (rrc->node_name != NULL)
resp.gNB_CU_name = strdup(rrc->node_name);
xnap_gNB_instance_t *instance_xn = xnap_gNB_get_instance(instance);
xnap_gNB_instance_t *instance_xn = xnap_gNB_get_instance(0);
if (instance_xn != NULL) {
LOG_D(NR_RRC, "XNAP is enabled, Triggering SCTP Association \n");
if (instance_xn.setup_req ==NULL) {
CU_register_xn(cell_info,instance_xn->nc);
if (instance_xn->setup_req.gNB_id == 0) {
cu_register_xn(1, cell_info,instance_xn->net_config);
}
}
rrc->mac_rrc.f1_setup_response(assoc_id, &resp);
......
add_subdirectory(MESSAGES)
add_library(xnap xnap_common.c)
add_library(xnap
xnap_common.c
xnap_gNB_generate_messages.c
xnap_gNB_management_procedures.c
xnap_gNB_task.c
xnap_gNB_itti_messaging.c)
target_link_libraries(xnap
PUBLIC asn1_xnap
PRIVATE nr_rrc)
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "intertask_interface.h"
#include "xnap_gNB_itti_messaging.h"
void xnap_gNB_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
instance_t instance = 0; // we have only one instance
message_p = itti_alloc_new_message(TASK_XNAP, 0, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_gNB_itti_messaging.h
* \brief xnap itti messaging for gNB
* \date 2023 July
* \version 1.0
*/
#ifndef XNAP_GNB_ITTI_MESSAGING_H_
#define XNAP_GNB_ITTI_MESSAGING_H_
void xnap_gNB_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length, uint16_t stream);
#endif /* XNAP_GNB_ITTI_MESSAGING_H_ */
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