Commit f8509c1f authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava

Merge branch 'Issue30_DRB_Rebased' into 'Issue_19_Unified'

# Conflicts:
#   FirecellRD/components/RAN/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
parents 2b3d3e4b 34ff6192
......@@ -112,7 +112,12 @@ void msc_log_message(
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
#ifdef MSC_INTERFACE
extern msc_interface_t msc_interface;
#else
msc_interface_t msc_interface;
#endif
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end
......
......@@ -56,7 +56,7 @@
#define SS_VTP_PROXY_UPD(mSGpTR) (mSGpTR)->ittiMsg.ss_vtp_proxy_upd
#define SS_VTP_PROXY_ACK(mSGpTR) (mSGpTR)->ittiMsg.ss_vtp_proxy_ack
#define SS_VT_TIME_OUT(mSGpTR) (mSGpTR)->ittiMsg.ss_vt_time_out
#define SDU_SIZE (512)
#define SDU_SIZE (1024)
/** SYS IND */
#define SS_SYSTEM_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_system_ind
......@@ -192,6 +192,8 @@ typedef struct ss_drb_pdu_ind_s {
uint8_t drb_id;
uint32_t sdu_size;
uint8_t sdu[SDU_SIZE];
frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
} ss_drb_pdu_ind_t;
typedef enum carrierBandwidthEUTRA_dl_Bandwidth_e {
......
......@@ -1631,7 +1631,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
}
const uint8_t ndi = 1 - UE_template_ptr->oldNDI_UL[harq_pid]; // NDI: new data indicator
// Changed pre_assigned_mcs_ul for sending full SDU to UE on DRB in System Simulator Mode
// Changed pre_assigned_mcs_ul for sending full SDU to UE on DRB in System Simulator Mode
if (RC.ss.mode == SS_SOFTMODEM){
UE_template_ptr->pre_assigned_mcs_ul = 16;
}
......
......@@ -1049,30 +1049,54 @@ pdcp_data_ind(
* from its second byte (skipping 0th and 1st octets, i.e.
* PDCP header)
*/
if (LINK_ENB_PDCP_TO_GTPV1U) {
if (RC.ss.mode >= SS_SOFTMODEM) {
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %ld len %u\n",
LOG_A(PDCP, "Sending packet to SS, Calling SS_DRB_PDU_IND ue %x drb id %ld len %u\n",
ctxt_pP->rnti,
rb_id + 4,
rb_id,
sdu_buffer_sizeP - payload_offset );
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
memcpy(&gtpu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ);
AssertFatal(message_p != NULL, "OUT OF MEMORY");
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
packet_forwarded = TRUE;
MessageDef *message_p = itti_alloc_new_message (TASK_SS_DRB, 0, SS_DRB_PDU_IND);
if (message_p) {
/* Populate the message to SS */
SS_DRB_PDU_IND (message_p).sdu_size = sdu_buffer_sizeP - payload_offset;
SS_DRB_PDU_IND (message_p).drb_id = rb_id;
memset(SS_DRB_PDU_IND (message_p).sdu, 0, SS_DRB_PDU_IND (message_p).sdu_size);
memcpy(&SS_DRB_PDU_IND (message_p).sdu, &sdu_buffer_pP->data[payload_offset], SS_DRB_PDU_IND (message_p).sdu_size);
SS_DRB_PDU_IND (message_p).frame = ctxt_pP->frame;
SS_DRB_PDU_IND (message_p).subframe = ctxt_pP->subframe;
int send_res = itti_send_msg_to_task (TASK_SS_DRB, INSTANCE_DEFAULT, message_p);
if(send_res < 0) {
LOG_E(RRC,"Error in itti_send_msg_to_task");
}
}
}
} else {
packet_forwarded = FALSE;
if (LINK_ENB_PDCP_TO_GTPV1U) {
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %ld len %u\n",
ctxt_pP->rnti,
rb_id + 4,
sdu_buffer_sizeP - payload_offset );
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
memcpy(&gtpu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ);
AssertFatal(message_p != NULL, "OUT OF MEMORY");
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
packet_forwarded = TRUE;
}
} else {
packet_forwarded = FALSE;
}
}
#ifdef MBMS_MULTICAST_OUT
......@@ -1396,7 +1420,7 @@ pdcp_run (
break;
}
message_p = itti_alloc_new_message (TASK_PDCP_ENB, ctxt_pP->module_id, SS_GET_PDCP_CNT);
message_p = itti_alloc_new_message (TASK_PDCP_ENB, 0, SS_GET_PDCP_CNT);
SS_GET_PDCP_CNT(message_p).size = 0;
......
......@@ -343,7 +343,7 @@ mac_rrc_data_ind(
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE)
{
LOG_I(RRC,"RRC Sending CCCH PDU_IND to SS \n");
MessageDef *message_p = itti_alloc_new_message (TASK_SS_SRB, INSTANCE_DEFAULT, SS_RRC_PDU_IND);
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_ENB, 0, SS_RRC_PDU_IND);
if (message_p) {
/* Populate the message to SS */
SS_RRC_PDU_IND (message_p).sdu_size = sdu_lenP;
......@@ -354,7 +354,7 @@ mac_rrc_data_ind(
memset (SS_RRC_PDU_IND (message_p).sdu, 0, SDU_SIZE);
memcpy (SS_RRC_PDU_IND (message_p).sdu, sduP, sdu_lenP);
int send_res = itti_send_msg_to_task (TASK_SS_SRB, INSTANCE_DEFAULT, message_p);
int send_res = itti_send_msg_to_task (TASK_SS_SRB, 0, message_p);
if(send_res < 0) {
LOG_E(RRC,"Error in itti_send_msg_to_task");
}
......
......@@ -125,7 +125,7 @@ rrc_data_ind(
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE)
{
LOG_I(RRC,"L2 Interface Sending DCCH PDU_IND to SS \n");
MessageDef *message_p = itti_alloc_new_message (TASK_SS_SRB, ctxt_pP->instance, SS_RRC_PDU_IND);
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_ENB, 0, SS_RRC_PDU_IND);
if (message_p) {
/* Populate the message and send to SS */
SS_RRC_PDU_IND (message_p).sdu_size = sdu_sizeP;
......@@ -136,7 +136,7 @@ rrc_data_ind(
memset (SS_RRC_PDU_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (SS_RRC_PDU_IND (message_p).sdu, buffer_pP, sdu_sizeP);
int send_res = itti_send_msg_to_task (TASK_SS_SRB, ctxt_pP->instance, message_p);
int send_res = itti_send_msg_to_task (TASK_SS_SRB, 0, message_p);
if(send_res < 0) {
LOG_E(RRC,"Error in itti_send_msg_to_task");
}
......
This diff is collapsed.
......@@ -79,6 +79,8 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
DevAssert(out != NULL);
n = ( stream_cipher->blength + 31 ) / 32;
int actual_buf_size = stream_cipher->blength >> 3;
zero_bit = stream_cipher->blength & 0x7;
memset(&snow_3g_context, 0, sizeof(snow_3g_context));
......@@ -120,7 +122,8 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
/* Exclusive-OR the input data with keystream to generate the output bit
stream */
for (i=0; i<n*4; i++) {
LOG_A(OSA,"stream_cipher->blength %d loop till %d byte KS size is %d\n",stream_cipher->blength, actual_buf_size,4*n);
for (i=0; i<actual_buf_size; i++) {
stream_cipher->message[i] ^= *(((uint8_t*)KS)+i);
}
......
......@@ -54,7 +54,7 @@
extern RAN_CONTEXT_t RC;
extern uint16_t ss_rnti_g;
static acpCtx_t ctx_drb_g = NULL;
SSConfigContext_t SS_context;
extern SSConfigContext_t SS_context;
static unsigned char *buffer = NULL;
static const size_t size = 16 * 1024;
......@@ -90,13 +90,13 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
//Populated the Timing Info
ind.Common.TimingInfo.d = TimingInfo_Type_SubFrame;
ind.Common.TimingInfo.v.SubFrame.SFN.d = SystemFrameNumberInfo_Type_Number;
ind.Common.TimingInfo.v.SubFrame.SFN.v.Number = 0; //Need to check what value needs to be sent
ind.Common.TimingInfo.v.SubFrame.SFN.v.Number = pdu_ind->frame;
ind.Common.TimingInfo.v.SubFrame.Subframe.d = SubFrameInfo_Type_Number;
ind.Common.TimingInfo.v.SubFrame.Subframe.v.Number = 0; //Need to check what value needs to be sent
ind.Common.TimingInfo.v.SubFrame.Subframe.v.Number = pdu_ind->subframe;
ind.Common.TimingInfo.v.SubFrame.HSFN.d = SystemFrameNumberInfo_Type_Number;
ind.Common.TimingInfo.v.SubFrame.HSFN.v.Number = 0; //Need to check what value needs to be sent
ind.Common.TimingInfo.v.SubFrame.HSFN.v.Number = 0;
ind.Common.TimingInfo.v.SubFrame.Slot.d = SlotTimingInfo_Type_Any;
ind.Common.TimingInfo.v.SubFrame.Slot.v.Any = true;
......@@ -112,10 +112,12 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
ind.U_Plane.SubframeData.NoOfTTIs = 1;
ind.U_Plane.SubframeData.PduSduList.d = L2DataList_Type_PdcpSdu;
ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.d = 1;
LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_IND] PDCP SDU Count: %d\n", ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.d);
LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_IND] PDCP SDU Count: %lu\n", ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.d);
for(int i = 0; i < ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.d; i++){
ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v[i].d = pdu_ind->sdu_size;
ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v = CALLOC(1,(ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.d)*(sizeof(PDCP_SDU_Type)));
DevAssert(ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v != NULL);
ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v[i].d = pdu_ind->sdu_size;
ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v[i].v = CALLOC(1,ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v[i].d);
memcpy(ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.v[i].v, pdu_ind->sdu, pdu_ind->sdu_size);
}
......@@ -144,7 +146,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req)
{
assert(req);
MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_ENB, instance_g, SS_DRB_PDU_REQ);
MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, SS_DRB_PDU_REQ);
assert(message_p);
if (message_p)
{
......@@ -157,7 +159,7 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req)
LOG_A(ENB_APP, "PDCP SDU Received in DRB_COMMON_REQ");
for(int j = 0; j < req->U_Plane.SubframeDataList.v[i].PduSduList.v.PdcpSdu.d; j++){
SS_DRB_PDU_REQ(message_p).sdu_size = req->U_Plane.SubframeDataList.v[i].PduSduList.v.PdcpSdu.v[j].d;
LOG_A(ENB_APP, "Length of PDCP SDU received in DRB_COMMON_REQ: %d", req->U_Plane.SubframeDataList.v[i].PduSduList.v.PdcpSdu.v[j].d);
LOG_A(ENB_APP, "Length of PDCP SDU received in DRB_COMMON_REQ: %lu\n", req->U_Plane.SubframeDataList.v[i].PduSduList.v.PdcpSdu.v[j].d);
memcpy(SS_DRB_PDU_REQ(message_p).sdu, req->U_Plane.SubframeDataList.v[i].PduSduList.v.PdcpSdu.v[j].v, req->U_Plane.SubframeDataList.v[i].PduSduList.v.PdcpSdu.v[j].d);
}
}
......@@ -176,6 +178,7 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req)
}
static void
ss_eNB_read_from_drb_socket(acpCtx_t ctx){
size_t msgSize = size; //2
......
......@@ -360,7 +360,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE)
{
LOG_A(ENB_SS,"[SS-PORTMAN] Sending Wake up signal to SRB task \n");
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, INSTANCE_DEFAULT, SS_RRC_PDU_IND);
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_RRC_PDU_IND);
if (message_p)
{
/* Populate the message to SS */
......@@ -370,7 +370,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
SS_RRC_PDU_IND(message_p).frame = -1;
SS_RRC_PDU_IND(message_p).subframe = -1;
int send_res = itti_send_msg_to_task(TASK_SS_SRB, INSTANCE_DEFAULT, message_p);
int send_res = itti_send_msg_to_task(TASK_SS_SRB, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS, "Error in itti_send_msg_to_task");
......@@ -388,12 +388,12 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
if (userId == MSG_SysProcess_userId)
{
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, INSTANCE_DEFAULT, SS_SYS_PORT_MSG_IND);
MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_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);
itti_send_msg_to_task(TASK_SYS, 0, message_p);
}
}
}
......
......@@ -208,7 +208,7 @@ static void ss_task_handle_rrc_pdu_req(struct EUTRA_RRC_PDU_REQ *req)
assert(req);
LTE_DL_DCCH_Message_t *dl_dcch_msg=NULL;
LTE_DL_CCCH_Message_t *dl_ccch_msg=NULL;
MessageDef *message_p = itti_alloc_new_message(TASK_RRC_ENB, instance_g, SS_RRC_PDU_REQ);
MessageDef *message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, SS_RRC_PDU_REQ);
assert(message_p);
instance_g = 0;
if (message_p)
......@@ -456,7 +456,8 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed)
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
};
received_msg = NULL;
}
break;
case TERMINATE_MESSAGE:
......@@ -529,4 +530,4 @@ void *ss_eNB_srb_acp_task(void *arg)
ss_eNB_read_from_srb_socket(ctx_srb_g);
}
acpFree(buffer);
}
\ No newline at end of file
}
......@@ -190,7 +190,7 @@ static int sys_send_udp_msg(
// Create and alloc new message
MessageDef *message_p = NULL;
udp_data_req_t *udp_data_req_p = NULL;
message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, UDP_DATA_REQ);
message_p = itti_alloc_new_message(TASK_SYS, 0, UDP_DATA_REQ);
if (message_p)
{
......@@ -201,7 +201,7 @@ static int sys_send_udp_msg(
udp_data_req_p->buffer = buffer;
udp_data_req_p->buffer_length = buffer_len;
udp_data_req_p->buffer_offset = buffer_offset;
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, 0, message_p);
}
else
{
......@@ -219,7 +219,7 @@ static int sys_send_init_udp(const udpSockReq_t *req)
{
// Create and alloc new message
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, UDP_INIT);
message_p = itti_alloc_new_message(TASK_SYS, 0, UDP_INIT);
if (message_p == NULL)
{
return -1;
......@@ -233,7 +233,7 @@ static int sys_send_init_udp(const udpSockReq_t *req)
"0 UDP bind %s:%u",
UDP_INIT(message_p).address,
UDP_INIT(message_p).port);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, 0, message_p);
}
/*
......@@ -243,14 +243,14 @@ static int sys_send_init_udp(const udpSockReq_t *req)
*/
static void ss_task_sys_handle_timing_info(ss_set_timinfo_t *tinfo)
{
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, SS_SET_TIM_INFO);
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0, SS_SET_TIM_INFO);
if (message_p)
{
LOG_A(ENB_SS, "[SYS] Reporting info sfn:%d\t sf:%d.\n", tinfo->sfn, tinfo->sf);
SS_SET_TIM_INFO(message_p).sf = tinfo->sf;
SS_SET_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, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN] \n");
......@@ -287,11 +287,10 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure)
uint8_t num_CC = 0; /** NOTE: Handling only one cell */
for (int enb_id = 0; enb_id < RC.nb_inst; enb_id++)
{
MessageDef *msg_p = itti_alloc_new_message(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(enb_id), RRC_CONFIGURATION_REQ);
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
if (AddOrReconfigure->Basic.d == true)
{
MessageDef *msg_p = itti_alloc_new_message(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(enb_id), RRC_CONFIGURATION_REQ);
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
if (AddOrReconfigure->Basic.v.StaticCellInfo.d == true)
{
/** Handle Static Cell Info */
......@@ -561,7 +560,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
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);
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0, SS_SYS_PORT_MSG_CNF);
/* The request has send confirm flag flase so do nothing in this funciton */
if (reqCnfFlag_g == FALSE)
......@@ -625,7 +624,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
LOG_A(ENB_SS, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN] \n");
}
SS_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf;
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, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN] \n");
......@@ -1260,7 +1259,7 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0,SS_SS_PAGING_IND);
if (message_p == NULL)
{
return -1;
return;
}
SS_PAGING_IND(message_p).sfn = tinfo.sfn;
......@@ -1369,14 +1368,14 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s
*/
static void sys_handle_enquire_timing(ss_set_timinfo_t *tinfo)
{
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT,SS_SET_TIM_INFO);
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0,SS_SET_TIM_INFO);
if (message_p)
{
LOG_A(ENB_SS, "[SYS] Reporting info sfn:%d\t sf:%d.\n", tinfo->sfn, tinfo->sf);
SS_SET_TIM_INFO(message_p).sf = tinfo->sf;
SS_SET_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, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN]");
......@@ -1386,7 +1385,7 @@ static void sys_handle_enquire_timing(ss_set_timinfo_t *tinfo)
static void sys_handle_l1macind_ctrl(struct L1Mac_IndicationControl_Type *L1MacInd_Ctrl)
{
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, SS_L1MACIND_CTRL);
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0, SS_L1MACIND_CTRL);
if (message_p)
{
LOG_A(ENB_SS,"[SYS] l1macind ctrl, prach preamble: %d\n",L1MacInd_Ctrl->RachPreamble.d);
......@@ -1399,7 +1398,7 @@ static void sys_handle_l1macind_ctrl(struct L1Mac_IndicationControl_Type *L1MacI
SS_L1MACIND_CTRL(message_p).rachpreamble_enable = false;
}
}
int send_res = itti_send_msg_to_task(TASK_MAC_ENB, INSTANCE_DEFAULT, message_p);
int send_res = itti_send_msg_to_task(TASK_MAC_ENB, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS, "[SYS] Error sending to MAC");
......@@ -1422,7 +1421,7 @@ static void sys_handle_ue_cat_info_req(struct UE_CategoryInfo_Type *UE_Cat_Info)
enum SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_UE_Cat_Info;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = TRUE;
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, RRC_UE_CAT_INFO);
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0, RRC_UE_CAT_INFO);
if (message_p)
{
LOG_A(ENB_SS,"[SYS] UE Category Info received \n");
......@@ -1477,7 +1476,7 @@ static void sys_handle_ue_cat_info_req(struct UE_CategoryInfo_Type *UE_Cat_Info)
RRC_UE_CAT_INFO(message_p).is_ue_CategoryDL_v1460_present = true;
RRC_UE_CAT_INFO(message_p).ue_CategoryDL_v1460 = UE_Cat_Info->ue_CategoryDL_v1460.v;
}
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, INSTANCE_DEFAULT, message_p);
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, 0, message_p);
if (send_res < 0)
{
LOG_A(ENB_SS, "[SYS] Error sending RRC_UE_CAT_INFO to TASK_RRC_ENB");
......@@ -1996,7 +1995,7 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed)
case SS_VNG_CMD_RESP:
memcpy(&VngResp, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(VngCmdResp_t));
MessageDef *vng_resp_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, SS_VNG_PROXY_RESP);
MessageDef *vng_resp_p = itti_alloc_new_message(TASK_SYS, 0, SS_VNG_PROXY_RESP);
assert(vng_resp_p);
SS_VNG_PROXY_RESP(vng_resp_p).cell_id = VngResp.header.cell_id;
......@@ -2005,7 +2004,7 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed)
LOG_A(ENB_SS, "Sending CMD_RESP for CNF @ sfn: %d sf: %d\n", tinfo.sfn, tinfo.sf);
int res = itti_send_msg_to_task(TASK_VNG, INSTANCE_DEFAULT, vng_resp_p);
int res = itti_send_msg_to_task(TASK_VNG, 0, vng_resp_p);
if (res < 0)
{
LOG_A(ENB_SS, "[SS-VNG] Error in itti_send_msg_to_task\n");
......
......@@ -48,7 +48,7 @@
#include "ss_eNB_sysind_task.h"
extern RAN_CONTEXT_t RC;
SSConfigContext_t SS_context;
extern SSConfigContext_t SS_context;
static acpCtx_t ctx_sysind_g = NULL;
static unsigned char *buffer = NULL;
static const size_t size = 16 * 1024;
......
......@@ -30,7 +30,7 @@
#include "SIDL_EUTRA_VNG_PORT.h"
#include "acpVng.h"
SSConfigContext_t SS_context;
extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC;
static acpCtx_t ctx_vng_g = NULL;
......@@ -112,7 +112,7 @@ static inline void
vng_ss_configure_cell (EUTRA_CellId_Type CellId, Dl_Bandwidth_Type Bandwidth,
int32_t NocLevel, VngProxyCmd_e cmd)
{
MessageDef *message_p = itti_alloc_new_message(TASK_VNG, INSTANCE_DEFAULT, SS_VNG_PROXY_REQ);
MessageDef *message_p = itti_alloc_new_message(TASK_VNG, 0, SS_VNG_PROXY_REQ);
assert(message_p);
SS_VNG_PROXY_REQ(message_p).cell_id = SS_context.cellId;
......@@ -120,7 +120,7 @@ vng_ss_configure_cell (EUTRA_CellId_Type CellId, Dl_Bandwidth_Type Bandwidth,
SS_VNG_PROXY_REQ(message_p).Noc_level = NocLevel;
SS_VNG_PROXY_REQ(message_p).cmd = cmd;
int res = itti_send_msg_to_task(TASK_SYS, INSTANCE_DEFAULT, message_p);
int res = itti_send_msg_to_task(TASK_SYS, 0, message_p);
if (res < 0)
{
LOG_A(ENB_SS, "[SS-VNG] Error in itti_send_msg_to_task\n");
......@@ -241,7 +241,7 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx)
void *ss_eNB_vng_process_itti_msg(void *notUsed)
{
MessageDef *received_msg = NULL;
int result;
itti_poll_msg(TASK_VNG, &received_msg);
/* Check if there is a packet to handle */
......@@ -269,6 +269,9 @@ void *ss_eNB_vng_process_itti_msg(void *notUsed)
LOG_A(ENB_SS, "[VNG] Received unhandled message %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
}
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal(result == EXIT_SUCCESS, "[SYS] Failed to free memory (%d)!\n", result);
received_msg = NULL;
}
ss_eNB_read_from_vng_socket(ctx_vng_g);
......
......@@ -33,7 +33,7 @@
#include "ss_eNB_vt_timer_task.h"
SSConfigContext_t SS_context;
extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC;
......
......@@ -29,9 +29,10 @@
#include "ss_eNB_proxy_iface.h"
#include "SIDL_VIRTUAL_TIME_PORT.h"
#include "acpSysVT.h"
#define MSC_INTERFACE
#include "msc.h"
SSConfigContext_t SS_context;
extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC;
static acpCtx_t ctx_vtp_g = NULL;
......@@ -54,7 +55,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req)
{
// Create and alloc new message
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_VTP, INSTANCE_DEFAULT, UDP_INIT);
message_p = itti_alloc_new_message(TASK_VTP, 0, UDP_INIT);
if (message_p == NULL)
{
return -1;
......@@ -68,7 +69,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req)
"0 UDP bind %s:%u",
UDP_INIT(message_p).address,
UDP_INIT(message_p).port);
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, 0, message_p);
}
//------------------------------------------------------------------------------
// Function to send response to the SIDL client
......@@ -145,18 +146,18 @@ static int vtp_send_udp_msg(
// Create and alloc new message
MessageDef *message_p = NULL;
udp_data_req_t *udp_data_req_p = NULL;
message_p = itti_alloc_new_message(TASK_VTP, INSTANCE_DEFAULT, UDP_DATA_REQ);
message_p = itti_alloc_new_message(TASK_VTP, 0, UDP_DATA_REQ);
if (message_p)
{
LOG_A(ENB_APP, "Sending UDP_DATA_REQ length %u offset %u buffer %d %d %d", buffer_len, buffer_offset, buffer[0], buffer[1], buffer[2]);
LOG_A(ENB_APP, "Sending UDP_DATA_REQ length %u offset %u buffer %d %d %d\n", buffer_len, buffer_offset, buffer[0], buffer[1], buffer[2]);
udp_data_req_p = &message_p->ittiMsg.udp_data_req;
udp_data_req_p->peer_address = peerIpAddr;
udp_data_req_p->peer_port = peerPort;
udp_data_req_p->buffer = buffer;
udp_data_req_p->buffer_length = buffer_len;
udp_data_req_p->buffer_offset = buffer_offset;
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
return itti_send_msg_to_task(TASK_UDP, 0, message_p);
}
else
{
......@@ -196,6 +197,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
//assert(message_p);
VtpCmdReq_t *req = (VtpCmdReq_t *)malloc(sizeof(VtpCmdReq_t));
LOG_A(ENB_APP,"itti_alloc %p\n", req);
req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VTP_RESP;
req->header.length = sizeof(proxy_ss_header_t);
......@@ -204,7 +206,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
req->tinfo.sfn = virtualTime->TimingInfo.SFN.v.Number;
req->tinfo.sf = virtualTime->TimingInfo.Subframe.v.Number;
LOG_A(ENB_APP, "VTP_ACK Command to proxy sent for cell_id: %d SFN %d SF %d",
LOG_A(ENB_APP, "VTP_ACK Command to proxy sent for cell_id: %d SFN %d SF %d\n",
req->header.cell_id,req->tinfo.sfn ,req->tinfo.sf );
vtp_send_proxy((void *)req, sizeof(VtpCmdReq_t));
......@@ -213,7 +215,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
SS_VTP_PROXY_ACK(message_p).tinfo.sfn = virtualTime->TimingInfo.SFN.v.Number;
SS_VTP_PROXY_ACK(message_p).tinfo.sf = virtualTime->TimingInfo.Subframe.v.Number;
int res = itti_send_msg_to_task(TASK_SYS, INSTANCE_DEFAULT, message_p);
int res = itti_send_msg_to_task(TASK_SYS, 0, message_p);
if (res < 0)
{
LOG_E(ENB_APP, "[SS-VTP] Error in itti_send_msg_to_task\n");
......@@ -234,11 +236,14 @@ static inline void ss_enable_vtp()
req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_context.cellId;
/* Initialize with zero */
req->tinfo.sfn = 0;
req->tinfo.sf = 0;
LOG_A(ENB_APP, "VTP_ENABLE Command to proxy sent for cell_id: %d SFN %d SF %d",
req->header.cell_id);
LOG_A(ENB_APP, "VTP_ENABLE Command to proxy sent for cell_id: %d SFN %d SF %d\n",
req->header.cell_id,req->tinfo.sfn ,req->tinfo.sf);
LOG_A(ENB_APP,"VTP_ENABLE Command to proxy sent for cell_id: %d",
LOG_A(ENB_APP,"VTP_ENABLE Command to proxy sent for cell_id: %d\n",
req->header.cell_id );
vtp_send_proxy((void *)req, sizeof(VtpCmdReq_t));
......@@ -246,7 +251,7 @@ static inline void ss_enable_vtp()
SS_VTP_PROXY_ACK(message_p).tinfo.sfn = virtualTime->TimingInfo.SFN.v.Number;
SS_VTP_PROXY_ACK(message_p).tinfo.sf = virtualTime->TimingInfo.Subframe.v.Number;
int res = itti_send_msg_to_task(TASK_SYS, INSTANCE_DEFAULT, message_p);
int res = itti_send_msg_to_task(TASK_SYS, 0, message_p);
if (res < 0)
{
LOG_E(ENB_APP, "[SS-VTP] Error in itti_send_msg_to_task\n");
......
......@@ -44,6 +44,7 @@
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#define MSC_INTERFACE
#include "msc.h"
......@@ -257,7 +258,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP)
forwarded_buffer = itti_malloc(TASK_UDP, udp_sock_pP->task_id, n*sizeof(uint8_t));
DevAssert(forwarded_buffer != NULL);
memcpy(forwarded_buffer, l_buffer, n);
message_p = itti_alloc_new_message(TASK_UDP, INSTANCE_DEFAULT, UDP_DATA_IND);
message_p = itti_alloc_new_message(TASK_UDP, 0, UDP_DATA_IND);
DevAssert(message_p != NULL);
udp_data_ind_p = &message_p->ittiMsg.udp_data_ind;
udp_data_ind_p->buffer = forwarded_buffer;
......@@ -276,7 +277,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP)
* if the queue is full.
*/
/* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */
if (itti_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) {
if (itti_send_msg_to_task(udp_sock_pP->task_id, 0, message_p) < 0) {
LOG_E(UDP_, "Failed to send message %d to task %d\n",
UDP_DATA_IND,
udp_sock_pP->task_id);
......
......@@ -263,13 +263,13 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
//#ifdef ENB_SS
if (RC.ss.mode >= SS_SOFTMODEM)
{
MessageDef *message_p = itti_alloc_new_message(TASK_SYS, INSTANCE_DEFAULT, SS_UPD_TIM_INFO);
MessageDef *message_p = itti_alloc_new_message(TASK_ENB_APP, 0, SS_UPD_TIM_INFO);
if (message_p)
{
SS_UPD_TIM_INFO(message_p).sf = eNB->UL_INFO.subframe;
SS_UPD_TIM_INFO(message_p).sfn = eNB->UL_INFO.frame;
int send_res = itti_send_msg_to_task(TASK_SYS, INSTANCE_DEFAULT, message_p);
int send_res = itti_send_msg_to_task(TASK_SYS, 0, message_p);
if (send_res < 0)
{
printf("Error in itti_send_msg_to_task");
......@@ -278,12 +278,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
LOG_D(PHY, "[SS] SS_UPD_TIM_INFO from L1_Thread to SYS task itti_send_msg_to_task sfn %d sf %d",
eNB->UL_INFO.subframe, eNB->UL_INFO.frame); /** TODO: Need separate logging for SS */
}
MessageDef *message_p_vtp = itti_alloc_new_message(TASK_VTP, INSTANCE_DEFAULT, SS_UPD_TIM_INFO);
MessageDef *message_p_vtp = itti_alloc_new_message(TASK_ENB_APP, 0, SS_UPD_TIM_INFO);
if (message_p_vtp && RC.ss.vtp_ready)
{
SS_UPD_TIM_INFO(message_p_vtp).sf = eNB->UL_INFO.subframe;
SS_UPD_TIM_INFO(message_p_vtp).sfn = eNB->UL_INFO.frame;
int send_res = itti_send_msg_to_task(TASK_VTP, INSTANCE_DEFAULT, message_p_vtp);
int send_res = itti_send_msg_to_task(TASK_VTP, 0, message_p_vtp);
if (send_res < 0)
{
printf("Error in itti_send_msg_to_task");
......@@ -292,12 +292,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
LOG_A(PHY, "[SS] SS_UPD_TIM_INFO from L1_Thread to VTP task itti_send_msg_to_task sfn %d sf %d",
eNB->UL_INFO.subframe, eNB->UL_INFO.frame); /** TODO: Need separate logging for SS */
}
MessageDef *message_p_vt_timer = itti_alloc_new_message(TASK_VT_TIMER, INSTANCE_DEFAULT, SS_UPD_TIM_INFO);
MessageDef *message_p_vt_timer = itti_alloc_new_message(TASK_ENB_APP, 0, SS_UPD_TIM_INFO);
if (message_p_vt_timer)
{
SS_UPD_TIM_INFO(message_p_vt_timer).sf = eNB->UL_INFO.subframe;
SS_UPD_TIM_INFO(message_p_vt_timer).sfn = eNB->UL_INFO.frame;
int send_res = itti_send_msg_to_task(TASK_VT_TIMER, INSTANCE_DEFAULT, message_p_vt_timer);
int send_res = itti_send_msg_to_task(TASK_VT_TIMER, 0, message_p_vt_timer);
if (send_res < 0)
{
printf("Error in itti_send_msg_to_task");
......
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