Commit 62d14b23 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 ce23d0393586c43b536f4fab70a1aaec17319676 to 44166c915975b81d1aa4b2de52920d9829faad56
parent 8a6027df
...@@ -126,6 +126,15 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) ...@@ -126,6 +126,15 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
mib_sdu_length); mib_sdu_length);
} }
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIRECTION_DOWNLINK;
mac_pkt.rnti_type = WS_NO_RNTI;
mac_pkt.rnti = 0xFFFF;
mac_pkt.harq_pid = 0;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_DL_PDU", frameP, slotP, mac_pkt, (uint8_t *)&cc->MIB_pdu.payload[0], (int)mib_sdu_length);
int8_t ssb_period = *scc->ssb_periodicityServingCell; int8_t ssb_period = *scc->ssb_periodicityServingCell;
uint8_t ssb_frame_periodicity = 1; // every how many frames SSB are generated uint8_t ssb_frame_periodicity = 1; // every how many frames SSB are generated
......
...@@ -296,7 +296,7 @@ void *ss_eNB_drb_process_itti_msg(void *notUsed) ...@@ -296,7 +296,7 @@ void *ss_eNB_drb_process_itti_msg(void *notUsed)
{ {
case SS_DRB_PDU_IND: case SS_DRB_PDU_IND:
{ {
int cell_index = 0; int cell_index=0;
if(received_msg->ittiMsg.ss_drb_pdu_ind.physCellId){ if(received_msg->ittiMsg.ss_drb_pdu_ind.physCellId){
cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_drb_pdu_ind.physCellId, SS_context.SSCell_list); cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_drb_pdu_ind.physCellId, SS_context.SSCell_list);
LOG_A(ENB_SS,"[SS_DRB] cell_index in SS_DRB_PDU_IND: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].PhysicalCellId); LOG_A(ENB_SS,"[SS_DRB] cell_index in SS_DRB_PDU_IND: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].PhysicalCellId);
...@@ -308,6 +308,14 @@ void *ss_eNB_drb_process_itti_msg(void *notUsed) ...@@ -308,6 +308,14 @@ void *ss_eNB_drb_process_itti_msg(void *notUsed)
LOG_D(ENB_APP, "[SS_DRB] DUMMY WAKEUP recevied from PORTMAN state %d \n", SS_context.SSCell_list[cell_index].State); LOG_D(ENB_APP, "[SS_DRB] DUMMY WAKEUP recevied from PORTMAN state %d \n", SS_context.SSCell_list[cell_index].State);
} }
else else
{
LOG_A(ENB_APP, "[SS_DRB] Received SS_DRB_PDU_IND from RRC PDCP\n");
if (SS_context.SSCell_list[cell_index].State >= SS_STATE_CELL_ACTIVE)
{
instance_g = ITTI_MSG_DESTINATION_INSTANCE(received_msg);
ss_send_drb_data(&received_msg->ittiMsg.ss_drb_pdu_ind,cell_index);
}
else
{ {
LOG_A(ENB_APP, "[SS_DRB] Received SS_DRB_PDU_IND from RRC PDCP\n"); LOG_A(ENB_APP, "[SS_DRB] Received SS_DRB_PDU_IND from RRC PDCP\n");
if (SS_context.SSCell_list[cell_index].State >= SS_STATE_CELL_ACTIVE) if (SS_context.SSCell_list[cell_index].State >= SS_STATE_CELL_ACTIVE)
......
...@@ -147,8 +147,11 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf) ...@@ -147,8 +147,11 @@ void ss_port_man_send_cnf(struct SYSTEM_CTRL_CNF recvCnf)
cnf.Confirm.v.PdcchOrder = true; cnf.Confirm.v.PdcchOrder = true;
break; break;
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_L1MacIndCtrl: case SystemConfirm_Type_L1MacIndCtrl:
LOG_A(ENB_SS, "[SS-PORTMAN] SystemConfirm_Type_L1MacIndCtrl\n");
cnf.Confirm.v.L1MacIndCtrl = true;
break;
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_RlcIndCtrl: case SystemConfirm_Type_RlcIndCtrl:
case SystemConfirm_Type_PdcpHandoverControl: case SystemConfirm_Type_PdcpHandoverControl:
case SystemConfirm_Type_L1_TestMode: case SystemConfirm_Type_L1_TestMode:
......
...@@ -197,7 +197,7 @@ static int sys_send_udp_msg( ...@@ -197,7 +197,7 @@ static int sys_send_udp_msg(
uint32_t buffer_len, uint32_t buffer_len,
uint32_t buffer_offset, uint32_t buffer_offset,
uint32_t peerIpAddr, uint32_t peerIpAddr,
uint16_t peerPort, int msg_queued, ss_set_timinfo_t timer_tinfo) uint16_t peerPort,int msg_queued, ss_set_timinfo_t timer_tinfo)
{ {
// Create and alloc new message // Create and alloc new message
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
...@@ -670,7 +670,6 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req) ...@@ -670,7 +670,6 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
#if 0 #if 0
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame) if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{ {
ss_set_timinfo_t tinfo, timer_tinfo;
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number; tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number; tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo; timer_tinfo = tinfo;
...@@ -793,10 +792,10 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType, ...@@ -793,10 +792,10 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
msgCnf->Confirm.v.PdcchOrder = true; msgCnf->Confirm.v.PdcchOrder = true;
break; break;
} }
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_L1MacIndCtrl: case SystemConfirm_Type_L1MacIndCtrl:
msgCnf->Confirm.v.L1MacIndCtrl = true; msgCnf->Confirm.v.L1MacIndCtrl = true;
break; break;
case SystemConfirm_Type_Sps:
case SystemConfirm_Type_RlcIndCtrl: case SystemConfirm_Type_RlcIndCtrl:
case SystemConfirm_Type_PdcpHandoverControl: case SystemConfirm_Type_PdcpHandoverControl:
case SystemConfirm_Type_L1_TestMode: case SystemConfirm_Type_L1_TestMode:
...@@ -2138,7 +2137,7 @@ bool valid_sys_msg(struct SYSTEM_CTRL_REQ *req) ...@@ -2138,7 +2137,7 @@ bool valid_sys_msg(struct SYSTEM_CTRL_REQ *req)
bool sendDummyCnf = true; bool sendDummyCnf = true;
enum SystemConfirm_Type_Sel cnfType = 0; enum SystemConfirm_Type_Sel cnfType = 0;
// if (req->Common.ControlInfo.CnfFlag == false) // if (req->Common.ControlInfo.CnfFlag == FALSE)
// { // {
// return FALSE; // return FALSE;
// } // }
...@@ -2214,7 +2213,7 @@ bool valid_sys_msg(struct SYSTEM_CTRL_REQ *req) ...@@ -2214,7 +2213,7 @@ bool valid_sys_msg(struct SYSTEM_CTRL_REQ *req)
break; break;
case SystemRequest_Type_PdcchOrder: case SystemRequest_Type_PdcchOrder:
valid = true; valid = true;
sendDummyCnf = true; sendDummyCnf = false;
cnfType = SystemConfirm_Type_PdcchOrder; cnfType = SystemConfirm_Type_PdcchOrder;
reqCnfFlag_g = req->Common.ControlInfo.CnfFlag; reqCnfFlag_g = req->Common.ControlInfo.CnfFlag;
break; break;
......
...@@ -119,6 +119,32 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind,int cell_index) ...@@ -119,6 +119,32 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind,int cell_index)
ind.Indication.v.RachPreamble.RepetitionsPerPreambleAttempt.d = true; ind.Indication.v.RachPreamble.RepetitionsPerPreambleAttempt.d = true;
ind.Indication.v.RachPreamble.RepetitionsPerPreambleAttempt.v = p_ind->repetitionsPerPreambleAttempt; ind.Indication.v.RachPreamble.RepetitionsPerPreambleAttempt.v = p_ind->repetitionsPerPreambleAttempt;
} }
if(SysInd_Type_UL_HARQ == p_ind->sysind_type)
{
LOG_A(ENB_SS, "[SS_SYSIND] SYSTEM_IND with UL HARQ %d\n", p_ind->UL_Harq);
ind.Indication.d = SystemIndication_Type_UL_HARQ;
if (p_ind->UL_Harq)
ind.Indication.v.UL_HARQ = HARQ_Type_ack;
else
ind.Indication.v.UL_HARQ = HARQ_Type_nack;
}
else if (SysInd_Type_HarqError == p_ind->sysind_type)
{
LOG_A(ENB_SS, "SYSTEM_IND with HarqError \n");
ind.Indication.d = SystemIndication_Type_HarqError;
if (p_ind->HarqError.bIsUL)
{
ind.Indication.v.HarqError.d = HarqError_Type_UL;
ind.Indication.v.HarqError.v.UL.Id = p_ind->HarqError.Id;
ind.Indication.v.HarqError.v.UL.CURRENT_TX_NB = p_ind->HarqError.CURRENT_TX_NB;
}
else
{
ind.Indication.v.HarqError.d = HarqError_Type_DL;
ind.Indication.v.HarqError.v.DL.Id = p_ind->HarqError.Id;
ind.Indication.v.HarqError.v.DL.CURRENT_TX_NB = p_ind->HarqError.CURRENT_TX_NB;
}
}
/* Encode message */ /* Encode message */
if (acpSysIndProcessToSSEncSrv(ctx_sysind_g, buffer, &msgSize, &ind) != 0) if (acpSysIndProcessToSSEncSrv(ctx_sysind_g, buffer, &msgSize, &ind) != 0)
...@@ -160,7 +186,7 @@ ss_eNB_read_from_sysind_socket(acpCtx_t ctx) ...@@ -160,7 +186,7 @@ ss_eNB_read_from_sysind_socket(acpCtx_t ctx)
while (1) while (1)
{ {
int userId = acpRecvMsg(ctx, &msgSize, buffer); int userId = acpRecvMsg(ctx, &msgSize, buffer);
LOG_A(ENB_SS, "[SS_SYSIND] Received msgSize=%d, userId=%d\n", (int)msgSize, userId); LOG_D(ENB_SS, "[SS_SYSIND] Received msgSize=%d, userId=%d\n", (int)msgSize, userId);
// Error handling // Error handling
if (userId < 0) if (userId < 0)
...@@ -274,7 +300,7 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed) ...@@ -274,7 +300,7 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed)
{ {
case SS_SYSTEM_IND: case SS_SYSTEM_IND:
{ {
int cell_index; int cell_index = 0;
if(received_msg->ittiMsg.ss_system_ind.physCellId){ if(received_msg->ittiMsg.ss_system_ind.physCellId){
cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_system_ind.physCellId, SS_context.SSCell_list); cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_system_ind.physCellId, SS_context.SSCell_list);
LOG_A(ENB_SS,"[SS_SYSIND] cell_index in SS_SYSTEM_IND: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].PhysicalCellId); LOG_A(ENB_SS,"[SS_SYSIND] cell_index in SS_SYSTEM_IND: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].PhysicalCellId);
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
/* /*
* Function : vt_add_sf * Function : vt_add_sf
* Description: Helper function to add offset to SFN_SF * Description: Helper function to add offset to SFN_SF
...@@ -60,6 +59,7 @@ static void vt_subtract_sf(uint16_t *frameP, uint8_t *subframeP, int offset) ...@@ -60,6 +59,7 @@ static void vt_subtract_sf(uint16_t *frameP, uint8_t *subframeP, int offset)
} }
*subframeP = (*subframeP+10-offset)%10; *subframeP = (*subframeP+10-offset)%10;
} }
/* /*
* Function : msg_can_be_queued * Function : msg_can_be_queued
* Description: Helper function to check if the received MSG shall be queued * Description: Helper function to check if the received MSG shall be queued
...@@ -72,12 +72,11 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti ...@@ -72,12 +72,11 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti
LOG_A(ENB_APP,"VT_TIMER Enter msg_can_be_queued for SFN %d , SF %d\n",req_tinfo.sfn,req_tinfo.sf); LOG_A(ENB_APP,"VT_TIMER Enter msg_can_be_queued for SFN %d , SF %d\n",req_tinfo.sfn,req_tinfo.sf);
vt_subtract_sf(&req_tinfo.sfn,&req_tinfo.sf, curr_tinfo.sf); /*It is nonsense to check req_tinfo is after curr_tinfo */
if(req_tinfo.sfn != curr_tinfo.sfn || ((req_tinfo.sfn == curr_tinfo.sfn) && (req_tinfo.sf - curr_tinfo.sf) > 0) )
if((req_tinfo.sfn - curr_tinfo.sfn) > 0)
{ {
LOG_A(ENB_APP,"VT_TIMER MSG to be queued TRUE for SFN %d , SF %d\n",timer_tinfo->sfn,timer_tinfo->sf); LOG_A(ENB_APP,"VT_TIMER MSG to be queued TRUE for SFN %d , SF %d\n",timer_tinfo->sfn,timer_tinfo->sf);
vt_subtract_sf(&timer_tinfo->sfn,&timer_tinfo->sf, 7); vt_subtract_sf(&timer_tinfo->sfn,&timer_tinfo->sf, 4); /* queued ahead of 4 subframes because of mac schedule 4 subframes ahead when processing */
return true; return true;
} }
...@@ -117,9 +116,8 @@ static inline void ss_vt_timer_check(ss_set_timinfo_t tinfo) ...@@ -117,9 +116,8 @@ static inline void ss_vt_timer_check(ss_set_timinfo_t tinfo)
uint32_t sfnSfKey = (tinfo.sfn << 4) | tinfo.sf; uint32_t sfnSfKey = (tinfo.sfn << 4) | tinfo.sf;
hash_rc = hashtable_is_key_exists(SS_context.vt_timer_table, (hash_key_t)sfnSfKey);
//printf("VT_TIMER foudn queued SFN %d , SF %d\n",tinfo.sfn,tinfo.sf); //printf("VT_TIMER foudn queued SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if (hash_rc == HASH_TABLE_OK) while (hashtable_is_key_exists(SS_context.vt_timer_table, (hash_key_t)sfnSfKey) == HASH_TABLE_OK)
{ {
LOG_D(ENB_APP,"VT_TIMER Timeout sending curr SFN %d SF %d\n", LOG_D(ENB_APP,"VT_TIMER Timeout sending curr SFN %d SF %d\n",
SS_context.sfn,SS_context.sf); SS_context.sfn,SS_context.sf);
......
...@@ -152,6 +152,37 @@ static void ss_send_srb_data(ss_nrrrc_pdu_ind_t *pdu_ind) ...@@ -152,6 +152,37 @@ static void ss_send_srb_data(ss_nrrrc_pdu_ind_t *pdu_ind)
LOG_P(OAILOG_DEBUG, "UL_DCCH_Message", lttng_sdu, pdu_ind->sdu_size); LOG_P(OAILOG_DEBUG, "UL_DCCH_Message", lttng_sdu, pdu_ind->sdu_size);
xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)ul_dcch_msg); xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)ul_dcch_msg);
#define UL_DCCH ul_dcch_msg->message.choice
#define SETCMPLT_NASINFO c1->choice.rrcSetupComplete->criticalExtensions.choice.rrcSetupComplete->dedicatedNAS_Message
#define RESCMPLT_NASINFO c1->choice.rrcResumeComplete->criticalExtensions.choice.rrcResumeComplete->dedicatedNAS_Message
#define UL_NASINFO c1->choice.ulInformationTransfer->criticalExtensions.choice.ulInformationTransfer->dedicatedNAS_Message
if(UL_DCCH.c1->present == NR_UL_DCCH_MessageType__c1_PR_rrcSetupComplete)
{
if (UL_DCCH.c1->choice.rrcSetupComplete->criticalExtensions.present ==
NR_RRCSetupComplete__criticalExtensions_PR_rrcSetupComplete)
{
LOG_NAS_P(OAILOG_INFO, "NR_NAS_PDU", UL_DCCH.SETCMPLT_NASINFO.buf, UL_DCCH.SETCMPLT_NASINFO.size);
}
}
if(UL_DCCH.c1->present == NR_UL_DCCH_MessageType__c1_PR_rrcResumeComplete)
{
if (UL_DCCH.c1->choice.rrcResumeComplete->criticalExtensions.present ==
NR_RRCResumeComplete__criticalExtensions_PR_rrcResumeComplete)
{
LOG_NAS_P(OAILOG_INFO, "NR_NAS_PDU", UL_DCCH.RESCMPLT_NASINFO->buf, UL_DCCH.RESCMPLT_NASINFO->size);
}
}
if(UL_DCCH.c1->present == NR_UL_DCCH_MessageType__c1_PR_ulInformationTransfer)
{
if (UL_DCCH.c1->choice.ulInformationTransfer->criticalExtensions.present ==
NR_ULInformationTransfer__criticalExtensions_PR_ulInformationTransfer)
{
LOG_NAS_P(OAILOG_INFO, "NR_NAS_PDU", UL_DCCH.UL_NASINFO->buf, UL_DCCH.UL_NASINFO->size);
}
}
ind.RrcPdu.d = NR_RRC_MSG_Indication_Type_Dcch; ind.RrcPdu.d = NR_RRC_MSG_Indication_Type_Dcch;
ind.RrcPdu.v.Dcch.d = pdu_ind->sdu_size; ind.RrcPdu.v.Dcch.d = pdu_ind->sdu_size;
ind.RrcPdu.v.Dcch.v = pdu_ind->sdu; ind.RrcPdu.v.Dcch.v = pdu_ind->sdu;
...@@ -211,6 +242,10 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req) ...@@ -211,6 +242,10 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req)
} }
else else
{ {
#define DL_DCCH dl_dcch_msg->message.choice
#define DL_NASINFO c1->choice.dlInformationTransfer->criticalExtensions.choice.dlInformationTransfer->dedicatedNAS_Message
#define RECNFG_NASINFO c1->choice.rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->nonCriticalExtension->dedicatedNAS_MessageList
SS_NRRRC_PDU_REQ(message_p).sdu_size = req->RrcPdu.v.Dcch.d; SS_NRRRC_PDU_REQ(message_p).sdu_size = req->RrcPdu.v.Dcch.d;
memcpy(SS_NRRRC_PDU_REQ(message_p).sdu, req->RrcPdu.v.Dcch.v, req->RrcPdu.v.Dcch.d); memcpy(SS_NRRRC_PDU_REQ(message_p).sdu, req->RrcPdu.v.Dcch.v, req->RrcPdu.v.Dcch.d);
uper_decode(NULL, uper_decode(NULL,
...@@ -220,6 +255,29 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req) ...@@ -220,6 +255,29 @@ static void ss_task_handle_rrc_pdu_req(struct NR_RRC_PDU_REQ *req)
SS_NRRRC_PDU_REQ(message_p).sdu_size,0,0); SS_NRRRC_PDU_REQ(message_p).sdu_size,0,0);
xer_fprint(stdout,&asn_DEF_NR_DL_DCCH_Message,(void *)dl_dcch_msg); xer_fprint(stdout,&asn_DEF_NR_DL_DCCH_Message,(void *)dl_dcch_msg);
if(DL_DCCH.c1->present == NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer)
{
if (DL_DCCH.c1->choice.dlInformationTransfer->criticalExtensions.present
== NR_DLInformationTransfer__criticalExtensions_PR_dlInformationTransfer)
{
LOG_NAS_P(OAILOG_INFO, "NR_NAS_PDU", DL_DCCH.DL_NASINFO->buf, DL_DCCH.DL_NASINFO->size);
}
}
if(DL_DCCH.c1->present == NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration)
{
if (DL_DCCH.c1->choice.rrcReconfiguration->criticalExtensions.present
== NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration)
{
int nas_list_cnt;
for (nas_list_cnt = 0; nas_list_cnt < DL_DCCH.RECNFG_NASINFO->list.count; nas_list_cnt++)
{
LOG_NAS_P(OAILOG_INFO, "NR_NAS_PDU", DL_DCCH.RECNFG_NASINFO->list.array[nas_list_cnt]->buf, DL_DCCH.RECNFG_NASINFO->list.array[nas_list_cnt]->size);
}
}
}
memcpy(lttng_sdu, SS_NRRRC_PDU_REQ(message_p).sdu, SS_NRRRC_PDU_REQ(message_p).sdu_size); memcpy(lttng_sdu, SS_NRRRC_PDU_REQ(message_p).sdu, SS_NRRRC_PDU_REQ(message_p).sdu_size);
LOG_P(OAILOG_DEBUG, "DL_DCCH_Message", lttng_sdu, SS_NRRRC_PDU_REQ(message_p).sdu_size); LOG_P(OAILOG_DEBUG, "DL_DCCH_Message", lttng_sdu, SS_NRRRC_PDU_REQ(message_p).sdu_size);
......
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