Commit 1c3d9eb3 authored by Siddharth Rana's avatar Siddharth Rana Committed by Vijay Chadachan

Rebasing from 3GPP_TTCN_System_Simulator Commit...

Rebasing from 3GPP_TTCN_System_Simulator Commit a36f5204bcfc297fff68d69c93dd7b1f24389949 to 507617c0e24cde488e4d09a788ada50766e895d4
parent aa2cebd2
......@@ -45,7 +45,8 @@
exit(1); \
} while (0)
static nr_pdcp_ue_manager_t *nr_pdcp_ue_manager;
nr_pdcp_ue_manager_t *nr_pdcp_ue_manager;
/* TODO: handle time a bit more properly */
static uint64_t nr_pdcp_current_time;
......
......@@ -75,6 +75,30 @@ void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *_m)
}
}
/* must be called with lock acquired */
nr_pdcp_ue_t *nr_pdcp_manager_get_ue_ex(nr_pdcp_ue_manager_t *_m, int rnti)
{
nr_pdcp_ue_manager_internal_t *m = _m;
nr_pdcp_ue_t* ret = NULL;
int i;
if (_m == NULL) {
return NULL;
}
nr_pdcp_manager_lock(m);
for (i = 0; i < m->ue_count; i++)
{
if (m->ue_list[i]->rnti == rnti)
{
ret = m->ue_list[i];
break;
}
}
nr_pdcp_manager_unlock(m);
return ret;
}
/* must be called with lock acquired */
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *_m, ue_id_t rntiMaybeUEid)
{
......
......@@ -46,6 +46,7 @@ void nr_pdcp_manager_lock(nr_pdcp_ue_manager_t *m);
void nr_pdcp_manager_unlock(nr_pdcp_ue_manager_t *m);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue(nr_pdcp_ue_manager_t *m, ue_id_t rntiMaybeUEid);
nr_pdcp_ue_t *nr_pdcp_manager_get_ue_ex(nr_pdcp_ue_manager_t *_m, int rnti);
void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *m, ue_id_t rntiMaybeUEid);
nr_pdcp_ue_t **nr_pdcp_manager_get_ue_list(nr_pdcp_ue_manager_t *_m);
......
......@@ -52,51 +52,21 @@ static void ss_dumpReqMsg(struct NR_SYSTEM_CTRL_REQ *msg)
LOG_A(GNB_APP, "\tRequest=%d\n", msg->Request.d);
}
void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF* recvCnf)
{
struct NR_SYSTEM_CTRL_CNF cnf;
const size_t size = 16 * 1024;
uint32_t status;
unsigned char *buffer = (unsigned char *)acpMalloc(size);
size_t msgSize = size;
memset(&cnf, 0, sizeof(cnf));
cnf.Common.CellId = recvCnf.Common.CellId;
cnf.Common.RoutingInfo.d = RoutingInfo_Type_None;
cnf.Common.RoutingInfo.v.None = true;
cnf.Common.TimingInfo.d = TimingInfo_Type_Now;
cnf.Common.TimingInfo.v.Now = true;
cnf.Common.Result.d = recvCnf.Common.Result.d;
cnf.Common.Result.v.Success = recvCnf.Common.Result.v.Success;
cnf.Confirm.d = recvCnf.Confirm.d;
LOG_A(GNB_APP, "[SS-PORTMAN] Attn CNF received cellId %d result %d type %d \n",
cnf.Common.CellId,cnf.Common.Result.d, recvCnf.Confirm.d);
switch (recvCnf.Confirm.d)
{
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;
case NR_SystemConfirm_Type_PdcpCount:
cnf.Confirm.v.PdcpCount.d = recvCnf.Confirm.v.PdcpCount.d;
cnf.Confirm.v.PdcpCount.v = recvCnf.Confirm.v.PdcpCount.v;
break;
case NR_SystemConfirm_Type_AS_Security:
cnf.Confirm.v.AS_Security = true;
break;
default:
LOG_A(GNB_APP, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN] %d \n", recvCnf.Confirm.d);
}
recvCnf->Common.RoutingInfo.d = RoutingInfo_Type_None;
recvCnf->Common.RoutingInfo.v.None = true;
recvCnf->Common.TimingInfo.d = TimingInfo_Type_None;
recvCnf->Common.TimingInfo.v.None = true;
/* Encode message
*/
if (acpNrSysProcessEncSrv(nrctx_g, buffer, &msgSize, &cnf) != 0)
if (acpNrSysProcessEncSrv(nrctx_g, buffer, &msgSize, recvCnf) != 0)
{
acpFree(buffer);
return;
......@@ -275,12 +245,11 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
}
else if (userId == 0)
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] fxn:%s userId:0\n", __FUNCTION__);
// No message (timeout on socket)
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE)
{
LOG_A(ENB_SS,"[SS-PORTMAN] Sending Wake up signal/SS_RRC_PDU_IND (msg_Id:%d) to TASK_SS_SRB_GNB task \n", SS_NRRRC_PDU_IND);
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_RRC_PDU_IND);
LOG_A(ENB_SS,"[SS-PORTMAN] Sending Wake up signal/SS_NRRRC_PDU_IND (msg_Id:%d) to TASK_SS_SRB_GNB task \n", SS_NRRRC_PDU_IND);
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_NRRRC_PDU_IND);
if (message_p)
{
/* Populate the message to SS */
......@@ -353,7 +322,7 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
case SS_NR_SYS_PORT_MSG_CNF:
{
LOG_A(GNB_APP, "[SS-PORTMAN-GNB] Received SS_NR_SYS_PORT_MSG_CNF \n");
ss_nr_port_man_send_cnf(*(SS_NR_SYS_PORT_MSG_CNF(received_msg).cnf));
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;
......
This diff is collapsed.
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