Commit 2afbdc6c authored by Manu Agrawal's avatar Manu Agrawal

Changes Part1

parent 6ac0e403
...@@ -327,9 +327,9 @@ void *rrc_enb_process_msg(void *); ...@@ -327,9 +327,9 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_PORTMAN, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SS_PORTMAN, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_PORTMAN_5G_NR, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SS_PORTMAN_GNB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SYS, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SYS, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SYS_5G_NR, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SYS_GNB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SYSIND, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SS_SYSIND, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SRB, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SS_SRB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_SS_SRB_ACP, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_SS_SRB_ACP, TASK_PRIORITY_MED, 200, NULL, NULL) \
......
...@@ -247,13 +247,13 @@ void rx_func(void *param) { ...@@ -247,13 +247,13 @@ void rx_func(void *param) {
if (RC.ss.mode >= SS_SOFTMODEM) if (RC.ss.mode >= SS_SOFTMODEM)
{ {
MessageDef *message_p = itti_alloc_new_message(TASK_SYS_5G_NR, INSTANCE_DEFAULT, SS_NRUPD_TIM_INFO); MessageDef *message_p = itti_alloc_new_message(TASK_SYS_GNB, INSTANCE_DEFAULT, SS_NRUPD_TIM_INFO);
if (message_p) if (message_p)
{ {
SS_NRUPD_TIM_INFO(message_p).slot = gNB->UL_INFO.slot; SS_NRUPD_TIM_INFO(message_p).slot = gNB->UL_INFO.slot;
SS_NRUPD_TIM_INFO(message_p).sfn = gNB->UL_INFO.frame; SS_NRUPD_TIM_INFO(message_p).sfn = gNB->UL_INFO.frame;
int send_res = itti_send_msg_to_task(TASK_SYS_5G_NR, INSTANCE_DEFAULT, message_p); int send_res = itti_send_msg_to_task(TASK_SYS_GNB, INSTANCE_DEFAULT, message_p);
if (send_res < 0) if (send_res < 0)
{ {
printf("Error in itti_send_msg_to_task"); printf("Error in itti_send_msg_to_task");
......
...@@ -80,6 +80,8 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -80,6 +80,8 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "gnb_paramdef.h" #include "gnb_paramdef.h"
#include <openair3/ocp-gtpu/gtp_itf.h> #include <openair3/ocp-gtpu/gtp_itf.h>
#include "nfapi/oai_integration/vendor_ext.h" #include "nfapi/oai_integration/vendor_ext.h"
#include "ss_gNB_sys_task.h"
#include "ss_gNB_port_man_task.h"
#include "ss_gNB_srb_task.h" #include "ss_gNB_srb_task.h"
pthread_cond_t nfapi_sync_cond; pthread_cond_t nfapi_sync_cond;
...@@ -352,12 +354,26 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -352,12 +354,26 @@ int create_gNB_tasks(uint32_t gnb_nb) {
LOG_E(GNB_APP, "Create task for gNB APP failed\n"); LOG_E(GNB_APP, "Create task for gNB APP failed\n");
return -1; return -1;
} }
if (RC.ss.mode >= SS_SOFTMODEM)
{
if(itti_create_task(TASK_SS_PORTMAN_GNB, ss_gNB_port_man_task, NULL) < 0)
{
LOG_E(GNB_APP, "Create task for SS Port manager GNB failed\n");
return -1;
}
/* This sleep is for gNB_app_task to load the RRC configuration */
usleep(1000);
if(itti_create_task(TASK_SYS_GNB, ss_gNB_sys_task, NULL) < 0)
{
LOG_E(GNB_APP, "Create task for SS GNB failed\n");
return -1;
}
}
if(itti_create_task(TASK_SS_SRB, ss_gNB_srb_task, NULL) < 0) { if(itti_create_task(TASK_SS_SRB, ss_gNB_srb_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SS SRB failed\n"); LOG_E(SCTP, "Create task for SS SRB failed\n");
return -1; return -1;
} }
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n"); LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) { if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
......
...@@ -732,6 +732,7 @@ void RCconfig_nr_ssparam(void) { ...@@ -732,6 +732,7 @@ void RCconfig_nr_ssparam(void) {
RC.ss.Srbport = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_SRBPORT_IDX].iptr); RC.ss.Srbport = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_SRBPORT_IDX].iptr);
RC.ss.Vngport = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_VNGPORT_IDX].iptr); RC.ss.Vngport = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_VNGPORT_IDX].iptr);
RC.ss.mode = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_MODE_IDX].iptr); RC.ss.mode = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_MODE_IDX].iptr);
RC.ss.SysportNR = *(SSConfig_ParamList.paramarray[0][GNB_CONFIG_SS_SYSPORT_IDX].iptr);
} }
LOG_A(GNB_APP,"SS_Config:SSMode %d, hostIp=%s, Sysport=%d, Srbport=%d Vngport=%d\n", LOG_A(GNB_APP,"SS_Config:SSMode %d, hostIp=%s, Sysport=%d, Srbport=%d Vngport=%d\n",
RC.ss.mode, RC.ss.hostIp,RC.ss.Sysport,RC.ss.Srbport,RC.ss.Vngport); RC.ss.mode, RC.ss.hostIp,RC.ss.Sysport,RC.ss.Srbport,RC.ss.Vngport);
......
...@@ -37,7 +37,7 @@ acpCtx_t nrctx_g = NULL; ...@@ -37,7 +37,7 @@ acpCtx_t nrctx_g = NULL;
enum MsgUserId enum MsgUserId
{ {
MSG_SysProcess_userId = 1, MSG_NrSysProcess_userId = 1,
}; };
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
static void ss_dumpReqMsg(struct SYSTEM_CTRL_REQ *msg) static void ss_dumpReqMsg(struct SYSTEM_CTRL_REQ *msg)
...@@ -235,7 +235,7 @@ void ss_gNB_port_man_init(void) ...@@ -235,7 +235,7 @@ void ss_gNB_port_man_init(void)
/* TODO: Check for acpMsgTable 5G NR*/ /* TODO: Check for acpMsgTable 5G NR*/
const struct acpMsgTable msgTable[] = { const struct acpMsgTable msgTable[] = {
{"SysProcess5GNR", MSG_SysProcess_userId}, {"NrSysProcess", MSG_NrSysProcess_userId},
// The last element should be NULL // The last element should be NULL
{NULL, 0}}; {NULL, 0}};
...@@ -255,7 +255,7 @@ void ss_gNB_port_man_init(void) ...@@ -255,7 +255,7 @@ void ss_gNB_port_man_init(void)
//itti_subscribe_event_fd(TASK_SS_PORTMAN, fd1); //itti_subscribe_event_fd(TASK_SS_PORTMAN, fd1);
itti_mark_task_ready(TASK_SS_PORTMAN_5G_NR); itti_mark_task_ready(TASK_SS_PORTMAN_GNB);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -326,7 +326,7 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx) ...@@ -326,7 +326,7 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
ss_dumpReqMsg(req); ss_dumpReqMsg(req);
if (userId == MSG_SysProcess_userId) if (userId == MSG_NrSysProcess_userId)
{ {
#if 0 #if 0
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN_5G_NR, INSTANCE_DEFAULT, SS_SYS_PORT_MSG_IND); MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN_5G_NR, INSTANCE_DEFAULT, SS_SYS_PORT_MSG_IND);
...@@ -349,7 +349,7 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed) ...@@ -349,7 +349,7 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result; int result;
itti_poll_msg(TASK_SS_PORTMAN_5G_NR, &received_msg); itti_poll_msg(TASK_SS_PORTMAN_GNB, &received_msg);
/* Check if there is a packet to handle */ /* Check if there is a packet to handle */
if (received_msg != NULL) if (received_msg != NULL)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "common/ran_context.h" #include "common/ran_context.h"
#include "acpSys.h" #include "acpSys.h"
#include "acpNrSys.h"
#include "ss_gNB_sys_task.h" #include "ss_gNB_sys_task.h"
#include "ss_gNB_context.h" #include "ss_gNB_context.h"
...@@ -139,7 +140,7 @@ static void bitStrint_to_byteArray(unsigned char arr[], int bit_length, unsigned ...@@ -139,7 +140,7 @@ static void bitStrint_to_byteArray(unsigned char arr[], int bit_length, unsigned
*/ */
int cell_config_5g_done_indication() int cell_config_5g_done_indication()
{ {
#if 0
if (cell_config_5g_done < 0) if (cell_config_5g_done < 0)
{ {
printf("[SYS] Signal to OAI main code about cell config\n"); printf("[SYS] Signal to OAI main code about cell config\n");
...@@ -148,7 +149,7 @@ int cell_config_5g_done_indication() ...@@ -148,7 +149,7 @@ int cell_config_5g_done_indication()
pthread_cond_broadcast(&cell_config_5g_done_cond); pthread_cond_broadcast(&cell_config_5g_done_cond);
pthread_mutex_unlock(&cell_config_5g_done_mutex); pthread_mutex_unlock(&cell_config_5g_done_mutex);
} }
#endif
return 0; return 0;
} }
...@@ -524,7 +525,7 @@ int sys_handle_nr_cell_config_req(struct CellConfigRequest_Type *Cell) ...@@ -524,7 +525,7 @@ int sys_handle_nr_cell_config_req(struct CellConfigRequest_Type *Cell)
switch (Cell->d) switch (Cell->d)
{ {
case CellConfigRequest_Type_AddOrReconfigure: case CellConfigRequest_Type_AddOrReconfigure:
#if 0
LOG_A(NR_RRC, "TASK_SYS_5G_NR: CellConfigRequest_Type_AddOrReconfigure received\n"); LOG_A(NR_RRC, "TASK_SYS_5G_NR: CellConfigRequest_Type_AddOrReconfigure received\n");
status = sys_add_nr_reconfig_cell(&(Cell->v.AddOrReconfigure)); status = sys_add_nr_reconfig_cell(&(Cell->v.AddOrReconfigure));
if (status) if (status)
...@@ -538,7 +539,7 @@ int sys_handle_nr_cell_config_req(struct CellConfigRequest_Type *Cell) ...@@ -538,7 +539,7 @@ int sys_handle_nr_cell_config_req(struct CellConfigRequest_Type *Cell)
{ {
returnState = SS_STATE_CELL_CONFIGURED; returnState = SS_STATE_CELL_CONFIGURED;
} }
#endif
break; break;
default: default:
...@@ -1204,7 +1205,7 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s ...@@ -1204,7 +1205,7 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s
*/ */
static void sys_handle_nr_enquire_timing(ss_nrset_timinfo_t *tinfo) static void sys_handle_nr_enquire_timing(ss_nrset_timinfo_t *tinfo)
{ {
MessageDef *message_p = itti_alloc_new_message(TASK_SYS_5G_NR, INSTANCE_DEFAULT, SS_NRSET_TIM_INFO); MessageDef *message_p = itti_alloc_new_message(TASK_SYS_GNB, INSTANCE_DEFAULT, SS_NRSET_TIM_INFO);
if (message_p) if (message_p)
{ {
LOG_A(RRC, "[SYS] Reporting info sfn:%d\t sf:%d.\n", tinfo->sfn, tinfo->slot); LOG_A(RRC, "[SYS] Reporting info sfn:%d\t sf:%d.\n", tinfo->sfn, tinfo->slot);
...@@ -1419,7 +1420,7 @@ static void sys_handle_as_security_req(struct AS_Security_Type *ASSecurity) ...@@ -1419,7 +1420,7 @@ static void sys_handle_as_security_req(struct AS_Security_Type *ASSecurity)
* Returns : Void * Returns : Void
* ========================================================================================================== * ==========================================================================================================
*/ */
static void ss_task_sys_nr_handle_req(struct SYSTEM_CTRL_REQ *req, ss_set_timinfo_t *tinfo) static void ss_task_sys_nr_handle_req(struct NR_SYSTEM_CTRL_REQ *req, ss_nrset_timinfo_t *tinfo)
{ {
int enterState = RC.ss.State; int enterState = RC.ss.State;
int exitState = RC.ss.State; int exitState = RC.ss.State;
...@@ -1489,6 +1490,9 @@ bool valid_nr_sys_msg(struct SYSTEM_CTRL_REQ *req) ...@@ -1489,6 +1490,9 @@ bool valid_nr_sys_msg(struct SYSTEM_CTRL_REQ *req)
cnfType = SystemConfirm_Type_Cell; cnfType = SystemConfirm_Type_Cell;
} }
break; break;
case NR_SystemRequest_Type_EnquireTiming:
valid = TRUE;
break;
default: default:
valid = FALSE; valid = FALSE;
sendDummyCnf = FALSE; sendDummyCnf = FALSE;
...@@ -1496,7 +1500,7 @@ bool valid_nr_sys_msg(struct SYSTEM_CTRL_REQ *req) ...@@ -1496,7 +1500,7 @@ bool valid_nr_sys_msg(struct SYSTEM_CTRL_REQ *req)
if (sendDummyCnf) if (sendDummyCnf)
{ {
send_sys_cnf(resType, resVal, cnfType, NULL); send_sys_cnf(resType, resVal, cnfType, NULL);
LOG_A(NR_RRC, "TASK_SYS_5G_NR: Sending Dummy OK Req %d cnTfype %d ResType %d ResValue %d\n", LOG_A(NR_RRC, "TASK_SYS_GNB: Sending Dummy OK Req %d cnTfype %d ResType %d ResValue %d\n",
req->Request.d, cnfType, resType, resVal); req->Request.d, cnfType, resType, resVal);
} }
return valid; return valid;
...@@ -1523,7 +1527,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed) ...@@ -1523,7 +1527,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
//SS_context.sf = tinfo.sf; //SS_context.sf = tinfo.sf;
/* 5G_cell_config end */ /* 5G_cell_config end */
itti_receive_msg(TASK_SYS_5G_NR, &received_msg); itti_receive_msg(TASK_SYS_GNB, &received_msg);
/* Check if there is a packet to handle */ /* Check if there is a packet to handle */
if (received_msg != NULL) if (received_msg != NULL)
...@@ -1546,7 +1550,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed) ...@@ -1546,7 +1550,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
} }
else else
{ {
LOG_A(NR_RRC, "TASK_SYS_5G_NR: Not handled SYS_PORT message received \n"); LOG_A(NR_RRC, "TASK_SYS_GNB: Not handled SYS_PORT message received \n");
} }
} }
break; break;
...@@ -1557,7 +1561,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed) ...@@ -1557,7 +1561,7 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
break; break;
} }
default: default:
LOG_A(NR_RRC, "TASK_SYS_5G_NR: Received unhandled message %d:%s\n", LOG_A(NR_RRC, "TASK_SYS_GNB: Received unhandled message %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break; break;
} }
......
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