Commit 1d7925c6 authored by Swetank Srivastava's avatar Swetank Srivastava

Cell Config API Support for 5G SA

parent 5fee4dc4
......@@ -2814,6 +2814,7 @@ target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (nr-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-softmodem ${T_LIB})
target_link_libraries (nr-softmodem UDP)
add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
......
......@@ -83,6 +83,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "ss_gNB_sys_task.h"
#include "ss_gNB_port_man_task.h"
#include "ss_gNB_srb_task.h"
#include "udp_eNB_task.h"
pthread_cond_t nfapi_sync_cond;
pthread_mutex_t nfapi_sync_mutex;
......@@ -170,7 +171,7 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
extern void *udp_eNB_task(void *args_p);
//extern void *udp_eNB_task(void *args_p);
int transmission_mode=1;
int emulate_rf = 0;
......@@ -350,6 +351,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
if (gnb_nb > 0) {
RCconfig_nr_ssparam();
if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
return -1;
......@@ -370,11 +372,11 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
if(itti_create_task(TASK_SS_SRB, ss_gNB_srb_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SS SRB failed\n");
return -1;
}
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
if(itti_create_task(TASK_SS_SRB, ss_gNB_srb_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SS SRB failed\n");
return -1;
}
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
......@@ -388,6 +390,13 @@ int create_gNB_tasks(uint32_t gnb_nb) {
return -1;
}
}
if (itti_create_task(TASK_UDP, udp_eNB_task, NULL) < 0)
{
LOG_E(GTPU, "Create task for UDP failed\n");
return -1;
}
}
return 0;
......
This diff is collapsed.
......@@ -244,6 +244,7 @@ typedef enum {
#define GNB_CONFIG_SS_SRBPORT_IDX 2
#define GNB_CONFIG_SS_VNGPORT_IDX 3
#define GNB_CONFIG_SS_MODE_IDX 4
//#define GNB_CONFIG_SS_NR_MODE_IDX 5
#define GNB_SSPARAMS_DESC { \
{GNB_CONFIG_SS_HOSTIP , NULL, 0, uptr:NULL, defstrval:"0.0.0.0", TYPE_STRING, 0}, \
......
......@@ -415,9 +415,21 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
scs_scaling = scs_scaling0>>2;
scs_scaling2 = scs_scaling0>>2;
}
uint32_t absolute_diff = (*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB -
NR_ARFCN_ValueNR_t absoluteFrequencySSB = 0;
uint32_t absolute_diff = 0;
if (RC.ss.mode == SS_SOFTMODEM)
{
LOG_A(NR_RRC, "fxn:%s absoluteFrequencySSB:%d ", __FUNCTION__, absoluteFrequencySSB);
absoluteFrequencySSB = *RC.nrrrc[0]->configuration.scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB;
absolute_diff = absoluteFrequencySSB - configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
}
else
{
absolute_diff = (*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB -
configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
}
/*TODO: */
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = scs_scaling2 * (absolute_diff/(12*scs_scaling) - 10);
LOG_I(NR_RRC,"SIB1 freq: absoluteFrequencySSB %ld, absoluteFrequencyPointA %ld\n",
......
......@@ -224,6 +224,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
rrc->carrier.sib1_tda = configuration->sib1_tda;
rrc->carrier.do_CSIRS = configuration->do_CSIRS;
rrc->carrier.do_SRS = configuration->do_SRS;
LOG_A(NR_RRC, "fxn:%s rrc->carrier:pci:%d rrc->configuration:pci:%d gnb_mod_idP:%d", __FUNCTION__, rrc->carrier.physCellId, *rrc->configuration.scc->physCellId, gnb_mod_idP);
nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME);
/// System Information INIT
pthread_mutex_init(&rrc->cell_info_mutex,NULL);
......
......@@ -194,7 +194,7 @@ static int sys_send_udp_msg(
if (message_p)
{
LOG_A(ENB_SS, "Sending UDP_DATA_REQ length %u offset %u buffer %d %d %d \n", buffer_len, buffer_offset, buffer[0], buffer[1], buffer[2]);
LOG_A(ENB_SS, "Sending UDP_DATA_REQ length %u offset %u buffer %d %d %d to address peerIpAddr:%s and peer port:peerPort\n", buffer_len, buffer_offset, buffer[0], buffer[1], buffer[2], peerIpAddr, peerPort);
udp_data_req_p = &message_p->ittiMsg.udp_data_req;
udp_data_req_p->peer_address = peerIpAddr;
udp_data_req_p->peer_port = peerPort;
......
......@@ -77,7 +77,12 @@ void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
case NR_SystemConfirm_Type_Cell:
cnf.Confirm.v.Cell = true;
break;
case NR_SystemConfirm_Type_RadioBearerList:
cnf.Confirm.v.RadioBearerList= true;
break;
case NR_SystemConfirm_Type_CellAttenuationList:
cnf.Confirm.v.CellAttenuationList= true;
break;
default:
LOG_A(GNB_APP, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN] %d \n", recvCnf.Confirm.d);
}
......@@ -232,14 +237,17 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
// Error handling
if (userId < 0)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s userId:%d\n", __FUNCTION__, userId);
if (userId == -ACP_ERR_SERVICE_NOT_MAPPED)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s userId:-ACP_ERR_SERVICE_NOT_MAPPED \n", __FUNCTION__);
// Message not mapped to user id,
// this error should not appear on server side for the messages
// received from clients
}
else if (userId == -ACP_ERR_SIDL_FAILURE)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s userId:-ACP_ERR_SIDL_FAILURE\n", __FUNCTION__);
// Server returned service error,
// this error should not appear on server side for the messages
// received from clients
......@@ -248,29 +256,36 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
}
else
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s line:%d\n", __FUNCTION__, __LINE__);
return;
}
}
else if (userId == 0)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s userId:0\n", __FUNCTION__);
// No message (timeout on socket)
}
else
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] received msg %d from the client.\n", userId);
if (acpNrSysProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s line:%d\n", __FUNCTION__, __LINE__);
return;
}
ss_dumpReqMsg(req);
if (userId == MSG_NrSysProcess_userId)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s userId: MSG_NrSysProcess_userId\n", __FUNCTION__);
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN_GNB, INSTANCE_DEFAULT, SS_NR_SYS_PORT_MSG_IND);
if (message_p)
{
SS_NR_SYS_PORT_MSG_IND(message_p).req = req;
SS_NR_SYS_PORT_MSG_IND(message_p).userId = userId;
itti_send_msg_to_task(TASK_SYS_GNB, INSTANCE_DEFAULT, message_p);
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s line:%d Msg sent to \n", __FUNCTION__, __LINE__, TASK_SYS_GNB);
}
}
}
......@@ -281,13 +296,13 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
//------------------------------------------------------------------------------
void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
{
MessageDef *received_msg = NULL;
int result;
MessageDef *received_msg = NULL;
int result;
itti_poll_msg(TASK_SS_PORTMAN_GNB, &received_msg);
itti_poll_msg(TASK_SS_PORTMAN_GNB, &received_msg);
/* Check if there is a packet to handle */
if (received_msg != NULL)
/* Check if there is a packet to handle */
if (received_msg != NULL)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received a message id : %d \n",
......@@ -309,7 +324,10 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
}
break;
case TERMINATE_MESSAGE:
itti_exit_task();
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received TERMINATE_MESSAGE\n");
itti_exit_task();
}
break;
default:
......@@ -323,9 +341,9 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
received_msg = NULL;
}
ss_gNB_read_from_socket(nrctx_g);
ss_gNB_read_from_socket(nrctx_g);
return NULL;
return NULL;
}
//------------------------------------------------------------------------------
......
......@@ -361,9 +361,11 @@ void ss_gNB_srb_init(void)
buffer = (unsigned char *)acpMalloc(size);
assert(buffer);
RC.ss.State = SS_STATE_CELL_ACTIVE;
if (RC.ss.mode == SS_SOFTMODEM_SRB)
{
RC.ss.State = SS_STATE_CELL_ACTIVE;
}
itti_subscribe_event_fd(TASK_SS_SRB, fd1);
itti_mark_task_ready(TASK_SS_SRB);
}
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include "ss_eNB_proxy_iface.h"
#ifndef SS_GNB_TASK_H_
#define SS_GNB_TASK_H_
......@@ -23,4 +24,19 @@ typedef struct udpSockReq_s
char *address;
} udpSockReq_t;
typedef struct CellConfig5GReq_s
{
proxy_ss_header_t header;
int16_t maxRefPower;
uint8_t initialAttenuation;
long absoluteFrequencySSB;
} CellConfig5GReq_t;
typedef enum _sys_Type
{
SYS_TYPE_LTE,
SYS_TYPE_NR,
SYS_TYPE_ENDC
}sys_Type;
#endif /* SS_ENB_TASK_H_ */
......@@ -308,8 +308,10 @@ void *udp_eNB_task(void *args_p)
itti_mark_task_ready(TASK_UDP);
MSC_START_USE();
LOG_I(UDP_, " Entry in %s\n", __FUNCTION__);
while(1) {
LOG_I(UDP_, " Fxn:%s line:%d\n", __FUNCTION__, __LINE__);
itti_receive_msg(TASK_UDP, &received_message_p);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UDP_ENB_TASK, VCD_FUNCTION_IN);
#if defined(LOG_UDP) && LOG_UDP > 0
......@@ -343,7 +345,7 @@ void *udp_eNB_task(void *args_p)
struct udp_socket_desc_s *udp_sock_p = NULL;
udp_data_req_t *udp_data_req_p;
struct sockaddr_in peer_addr;
char buffer[INET_ADDRSTRLEN];
udp_data_req_p = &received_message_p->ittiMsg.udp_data_req;
memset(&peer_addr, 0, sizeof(struct sockaddr_in));
......@@ -351,6 +353,7 @@ void *udp_eNB_task(void *args_p)
peer_addr.sin_family = AF_INET;
peer_addr.sin_port = htons(udp_data_req_p->peer_port);
peer_addr.sin_addr.s_addr = udp_data_req_p->peer_address;
inet_ntop( AF_INET, &peer_addr.sin_addr, buffer, sizeof( buffer ));
pthread_mutex_lock(&udp_socket_list_mutex);
udp_sock_p = udp_eNB_get_socket_desc(ITTI_MSG_ORIGIN_ID(received_message_p));
......
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