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( ...@@ -112,7 +112,12 @@ void msc_log_message(
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded #define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
#ifdef MSC_INTERFACE
extern msc_interface_t msc_interface;
#else
msc_interface_t msc_interface; msc_interface_t msc_interface;
#endif
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2) #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_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end #define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#define SS_VTP_PROXY_UPD(mSGpTR) (mSGpTR)->ittiMsg.ss_vtp_proxy_upd #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_VTP_PROXY_ACK(mSGpTR) (mSGpTR)->ittiMsg.ss_vtp_proxy_ack
#define SS_VT_TIME_OUT(mSGpTR) (mSGpTR)->ittiMsg.ss_vt_time_out #define SS_VT_TIME_OUT(mSGpTR) (mSGpTR)->ittiMsg.ss_vt_time_out
#define SDU_SIZE (512) #define SDU_SIZE (1024)
/** SYS IND */ /** SYS IND */
#define SS_SYSTEM_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_system_ind #define SS_SYSTEM_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_system_ind
...@@ -192,6 +192,8 @@ typedef struct ss_drb_pdu_ind_s { ...@@ -192,6 +192,8 @@ typedef struct ss_drb_pdu_ind_s {
uint8_t drb_id; uint8_t drb_id;
uint32_t sdu_size; uint32_t sdu_size;
uint8_t sdu[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; } ss_drb_pdu_ind_t;
typedef enum carrierBandwidthEUTRA_dl_Bandwidth_e { typedef enum carrierBandwidthEUTRA_dl_Bandwidth_e {
......
...@@ -1631,7 +1631,7 @@ schedule_ulsch_rnti(module_id_t module_idP, ...@@ -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 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){ if (RC.ss.mode == SS_SOFTMODEM){
UE_template_ptr->pre_assigned_mcs_ul = 16; UE_template_ptr->pre_assigned_mcs_ul = 16;
} }
......
...@@ -1049,30 +1049,54 @@ pdcp_data_ind( ...@@ -1049,30 +1049,54 @@ pdcp_data_ind(
* from its second byte (skipping 0th and 1st octets, i.e. * from its second byte (skipping 0th and 1st octets, i.e.
* PDCP header) * PDCP header)
*/ */
if (RC.ss.mode >= SS_SOFTMODEM) {
if (LINK_ENB_PDCP_TO_GTPV1U) {
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) { 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, ctxt_pP->rnti,
rb_id + 4, rb_id,
sdu_buffer_sizeP - payload_offset ); 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, MessageDef *message_p = itti_alloc_new_message (TASK_SS_DRB, 0, SS_DRB_PDU_IND);
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX); if (message_p) {
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY"); /* Populate the message to SS */
memcpy(&gtpu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset); SS_DRB_PDU_IND (message_p).sdu_size = sdu_buffer_sizeP - payload_offset;
message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, GTPV1U_ENB_TUNNEL_DATA_REQ); SS_DRB_PDU_IND (message_p).drb_id = rb_id;
AssertFatal(message_p != NULL, "OUT OF MEMORY"); memset(SS_DRB_PDU_IND (message_p).sdu, 0, SS_DRB_PDU_IND (message_p).sdu_size);
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p; memcpy(&SS_DRB_PDU_IND (message_p).sdu, &sdu_buffer_pP->data[payload_offset], SS_DRB_PDU_IND (message_p).sdu_size);
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset; SS_DRB_PDU_IND (message_p).frame = ctxt_pP->frame;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; SS_DRB_PDU_IND (message_p).subframe = ctxt_pP->subframe;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4; int send_res = itti_send_msg_to_task (TASK_SS_DRB, INSTANCE_DEFAULT, message_p);
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); if(send_res < 0) {
packet_forwarded = TRUE; LOG_E(RRC,"Error in itti_send_msg_to_task");
}
}
} }
} else { } 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 #ifdef MBMS_MULTICAST_OUT
...@@ -1396,7 +1420,7 @@ pdcp_run ( ...@@ -1396,7 +1420,7 @@ pdcp_run (
break; 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; SS_GET_PDCP_CNT(message_p).size = 0;
......
...@@ -343,7 +343,7 @@ mac_rrc_data_ind( ...@@ -343,7 +343,7 @@ mac_rrc_data_ind(
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE) if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE)
{ {
LOG_I(RRC,"RRC Sending CCCH PDU_IND to SS \n"); 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) { if (message_p) {
/* Populate the message to SS */ /* Populate the message to SS */
SS_RRC_PDU_IND (message_p).sdu_size = sdu_lenP; SS_RRC_PDU_IND (message_p).sdu_size = sdu_lenP;
...@@ -354,7 +354,7 @@ mac_rrc_data_ind( ...@@ -354,7 +354,7 @@ mac_rrc_data_ind(
memset (SS_RRC_PDU_IND (message_p).sdu, 0, SDU_SIZE); memset (SS_RRC_PDU_IND (message_p).sdu, 0, SDU_SIZE);
memcpy (SS_RRC_PDU_IND (message_p).sdu, sduP, sdu_lenP); 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) { if(send_res < 0) {
LOG_E(RRC,"Error in itti_send_msg_to_task"); LOG_E(RRC,"Error in itti_send_msg_to_task");
} }
......
...@@ -125,7 +125,7 @@ rrc_data_ind( ...@@ -125,7 +125,7 @@ rrc_data_ind(
if (RC.ss.mode >= SS_SOFTMODEM && RC.ss.State >= SS_STATE_CELL_ACTIVE) 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"); 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) { if (message_p) {
/* Populate the message and send to SS */ /* Populate the message and send to SS */
SS_RRC_PDU_IND (message_p).sdu_size = sdu_sizeP; SS_RRC_PDU_IND (message_p).sdu_size = sdu_sizeP;
...@@ -136,7 +136,7 @@ rrc_data_ind( ...@@ -136,7 +136,7 @@ rrc_data_ind(
memset (SS_RRC_PDU_IND (message_p).sdu, 0, CCCH_SDU_SIZE); memset (SS_RRC_PDU_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
memcpy (SS_RRC_PDU_IND (message_p).sdu, buffer_pP, sdu_sizeP); 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) { if(send_res < 0) {
LOG_E(RRC,"Error in itti_send_msg_to_task"); LOG_E(RRC,"Error in itti_send_msg_to_task");
} }
......
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
#include "SIMULATION/TOOLS/sim.h" // for taus #include "SIMULATION/TOOLS/sim.h" // for taus
bool RRCConnSetup_PDU_Present = false; bool RRCConnSetup_PDU_Present = false;
uint8_t RRCConnSetup_PDUSize = 0; uint8_t RRCMsgOnSRB0_PDUSize = 0;
uint8_t RRCConnSetup_PDU[100]; uint8_t RRCMsgOnSRB0_PDU[1024];
#define ASN_MAX_ENCODE_SIZE 4096 #define ASN_MAX_ENCODE_SIZE 4096
#define NUMBEROF_DRBS_TOBE_ADDED 1 #define NUMBEROF_DRBS_TOBE_ADDED 1
...@@ -1530,6 +1530,13 @@ rrc_eNB_generate_RRCConnectionReject( ...@@ -1530,6 +1530,13 @@ rrc_eNB_generate_RRCConnectionReject(
ue_p->Srb0.Tx_buffer.payload_size = ue_p->Srb0.Tx_buffer.payload_size =
do_RRCConnectionReject(ctxt_pP->module_id, do_RRCConnectionReject(ctxt_pP->module_id,
(uint8_t *) ue_p->Srb0.Tx_buffer.Payload); (uint8_t *) ue_p->Srb0.Tx_buffer.Payload);
if((RC.ss.mode != SS_ENB) && (RRCMsgOnSRB0_PDUSize > 0)) {
memcpy(ue_p->Srb0.Tx_buffer.Payload,RRCMsgOnSRB0_PDU,RRCMsgOnSRB0_PDUSize);
LOG_A(RRC,"RRC CCCH PDU overwritten , size: %d \n",RRCMsgOnSRB0_PDUSize);
ue_p->Srb0.Tx_buffer.payload_size= RRCMsgOnSRB0_PDUSize;
}
LOG_DUMPMSG(RRC,DEBUG_RRC, LOG_DUMPMSG(RRC,DEBUG_RRC,
(char *)(ue_p->Srb0.Tx_buffer.Payload), (char *)(ue_p->Srb0.Tx_buffer.Payload),
ue_p->Srb0.Tx_buffer.payload_size, ue_p->Srb0.Tx_buffer.payload_size,
...@@ -3777,33 +3784,35 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t ...@@ -3777,33 +3784,35 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 || measurements_enabled = RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_x2 ||
RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports; RC.rrc[ENB_INSTANCE_TO_MODULE_ID(ctxt_pP->instance)]->configuration.enable_measurement_reports;
memset(buffer, 0, sizeof(buffer)); if (RC.ss.mode == SS_ENB) {
size = do_RRCConnectionReconfiguration(ctxt_pP, memset(buffer, 0, sizeof(buffer));
buffer, size = do_RRCConnectionReconfiguration(ctxt_pP,
sizeof(buffer), buffer,
xid, // Transaction_id, sizeof(buffer),
(LTE_SRB_ToAddModList_t *) *SRB_configList2, // SRB_configList xid, // Transaction_id,
(LTE_DRB_ToAddModList_t *) *DRB_configList, (LTE_SRB_ToAddModList_t *) *SRB_configList2, // SRB_configList
(LTE_DRB_ToReleaseList_t *) NULL, // DRB2_list, (LTE_DRB_ToAddModList_t *) *DRB_configList,
(struct LTE_SPS_Config *) NULL, // *sps_Config, (LTE_DRB_ToReleaseList_t *) NULL, // DRB2_list,
(struct LTE_PhysicalConfigDedicated *) *physicalConfigDedicated, (struct LTE_SPS_Config *) NULL, // *sps_Config,
measurements_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL, (struct LTE_PhysicalConfigDedicated *) *physicalConfigDedicated,
measurements_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL, measurements_enabled ? (LTE_MeasObjectToAddModList_t *) MeasObj_list : NULL,
measurements_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL, measurements_enabled ? (LTE_ReportConfigToAddModList_t *) ReportConfig_list : NULL,
measurements_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL, measurements_enabled ? (LTE_QuantityConfig_t *) quantityConfig : NULL,
(LTE_MAC_MainConfig_t *) mac_MainConfig, measurements_enabled ? (LTE_MeasIdToAddModList_t *) MeasId_list : NULL,
(LTE_MeasGapConfig_t *) NULL, (LTE_MAC_MainConfig_t *) mac_MainConfig,
(LTE_MobilityControlInfo_t *) NULL, (LTE_MeasGapConfig_t *) NULL,
(LTE_SecurityConfigHO_t *) NULL, (LTE_MobilityControlInfo_t *) NULL,
(struct LTE_MeasConfig__speedStatePars *) Sparams, (LTE_SecurityConfigHO_t *) NULL,
(LTE_RSRP_Range_t *) rsrp, (struct LTE_MeasConfig__speedStatePars *) Sparams,
(LTE_C_RNTI_t *) cba_RNTI, (LTE_RSRP_Range_t *) rsrp,
(struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *) dedicatedInfoNASList, (LTE_C_RNTI_t *) cba_RNTI,
(LTE_SL_CommConfig_r12_t *) NULL, (struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *) dedicatedInfoNASList,
(LTE_SL_DiscConfig_r12_t *) NULL, (LTE_SL_CommConfig_r12_t *) NULL,
(LTE_SCellToAddMod_r10_t *) NULL (LTE_SL_DiscConfig_r12_t *) NULL,
); (LTE_SCellToAddMod_r10_t *) NULL
LOG_DUMPMSG(RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Connection Reconfiguration\n"); );
LOG_DUMPMSG(RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Connection Reconfiguration\n");
}
/* Free all NAS PDUs */ /* Free all NAS PDUs */
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) { for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
...@@ -7055,13 +7064,12 @@ rrc_eNB_generate_RRCConnectionSetup( ...@@ -7055,13 +7064,12 @@ rrc_eNB_generate_RRCConnectionSetup(
0,//rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), 0,//rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
SRB_configList, SRB_configList,
&ue_context_pP->ue_context.physicalConfigDedicated); &ue_context_pP->ue_context.physicalConfigDedicated);
if((RRCConnSetup_PDU_Present == true) && (RRCConnSetup_PDUSize > 0))
if((RC.ss.mode != SS_ENB) && (RRCConnSetup_PDU_Present == true) && (RRCConnSetup_PDUSize > 0)) if((RC.ss.mode != SS_ENB) && (RRCConnSetup_PDU_Present == true) && (RRCMsgOnSRB0_PDUSize > 0))
{ {
memcpy(ue_p->Srb0.Tx_buffer.Payload,RRCConnSetup_PDU,RRCConnSetup_PDUSize); memcpy(ue_p->Srb0.Tx_buffer.Payload,RRCMsgOnSRB0_PDU,RRCMsgOnSRB0_PDUSize);
LOG_A(RRC,"RRC CCCH PDU overwritten , size: %d \n",RRCConnSetup_PDUSize); LOG_A(RRC,"RRC CCCH PDU overwritten , size: %d \n",RRCMsgOnSRB0_PDUSize);
ue_p->Srb0.Tx_buffer.payload_size= RRCConnSetup_PDUSize; ue_p->Srb0.Tx_buffer.payload_size= RRCMsgOnSRB0_PDUSize;
} }
} }
...@@ -7290,8 +7298,8 @@ char openair_rrc_eNB_configuration( ...@@ -7290,8 +7298,8 @@ char openair_rrc_eNB_configuration(
LOG_D(RRC,"Update config from TTCN RRCConnSetup_PDU_Present %d \n",RRCConnSetup_PDU_Present); LOG_D(RRC,"Update config from TTCN RRCConnSetup_PDU_Present %d \n",RRCConnSetup_PDU_Present);
if(RRCConnSetup_PDU_Present == true) if(RRCConnSetup_PDU_Present == true)
{ {
RRCConnSetup_PDUSize = configuration->RlcPduCCCH_Size; RRCMsgOnSRB0_PDUSize = configuration->RlcPduCCCH_Size;
memcpy(RRCConnSetup_PDU,configuration->RlcPduCCCH,RRCConnSetup_PDUSize); memcpy(RRCMsgOnSRB0_PDU,configuration->RlcPduCCCH,RRCMsgOnSRB0_PDUSize);
} }
} }
/* /*
...@@ -8144,9 +8152,9 @@ rrc_eNB_decode_ccch( ...@@ -8144,9 +8152,9 @@ rrc_eNB_decode_ccch(
if ((RC.ss.mode == SS_ENB) || (true == RRCConnSetup_PDU_Present)) if ((RC.ss.mode == SS_ENB) || (true == RRCConnSetup_PDU_Present))
{ {
rrc_eNB_generate_RRCConnectionSetup(ctxt_pP, ue_context_p, CC_id); rrc_eNB_generate_RRCConnectionSetup(ctxt_pP, ue_context_p, CC_id);
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT "CALLING RLC CONFIG SRB1 (rbid %d)\n", LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT "CALLING RLC CONFIG SRB1 (rbid %d),RRCConnSetup_PDU_Present: %d \n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
Idx); Idx,RRCConnSetup_PDU_Present);
rrc_pdcp_config_asn1_req(ctxt_pP, rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList, ue_context_p->ue_context.SRB_configList,
(LTE_DRB_ToAddModList_t *)NULL, (LTE_DRB_ToAddModList_t *)NULL,
...@@ -10030,14 +10038,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) { ...@@ -10030,14 +10038,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
RRC_DCCH_DATA_IND(msg_p).dcch_index, RRC_DCCH_DATA_IND(msg_p).dcch_index,
RRC_DCCH_DATA_IND(msg_p).sdu_p, RRC_DCCH_DATA_IND(msg_p).sdu_p,
RRC_DCCH_DATA_IND(msg_p).sdu_size); RRC_DCCH_DATA_IND(msg_p).sdu_size);
// Message buffer has been processed, free it now.
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND(msg_p).sdu_p);
if (result != EXIT_SUCCESS) {
LOG_I(RRC, "Failed to free memory (%d)!\n",result);
break;
}
break; break;
/* Messages from S1AP */ /* Messages from S1AP */
...@@ -10444,6 +10444,7 @@ void *rrc_enb_process_itti_msg(void *notUsed) { ...@@ -10444,6 +10444,7 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
else else
{ {
struct rrc_eNB_ue_context_s *ue_context_pP = NULL; struct rrc_eNB_ue_context_s *ue_context_pP = NULL;
LTE_DL_CCCH_Message_t *dl_ccch_msg=NULL;
ue_context_pP = rrc_eNB_get_ue_context(RC.rrc[instance], SS_RRC_PDU_REQ(msg_p).rnti); ue_context_pP = rrc_eNB_get_ue_context(RC.rrc[instance], SS_RRC_PDU_REQ(msg_p).rnti);
LOG_A(RRC, "Genreating RRC-CS from TTCN message RRC_PDU_REQ\n"); LOG_A(RRC, "Genreating RRC-CS from TTCN message RRC_PDU_REQ\n");
module_id_t Idx; module_id_t Idx;
...@@ -10451,9 +10452,16 @@ void *rrc_enb_process_itti_msg(void *notUsed) { ...@@ -10451,9 +10452,16 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
ctxt.module_id, msg_p->ittiMsgHeader.lte_time.frame, instance); ctxt.module_id, msg_p->ittiMsgHeader.lte_time.frame, instance);
eNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; eNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
RRCConnSetup_PDU_Present = true; uper_decode(NULL,
RRCConnSetup_PDUSize = SS_RRC_PDU_REQ(msg_p).sdu_size; &asn_DEF_LTE_DL_CCCH_Message,
memcpy(RRCConnSetup_PDU, SS_RRC_PDU_REQ(msg_p).sdu, SS_RRC_PDU_REQ(msg_p).sdu_size); (void **)&dl_ccch_msg,
(uint8_t *)SS_RRC_PDU_REQ(msg_p).sdu,
SS_RRC_PDU_REQ(msg_p).sdu_size,0,0);
xer_fprint(stdout,&asn_DEF_LTE_DL_CCCH_Message,(void *)dl_ccch_msg);
RRCMsgOnSRB0_PDUSize = SS_RRC_PDU_REQ(msg_p).sdu_size;
memcpy(RRCMsgOnSRB0_PDU, SS_RRC_PDU_REQ(msg_p).sdu, SS_RRC_PDU_REQ(msg_p).sdu_size);
Idx = DCCH; Idx = DCCH;
// SRB1 // SRB1
...@@ -10475,28 +10483,32 @@ void *rrc_enb_process_itti_msg(void *notUsed) { ...@@ -10475,28 +10483,32 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
&DCCH_LCHAN_DESC, &DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE); LCHAN_DESC_SIZE);
rrc_eNB_generate_RRCConnectionSetup(&ctxt, ue_context_pP, 0); if (dl_ccch_msg->message.choice.c1.present == LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionSetup) {
RRCConnSetup_PDU_Present = true;
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT "CALLING RLC CONFIG SRB1 (rbid %d)\n", rrc_eNB_generate_RRCConnectionSetup(&ctxt, ue_context_pP, 0);
PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt),
Idx); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT "CALLING RLC CONFIG SRB1 (rbid %d)\n",
rrc_pdcp_config_asn1_req(&ctxt, PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt),
ue_context_pP->ue_context.SRB_configList, Idx);
(LTE_DRB_ToAddModList_t *)NULL, rrc_pdcp_config_asn1_req(&ctxt,
(LTE_DRB_ToReleaseList_t *)NULL, ue_context_pP->ue_context.SRB_configList,
0xff, (LTE_DRB_ToAddModList_t *)NULL,
NULL, (LTE_DRB_ToReleaseList_t *)NULL,
NULL, 0xff,
NULL, NULL,
(LTE_PMCH_InfoList_r9_t *)NULL, NULL); NULL,
NULL,
if (!NODE_IS_CU(RC.rrc[ctxt.module_id]->node_type)) (LTE_PMCH_InfoList_r9_t *)NULL, NULL);
{
rrc_rlc_config_asn1_req(&ctxt, if (!NODE_IS_CU(RC.rrc[ctxt.module_id]->node_type)) {
ue_context_pP->ue_context.SRB_configList, rrc_rlc_config_asn1_req(&ctxt,
(LTE_DRB_ToAddModList_t *)NULL, ue_context_pP->ue_context.SRB_configList,
(LTE_DRB_ToReleaseList_t *)NULL, (LTE_DRB_ToAddModList_t *)NULL,
(LTE_PMCH_InfoList_r9_t *)NULL, 0, 0); (LTE_DRB_ToReleaseList_t *)NULL,
(LTE_PMCH_InfoList_r9_t *)NULL, 0, 0);
}
} else if (dl_ccch_msg->message.choice.c1.present == LTE_DL_CCCH_MessageType__c1_PR_rrcConnectionReject) {
rrc_eNB_generate_RRCConnectionReject(&ctxt, ue_context_pP, 0);
} }
} }
#endif #endif
......
...@@ -79,6 +79,8 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out) ...@@ -79,6 +79,8 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
DevAssert(out != NULL); DevAssert(out != NULL);
n = ( stream_cipher->blength + 31 ) / 32; n = ( stream_cipher->blength + 31 ) / 32;
int actual_buf_size = stream_cipher->blength >> 3;
zero_bit = stream_cipher->blength & 0x7; zero_bit = stream_cipher->blength & 0x7;
memset(&snow_3g_context, 0, sizeof(snow_3g_context)); 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) ...@@ -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 /* Exclusive-OR the input data with keystream to generate the output bit
stream */ 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); stream_cipher->message[i] ^= *(((uint8_t*)KS)+i);
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
extern uint16_t ss_rnti_g; extern uint16_t ss_rnti_g;
static acpCtx_t ctx_drb_g = NULL; static acpCtx_t ctx_drb_g = NULL;
SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
static unsigned char *buffer = NULL; static unsigned char *buffer = NULL;
static const size_t size = 16 * 1024; static const size_t size = 16 * 1024;
...@@ -90,13 +90,13 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){ ...@@ -90,13 +90,13 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
//Populated the Timing Info //Populated the Timing Info
ind.Common.TimingInfo.d = TimingInfo_Type_SubFrame; ind.Common.TimingInfo.d = TimingInfo_Type_SubFrame;
ind.Common.TimingInfo.v.SubFrame.SFN.d = SystemFrameNumberInfo_Type_Number; 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.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.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.d = SlotTimingInfo_Type_Any;
ind.Common.TimingInfo.v.SubFrame.Slot.v.Any = true; 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){ ...@@ -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.NoOfTTIs = 1;
ind.U_Plane.SubframeData.PduSduList.d = L2DataList_Type_PdcpSdu; ind.U_Plane.SubframeData.PduSduList.d = L2DataList_Type_PdcpSdu;
ind.U_Plane.SubframeData.PduSduList.v.PdcpSdu.d = 1; 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++){ 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); 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); 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){ ...@@ -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) static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req)
{ {
assert(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); assert(message_p);
if (message_p) if (message_p)
{ {
...@@ -157,7 +159,7 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req) ...@@ -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"); 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++){ 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; 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); 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) ...@@ -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){ ss_eNB_read_from_drb_socket(acpCtx_t ctx){
size_t msgSize = size; //2 size_t msgSize = size; //2
......
...@@ -360,7 +360,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx) ...@@ -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) 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"); 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) if (message_p)
{ {
/* Populate the message to SS */ /* Populate the message to SS */
...@@ -370,7 +370,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx) ...@@ -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).frame = -1;
SS_RRC_PDU_IND(message_p).subframe = -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) if (send_res < 0)
{ {
LOG_A(ENB_SS, "Error in itti_send_msg_to_task"); 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) ...@@ -388,12 +388,12 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
if (userId == MSG_SysProcess_userId) 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) if (message_p)
{ {
SS_SYS_PORT_MSG_IND(message_p).req = req; SS_SYS_PORT_MSG_IND(message_p).req = req;
SS_SYS_PORT_MSG_IND(message_p).userId = userId; 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) ...@@ -208,7 +208,7 @@ static void ss_task_handle_rrc_pdu_req(struct EUTRA_RRC_PDU_REQ *req)
assert(req); assert(req);
LTE_DL_DCCH_Message_t *dl_dcch_msg=NULL; LTE_DL_DCCH_Message_t *dl_dcch_msg=NULL;
LTE_DL_CCCH_Message_t *dl_ccch_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); assert(message_p);
instance_g = 0; instance_g = 0;
if (message_p) if (message_p)
...@@ -456,7 +456,8 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed) ...@@ -456,7 +456,8 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed)
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg); result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}; received_msg = NULL;
}
break; break;
case TERMINATE_MESSAGE: case TERMINATE_MESSAGE:
...@@ -529,4 +530,4 @@ void *ss_eNB_srb_acp_task(void *arg) ...@@ -529,4 +530,4 @@ void *ss_eNB_srb_acp_task(void *arg)
ss_eNB_read_from_srb_socket(ctx_srb_g); ss_eNB_read_from_srb_socket(ctx_srb_g);
} }
acpFree(buffer); acpFree(buffer);
} }
\ No newline at end of file
...@@ -190,7 +190,7 @@ static int sys_send_udp_msg( ...@@ -190,7 +190,7 @@ static int sys_send_udp_msg(
// Create and alloc new message // Create and alloc new message
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
udp_data_req_t *udp_data_req_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) if (message_p)
{ {
...@@ -201,7 +201,7 @@ static int sys_send_udp_msg( ...@@ -201,7 +201,7 @@ 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;
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); return itti_send_msg_to_task(TASK_UDP, 0, message_p);
} }
else else
{ {
...@@ -219,7 +219,7 @@ static int sys_send_init_udp(const udpSockReq_t *req) ...@@ -219,7 +219,7 @@ static int sys_send_init_udp(const udpSockReq_t *req)
{ {
// Create and alloc new message // Create and alloc new message
MessageDef *message_p; 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) if (message_p == NULL)
{ {
return -1; return -1;
...@@ -233,7 +233,7 @@ static int sys_send_init_udp(const udpSockReq_t *req) ...@@ -233,7 +233,7 @@ static int sys_send_init_udp(const udpSockReq_t *req)
"0 UDP bind %s:%u", "0 UDP bind %s:%u",
UDP_INIT(message_p).address, UDP_INIT(message_p).address,
UDP_INIT(message_p).port); 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) ...@@ -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) 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) if (message_p)
{ {
LOG_A(ENB_SS, "[SYS] Reporting info sfn:%d\t sf:%d.\n", tinfo->sfn, tinfo->sf); 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).sf = tinfo->sf;
SS_SET_TIM_INFO(message_p).sfn = tinfo->sfn; 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) if (send_res < 0)
{ {
LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN] \n"); LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN] \n");
...@@ -287,11 +287,10 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure) ...@@ -287,11 +287,10 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure)
uint8_t num_CC = 0; /** NOTE: Handling only one cell */ uint8_t num_CC = 0; /** NOTE: Handling only one cell */
for (int enb_id = 0; enb_id < RC.nb_inst; enb_id++) 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) 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) if (AddOrReconfigure->Basic.v.StaticCellInfo.d == true)
{ {
/** Handle Static Cell Info */ /** Handle Static Cell Info */
...@@ -561,7 +560,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType, ...@@ -561,7 +560,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType,
void *msg) void *msg)
{ {
struct SYSTEM_CTRL_CNF *msgCnf = CALLOC(1, sizeof(struct SYSTEM_CTRL_CNF)); 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 */ /* The request has send confirm flag flase so do nothing in this funciton */
if (reqCnfFlag_g == FALSE) if (reqCnfFlag_g == FALSE)
...@@ -625,7 +624,7 @@ static void send_sys_cnf(enum ConfirmationResult_Type_Sel resType, ...@@ -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"); LOG_A(ENB_SS, "[SYS] Error not handled CNF TYPE to [SS-PORTMAN] \n");
} }
SS_SYS_PORT_MSG_CNF(message_p).cnf = msgCnf; 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) if (send_res < 0)
{ {
LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN] \n"); 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 ...@@ -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); MessageDef *message_p = itti_alloc_new_message(TASK_SYS, 0,SS_SS_PAGING_IND);
if (message_p == NULL) if (message_p == NULL)
{ {
return -1; return;
} }
SS_PAGING_IND(message_p).sfn = tinfo.sfn; SS_PAGING_IND(message_p).sfn = tinfo.sfn;
...@@ -1369,14 +1368,14 @@ static void sys_handle_paging_req(struct PagingTrigger_Type *pagingRequest, ss_s ...@@ -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) 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) if (message_p)
{ {
LOG_A(ENB_SS, "[SYS] Reporting info sfn:%d\t sf:%d.\n", tinfo->sfn, tinfo->sf); 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).sf = tinfo->sf;
SS_SET_TIM_INFO(message_p).sfn = tinfo->sfn; 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) if (send_res < 0)
{ {
LOG_A(ENB_SS, "[SYS] Error sending to [SS-PORTMAN]"); 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) ...@@ -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) 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) if (message_p)
{ {
LOG_A(ENB_SS,"[SYS] l1macind ctrl, prach preamble: %d\n",L1MacInd_Ctrl->RachPreamble.d); 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 ...@@ -1399,7 +1398,7 @@ static void sys_handle_l1macind_ctrl(struct L1Mac_IndicationControl_Type *L1MacI
SS_L1MACIND_CTRL(message_p).rachpreamble_enable = false; 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) if (send_res < 0)
{ {
LOG_A(ENB_SS, "[SYS] Error sending to MAC"); 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) ...@@ -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 SystemConfirm_Type_Sel cnfType = SystemConfirm_Type_UE_Cat_Info;
enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success; enum ConfirmationResult_Type_Sel resType = ConfirmationResult_Type_Success;
bool resVal = TRUE; 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) if (message_p)
{ {
LOG_A(ENB_SS,"[SYS] UE Category Info received \n"); 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) ...@@ -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).is_ue_CategoryDL_v1460_present = true;
RRC_UE_CAT_INFO(message_p).ue_CategoryDL_v1460 = UE_Cat_Info->ue_CategoryDL_v1460.v; 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) if (send_res < 0)
{ {
LOG_A(ENB_SS, "[SYS] Error sending RRC_UE_CAT_INFO to TASK_RRC_ENB"); 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) ...@@ -1996,7 +1995,7 @@ void *ss_eNB_sys_process_itti_msg(void *notUsed)
case SS_VNG_CMD_RESP: case SS_VNG_CMD_RESP:
memcpy(&VngResp, (SS_SYS_PROXY_MSG_CNF(received_msg).buffer), sizeof(VngCmdResp_t)); 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); assert(vng_resp_p);
SS_VNG_PROXY_RESP(vng_resp_p).cell_id = VngResp.header.cell_id; 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) ...@@ -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); 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) if (res < 0)
{ {
LOG_A(ENB_SS, "[SS-VNG] Error in itti_send_msg_to_task\n"); LOG_A(ENB_SS, "[SS-VNG] Error in itti_send_msg_to_task\n");
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#include "ss_eNB_sysind_task.h" #include "ss_eNB_sysind_task.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
static acpCtx_t ctx_sysind_g = NULL; static acpCtx_t ctx_sysind_g = NULL;
static unsigned char *buffer = NULL; static unsigned char *buffer = NULL;
static const size_t size = 16 * 1024; static const size_t size = 16 * 1024;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "SIDL_EUTRA_VNG_PORT.h" #include "SIDL_EUTRA_VNG_PORT.h"
#include "acpVng.h" #include "acpVng.h"
SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
static acpCtx_t ctx_vng_g = NULL; static acpCtx_t ctx_vng_g = NULL;
...@@ -112,7 +112,7 @@ static inline void ...@@ -112,7 +112,7 @@ static inline void
vng_ss_configure_cell (EUTRA_CellId_Type CellId, Dl_Bandwidth_Type Bandwidth, vng_ss_configure_cell (EUTRA_CellId_Type CellId, Dl_Bandwidth_Type Bandwidth,
int32_t NocLevel, VngProxyCmd_e cmd) 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); assert(message_p);
SS_VNG_PROXY_REQ(message_p).cell_id = SS_context.cellId; 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, ...@@ -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).Noc_level = NocLevel;
SS_VNG_PROXY_REQ(message_p).cmd = cmd; 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) if (res < 0)
{ {
LOG_A(ENB_SS, "[SS-VNG] Error in itti_send_msg_to_task\n"); 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) ...@@ -241,7 +241,7 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx)
void *ss_eNB_vng_process_itti_msg(void *notUsed) void *ss_eNB_vng_process_itti_msg(void *notUsed)
{ {
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result;
itti_poll_msg(TASK_VNG, &received_msg); itti_poll_msg(TASK_VNG, &received_msg);
/* Check if there is a packet to handle */ /* Check if there is a packet to handle */
...@@ -269,6 +269,9 @@ void *ss_eNB_vng_process_itti_msg(void *notUsed) ...@@ -269,6 +269,9 @@ void *ss_eNB_vng_process_itti_msg(void *notUsed)
LOG_A(ENB_SS, "[VNG] Received unhandled message %d:%s\n", LOG_A(ENB_SS, "[VNG] 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);
AssertFatal(result == EXIT_SUCCESS, "[SYS] Failed to free memory (%d)!\n", result);
received_msg = NULL;
} }
ss_eNB_read_from_vng_socket(ctx_vng_g); ss_eNB_read_from_vng_socket(ctx_vng_g);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "ss_eNB_vt_timer_task.h" #include "ss_eNB_vt_timer_task.h"
SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
......
...@@ -29,9 +29,10 @@ ...@@ -29,9 +29,10 @@
#include "ss_eNB_proxy_iface.h" #include "ss_eNB_proxy_iface.h"
#include "SIDL_VIRTUAL_TIME_PORT.h" #include "SIDL_VIRTUAL_TIME_PORT.h"
#include "acpSysVT.h" #include "acpSysVT.h"
#define MSC_INTERFACE
#include "msc.h" #include "msc.h"
SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
static acpCtx_t ctx_vtp_g = NULL; static acpCtx_t ctx_vtp_g = NULL;
...@@ -54,7 +55,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req) ...@@ -54,7 +55,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req)
{ {
// Create and alloc new message // Create and alloc new message
MessageDef *message_p; 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) if (message_p == NULL)
{ {
return -1; return -1;
...@@ -68,7 +69,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req) ...@@ -68,7 +69,7 @@ static int vtp_send_init_udp(const vtp_udpSockReq_t *req)
"0 UDP bind %s:%u", "0 UDP bind %s:%u",
UDP_INIT(message_p).address, UDP_INIT(message_p).address,
UDP_INIT(message_p).port); 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 // Function to send response to the SIDL client
...@@ -145,18 +146,18 @@ static int vtp_send_udp_msg( ...@@ -145,18 +146,18 @@ static int vtp_send_udp_msg(
// Create and alloc new message // Create and alloc new message
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
udp_data_req_t *udp_data_req_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) 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 = &message_p->ittiMsg.udp_data_req;
udp_data_req_p->peer_address = peerIpAddr; udp_data_req_p->peer_address = peerIpAddr;
udp_data_req_p->peer_port = peerPort; udp_data_req_p->peer_port = peerPort;
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;
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); return itti_send_msg_to_task(TASK_UDP, 0, message_p);
} }
else else
{ {
...@@ -196,6 +197,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime) ...@@ -196,6 +197,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
//assert(message_p); //assert(message_p);
VtpCmdReq_t *req = (VtpCmdReq_t *)malloc(sizeof(VtpCmdReq_t)); VtpCmdReq_t *req = (VtpCmdReq_t *)malloc(sizeof(VtpCmdReq_t));
LOG_A(ENB_APP,"itti_alloc %p\n", req);
req->header.preamble = 0xFEEDC0DE; req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VTP_RESP; req->header.msg_id = SS_VTP_RESP;
req->header.length = sizeof(proxy_ss_header_t); req->header.length = sizeof(proxy_ss_header_t);
...@@ -204,7 +206,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime) ...@@ -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.sfn = virtualTime->TimingInfo.SFN.v.Number;
req->tinfo.sf = virtualTime->TimingInfo.Subframe.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 ); req->header.cell_id,req->tinfo.sfn ,req->tinfo.sf );
vtp_send_proxy((void *)req, sizeof(VtpCmdReq_t)); vtp_send_proxy((void *)req, sizeof(VtpCmdReq_t));
...@@ -213,7 +215,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime) ...@@ -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.sfn = virtualTime->TimingInfo.SFN.v.Number;
SS_VTP_PROXY_ACK(message_p).tinfo.sf = virtualTime->TimingInfo.Subframe.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) if (res < 0)
{ {
LOG_E(ENB_APP, "[SS-VTP] Error in itti_send_msg_to_task\n"); LOG_E(ENB_APP, "[SS-VTP] Error in itti_send_msg_to_task\n");
...@@ -234,11 +236,14 @@ static inline void ss_enable_vtp() ...@@ -234,11 +236,14 @@ static inline void ss_enable_vtp()
req->header.length = sizeof(proxy_ss_header_t); req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_context.cellId; 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", LOG_A(ENB_APP, "VTP_ENABLE Command to proxy sent for cell_id: %d SFN %d SF %d\n",
req->header.cell_id); 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 ); req->header.cell_id );
vtp_send_proxy((void *)req, sizeof(VtpCmdReq_t)); vtp_send_proxy((void *)req, sizeof(VtpCmdReq_t));
...@@ -246,7 +251,7 @@ static inline void ss_enable_vtp() ...@@ -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.sfn = virtualTime->TimingInfo.SFN.v.Number;
SS_VTP_PROXY_ACK(message_p).tinfo.sf = virtualTime->TimingInfo.Subframe.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) if (res < 0)
{ {
LOG_E(ENB_APP, "[SS-VTP] Error in itti_send_msg_to_task\n"); LOG_E(ENB_APP, "[SS-VTP] Error in itti_send_msg_to_task\n");
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#define MSC_INTERFACE
#include "msc.h" #include "msc.h"
...@@ -257,7 +258,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP) ...@@ -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)); forwarded_buffer = itti_malloc(TASK_UDP, udp_sock_pP->task_id, n*sizeof(uint8_t));
DevAssert(forwarded_buffer != NULL); DevAssert(forwarded_buffer != NULL);
memcpy(forwarded_buffer, l_buffer, n); 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); DevAssert(message_p != NULL);
udp_data_ind_p = &message_p->ittiMsg.udp_data_ind; udp_data_ind_p = &message_p->ittiMsg.udp_data_ind;
udp_data_ind_p->buffer = forwarded_buffer; udp_data_ind_p->buffer = forwarded_buffer;
...@@ -276,7 +277,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP) ...@@ -276,7 +277,7 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP)
* if the queue is full. * if the queue is full.
*/ */
/* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */ /* 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", LOG_E(UDP_, "Failed to send message %d to task %d\n",
UDP_DATA_IND, UDP_DATA_IND,
udp_sock_pP->task_id); udp_sock_pP->task_id);
......
...@@ -263,13 +263,13 @@ static inline int rxtx(PHY_VARS_eNB *eNB, ...@@ -263,13 +263,13 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
//#ifdef ENB_SS //#ifdef ENB_SS
if (RC.ss.mode >= SS_SOFTMODEM) 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) if (message_p)
{ {
SS_UPD_TIM_INFO(message_p).sf = eNB->UL_INFO.subframe; SS_UPD_TIM_INFO(message_p).sf = eNB->UL_INFO.subframe;
SS_UPD_TIM_INFO(message_p).sfn = eNB->UL_INFO.frame; 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) if (send_res < 0)
{ {
printf("Error in itti_send_msg_to_task"); printf("Error in itti_send_msg_to_task");
...@@ -278,12 +278,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB, ...@@ -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", 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 */ 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) 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).sf = eNB->UL_INFO.subframe;
SS_UPD_TIM_INFO(message_p_vtp).sfn = eNB->UL_INFO.frame; 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) if (send_res < 0)
{ {
printf("Error in itti_send_msg_to_task"); printf("Error in itti_send_msg_to_task");
...@@ -292,12 +292,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB, ...@@ -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", 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 */ 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) 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).sf = eNB->UL_INFO.subframe;
SS_UPD_TIM_INFO(message_p_vt_timer).sfn = eNB->UL_INFO.frame; 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) if (send_res < 0)
{ {
printf("Error in itti_send_msg_to_task"); 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