Commit 849ccbf7 authored by Danil Ruban's avatar Danil Ruban Committed by Jerome PERALDI

bugz #125608 rework vt timer task

parent b7b038cb
...@@ -168,32 +168,11 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req,int cell_index ...@@ -168,32 +168,11 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req,int cell_index
} }
SS_DRB_PDU_REQ(message_p).rnti = SS_context.SSCell_list[cell_index].ss_rnti_g; SS_DRB_PDU_REQ(message_p).rnti = SS_context.SSCell_list[cell_index].ss_rnti_g;
uint8_t msg_queued = 0; if (!vt_timer_push_msg(&req->Common.TimingInfo, TASK_RRC_ENB,instance_g, message_p))
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{ {
ss_set_timinfo_t tinfo, timer_tinfo; itti_send_msg_to_task(TASK_RRC_ENB, instance_g, message_p);
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_A(ENB_SS_DRB_ACP,"VT_TIMER DRB task received MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued)
{
msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, instance_g,message_p);
LOG_A(ENB_SS_DRB_ACP, "DRB_PDU Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
}
if (!msg_queued)
{
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, instance_g, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS_DRB_ACP, "[SS_DRB] Error in itti_send_msg_to_task");
}
LOG_A(ENB_SS_DRB_ACP, "Send res: %d", send_res);
} }
} }
} }
......
...@@ -251,54 +251,18 @@ static void ss_task_handle_rrc_pdu_req(struct EUTRA_RRC_PDU_REQ *req) ...@@ -251,54 +251,18 @@ static void ss_task_handle_rrc_pdu_req(struct EUTRA_RRC_PDU_REQ *req)
LOG_P(OAILOG_DEBUG, "DL_DCCH_Message", lttng_sdu, SS_RRC_PDU_REQ(message_p).sdu_size); LOG_P(OAILOG_DEBUG, "DL_DCCH_Message", lttng_sdu, SS_RRC_PDU_REQ(message_p).sdu_size);
} }
LOG_A(ENB_SS_SRB_ACP, "[SS_SRB][EUTRA_RRC_PDU_REQ] sending to TASK_RRC_ENB: {srb: %d, ch: %s, qty: %d rnti %d}\n", LOG_A(ENB_SS_SRB, "[SS_SRB][EUTRA_RRC_PDU_REQ] sending to TASK_RRC_ENB: {srb: %d, ch: %s, qty: %d rnti %d}\n",
SS_RRC_PDU_REQ(message_p).srb_id, SS_RRC_PDU_REQ(message_p).srb_id,
req->RrcPdu.d == RRC_MSG_Request_Type_Ccch ? "CCCH" : "DCCH", SS_RRC_PDU_REQ(message_p).sdu_size ,rnti_g); req->RrcPdu.d == RRC_MSG_Request_Type_Ccch ? "CCCH" : "DCCH", SS_RRC_PDU_REQ(message_p).sdu_size ,rnti_g);
SS_RRC_PDU_REQ(message_p).rnti = rnti_g; SS_RRC_PDU_REQ(message_p).rnti = rnti_g;
uint8_t msg_queued = 0; if (!vt_timer_push_msg(&req->Common.TimingInfo, TASK_RRC_ENB, instance_g, message_p))
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{ {
ss_set_timinfo_t tinfo, timer_tinfo; itti_send_msg_to_task(TASK_RRC_ENB, instance_g, message_p);
memset(&tinfo, 0, sizeof(tinfo));
memset(&timer_tinfo, 0, sizeof(timer_tinfo));
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_I(ENB_SS_SRB_ACP, "msg_queued:%d\n",msg_queued);
LOG_A(ENB_SS_SRB_ACP,"VT_TIMER SRB task received MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued)
{
/* Below adjustment is made as MAC is taking 1 extra SF before scheduling and "msg_can_be_queued" is adjusting by 4 SF */
if (timer_tinfo.sf == 0)
{
timer_tinfo.sfn--;
timer_tinfo.sf = 9;
}
else
timer_tinfo.sf--;
msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, instance_g,message_p);
LOG_A(ENB_SS_SRB_ACP, "RRC_PDU Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
} }
LOG_I(ENB_SS_SRB_ACP, "msg_queued2:%d\n",msg_queued);
} }
if (!msg_queued)
{
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, instance_g, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS_SRB_ACP, "[SS_SRB] Error in itti_send_msg_to_task");
}
LOG_A(ENB_SS_SRB_ACP, "Send res: %d", send_res);
}
}
} }
/* /*
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "common/ran_context.h" #include "common/ran_context.h"
#include "acpSys.h" #include "acpSys.h"
#include "SidlCommon.h"
#include "ss_eNB_sys_task.h" #include "ss_eNB_sys_task.h"
#include "ss_eNB_context.h" #include "ss_eNB_context.h"
#include "ss_eNB_vt_timer_task.h" #include "ss_eNB_vt_timer_task.h"
...@@ -74,7 +75,7 @@ extern int cell_config_done; ...@@ -74,7 +75,7 @@ extern int cell_config_done;
//extern uint16_t ss_rnti_g; //extern uint16_t ss_rnti_g;
static void sys_send_proxy(void *msg, int msgLen, int msg_queued, ss_set_timinfo_t timer_tinfo); static void sys_send_proxy(void *msg, int msgLen, struct TimingInfo_Type* at);
int cell_config_done_indication(void); int cell_config_done_indication(void);
static uint16_t paging_ue_index_g = 0; static uint16_t paging_ue_index_g = 0;
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
...@@ -213,6 +214,19 @@ int cell_config_done_indication() ...@@ -213,6 +214,19 @@ int cell_config_done_indication()
return 0; return 0;
} }
void set_syscnf(bool reqCnfFlag, enum ConfirmationResult_Type_Sel resType, bool resVal, enum SystemConfirm_Type_Sel cnfType)
{
if (reqCnfFlag == true)
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
SS_context.sys_cnf.cnfFlag = 1;
memset(SS_context.sys_cnf.msg_buffer, 0, 1000);
}
}
/* /*
* Function : sys_send_udp_msg * Function : sys_send_udp_msg
* Description: Sends the UDP_INIT message to UDP_TASK to create the listening socket * Description: Sends the UDP_INIT message to UDP_TASK to create the listening socket
...@@ -222,7 +236,7 @@ static int sys_send_udp_msg( ...@@ -222,7 +236,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, struct TimingInfo_Type* at)
{ {
// Create and alloc new message // Create and alloc new message
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
...@@ -237,22 +251,18 @@ static int sys_send_udp_msg( ...@@ -237,22 +251,18 @@ static int sys_send_udp_msg(
udp_data_req_p->buffer = buffer; udp_data_req_p->buffer = buffer;
udp_data_req_p->buffer_length = buffer_len; udp_data_req_p->buffer_length = buffer_len;
udp_data_req_p->buffer_offset = buffer_offset; udp_data_req_p->buffer_offset = buffer_offset;
if(msg_queued) if(at == NULL || !vt_timer_push_msg(at, TASK_UDP, 0, message_p))
{
LOG_A(ENB_SS_SYS_TASK, "UDP Message Queued for Proxy\n");
return vt_timer_setup(timer_tinfo, TASK_UDP, 0,message_p);
}
else
{ {
LOG_A(ENB_SS_SYS_TASK, "Sending UDP_DATA_REQ to TASK_UDP\n"); LOG_A(ENB_SS_SYS_TASK, "Sending UDP_DATA_REQ to TASK_UDP\n");
return itti_send_msg_to_task(TASK_UDP, 0, message_p); return itti_send_msg_to_task(TASK_UDP, 0, message_p);
} }
return 0;
} }
else
{
LOG_A(ENB_SS_SYS_TASK, "Failed Sending UDP_DATA_REQ length %u offset %u \n", buffer_len, buffer_offset); LOG_A(ENB_SS_SYS_TASK, "Failed Sending UDP_DATA_REQ length %u offset %u \n", buffer_len, buffer_offset);
return -1; return -1;
}
} }
/* /*
...@@ -697,33 +707,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req) ...@@ -697,33 +707,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
RRC_CONFIGURATION_REQ(msg_p).intraFreqReselection[cell_index] = SIB1_CELL_ACCESS_REL_INFO.intraFreqReselection; RRC_CONFIGURATION_REQ(msg_p).intraFreqReselection[cell_index] = SIB1_CELL_ACCESS_REL_INFO.intraFreqReselection;
} }
} }
uint8_t msg_queued = 0;
ss_set_timinfo_t timer_tinfo;
timer_tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
timer_tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
#if 0
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_A(ENB_SS_SYS_TASK,"VT_TIMER SYS task received MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued)
{
msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, 0,msg_p);
LOG_A(ENB_SS, "Cell_Config Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
}
if (!msg_queued)
{
LOG_A(ENB_SS_SYS_TASK, "Sending Cell configuration to RRC from SYSTEM_CTRL_REQ \n");
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
}
#endif
/** Handle Initial Cell power, Sending to Proxy */ /** Handle Initial Cell power, Sending to Proxy */
if (AddOrReconfigure->Basic.v.InitialCellPower.d == true) if (AddOrReconfigure->Basic.v.InitialCellPower.d == true)
{ {
...@@ -752,7 +736,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req) ...@@ -752,7 +736,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
cellConfig->header.cell_id, cellConfig->header.cell_id,
cellConfig->initialAttenuation, cellConfig->maxRefPower, cellConfig->initialAttenuation, cellConfig->maxRefPower,
cellConfig->dl_earfcn, cell_index); cellConfig->dl_earfcn, cell_index);
sys_send_proxy((void *)cellConfig, sizeof(CellConfigReq_t), msg_queued, timer_tinfo); sys_send_proxy((void *)cellConfig, sizeof(CellConfigReq_t), &req->Common.TimingInfo);
} }
} }
// Cell Config Active Param // Cell Config Active Param
...@@ -917,23 +901,8 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req) ...@@ -917,23 +901,8 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
/* Currently only queuing UL_GrantConfig from Cell Config API. On timer expiry, message will be sent to MAC */ /* Currently only queuing UL_GrantConfig from Cell Config API. On timer expiry, message will be sent to MAC */
if (destTaskMAC == true) if (destTaskMAC == true)
{ {
uint8_t msg_queued = 0; if (!vt_timer_push_msg(&req->Common.TimingInfo, TASK_MAC_ENB,ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p))
/* Checking if message have to be queued */
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{
ss_set_timinfo_t tinfo;
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
if (tinfo.sfn > SS_context.sfn || tinfo.sf > SS_context.sf)
{
msg_queued = vt_timer_setup(tinfo, TASK_MAC_ENB, 0, msg_p);
}
LOG_A(ENB_SS_SYS_TASK,"UL_Grant Configuration queued for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
}
if (!msg_queued)
{ {
LOG_A(ENB_SS_SYS_TASK, "Sending SS_ULGRANT_INFO to MAC\n");
itti_send_msg_to_task(TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); itti_send_msg_to_task(TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
} }
} }
...@@ -1083,7 +1052,7 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req) ...@@ -1083,7 +1052,7 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req)
{ {
//Increment the nb_CC supported as new cell is confiured. //Increment the nb_CC supported as new cell is confiured.
if (RC.nb_CC[0] >= MAX_NUM_CCs) { if (RC.nb_CC[0] >= MAX_NUM_CCs) {
LOG_E (ENB_SS_SYS_TASK,"Can't add cell, MAX_NUM_CC reached (%d > %d) \n", RC.nb_CC[0], MAX_NUM_CCs); LOG_E (ENB_SS_SYS_TASK,"[SYS] Can't add cell, MAX_NUM_CC reached (%d > %d) \n", RC.nb_CC[0], MAX_NUM_CCs);
} else { } else {
RC.nb_CC[0] ++; RC.nb_CC[0] ++;
//Set the number of MAC_CC to current configured CC value //Set the number of MAC_CC to current configured CC value
...@@ -1114,14 +1083,7 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req) ...@@ -1114,14 +1083,7 @@ int sys_handle_cell_config_req(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest INVALID Type receivied\n"); LOG_A(ENB_SS_SYS_TASK, "CellConfigRequest INVALID Type receivied\n");
} }
if (reqCnfFlag_g == true) set_syscnf(reqCnfFlag_g, resType, resVal, cnfType);
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
memset(SS_context.sys_cnf.msg_buffer, 0, 1000);
SS_context.sys_cnf.cnfFlag = 1;
}
return returnState; return returnState;
} }
...@@ -1487,43 +1449,15 @@ static int sys_handle_radiobearer_list(struct SYSTEM_CTRL_REQ *req) ...@@ -1487,43 +1449,15 @@ static int sys_handle_radiobearer_list(struct SYSTEM_CTRL_REQ *req)
} }
} }
uint8_t msg_queued = 0; if (!vt_timer_push_msg(&req->Common.TimingInfo, TASK_RRC_ENB,0, msg_p))
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.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_A(ENB_SS_SYS_TASK,"VT_TIMER SYS task received MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued)
{ {
msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, 0,msg_p); itti_send_msg_to_task(TASK_RRC_ENB, 0, msg_p);
LOG_A(ENB_SS_SYS_TASK, "RB List Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
}
if (!msg_queued)
{
LOG_A(ENB_SS_SYS_TASK, "Send RRC_RBLIST_CFG_REQ to TASK_RRC_ENB, RB Count : %d, Message: %s \n", RRC_RBLIST_CFG_REQ(msg_p).rb_count, ITTI_MSG_NAME(msg_p));
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, 0, msg_p);
if (send_res < 0)
{
LOG_A(ENB_SS_SYS_TASK, "Error sending RRC_RBLIST_CFG_REQ to RRC_ENB \n");
}
}
} }
if (reqCnfFlag_g == true)
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
SS_context.sys_cnf.cnfFlag = 1;
memset(SS_context.sys_cnf.msg_buffer, 0, 1000);
returnState = SS_STATE_CELL_ACTIVE;
} }
set_syscnf(reqCnfFlag_g, resType, resVal, cnfType);
returnState = reqCnfFlag_g ? SS_STATE_CELL_ACTIVE : returnState;
// send_sys_cnf(resType, resVal, cnfType, NULL); // send_sys_cnf(resType, resVal, cnfType, NULL);
return returnState; return returnState;
} }
...@@ -1648,7 +1582,7 @@ int sys_handle_pdcp_count_req(struct PDCP_CountReq_Type *PdcpCount) ...@@ -1648,7 +1582,7 @@ int sys_handle_pdcp_count_req(struct PDCP_CountReq_Type *PdcpCount)
* Function : sys_send_proxy * Function : sys_send_proxy
* Description: Sends the messages from SYS to proxy * Description: Sends the messages from SYS to proxy
*/ */
static void sys_send_proxy(void *msg, int msgLen, int msg_queued, ss_set_timinfo_t timer_tinfo) static void sys_send_proxy(void *msg, int msgLen, struct TimingInfo_Type* at)
{ {
LOG_A(ENB_SS_SYS_TASK, "In sys_send_proxy\n"); LOG_A(ENB_SS_SYS_TASK, "In sys_send_proxy\n");
uint32_t peerIpAddr; uint32_t peerIpAddr;
...@@ -1666,7 +1600,7 @@ static void sys_send_proxy(void *msg, int msgLen, int msg_queued, ss_set_timinfo ...@@ -1666,7 +1600,7 @@ static void sys_send_proxy(void *msg, int msgLen, int msg_queued, ss_set_timinfo
LOG_A(ENB_SS_SYS_TASK, "\nCell Config End of Buffer\n "); LOG_A(ENB_SS_SYS_TASK, "\nCell Config End of Buffer\n ");
/** Send to proxy */ /** Send to proxy */
sys_send_udp_msg((uint8_t *)msg, msgLen, 0, peerIpAddr, peerPort,msg_queued,timer_tinfo); sys_send_udp_msg((uint8_t *)msg, msgLen, 0, peerIpAddr, peerPort, at);
return; return;
} }
...@@ -1674,7 +1608,7 @@ static void sys_send_proxy(void *msg, int msgLen, int msg_queued, ss_set_timinfo ...@@ -1674,7 +1608,7 @@ static void sys_send_proxy(void *msg, int msgLen, int msg_queued, ss_set_timinfo
* Function : sys_cell_attn_update * Function : sys_cell_attn_update
* Description: Sends the attenuation updates received from TTCN to proxy * Description: Sends the attenuation updates received from TTCN to proxy
*/ */
static void sys_cell_attn_update(uint8_t cellId, uint8_t attnVal,int CellIndex, int msg_queued, ss_set_timinfo_t timer_tinfo) static void sys_cell_attn_update(uint8_t cellId, uint8_t attnVal,int CellIndex, struct TimingInfo_Type* at)
{ {
LOG_A(ENB_SS_SYS_TASK, "In sys_cell_attn_update, cellIndex:%d \n",CellIndex); LOG_A(ENB_SS_SYS_TASK, "In sys_cell_attn_update, cellIndex:%d \n",CellIndex);
attenuationConfigReq_t *attnConf = NULL; attenuationConfigReq_t *attnConf = NULL;
...@@ -1691,7 +1625,7 @@ static void sys_cell_attn_update(uint8_t cellId, uint8_t attnVal,int CellIndex, ...@@ -1691,7 +1625,7 @@ static void sys_cell_attn_update(uint8_t cellId, uint8_t attnVal,int CellIndex,
IPV4_STR_ADDR_TO_INT_NWBO(local_address, peerIpAddr, " BAD IP Address"); IPV4_STR_ADDR_TO_INT_NWBO(local_address, peerIpAddr, " BAD IP Address");
/** Send to proxy */ /** Send to proxy */
sys_send_udp_msg((uint8_t *)attnConf, sizeof(attenuationConfigReq_t), 0, peerIpAddr, peerPort,msg_queued,timer_tinfo); sys_send_udp_msg((uint8_t *)attnConf, sizeof(attenuationConfigReq_t), 0, peerIpAddr, peerPort, at);
LOG_A(ENB_SS_SYS_TASK, "Out sys_cell_attn_update\n"); LOG_A(ENB_SS_SYS_TASK, "Out sys_cell_attn_update\n");
return; return;
} }
...@@ -1704,22 +1638,7 @@ static void sys_handle_cell_attn_req(struct SYSTEM_CTRL_REQ *req) ...@@ -1704,22 +1638,7 @@ static void sys_handle_cell_attn_req(struct SYSTEM_CTRL_REQ *req)
assert(req); assert(req);
struct CellAttenuationConfig_Type_CellAttenuationList_Type_Dynamic *CellAttenuationList = &(req->Request.v.CellAttenuationList); struct CellAttenuationConfig_Type_CellAttenuationList_Type_Dynamic *CellAttenuationList = &(req->Request.v.CellAttenuationList);
assert(CellAttenuationList); assert(CellAttenuationList);
uint8_t msg_queued = 0;
ss_set_timinfo_t tinfo, timer_tinfo;
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_A(ENB_SS_SYS_TASK,"VT_TIMER SYS task received cell_attn MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued)
{
LOG_A(ENB_SS_SYS_TASK, "Cell_Attn Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
}
for(int i=0;i<CellAttenuationList->d;i++) { for(int i=0;i<CellAttenuationList->d;i++) {
uint8_t cellId = (uint8_t)CellAttenuationList->v[i].CellId; uint8_t cellId = (uint8_t)CellAttenuationList->v[i].CellId;
uint8_t CellIndex = get_cell_index(cellId, SS_context.SSCell_list); uint8_t CellIndex = get_cell_index(cellId, SS_context.SSCell_list);
...@@ -1731,13 +1650,13 @@ static void sys_handle_cell_attn_req(struct SYSTEM_CTRL_REQ *req) ...@@ -1731,13 +1650,13 @@ static void sys_handle_cell_attn_req(struct SYSTEM_CTRL_REQ *req)
attnVal = CellAttenuationList->v[i].Attenuation.v.Value; attnVal = CellAttenuationList->v[i].Attenuation.v.Value;
LOG_A(ENB_SS_SYS_TASK, "CellAttenuationList for Cell_id %d value %d dBm received\n", LOG_A(ENB_SS_SYS_TASK, "CellAttenuationList for Cell_id %d value %d dBm received\n",
cellId, attnVal); cellId, attnVal);
sys_cell_attn_update(cellId, attnVal,CellIndex,msg_queued,timer_tinfo); sys_cell_attn_update(cellId, attnVal,CellIndex, &req->Common.TimingInfo);
break; break;
case Attenuation_Type_Off: case Attenuation_Type_Off:
attnVal = 80; /* TODO: attnVal hardcoded currently but Need to handle proper Attenuation_Type_Off */ attnVal = 80; /* TODO: attnVal hardcoded currently but Need to handle proper Attenuation_Type_Off */
LOG_A(ENB_SS_SYS_TASK, "CellAttenuationList turn off for Cell_id %d received with attnVal : %d\n", LOG_A(ENB_SS_SYS_TASK, "CellAttenuationList turn off for Cell_id %d received with attnVal : %d\n",
cellId,attnVal); cellId,attnVal);
sys_cell_attn_update(cellId, attnVal,CellIndex,msg_queued,timer_tinfo); sys_cell_attn_update(cellId, attnVal,CellIndex, &req->Common.TimingInfo);
break; break;
case Attenuation_Type_UNBOUND_VALUE: case Attenuation_Type_UNBOUND_VALUE:
LOG_A(ENB_SS_SYS_TASK, "CellAttenuationList Attenuation_Type_UNBOUND_VALUE received\n"); LOG_A(ENB_SS_SYS_TASK, "CellAttenuationList Attenuation_Type_UNBOUND_VALUE received\n");
...@@ -1746,6 +1665,7 @@ static void sys_handle_cell_attn_req(struct SYSTEM_CTRL_REQ *req) ...@@ -1746,6 +1665,7 @@ static void sys_handle_cell_attn_req(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "Invalid CellAttenuationList received\n"); LOG_A(ENB_SS_SYS_TASK, "Invalid CellAttenuationList received\n");
} }
} }
//sys_confirm_done_indication();
} }
/* /*
* Function : sys_handle_paging_req * Function : sys_handle_paging_req
...@@ -1887,12 +1807,6 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s ...@@ -1887,12 +1807,6 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s
LOG_A(ENB_SS_SYS_TASK, "Exit sys_handle_paging_req Paging_IND processing for Cell_id %d \n", cellId); LOG_A(ENB_SS_SYS_TASK, "Exit sys_handle_paging_req Paging_IND processing for Cell_id %d \n", cellId);
} }
static void sys_vt_add_sf(uint16_t *frameP, uint8_t *subframeP, int offset)
{
*frameP = (*frameP + ((*subframeP + offset) / 10))%1024;
*subframeP = ((*subframeP + offset) % 10);
}
static void sys_handle_l1macind_ctrl(struct SYSTEM_CTRL_REQ *req) static void sys_handle_l1macind_ctrl(struct SYSTEM_CTRL_REQ *req)
{ {
...@@ -1943,37 +1857,11 @@ static void sys_handle_l1macind_ctrl(struct SYSTEM_CTRL_REQ *req) ...@@ -1943,37 +1857,11 @@ static void sys_handle_l1macind_ctrl(struct SYSTEM_CTRL_REQ *req)
SS_L1MACIND_CTRL(message_p).HarqError_Ctrl = IndCtrlMode_DISABLE; SS_L1MACIND_CTRL(message_p).HarqError_Ctrl = IndCtrlMode_DISABLE;
} }
} }
LOG_D(ENB_SS_SYS_TASK, "fxn:%s line:%d req->Common.TimingInfo.d:%d\n",__FUNCTION__, __LINE__, req->Common.TimingInfo.d);
uint8_t msg_queued = 0;
if (req->Common.TimingInfo.d == TimingInfo_Type_SubFrame)
{
LOG_D(ENB_SS_SYS_TASK, "fxn:%s line:%d\n",__FUNCTION__, __LINE__);
ss_set_timinfo_t tinfo, timer_tinfo;
tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
LOG_D(ENB_SS_SYS_TASK, "fxn:%s line:%d tinfo.sfn:%d tinfo.sf:%d\n",__FUNCTION__, __LINE__, tinfo.sfn, tinfo.sf);
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_A(ENB_SS_SYS_TASK,"VT_TIMER SYS task received MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued) vt_add_sf(&req->Common.TimingInfo, 4);
if (!vt_timer_push_msg(&req->Common.TimingInfo, TASK_MAC_ENB,0, message_p))
{ {
sys_vt_add_sf(&timer_tinfo.sfn,&timer_tinfo.sf,4); itti_send_msg_to_task(TASK_MAC_ENB, 0, message_p);
msg_queued = vt_timer_setup(timer_tinfo, TASK_MAC_ENB, 0,message_p);
}
LOG_A(ENB_SS_SYS_TASK, "RRC_PDU Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
if (!msg_queued)
{
int send_res = itti_send_msg_to_task(TASK_MAC_ENB, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS_SYS_TASK, "Error sending to MAC");
}
LOG_A(ENB_SS_SYS_TASK, "Send res: %d\n", send_res);
} }
} }
send_sys_cnf(resType, resVal, cnfType, NULL); send_sys_cnf(resType, resVal, cnfType, NULL);
...@@ -2174,32 +2062,9 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req) ...@@ -2174,32 +2062,9 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "Ciphering ActTimeList i=%d rb_id=%d\n", i, RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ActTimeList.SecurityActTime[i].rb_id); LOG_A(ENB_SS_SYS_TASK, "Ciphering ActTimeList i=%d rb_id=%d\n", i, RRC_AS_SECURITY_CONFIG_REQ(msg_p).Ciphering.ActTimeList.SecurityActTime[i].rb_id);
} }
} }
uint8_t msg_queued = 0; if (!vt_timer_push_msg(&req->Common.TimingInfo, TASK_RRC_ENB,0, msg_p))
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.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
timer_tinfo = tinfo;
msg_queued = msg_can_be_queued(tinfo, &timer_tinfo);
LOG_A(ENB_SS_SYS_TASK,"VT_TIMER SYS task received MSG for future SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if(msg_queued)
{
msg_queued = vt_timer_setup(timer_tinfo, TASK_RRC_ENB, 0,msg_p);
LOG_A(ENB_SS_SYS_TASK, "AS Security Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
LOG_A(ENB_SS_SYS_TASK, "AS_Security Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d\n",
tinfo.sfn,tinfo.sf, SS_context.sfn,SS_context.sf);
}
if (!msg_queued)
{
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, 0, msg_p);
if (send_res < 0)
{ {
LOG_A(ENB_SS_SYS_TASK, "Error sending RRC_AS_SECURITY_CONFIG_REQ to RRC_ENB"); itti_send_msg_to_task(TASK_RRC_ENB, 0, msg_p);
}
} }
} }
else if (ASSecurity->d == AS_Security_Type_Release) else if (ASSecurity->d == AS_Security_Type_Release)
...@@ -2207,14 +2072,7 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req) ...@@ -2207,14 +2072,7 @@ static void sys_handle_as_security_req(struct SYSTEM_CTRL_REQ *req)
LOG_A(ENB_SS_SYS_TASK, "AS_Security_Type_Release received\n"); LOG_A(ENB_SS_SYS_TASK, "AS_Security_Type_Release received\n");
} }
} }
if (reqCnfFlag_g == true) set_syscnf(reqCnfFlag_g, resType, resVal, cnfType);
{
SS_context.sys_cnf.resType = resType;
SS_context.sys_cnf.resVal = resVal;
SS_context.sys_cnf.cnfType = cnfType;
SS_context.sys_cnf.cnfFlag = 1;
memset((void *)SS_context.sys_cnf.msg_buffer, 0, 1000);
}
// send_sys_cnf(resType, resVal, cnfType, NULL); // send_sys_cnf(resType, resVal, cnfType, NULL);
} }
...@@ -2587,8 +2445,7 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed) ...@@ -2587,8 +2445,7 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed)
case SS_VNG_PROXY_REQ: case SS_VNG_PROXY_REQ:
{ {
LOG_A(ENB_SS_SYS_TASK, "received %s from %s \n", ITTI_MSG_NAME(received_msg), LOG_A(ENB_SS_SYS_TASK, "received %s from %s \n", ITTI_MSG_NAME(received_msg), ITTI_MSG_ORIGIN_NAME(received_msg));
ITTI_MSG_ORIGIN_NAME(received_msg));
VngCmdReq_t *req = (VngCmdReq_t *)malloc(sizeof(VngCmdReq_t)); VngCmdReq_t *req = (VngCmdReq_t *)malloc(sizeof(VngCmdReq_t));
req->header.preamble = 0xFEEDC0DE; req->header.preamble = 0xFEEDC0DE;
...@@ -2603,15 +2460,13 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed) ...@@ -2603,15 +2460,13 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed)
LOG_A(ENB_SS_SYS_TASK,"VNG Command for cell_id: %d CMD %d ", LOG_A(ENB_SS_SYS_TASK,"VNG Command for cell_id: %d CMD %d ",
req->header.cell_id, req->cmd); req->header.cell_id, req->cmd);
ss_set_timinfo_t timer_tinfo= {0}; sys_send_proxy((void *)req, sizeof(VngCmdReq_t), NULL);
sys_send_proxy((void *)req, sizeof(VngCmdReq_t), 0, timer_tinfo);
} }
break; break;
case SS_GET_PDCP_CNT: /** FIXME */ case SS_GET_PDCP_CNT: /** FIXME */
{ {
LOG_A(ENB_SS_SYS_TASK, "received SS_GET_PDCP_CNT Count from PDCP size %d\n", LOG_A(ENB_SS_SYS_TASK, "received SS_GET_PDCP_CNT Count from PDCP size %d\n", SS_GET_PDCP_CNT(received_msg).size);
SS_GET_PDCP_CNT(received_msg).size);
enum SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_PdcpCount; enum SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_PdcpCount;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success; enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = true; bool resVal = true;
......
...@@ -31,22 +31,16 @@ ...@@ -31,22 +31,16 @@
#include "ss_eNB_proxy_iface.h" #include "ss_eNB_proxy_iface.h"
#include "ss_eNB_vt_timer_task.h" #include "ss_eNB_vt_timer_task.h"
#include <assert.h>
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
/* static uint8_t _vt_timer_setup(ss_set_timinfo_t* tinfo, task_id_t task_id,instance_t instance, void *msg);
* Function : vt_add_sf static uint8_t _msg_can_be_queued(ss_set_timinfo_t* req_tinfo);
* Description: Helper function to add offset to SFN_SF
*/
static void vt_add_sf(uint16_t *frameP, uint8_t *subframeP, int offset)
{
*frameP = (*frameP + ((*subframeP + offset) / 10))%1024;
*subframeP = ((*subframeP + offset) % 10);
}
/* /*
* Function : vt_subtract_sf * Function : vt_subtract_sf
* Description: Helper function to substract offset to SFN_SF * Description: Helper function to substract offset to SFN_SF
...@@ -82,6 +76,8 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti ...@@ -82,6 +76,8 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti
return false; return false;
} }
/* /*
* Function : vt_timer_setup * Function : vt_timer_setup
* Description: Function to set upt the VT timer for the SFN_SF * Description: Function to set upt the VT timer for the SFN_SF
...@@ -89,23 +85,143 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti ...@@ -89,23 +85,143 @@ uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_ti
*/ */
uint8_t vt_timer_setup(ss_set_timinfo_t tinfo, task_id_t task_id,instance_t instance, void *msg) uint8_t vt_timer_setup(ss_set_timinfo_t tinfo, task_id_t task_id,instance_t instance, void *msg)
{ {
LOG_A(ENB_SS_VT_TIMER,"VT_TIMER setup1 for SFN %d , SF %d\n",tinfo.sfn,tinfo.sf); return _vt_timer_setup(&tinfo,task_id,instance, msg);
uint32_t sfnSfKey = (tinfo.sfn << 4) | tinfo.sf; }
vt_timer_elm_t *timer_ele_p;
timer_ele_p = calloc(1, sizeof(vt_timer_elm_t)); /*
* Function : vt_add_sf
* Description: Helper function to add offset to SFN_SF
*/
static void _vt_add_sf(uint16_t *frameP, uint8_t *subframeP, int offset)
{
if (offset > 0) {
*frameP = (*frameP + ((*subframeP + offset) / 10)) % 1024;
*subframeP = ((*subframeP + offset) % 10);
} else {
if (*subframeP < offset) {
*frameP = (*frameP + 1024 - 1) % 1024;
}
*subframeP = (*subframeP + 10 - offset) % 10;
}
}
void vt_add_sf(struct TimingInfo_Type* at, int offset)
{
if (at != NULL && at->d == TimingInfo_Type_SubFrame)
{
uint8_t sfn = SS_context.sfn;
uint16_t sf = SS_context.sf;
if (at->v.SubFrame.SFN.d == SystemFrameNumberInfo_Type_Number)
{
sfn = at->v.SubFrame.SFN.v.Number;
}
if (at->v.SubFrame.Subframe.d == SubFrameInfo_Type_Number)
{
sf = at->v.SubFrame.Subframe.v.Number;
}
_vt_add_sf(&sf, &sfn, offset);
at->v.SubFrame.SFN.d = SystemFrameNumberInfo_Type_Number;
at->v.SubFrame.SFN.v.Number = sfn;
at->v.SubFrame.Subframe.d = SubFrameInfo_Type_Number;
at->v.SubFrame.Subframe.v.Number = sf;
}
}
int vt_timer_push_msg(struct TimingInfo_Type* at, task_id_t task_id,instance_t instance, MessageDef *msg_p)
{
int msg_queued = 0;
if (at != NULL && at->d == TimingInfo_Type_SubFrame)
{
if (at->v.SubFrame.HSFN.d == SystemFrameNumberInfo_Type_Number)
{
return 0;
}
ss_set_timinfo_t timer_tinfo = {
.sfn = SS_context.sfn,
.sf = SS_context.sf + 6,
};
if (at->v.SubFrame.SFN.d == SystemFrameNumberInfo_Type_Number)
{
timer_tinfo.sfn = at->v.SubFrame.SFN.v.Number;
}
if (at->v.SubFrame.Subframe.d == SubFrameInfo_Type_Number)
{
timer_tinfo.sf = at->v.SubFrame.Subframe.v.Number;
}
else
{
return 0;
}
msg_queued = _msg_can_be_queued(&timer_tinfo);
if(msg_queued)
{
msg_queued = _vt_timer_setup(&timer_tinfo, task_id, instance ,msg_p);
LOG_E(ENB_SS, "Message Queued as the scheduled SFN is %d SF: %d and curr SFN %d , SF %d, msg_queued: %d\r\n",
timer_tinfo.sfn,timer_tinfo.sf, SS_context.sfn,SS_context.sf, msg_queued);
}
else
{
vt_add_sf(at, -3);
LOG_E(ENB_SS,"VT_TIMER SYS Rescheduling MSG %p for future SFN %d , SF %d\r\n", msg_p, timer_tinfo.sfn,timer_tinfo.sf);
return vt_timer_push_msg(at, task_id, instance, msg_p);
}
}
return msg_queued;
}
/*
* Function : msg_can_be_queued
* Description: Helper function to check if the received MSG shall be queued
*/
static uint8_t _msg_can_be_queued(ss_set_timinfo_t* req_tinfo)
{
ss_set_timinfo_t curr_tinfo;
curr_tinfo.sfn = SS_context.sfn;
curr_tinfo.sf = SS_context.sf;
uint32_t sfnSfKey = (req_tinfo->sfn << 4) | req_tinfo->sf;
/*It is nonsense to check req_tinfo is after curr_tinfo */
if(hashtable_is_key_exists(SS_context.vt_timer_table, sfnSfKey) != HASH_TABLE_OK &&
(req_tinfo->sfn != curr_tinfo.sfn || ((req_tinfo->sfn == curr_tinfo.sfn) && (req_tinfo->sf - curr_tinfo.sf) > 0)))
{
LOG_E(ENB_APP,"VT_TIMER MSG to be queued TRUE for SFN %d , SF %d\n",req_tinfo->sfn,req_tinfo->sf);
return true;
}
return false;
}
/*
* Function : vt_timer_setup
* Description: Function to set upt the VT timer for the SFN_SF
* and store the message to received
*/
static uint8_t _vt_timer_setup(ss_set_timinfo_t* tinfo, task_id_t task_id,instance_t instance, void *msg)
{
uint32_t sfnSfKey = (tinfo->sfn << 4) | tinfo->sf;
vt_timer_elm_t *timer_ele_p = calloc(1, sizeof(vt_timer_elm_t));
assert(timer_ele_p);
timer_ele_p->instance = instance; timer_ele_p->instance = instance;
timer_ele_p->task_id = task_id; timer_ele_p->task_id = task_id;
timer_ele_p->msg = msg; timer_ele_p->msg = msg;
LOG_A(ENB_SS_VT_TIMER,"VT_TIMER setup2 for SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
if (hashtable_insert(SS_context.vt_timer_table, if (hashtable_insert(SS_context.vt_timer_table,
(hash_key_t)sfnSfKey, (void *)timer_ele_p) == HASH_TABLE_OK) (hash_key_t)sfnSfKey, (void *)timer_ele_p) == HASH_TABLE_OK)
{ {
LOG_A(ENB_SS_VT_TIMER,"VT_TIMER setup for SFN %d , SF %d\n",tinfo.sfn,tinfo.sf); LOG_E(ENB_APP,"VT_TIMER setup for SFN %d , SF %d\n", tinfo->sfn,tinfo->sf);
return 1; return 1;
} }
LOG_A(ENB_SS_VT_TIMER,"VT_TIMER not setup for SFN %d , SF %d\n",tinfo.sfn,tinfo.sf);
return 0; return false;
} }
/* /*
* Function : ss_vt_timer_check * Function : ss_vt_timer_check
...@@ -121,30 +237,31 @@ static inline void ss_vt_timer_check(ss_set_timinfo_t tinfo) ...@@ -121,30 +237,31 @@ static inline void ss_vt_timer_check(ss_set_timinfo_t tinfo)
//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);
while (hashtable_is_key_exists(SS_context.vt_timer_table, (hash_key_t)sfnSfKey) == HASH_TABLE_OK) while (hashtable_is_key_exists(SS_context.vt_timer_table, (hash_key_t)sfnSfKey) == HASH_TABLE_OK)
{ {
LOG_D(ENB_SS_VT_TIMER,"VT_TIMER Timeout sending curr SFN %d SF %d\n", LOG_E(ENB_APP,"VT_TIMER Timeout sending curr SFN %d SF %d\n",
SS_context.sfn,SS_context.sf); SS_context.sfn,SS_context.sf);
hashtable_get(SS_context.vt_timer_table, (hash_key_t)sfnSfKey, (void **)&timer_ele_p); hashtable_get(SS_context.vt_timer_table, (hash_key_t)sfnSfKey, (void **)&timer_ele_p);
AssertFatal(timer_ele_p, "VT Timer - timer element is NULL"); AssertFatal(timer_ele_p, "VT Timer - timer element is NULL");
LOG_A(ENB_SS_VT_TIMER,"VT_TIMER Enter check SFN %d , SF %d taskID %d timer_ele.task_id instance %ld \n", LOG_A(ENB_SS_VT_TIMER,"VT_TIMER Enter check SFN %d , SF %d taskID %d timer_ele.task_id instance %ld \n",
tinfo.sfn,tinfo.sf, timer_ele_p->task_id,timer_ele_p->instance); tinfo.sfn,tinfo.sf, timer_ele_p->task_id,timer_ele_p->instance);
int send_res = itti_send_msg_to_task(timer_ele_p->task_id,timer_ele_p->instance, (MessageDef *)timer_ele_p->msg); int send_res = itti_send_msg_to_task(timer_ele_p->task_id,timer_ele_p->instance, (MessageDef *)timer_ele_p->msg);
if (send_res < 0) if (send_res < 0)
{ {
LOG_A(ENB_SS_VT_TIMER, "[VT_TIMER] Error in SS_VT_TIME_OUT itti_send_msg_to_task"); LOG_E(ENB_APP, "[VT_TIMER] Error in SS_VT_TIME_OUT itti_send_msg_to_task");
} }
else else
{ {
LOG_A(ENB_SS_VT_TIMER,"VT_TIMER Sent message to taskID %d timer_ele.task_id instance %ld \n", LOG_E(ENB_APP,"VT_TIMER Sent message to taskID %d timer_ele.task_id instance %ld \n",
timer_ele_p->task_id,timer_ele_p->instance); timer_ele_p->task_id,timer_ele_p->instance);
hashtable_remove(SS_context.vt_timer_table, (hash_key_t)sfnSfKey); hashtable_remove(SS_context.vt_timer_table, (hash_key_t)sfnSfKey);
} }
LOG_D(ENB_SS_VT_TIMER,"VT_TIMER Timeout sending done curr SFN %d SF %d\n", LOG_E(ENB_APP,"VT_TIMER Timeout sending done curr SFN %d SF %d\n",
SS_context.sfn,SS_context.sf); SS_context.sfn,SS_context.sf);
} }
} }
/* /*
* Function : ss_eNB_vt_timer_process_itti_msg * Function : ss_eNB_vt_timer_process_itti_msg
* Description: Function to hanle the ITTI messages for VT_TIMER_TASK * Description: Function to hanle the ITTI messages for VT_TIMER_TASK
...@@ -165,7 +282,7 @@ void *ss_eNB_vt_timer_process_itti_msg(void *notUsed) ...@@ -165,7 +282,7 @@ void *ss_eNB_vt_timer_process_itti_msg(void *notUsed)
ss_set_timinfo_t tinfo; ss_set_timinfo_t tinfo;
tinfo.sf = SS_UPD_TIM_INFO(received_msg).sf; tinfo.sf = SS_UPD_TIM_INFO(received_msg).sf;
tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn; tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn;
LOG_D(ENB_SS_VT_TIMER, "[VT_TIMER] received_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf); LOG_D(ENB_APP, "[VT_TIMER] received_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
ss_vt_timer_check(tinfo); ss_vt_timer_check(tinfo);
} }
...@@ -176,7 +293,7 @@ void *ss_eNB_vt_timer_process_itti_msg(void *notUsed) ...@@ -176,7 +293,7 @@ void *ss_eNB_vt_timer_process_itti_msg(void *notUsed)
break; break;
} }
default: default:
LOG_E(ENB_SS_VT_TIMER, "[SS-VT_TIMER] Received unhandled message %d:%s\n", LOG_E(ENB_APP, "[SS-VT_TIMER] 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));
} }
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg); result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
...@@ -207,14 +324,14 @@ void* ss_eNB_vt_timer_task(void *arg) { ...@@ -207,14 +324,14 @@ void* ss_eNB_vt_timer_task(void *arg) {
int retVal = ss_eNB_vt_timer_init(); int retVal = ss_eNB_vt_timer_init();
if (retVal != -1) { if (retVal != -1) {
LOG_A(ENB_SS_VT_TIMER, "[SS-VT_TIMER] Enabled TASK_VT_TIMER starting the itti_msg_handler \n"); LOG_A(ENB_APP, "[SS-VT_TIMER] Enabled TASK_VT_TIMER starting the itti_msg_handler \n");
while (1) { while (1) {
(void) ss_eNB_vt_timer_process_itti_msg(NULL); (void) ss_eNB_vt_timer_process_itti_msg(NULL);
} }
} else { } else {
LOG_A(ENB_SS_VT_TIMER, "[SS-VT_TIMER] TASK_VT_TIMER port disabled at eNB \n"); LOG_A(ENB_APP, "[SS-VT_TIMER] TASK_VT_TIMER port disabled at eNB \n");
sleep(10); sleep(10);
} }
......
...@@ -27,20 +27,30 @@ ...@@ -27,20 +27,30 @@
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h> #include <netinet/in.h>
#include "hashtable.h" #include "hashtable.h"
#include "intertask_interface.h"
#include "SidlCommon.h"
#ifndef SS_ENB_VT_TIMER_TASK_H_ #ifndef SS_ENB_VT_TIMER_TASK_H_
#define SS_ENB_VT_TIMER_TASK_H_ #define SS_ENB_VT_TIMER_TASK_H_
void *ss_eNB_vt_timer_process_itti_msg(void *); void *ss_eNB_vt_timer_process_itti_msg(void *);
void *ss_eNB_vt_timer_task(void *arg); void *ss_eNB_vt_timer_task(void *arg);
int vt_timer_push_msg(struct TimingInfo_Type* at, task_id_t task_id,instance_t instance, MessageDef *msg_p);
void vt_add_sf(struct TimingInfo_Type* at, int offset);
uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_tinfo); uint8_t msg_can_be_queued(ss_set_timinfo_t req_tinfo, ss_set_timinfo_t *timer_tinfo);
uint8_t vt_timer_setup(ss_set_timinfo_t tinfo, task_id_t task_id,instance_t instance,void *msg); uint8_t vt_timer_setup(ss_set_timinfo_t tinfo, task_id_t task_id,instance_t instance,void *msg);
typedef struct vt_timer_elm_s { typedef struct vt_timer_elm_s {
//uint8_t msg_type; ///MSG type //uint8_t msg_type; ///MSG type
task_id_t task_id; task_id_t task_id;
instance_t instance; instance_t instance;
ss_vt_time_out_t *msg; ///< Optional argument that will be passed when timer expires void *msg; ///< Optional argument that will be passed when timer expires
} vt_timer_elm_t ; } vt_timer_elm_t ;
......
...@@ -37,7 +37,6 @@ extern SSConfigContext_t SS_context; ...@@ -37,7 +37,6 @@ extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
int cellIndex = 0; int cellIndex = 0;
int ss_eNB_vtp_init(void);
static acpCtx_t ctx_vtp_g = NULL; static acpCtx_t ctx_vtp_g = NULL;
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
enum MsgUserId enum MsgUserId
......
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