Commit 1dc2d7a7 authored by Manu Agrawal's avatar Manu Agrawal

Chnages 2

parent 2afbdc6c
......@@ -32,6 +32,9 @@ MESSAGE_DEF(SS_NRUPD_TIM_INFO, MESSAGE_PRIORITY_MED, ss_nrupd_tim
MESSAGE_DEF(SS_SYS_PORT_MSG_IND, MESSAGE_PRIORITY_MED, ss_sys_port_msg_ind_t , ss_sys_port_msg_ind)
MESSAGE_DEF(SS_SYS_PORT_MSG_CNF, MESSAGE_PRIORITY_MED, ss_sys_port_msg_cnf_t , ss_sys_port_msg_cnf)
MESSAGE_DEF(SS_NR_SYS_PORT_MSG_IND, MESSAGE_PRIORITY_MED, ss_nr_sys_port_msg_ind_t , ss_nr_sys_port_msg_ind)
MESSAGE_DEF(SS_NR_SYS_PORT_MSG_CNF, MESSAGE_PRIORITY_MED, ss_nr_sys_port_msg_cnf_t , ss_nr_sys_port_msg_cnf)
MESSAGE_DEF(SS_GET_PDCP_CNT, MESSAGE_PRIORITY_MED, ss_get_pdcp_cnt_t , ss_get_pdcp_cnt)
MESSAGE_DEF(SS_SET_PDCP_CNT, MESSAGE_PRIORITY_MED, ss_set_pdcp_cnt_t , ss_set_pdcp_cnt)
MESSAGE_DEF(SS_REQ_PDCP_CNT, MESSAGE_PRIORITY_MED, ss_req_pdcp_cnt_t , ss_req_pdcp_cnt)
......
......@@ -25,6 +25,9 @@
#define SS_SYS_PORT_MSG_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_sys_port_msg_ind
#define SS_SYS_PORT_MSG_CNF(mSGpTR) (mSGpTR)->ittiMsg.ss_sys_port_msg_cnf
#define SS_NR_SYS_PORT_MSG_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_nr_sys_port_msg_ind
#define SS_NR_SYS_PORT_MSG_CNF(mSGpTR) (mSGpTR)->ittiMsg.ss_nr_sys_port_msg_cnf
#define SS_GET_TIM_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_get_timinfo
#define SS_SET_TIM_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_set_timinfo
#define SS_NRSET_TIM_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_nrset_timinfo
......@@ -77,6 +80,15 @@ typedef struct ss_sys_port_msg_cnf {
struct SYSTEM_CTRL_CNF* cnf;
} ss_sys_port_msg_cnf_t;
typedef struct ss_nr_sys_port_msg_ind {
struct NR_SYSTEM_CTRL_REQ* req;
int userId;
} ss_nr_sys_port_msg_ind_t;
typedef struct ss_nr_sys_port_msg_cnf {
struct NR_SYSTEM_CTRL_CNF* cnf;
} ss_nr_sys_port_msg_cnf_t;
/** SYS */
typedef struct ss_set_timinfo_s {
uint16_t sfn;
......
......@@ -30,6 +30,7 @@
#include "ss_gNB_port_man_task.h"
#include "ss_gNB_context.h"
#include "acpSys.h"
#include "acpNrSys.h"
extern RAN_CONTEXT_t RC;
......@@ -40,9 +41,9 @@ enum MsgUserId
MSG_NrSysProcess_userId = 1,
};
extern SSConfigContext_t SS_context;
static void ss_dumpReqMsg(struct SYSTEM_CTRL_REQ *msg)
static void ss_dumpReqMsg(struct NR_SYSTEM_CTRL_REQ *msg)
{
LOG_A(NR_RRC, "SysProcess: received from the TTCN\n");
LOG_A(NR_RRC, "NrSysProcess: received from the TTCN\n");
LOG_A(NR_RRC, "\tCommon:\n");
LOG_A(NR_RRC, "\t\tCellId=%d\n", msg->Common.CellId);
LOG_A(NR_RRC, "\t\tRoutingInfo=%d\n", msg->Common.RoutingInfo.d);
......@@ -52,10 +53,9 @@ static void ss_dumpReqMsg(struct SYSTEM_CTRL_REQ *msg)
LOG_A(NR_RRC, "\tRequest=%d\n", msg->Request.d);
}
#if 0
void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf)
void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
{
struct SYSTEM_CTRL_CNF cnf;
struct NR_SYSTEM_CTRL_CNF cnf;
const size_t size = 16 * 1024;
uint32_t status;
......@@ -97,10 +97,10 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf)
cnf.Confirm.v.PdcpCount.v = recvCnf.Confirm.v.PdcpCount.v;
break;
case SystemConfirm_Type_UE_Cat_Info:
cnf.Confirm.v.UE_Cat_Info = true;
//cnf.Confirm.v.UE_Cat_Info = true;
break;
case SystemConfirm_Type_Paging:
cnf.Confirm.v.Paging = true;
//cnf.Confirm.v.Paging = true;
break;
case SystemConfirm_Type_Sps:
......@@ -121,7 +121,7 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf)
/* Encode message
*/
if (acpSysProcessEncSrv(nrctx_g, buffer, &msgSize, &cnf) != 0)
if (acpNrSysProcessEncSrv(nrctx_g, buffer, &msgSize, &cnf) != 0)
{
acpFree(buffer);
return;
......@@ -146,7 +146,7 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf)
//------------------------------------------------------------------------------
// Function to send response to the SIDL client
void ss_port_man_send_data(
void ss_nr_port_man_send_data(
instance_t instance,
task_id_t task_id,
ss_set_timinfo_t *tinfo)
......@@ -194,7 +194,7 @@ void ss_port_man_send_data(
/* Encode message
*/
if (acpSysProcessEncSrv(nrctx_g, buffer, &msgSize, &cnf) != 0)
if (acpNrSysProcessEncSrv(nrctx_g, buffer, &msgSize, &cnf) != 0)
{
acpFree(buffer);
return;
......@@ -212,12 +212,11 @@ void ss_port_man_send_data(
}
else
{
LOG_A(NR_RRC, "[SS-PORTMAN] acpSendMsg Success \n");
LOG_A(NR_RRC, "[SS-PORTMAN GNB] acpSendMsg Success \n");
}
// Free allocated buffer
acpFree(buffer);
}
#endif
//------------------------------------------------------------------------------
void ss_gNB_port_man_init(void)
{
......@@ -261,7 +260,7 @@ void ss_gNB_port_man_init(void)
//------------------------------------------------------------------------------
static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
{
struct SYSTEM_CTRL_REQ *req = NULL;
struct NR_SYSTEM_CTRL_REQ *req = NULL;
const size_t size = 16 * 1024;
size_t msgSize = size; //2
unsigned char *buffer = (unsigned char *)acpMalloc(size);
......@@ -321,25 +320,23 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
else
{
LOG_A(NR_RRC, "[SS-PORTMAN-5GNR] received msg %d from the client.\n", userId);
if (acpSysProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
if (acpNrSysProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
return;
ss_dumpReqMsg(req);
if (userId == MSG_NrSysProcess_userId)
{
#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_GNB, INSTANCE_DEFAULT, SS_NR_SYS_PORT_MSG_IND);
if (message_p)
{
SS_SYS_PORT_MSG_IND(message_p).req = req;
SS_SYS_PORT_MSG_IND(message_p).userId = userId;
itti_send_msg_to_task(TASK_SYS, INSTANCE_DEFAULT, 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);
}
#endif
}
}
acpSysProcessFreeSrv(req);
acpNrSysProcessFreeSrv(req);
return;
}
......@@ -362,19 +359,17 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
case SS_NRSET_TIM_INFO:
{
LOG_A(RRC, "Received timing info \n");
ss_port_man_send_data(0, 0, &received_msg->ittiMsg.ss_nrset_timinfo);
ss_nr_port_man_send_data(0, 0, &received_msg->ittiMsg.ss_nrset_timinfo);
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
}
break;
#if 0
case SS_SYS_PORT_MSG_CNF:
case SS_NR_SYS_PORT_MSG_CNF:
{
LOG_A(RRC, "Received SS_SYS_PORT_MSG_CNF \n");
ss_port_man_send_cnf(*(SS_SYS_PORT_MSG_CNF(received_msg).cnf));
LOG_A(RRC, "Received SS_NR_SYS_PORT_MSG_CNF \n");
ss_nr_port_man_send_cnf(*(SS_NR_SYS_PORT_MSG_CNF(received_msg).cnf));
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
}
break;
#endif
case TERMINATE_MESSAGE:
itti_exit_task();
break;
......
......@@ -429,8 +429,8 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
enum SystemConfirm_Type_Sel cnfType,
void *msg)
{
struct SYSTEM_CTRL_CNF *msgCnf = CALLOC(1, sizeof(struct SYSTEM_CTRL_CNF));
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, SS_SYS_PORT_MSG_CNF);
struct NR_SYSTEM_CTRL_CNF *msgCnf = CALLOC(1, sizeof(struct NR_SYSTEM_CTRL_CNF));
MessageDef *message_p = itti_alloc_new_message(TASK_SYS_GNB, INSTANCE_DEFAULT, SS_NR_SYS_PORT_MSG_CNF);
/* The request has send confirm flag flase so do nothing in this funciton */
if (reqCnfFlag_g == FALSE)
......@@ -441,7 +441,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
if (message_p)
{
LOG_A(RRC, "[SYS] Send SS_SYS_PORT_MSG_CNF\n");
LOG_A(RRC, "[SYS] Send SS_NR_SYS_PORT_MSG_CNF\n");
msgCnf->Common.CellId = SS_context.eutra_cellId;
msgCnf->Common.Result.d = resType;
msgCnf->Common.Result.v.Success = resVal;
......@@ -466,7 +466,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
msgCnf->Confirm.v.AS_Security = true;
break;
case SystemConfirm_Type_UE_Cat_Info:
msgCnf->Confirm.v.UE_Cat_Info = true;
//msgCnf->Confirm.v.UE_Cat_Info = true;
break;
case SystemConfirm_Type_PdcpCount:
#if 0
......@@ -478,7 +478,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
break;
case SystemConfirm_Type_Paging:
msgCnf->Confirm.v.Paging = true;
//msgCnf->Confirm.v.Paging = true;
break;
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_L1MacIndCtrl:
......@@ -495,7 +495,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
default:
LOG_A(RRC, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN]");
}
SS_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
SS_NR_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN, INSTANCE_DEFAULT, message_p);
if (send_res < 0)
{
......@@ -1212,7 +1212,7 @@ static void sys_handle_nr_enquire_timing(ss_nrset_timinfo_t *tinfo)
SS_NRSET_TIM_INFO(message_p).slot = tinfo->slot;
SS_NRSET_TIM_INFO(message_p).sfn = tinfo->sfn;
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN, INSTANCE_DEFAULT, message_p);
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN_GNB, INSTANCE_DEFAULT, message_p);
if (send_res < 0)
{
LOG_A(RRC, "[SYS] Error sending to [SS-PORTMAN]");
......@@ -1433,7 +1433,7 @@ static void ss_task_sys_nr_handle_req(struct NR_SYSTEM_CTRL_REQ *req, ss_nrset_t
switch (RC.ss.State)
{
case SS_STATE_NOT_CONFIGURED:
if (req->Request.d == SystemRequest_Type_Cell)
if (req->Request.d == NR_SystemRequest_Type_Cell)
{
LOG_A(NR_RRC, "TASK_SYS_5G_NR: SystemRequest_Type_Cell received\n");
exitState = sys_handle_nr_cell_config_req(&(req->Request.v.Cell));
......@@ -1445,6 +1445,18 @@ static void ss_task_sys_nr_handle_req(struct NR_SYSTEM_CTRL_REQ *req, ss_nrset_t
RC.ss.State, req->Request.d);
}
break;
case SS_STATE_CELL_ACTIVE:
if (req->Request.d == NR_SystemRequest_Type_EnquireTiming)
{
sys_handle_nr_enquire_timing(tinfo);
LOG_A(NR_RRC, "TASK_SYS_5G_NR: NR_SystemRequest_Type_EnquireTiming received\n");
}
else
{
LOG_E(NR_RRC, "TASK_SYS_5G_NR: Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
RC.ss.State, req->Request.d);
}
break;
default:
LOG_E(NR_RRC, "TASK_SYS_5G_NR: Error ! SS_STATE %d Invalid SystemRequest_Type %d received\n",
RC.ss.State, req->Request.d);
......@@ -1466,7 +1478,7 @@ static void ss_task_sys_nr_handle_req(struct NR_SYSTEM_CTRL_REQ *req, ss_nrset_t
* ============================================================================================================
*/
bool valid_nr_sys_msg(struct SYSTEM_CTRL_REQ *req)
bool valid_nr_sys_msg(struct NR_SYSTEM_CTRL_REQ *req)
{
bool valid = FALSE;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
......@@ -1492,6 +1504,7 @@ bool valid_nr_sys_msg(struct SYSTEM_CTRL_REQ *req)
break;
case NR_SystemRequest_Type_EnquireTiming:
valid = TRUE;
sendDummyCnf = FALSE;
break;
default:
valid = FALSE;
......@@ -1541,12 +1554,12 @@ void *ss_gNB_sys_process_itti_msg(void *notUsed)
}
break;
case SS_SYS_PORT_MSG_IND:
case SS_NR_SYS_PORT_MSG_IND:
{
if (valid_nr_sys_msg(SS_SYS_PORT_MSG_IND(received_msg).req))
if (valid_nr_sys_msg(SS_NR_SYS_PORT_MSG_IND(received_msg).req))
{
ss_task_sys_nr_handle_req(SS_SYS_PORT_MSG_IND(received_msg).req, &tinfo);
ss_task_sys_nr_handle_req(SS_NR_SYS_PORT_MSG_IND(received_msg).req, &tinfo);
}
else
{
......
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