Commit db4f5937 authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava Committed by jperaldi

Remaining Cell Index Changes in DRB,SYSind,VTP & Portman

parent affe3625
...@@ -93,6 +93,8 @@ typedef struct ss_nr_sys_port_msg_cnf { ...@@ -93,6 +93,8 @@ typedef struct ss_nr_sys_port_msg_cnf {
typedef struct ss_set_timinfo_s { typedef struct ss_set_timinfo_s {
uint16_t sfn; uint16_t sfn;
uint8_t sf; uint8_t sf;
int cell_index;
int physCellId;
} ss_set_timinfo_t; } ss_set_timinfo_t;
typedef ss_set_timinfo_t ss_upd_timinfo_t; typedef ss_set_timinfo_t ss_upd_timinfo_t;
...@@ -216,6 +218,7 @@ typedef struct ss_drb_pdu_ind_s { ...@@ -216,6 +218,7 @@ typedef struct ss_drb_pdu_ind_s {
uint8_t sdu[SDU_SIZE]; uint8_t sdu[SDU_SIZE];
frame_t frame; /*!< \brief LTE frame number.*/ frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/ sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
int physCellId;
} ss_drb_pdu_ind_t; } ss_drb_pdu_ind_t;
typedef enum carrierBandwidthEUTRA_dl_Bandwidth_e { typedef enum carrierBandwidthEUTRA_dl_Bandwidth_e {
...@@ -310,6 +313,7 @@ typedef struct ss_system_ind_s ...@@ -310,6 +313,7 @@ typedef struct ss_system_ind_s
bool bitmask; //Flag for presence of optional parameter repetitionsPerPreambleAttempt bool bitmask; //Flag for presence of optional parameter repetitionsPerPreambleAttempt
frame_t sfn; frame_t sfn;
sub_frame_t sf; sub_frame_t sf;
int physCellId;
uint8_t ra_PreambleIndex; uint8_t ra_PreambleIndex;
bool prtPower_Type; bool prtPower_Type;
uint32_t repetitionsPerPreambleAttempt; uint32_t repetitionsPerPreambleAttempt;
......
...@@ -1437,6 +1437,7 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1437,6 +1437,7 @@ initiate_ra_proc(module_id_t module_idP,
SS_SYSTEM_IND(m).ra_PreambleIndex = preamble_index; SS_SYSTEM_IND(m).ra_PreambleIndex = preamble_index;
SS_SYSTEM_IND(m).prtPower_Type = true; SS_SYSTEM_IND(m).prtPower_Type = true;
SS_SYSTEM_IND(m).repetitionsPerPreambleAttempt = 0; SS_SYSTEM_IND(m).repetitionsPerPreambleAttempt = 0;
SS_SYSTEM_IND(m).physCellId = cc->physCellId;
itti_send_msg_to_task(TASK_SS_SYSIND, module_idP, m); itti_send_msg_to_task(TASK_SS_SYSIND, module_idP, m);
LOG_A(MAC,"MAC Sending SS_SYSTEM_IND with ra_PreambleIndex=%d prtPower_Type=%d bitmask=%d sfn=%d sf=%d to System Simulator\n", SS_SYSTEM_IND(m).ra_PreambleIndex, SS_SYSTEM_IND(m).prtPower_Type, LOG_A(MAC,"MAC Sending SS_SYSTEM_IND with ra_PreambleIndex=%d prtPower_Type=%d bitmask=%d sfn=%d sf=%d to System Simulator\n", SS_SYSTEM_IND(m).ra_PreambleIndex, SS_SYSTEM_IND(m).prtPower_Type,
SS_SYSTEM_IND(m).bitmask, SS_SYSTEM_IND(m).sfn, SS_SYSTEM_IND(m).sf); SS_SYSTEM_IND(m).bitmask, SS_SYSTEM_IND(m).sfn, SS_SYSTEM_IND(m).sf);
......
...@@ -1061,6 +1061,7 @@ pdcp_data_ind( ...@@ -1061,6 +1061,7 @@ pdcp_data_ind(
/* Populate the message to SS */ /* Populate the message to SS */
SS_DRB_PDU_IND (message_p).sdu_size = sdu_buffer_sizeP - payload_offset; SS_DRB_PDU_IND (message_p).sdu_size = sdu_buffer_sizeP - payload_offset;
SS_DRB_PDU_IND (message_p).drb_id = rb_id; SS_DRB_PDU_IND (message_p).drb_id = rb_id;
SS_DRB_PDU_IND (message_p).physCellId = RC.rrc[ctxt_pP->module_id]->carrier->physCellId;
memset(SS_DRB_PDU_IND (message_p).sdu, 0, SS_DRB_PDU_IND (message_p).sdu_size); 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); 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).frame = ctxt_pP->frame;
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "intertask_interface.h" #include "intertask_interface.h"
#include "common/ran_context.h" #include "common/ran_context.h"
#include "ss_eNB_multicell_helper.h"
#include "acpDrb.h" #include "acpDrb.h"
#include "ss_eNB_context.h" #include "ss_eNB_context.h"
...@@ -67,7 +68,7 @@ enum MsgUserId ...@@ -67,7 +68,7 @@ enum MsgUserId
MSG_DrbProcessToSS_userId, MSG_DrbProcessToSS_userId,
}; };
static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind, int cell_index){
struct DRB_COMMON_IND ind = {}; struct DRB_COMMON_IND ind = {};
uint32_t status = 0; uint32_t status = 0;
...@@ -80,7 +81,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){ ...@@ -80,7 +81,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
size_t msgSize = size; size_t msgSize = size;
memset(&ind, 0, sizeof(ind)); memset(&ind, 0, sizeof(ind));
ind.Common.CellId = SS_context.SSCell_list[0].eutra_cellId; ind.Common.CellId = SS_context.SSCell_list[cell_index].eutra_cellId;
//Populated the Routing Info //Populated the Routing Info
ind.Common.RoutingInfo.d = RoutingInfo_Type_RadioBearerId; ind.Common.RoutingInfo.d = RoutingInfo_Type_RadioBearerId;
...@@ -106,7 +107,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){ ...@@ -106,7 +107,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
ind.Common.RlcBearerRouting.d = true; ind.Common.RlcBearerRouting.d = true;
ind.Common.RlcBearerRouting.v.d = RlcBearerRouting_Type_EUTRA; ind.Common.RlcBearerRouting.v.d = RlcBearerRouting_Type_EUTRA;
ind.Common.RlcBearerRouting.v.v.EUTRA = SS_context.SSCell_list[0].eutra_cellId; ind.Common.RlcBearerRouting.v.v.EUTRA = SS_context.SSCell_list[cell_index].eutra_cellId;
//Populating the PDU //Populating the PDU
ind.U_Plane.SubframeData.NoOfTTIs = 1; ind.U_Plane.SubframeData.NoOfTTIs = 1;
...@@ -127,7 +128,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){ ...@@ -127,7 +128,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){
LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_IND] acpDrbProcessToSSEncSrv Failure\n"); LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_IND] acpDrbProcessToSSEncSrv Failure\n");
return; return;
} }
LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_IND] Buffer msgSize=%d (!!2) to EUTRACell %d", (int)msgSize,SS_context.SSCell_list[0].eutra_cellId); LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_IND] Buffer msgSize=%d (!!2) to EUTRACell %d", (int)msgSize,SS_context.SSCell_list[cell_index].eutra_cellId);
//Send Message //Send Message
status = acpSendMsg(ctx_drb_g, msgSize, buffer); status = acpSendMsg(ctx_drb_g, msgSize, buffer);
...@@ -143,7 +144,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind){ ...@@ -143,7 +144,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,int cell_index)
{ {
assert(req); assert(req);
MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, SS_DRB_PDU_REQ); MessageDef *message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0, SS_DRB_PDU_REQ);
...@@ -166,7 +167,7 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req) ...@@ -166,7 +167,7 @@ static void ss_task_handle_drb_pdu_req(struct DRB_COMMON_REQ *req)
} }
} }
SS_DRB_PDU_REQ(message_p).rnti = SS_context.SSCell_list[0].ss_rnti_g; SS_DRB_PDU_REQ(message_p).rnti = SS_context.SSCell_list[cell_index].ss_rnti_g;
int send_res = itti_send_msg_to_task(TASK_RRC_ENB, instance_g, message_p); int send_res = itti_send_msg_to_task(TASK_RRC_ENB, instance_g, message_p);
if (send_res < 0) if (send_res < 0)
...@@ -182,6 +183,7 @@ static void ...@@ -182,6 +183,7 @@ 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
int cell_index;
while (1) while (1)
{ {
...@@ -231,14 +233,19 @@ ss_eNB_read_from_drb_socket(acpCtx_t ctx){ ...@@ -231,14 +233,19 @@ ss_eNB_read_from_drb_socket(acpCtx_t ctx){
LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_REQ] acpDrbProcessFromSSDecSrv Failed\n"); LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_REQ] acpDrbProcessFromSSDecSrv Failed\n");
break; break;
} }
if(SS_context.SSCell_list[0].State >= SS_STATE_CELL_ACTIVE) if(req->Common.CellId){
cell_index = get_cell_index(req->Common.CellId, SS_context.SSCell_list);
SS_context.SSCell_list[cell_index].eutra_cellId = req->Common.CellId;
LOG_A(ENB_SS,"[SS_DRB] cell_index: %d eutra_cellId: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].eutra_cellId,SS_context.SSCell_list[cell_index].PhysicalCellId);
}
if(SS_context.SSCell_list[cell_index].State >= SS_STATE_CELL_ACTIVE)
{ {
LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_REQ] DRB_COMMON_REQ Received in CELL_ACTIVE\n"); LOG_A(ENB_APP, "[SS_DRB][DRB_COMMON_REQ] DRB_COMMON_REQ Received in CELL_ACTIVE\n");
ss_task_handle_drb_pdu_req(req); ss_task_handle_drb_pdu_req(req,cell_index);
} }
else else
{ {
LOG_W(ENB_APP, "[SS_DRB][DRB_COMMON_REQ] received in SS state %d \n", SS_context.SSCell_list[0].State); LOG_W(ENB_APP, "[SS_DRB][DRB_COMMON_REQ] received in SS state %d \n", SS_context.SSCell_list[cell_index].State);
} }
acpDrbProcessFromSSFreeSrv(req); acpDrbProcessFromSSFreeSrv(req);
...@@ -267,24 +274,27 @@ void *ss_eNB_drb_process_itti_msg(void *notUsed) ...@@ -267,24 +274,27 @@ void *ss_eNB_drb_process_itti_msg(void *notUsed)
{ {
case SS_DRB_PDU_IND: case SS_DRB_PDU_IND:
{ {
int cell_index;
if(received_msg->ittiMsg.ss_drb_pdu_ind.physCellId){
cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_drb_pdu_ind.physCellId, SS_context.SSCell_list);
}
task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg); task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg);
if (origin_task == TASK_SS_PORTMAN) if (origin_task == TASK_SS_PORTMAN)
{ {
LOG_D(ENB_APP, "[SS_DRB] DUMMY WAKEUP recevied from PORTMAN state %d \n", SS_context.SSCell_list[cell_index].State);
LOG_D(ENB_APP, "[SS_DRB] DUMMY WAKEUP recevied from PORTMAN state %d \n", SS_context.SSCell_list[0].State);
} }
else else
{ {
LOG_A(ENB_APP, "[SS_DRB] Received SS_DRB_PDU_IND from RRC PDCP\n"); LOG_A(ENB_APP, "[SS_DRB] Received SS_DRB_PDU_IND from RRC PDCP\n");
if (SS_context.SSCell_list[0].State >= SS_STATE_CELL_ACTIVE) if (SS_context.SSCell_list[cell_index].State >= SS_STATE_CELL_ACTIVE)
{ {
instance_g = ITTI_MSG_DESTINATION_INSTANCE(received_msg); instance_g = ITTI_MSG_DESTINATION_INSTANCE(received_msg);
ss_send_drb_data(&received_msg->ittiMsg.ss_drb_pdu_ind); ss_send_drb_data(&received_msg->ittiMsg.ss_drb_pdu_ind,cell_index);
} }
else else
{ {
LOG_A(ENB_APP, "ERROR [SS_DRB][SS_DRB_PDU_IND] received in SS state %d \n", SS_context.SSCell_list[0].State); LOG_A(ENB_APP, "ERROR [SS_DRB][SS_DRB_PDU_IND] received in SS state %d \n", SS_context.SSCell_list[cell_index].State);
} }
} }
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
acpCtx_t ctx_g = NULL; acpCtx_t ctx_g = NULL;
int cell_index = 0;
enum MsgUserId enum MsgUserId
{ {
...@@ -210,7 +211,7 @@ void ss_port_man_send_data( ...@@ -210,7 +211,7 @@ void ss_port_man_send_data(
size_t msgSize = size; size_t msgSize = size;
memset(&cnf, 0, sizeof(cnf)); memset(&cnf, 0, sizeof(cnf));
cnf.Common.CellId = SS_context.SSCell_list[0].eutra_cellId; cnf.Common.CellId = SS_context.SSCell_list[tinfo->cell_index].eutra_cellId;
cnf.Common.RoutingInfo.d = RoutingInfo_Type_None; cnf.Common.RoutingInfo.d = RoutingInfo_Type_None;
cnf.Common.RoutingInfo.v.None = true; cnf.Common.RoutingInfo.v.None = true;
cnf.Common.TimingInfo.d = TimingInfo_Type_Now; cnf.Common.TimingInfo.d = TimingInfo_Type_Now;
...@@ -220,6 +221,8 @@ void ss_port_man_send_data( ...@@ -220,6 +221,8 @@ void ss_port_man_send_data(
cnf.Confirm.d = SystemConfirm_Type_EnquireTiming; cnf.Confirm.d = SystemConfirm_Type_EnquireTiming;
cnf.Confirm.v.EnquireTiming = true; cnf.Confirm.v.EnquireTiming = true;
cell_index = tinfo->cell_index;
/** /**
* FIXME: Currently filling only SFN and subframe numbers. * FIXME: Currently filling only SFN and subframe numbers.
*/ */
...@@ -363,7 +366,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx) ...@@ -363,7 +366,7 @@ static inline void ss_eNB_read_from_socket(acpCtx_t ctx)
{ {
// No message (timeout on socket) // No message (timeout on socket)
//Send Dummy Wake up ITTI message to SRB task. //Send Dummy Wake up ITTI message to SRB task.
if (RC.ss.mode >= SS_SOFTMODEM && SS_context.SSCell_list[0].State >= SS_STATE_CELL_ACTIVE) if (RC.ss.mode >= SS_SOFTMODEM && SS_context.SSCell_list[cell_index].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, 0, SS_RRC_PDU_IND); MessageDef *message_p = itti_alloc_new_message(TASK_SS_PORTMAN, 0, SS_RRC_PDU_IND);
......
...@@ -445,7 +445,7 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed) ...@@ -445,7 +445,7 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed)
{ {
MessageDef *received_msg = NULL; MessageDef *received_msg = NULL;
int result = 0; int result = 0;
int cell_index; int cell_index = 0;
itti_receive_msg(TASK_SS_SRB, &received_msg); itti_receive_msg(TASK_SS_SRB, &received_msg);
...@@ -457,7 +457,7 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed) ...@@ -457,7 +457,7 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed)
case SS_RRC_PDU_IND: case SS_RRC_PDU_IND:
{ {
task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg); task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg);
if(received_msg->ittiMsg.ss_rrc_pdu_ind.rnti){ if(received_msg->ittiMsg.ss_rrc_pdu_ind.physCellId){
cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_rrc_pdu_ind.physCellId, SS_context.SSCell_list); cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_rrc_pdu_ind.physCellId, SS_context.SSCell_list);
} }
......
...@@ -253,6 +253,7 @@ static void ss_task_sys_handle_timing_info(ss_set_timinfo_t *tinfo) ...@@ -253,6 +253,7 @@ static void ss_task_sys_handle_timing_info(ss_set_timinfo_t *tinfo)
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;
SS_SET_TIM_INFO(message_p).cell_index = cell_index;
int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN, 0, message_p); int send_res = itti_send_msg_to_task(TASK_SS_PORTMAN, 0, message_p);
if (send_res < 0) if (send_res < 0)
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "acpSys.h" #include "acpSys.h"
#include "acpSysInd.h" #include "acpSysInd.h"
#include "ss_eNB_sysind_task.h" #include "ss_eNB_sysind_task.h"
#include "ss_eNB_multicell_helper.h"
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
...@@ -72,7 +73,7 @@ enum MsgUserId ...@@ -72,7 +73,7 @@ enum MsgUserId
* newState: No impack on the State * newState: No impack on the State
* *
*/ */
static void ss_send_sysind_data(ss_system_ind_t *p_ind) static void ss_send_sysind_data(ss_system_ind_t *p_ind,int cell_index)
{ {
struct SYSTEM_IND ind = {}; struct SYSTEM_IND ind = {};
uint32_t status = 0; uint32_t status = 0;
...@@ -80,7 +81,7 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind) ...@@ -80,7 +81,7 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind)
DevAssert(p_ind != NULL); DevAssert(p_ind != NULL);
size_t msgSize = size; size_t msgSize = size;
memset(&ind, 0, sizeof(ind)); memset(&ind, 0, sizeof(ind));
ind.Common.CellId = SS_context.SSCell_list[0].eutra_cellId; ind.Common.CellId = SS_context.SSCell_list[cell_index].eutra_cellId;
// Populated the Routing Info // Populated the Routing Info
ind.Common.RoutingInfo.d = RoutingInfo_Type_None; ind.Common.RoutingInfo.d = RoutingInfo_Type_None;
...@@ -105,7 +106,7 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind) ...@@ -105,7 +106,7 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind)
ind.Common.RlcBearerRouting.d = true; ind.Common.RlcBearerRouting.d = true;
ind.Common.RlcBearerRouting.v.d = RlcBearerRouting_Type_EUTRA; ind.Common.RlcBearerRouting.v.d = RlcBearerRouting_Type_EUTRA;
ind.Common.RlcBearerRouting.v.v.EUTRA = SS_context.SSCell_list[0].eutra_cellId; ind.Common.RlcBearerRouting.v.v.EUTRA = SS_context.SSCell_list[cell_index].eutra_cellId;
LOG_A(ENB_SS,"[SS_SYSIND][SYSTEM_IND] Frame: %d, Subframe: %d, RAPID: %d, PRTPower: %d, BitMask: %d \n",p_ind->sfn,p_ind->sf,p_ind->ra_PreambleIndex,p_ind->prtPower_Type,p_ind->bitmask); LOG_A(ENB_SS,"[SS_SYSIND][SYSTEM_IND] Frame: %d, Subframe: %d, RAPID: %d, PRTPower: %d, BitMask: %d \n",p_ind->sfn,p_ind->sf,p_ind->ra_PreambleIndex,p_ind->prtPower_Type,p_ind->bitmask);
...@@ -125,7 +126,7 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind) ...@@ -125,7 +126,7 @@ static void ss_send_sysind_data(ss_system_ind_t *p_ind)
LOG_A(ENB_SS, "[SS_SYSIND][SYSTEM_IND] acpSysIndProcessToSSEncSrv Failure\n"); LOG_A(ENB_SS, "[SS_SYSIND][SYSTEM_IND] acpSysIndProcessToSSEncSrv Failure\n");
return; return;
} }
LOG_A(ENB_SS, "[SS_SYSIND][SYSTEM_IND] Buffer msgSize=%d (!!2) to EUTRACell %d\n", (int)msgSize,SS_context.SSCell_list[0].eutra_cellId); LOG_A(ENB_SS, "[SS_SYSIND][SYSTEM_IND] Buffer msgSize=%d (!!2) to EUTRACell %d\n", (int)msgSize,SS_context.SSCell_list[cell_index].eutra_cellId);
/* Send message */ /* Send message */
status = acpSendMsg(ctx_sysind_g, msgSize, buffer); status = acpSendMsg(ctx_sysind_g, msgSize, buffer);
...@@ -266,7 +267,6 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed) ...@@ -266,7 +267,6 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed)
itti_receive_msg(TASK_SS_SYSIND, &received_msg); itti_receive_msg(TASK_SS_SYSIND, &received_msg);
/* Check if there is a packet to handle */ /* Check if there is a packet to handle */
if (received_msg != NULL) if (received_msg != NULL)
{ {
...@@ -274,23 +274,27 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed) ...@@ -274,23 +274,27 @@ void *ss_eNB_sysind_process_itti_msg(void *notUsed)
{ {
case SS_SYSTEM_IND: case SS_SYSTEM_IND:
{ {
int cell_index;
if(received_msg->ittiMsg.ss_system_ind.physCellId){
cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_system_ind.physCellId, SS_context.SSCell_list);
}
task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg); task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg);
if (origin_task == TASK_SS_PORTMAN) if (origin_task == TASK_SS_PORTMAN)
{ {
LOG_D(ENB_APP, "[SS_SYSIND] DUMMY WAKEUP receviedfrom PORTMAN state %d \n", SS_context.SSCell_list[0].State); LOG_D(ENB_APP, "[SS_SYSIND] DUMMY WAKEUP receviedfrom PORTMAN state %d \n", SS_context.SSCell_list[cell_index].State);
} }
else else
{ {
LOG_A(ENB_SS, "[SS_SYSIND] Received SS_SYSTEM_IND\n"); LOG_A(ENB_SS, "[SS_SYSIND] Received SS_SYSTEM_IND\n");
if (SS_context.SSCell_list[0].State >= SS_STATE_CELL_CONFIGURED) if (SS_context.SSCell_list[cell_index].State >= SS_STATE_CELL_CONFIGURED)
{ {
instance_g = ITTI_MSG_DESTINATION_INSTANCE(received_msg); instance_g = ITTI_MSG_DESTINATION_INSTANCE(received_msg);
ss_send_sysind_data(&received_msg->ittiMsg.ss_system_ind); ss_send_sysind_data(&received_msg->ittiMsg.ss_system_ind,cell_index);
} }
else else
{ {
LOG_E(ENB_SS, "[SS_SYSIND][SS_SYSTEM_IND] received in SS state %d \n", SS_context.SSCell_list[0].State); LOG_E(ENB_SS, "[SS_SYSIND][SS_SYSTEM_IND] received in SS state %d \n", SS_context.SSCell_list[cell_index].State);
} }
} }
result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg); result = itti_free(ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
......
...@@ -205,7 +205,7 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx) ...@@ -205,7 +205,7 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx)
if(req->Common.CellId){ if(req->Common.CellId){
cell_index = get_cell_index(req->Common.CellId, SS_context.SSCell_list); cell_index = get_cell_index(req->Common.CellId, SS_context.SSCell_list);
SS_context.SSCell_list[cell_index].eutra_cellId = req->Common.CellId; SS_context.SSCell_list[cell_index].eutra_cellId = req->Common.CellId;
LOG_A(ENB_SS,"[SS-VNG] Vaibhav: cell_index: %d eutra_cellId: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].eutra_cellId,SS_context.SSCell_list[cell_index].PhysicalCellId); LOG_A(ENB_SS,"[SS-VNG] cell_index: %d eutra_cellId: %d PhysicalCellId: %d \n",cell_index,SS_context.SSCell_list[cell_index].eutra_cellId,SS_context.SSCell_list[cell_index].PhysicalCellId);
} }
if (SS_context.SSCell_list[cell_index].State < SS_STATE_CELL_ACTIVE) { if (SS_context.SSCell_list[cell_index].State < SS_STATE_CELL_ACTIVE) {
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "ss_eNB_context.h" #include "ss_eNB_context.h"
#include "ss_eNB_proxy_iface.h" #include "ss_eNB_proxy_iface.h"
#include "ss_eNB_multicell_helper.h"
#include "SIDL_VIRTUAL_TIME_PORT.h" #include "SIDL_VIRTUAL_TIME_PORT.h"
#include "acpSysVT.h" #include "acpSysVT.h"
#define MSC_INTERFACE #define MSC_INTERFACE
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC; extern RAN_CONTEXT_t RC;
int cellIndex = 0;
static acpCtx_t ctx_vtp_g = NULL; static acpCtx_t ctx_vtp_g = NULL;
extern SSConfigContext_t SS_context; extern SSConfigContext_t SS_context;
...@@ -201,7 +203,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime) ...@@ -201,7 +203,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
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);
req->header.cell_id = SS_context.SSCell_list[0].PhysicalCellId; req->header.cell_id = SS_context.SSCell_list[cellIndex].PhysicalCellId;
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;
...@@ -234,7 +236,7 @@ static inline void ss_enable_vtp() ...@@ -234,7 +236,7 @@ static inline void ss_enable_vtp()
req->header.preamble = 0xFEEDC0DE; req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VTP_ENABLE; req->header.msg_id = SS_VTP_ENABLE;
req->header.length = sizeof(proxy_ss_header_t); req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_context.SSCell_list[0].PhysicalCellId; req->header.cell_id = SS_context.SSCell_list[cellIndex].PhysicalCellId;
/* Initialize with zero */ /* Initialize with zero */
req->tinfo.sfn = 0; req->tinfo.sfn = 0;
...@@ -321,15 +323,15 @@ static inline void ss_eNB_read_from_vtp_socket(acpCtx_t ctx, bool vtInit) ...@@ -321,15 +323,15 @@ static inline void ss_eNB_read_from_vtp_socket(acpCtx_t ctx, bool vtInit)
} }
LOG_A(ENB_APP,"[SS-VTP] Received VTEnquireTimingAck Request SFN %d Subframe %d Waiting for ACK of SFN %d SF %d\n ", LOG_A(ENB_APP,"[SS-VTP] Received VTEnquireTimingAck Request SFN %d Subframe %d Waiting for ACK of SFN %d SF %d\n ",
virtualTime->TimingInfo.SFN.v.Number,virtualTime->TimingInfo.Subframe.v.Number,SS_context.vtinfo.sfn,SS_context.vtinfo.sf); virtualTime->TimingInfo.SFN.v.Number,virtualTime->TimingInfo.Subframe.v.Number,SS_context.vtinfo.sfn,SS_context.vtinfo.sf);
// if (SS_context.SSCell_list[0].State < SS_STATE_CELL_ACTIVE) // if (SS_context.SSCell_list[cellIndex].State < SS_STATE_CELL_ACTIVE)
// { // {
// LOG_E(ENB_APP, "[SS-VTP] Request received in an invalid state: %d \n", SS_context.SSCell_list[0].State); // LOG_E(ENB_APP, "[SS-VTP] Request received in an invalid state: %d \n", SS_context.SSCell_list[cellIndex].State);
// break; // break;
// } // }
// if((SS_context.vtinfo.sfn == virtualTime->TimingInfo.SFN.v.Number) && // if((SS_context.vtinfo.sfn == virtualTime->TimingInfo.SFN.v.Number) &&
// (SS_context.SSCell_list[0].vtinfo.sf == virtualTime->TimingInfo.Subframe.v.Number)) // (SS_context.SSCell_list[cellIndex].vtinfo.sf == virtualTime->TimingInfo.Subframe.v.Number))
{ {
if (virtualTime->Enable) { if (virtualTime->Enable) {
ss_send_vtp_resp(virtualTime); ss_send_vtp_resp(virtualTime);
...@@ -379,6 +381,9 @@ void *ss_eNB_vtp_process_itti_msg(void *notUsed) ...@@ -379,6 +381,9 @@ void *ss_eNB_vtp_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;
if(SS_UPD_TIM_INFO(received_msg).physCellId){
cellIndex = get_cell_index_pci(SS_UPD_TIM_INFO(received_msg).physCellId, SS_context.SSCell_list);
}
LOG_A(ENB_APP, "[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf); LOG_A(ENB_APP, "[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
LOG_A(ENB_APP,"[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf); LOG_A(ENB_APP,"[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
if (SS_context.vtp_enabled == 1) if (SS_context.vtp_enabled == 1)
......
...@@ -283,6 +283,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB, ...@@ -283,6 +283,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
{ {
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;
SS_UPD_TIM_INFO(message_p).physCellId = RC.rrc[eNB->UL_INFO.module_id]->carrier->physCellId;
int send_res = itti_send_msg_to_task(TASK_VTP, 0, 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)
{ {
......
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