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

SS Changes for MultiCell

parent 181481c9
......@@ -170,6 +170,7 @@ typedef struct ss_rrc_pdu_ind_s {
uint32_t sdu_size;
uint8_t sdu[SDU_SIZE];
uint16_t rnti;
int physCellId;
frame_t frame; /*!< \brief LTE frame number.*/
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
} ss_rrc_pdu_ind_t;
......
......@@ -52,7 +52,6 @@
#include "openair3/SS/ss_eNB_context.h"
extern RAN_CONTEXT_t RC;
extern SSConfigContext_t SS_context;
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_req(
......@@ -341,7 +340,7 @@ mac_rrc_data_ind(
ctxt.brOption = brOption;
//#ifdef ENB_SS
if (RC.ss.mode >= SS_SOFTMODEM && SS_context.SSCell_list[0].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");
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_ENB, 0, SS_RRC_PDU_IND);
......@@ -350,6 +349,7 @@ mac_rrc_data_ind(
SS_RRC_PDU_IND (message_p).sdu_size = sdu_lenP;
SS_RRC_PDU_IND (message_p).srb_id = 0;
SS_RRC_PDU_IND (message_p).rnti = rntiP;
SS_RRC_PDU_IND (message_p).physCellId = RC.rrc[module_idP]->carrier->physCellId;
SS_RRC_PDU_IND (message_p).frame = ctxt.frame;
SS_RRC_PDU_IND (message_p).subframe = ctxt.subframe;
memset (SS_RRC_PDU_IND (message_p).sdu, 0, SDU_SIZE);
......
......@@ -43,7 +43,6 @@
//#define DEBUG_RRC 1
extern RAN_CONTEXT_t RC;
extern SSConfigContext_t SS_context;
//------------------------------------------------------------------------------
uint8_t
rrc_data_req(
......@@ -123,7 +122,7 @@ rrc_data_ind(
ctxt_pP->rnti);
//#ifdef ENB_SS
if (RC.ss.mode >= SS_SOFTMODEM && SS_context.SSCell_list[0].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");
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_ENB, 0, SS_RRC_PDU_IND);
......
......@@ -48,25 +48,23 @@ typedef enum SSEvents_E {
} SSEventsE;
/** Structure Containing Cell-specific values only */
typedef struct SSCellConfigContext_s{
typedef struct SS_Cell_Context_s{
int State;
uint16_t dl_earfcn;
uint16_t ul_earfcn;
uint32_t dl_freq;
uint32_t ul_freq;
uint16_t curr_attn;
uint16_t cellId;
uint16_t PhysicalCellId;
int16_t maxRefPower;
bool cell_configured_flag;
//TO DO: Need to remove one of the following cellId
EUTRA_CellId_Type ttcn_cell_id;
uint16_t eutra_cellId;
EUTRA_CellId_Type eutra_cellId;
uint16_t ss_rnti_g;
} SSCellConfigContext_t;
} SS_Cell_Context_t;
typedef struct SSConfigContext_s {
/** List of Cells */
SSCellConfigContext_t SSCell_list[8];
SS_Cell_Context_t SSCell_list[8];
/** Timing info */
uint16_t sfn;
uint8_t sf;
......
......@@ -52,17 +52,26 @@
#include "ss_eNB_context.h"
#include "ss_eNB_multicell_helper.h"
int set_cell_index(uint16_t cell_id, SSCellConfigContext_t SSCell_list[]){
for(int i = 0; i < 8; i++){
if(SSCell_list[i].cell_configured_flag == false){
SSCell_list[i].cellId = cell_id;
SSCell_list[i].cell_configured_flag = true;
return i;
}
else if(SSCell_list[i].cell_configured_flag == true){
if(SSCell_list[i].cellId == cell_id) return i;
}
}
return -1;
int get_cell_index(uint16_t cell_id, SS_Cell_Context_t SSCell_list[]){
for(int Cell_idx = 0; Cell_idx < 8; Cell_idx++){
if((SSCell_list[Cell_idx].cell_configured_flag == true)&&(SSCell_list[Cell_idx].eutra_cellId == cell_id)){
return Cell_idx;
}
}
for(int Cell_idx = 0; Cell_idx < 8; Cell_idx++){
if(SSCell_list[Cell_idx].cell_configured_flag == false){
SSCell_list[Cell_idx].cell_configured_flag = true;
return Cell_idx;
}
}
return -1;
}
int get_cell_index_pci(uint16_t physCellId, SS_Cell_Context_t SSCell_list[]){
for(int Cell_idx = 0; Cell_idx < 8; Cell_idx++){
if(SSCell_list[Cell_idx].PhysicalCellId == physCellId){
return Cell_idx;
}
}
return -1;
}
......@@ -25,6 +25,8 @@
#include "ss_eNB_context.h"
int set_cell_index(uint16_t, SSCellConfigContext_t[]);
int get_cell_index(uint16_t, SS_Cell_Context_t[]);
int get_cell_index_pci(uint16_t physCellId, SS_Cell_Context_t SSCell_list[]);
#endif
......@@ -57,6 +57,7 @@
#include "acpSys.h"
#include "ss_eNB_context.h"
#include "ss_eNB_vt_timer_task.h"
#include "ss_eNB_multicell_helper.h"
extern RAN_CONTEXT_t RC;
SSConfigContext_t SS_context;
static acpCtx_t ctx_srb_g = NULL;
......@@ -92,7 +93,7 @@ uint8_t lttng_sdu[SDU_SIZE];
* newState: No impack on the State
*
*/
static void ss_send_srb_data(ss_rrc_pdu_ind_t *pdu_ind)
static void ss_send_srb_data(ss_rrc_pdu_ind_t *pdu_ind,int cell_index)
{
struct EUTRA_RRC_PDU_IND ind = {};
uint32_t status = 0;
......@@ -104,10 +105,10 @@ static void ss_send_srb_data(ss_rrc_pdu_ind_t *pdu_ind)
DevAssert(pdu_ind->sdu_size >= 0);
DevAssert(pdu_ind->srb_id >= 0);
rnti_g = pdu_ind->rnti;
SS_context.SSCell_list[0].ss_rnti_g = rnti_g;
SS_context.SSCell_list[cell_index].ss_rnti_g = rnti_g;
size_t msgSize = size;
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
ind.Common.RoutingInfo.d = RoutingInfo_Type_RadioBearerId;
......@@ -133,7 +134,7 @@ static void ss_send_srb_data(ss_rrc_pdu_ind_t *pdu_ind)
ind.Common.RlcBearerRouting.d = true;
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;
/* Populate and Send the EUTRA RRC PDU IND to Client */
if (pdu_ind->srb_id == 0)
......@@ -181,7 +182,7 @@ static void ss_send_srb_data(ss_rrc_pdu_ind_t *pdu_ind)
LOG_A(ENB_SS, "[SS_SRB][EUTRA_RRC_PDU_IND] acpSysSrbProcessToSSEncSrv Failure\n");
return;
}
LOG_A(ENB_SS, "[SS_SRB][EUTRA_RRC_PDU_IND] Buffer msgSize=%d (!!2) to EUTRACell %d", (int)msgSize,SS_context.SSCell_list[0].eutra_cellId);
LOG_A(ENB_SS, "[SS_SRB][EUTRA_RRC_PDU_IND] Buffer msgSize=%d (!!2) to EUTRACell %d", (int)msgSize,SS_context.SSCell_list[cell_index].eutra_cellId);
/* Send message
*/
......@@ -301,6 +302,7 @@ static inline void
ss_eNB_read_from_srb_socket(acpCtx_t ctx)
{
size_t msgSize = size; //2
int cell_index;
while (1)
{
......@@ -354,13 +356,18 @@ ss_eNB_read_from_srb_socket(acpCtx_t ctx)
LOG_A(ENB_SS, "[SS_SRB][EUTRA_RRC_PDU_REQ] acpSysSrbProcessFromSSDecSrv Failed\n");
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_SRB] 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)
{
ss_task_handle_rrc_pdu_req(req);
}
else
{
LOG_A(ENB_SS, "ERROR [SS_SRB][EUTRA_RRC_PDU_REQ] received in SS state %d \n", SS_context.SSCell_list[0].State);
LOG_A(ENB_SS, "ERROR [SS_SRB][EUTRA_RRC_PDU_REQ] received in SS state %d \n", SS_context.SSCell_list[cell_index].State);
}
acpSysSrbProcessFromSSFreeSrv(req);
......@@ -438,6 +445,7 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed)
{
MessageDef *received_msg = NULL;
int result = 0;
int cell_index;
itti_receive_msg(TASK_SS_SRB, &received_msg);
......@@ -449,22 +457,25 @@ void *ss_eNB_srb_process_itti_msg(void *notUsed)
case SS_RRC_PDU_IND:
{
task_id_t origin_task = ITTI_MSG_ORIGIN_ID(received_msg);
if(received_msg->ittiMsg.ss_rrc_pdu_ind.rnti){
cell_index = get_cell_index_pci(received_msg->ittiMsg.ss_rrc_pdu_ind.physCellId, SS_context.SSCell_list);
}
if (origin_task == TASK_SS_PORTMAN)
{
LOG_D(ENB_APP, "[SS_SRB] DUMMY WAKEUP receviedfrom PORTMAN state %d \n", SS_context.SSCell_list[0].State);
LOG_D(ENB_APP, "[SS_SRB] DUMMY WAKEUP receviedfrom PORTMAN state %d \n", SS_context.SSCell_list[cell_index].State);
}
else
{
LOG_A(ENB_SS, "[SS_SRB] Received SS_RRC_PDU_IND from RRC\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);
ss_send_srb_data(&received_msg->ittiMsg.ss_rrc_pdu_ind);
ss_send_srb_data(&received_msg->ittiMsg.ss_rrc_pdu_ind,cell_index);
}
else
{
LOG_A(ENB_SS, "ERROR [SS_SRB][EUTRA_RRC_PDU_IND] received in SS state %d \n", SS_context.SSCell_list[0].State);
LOG_A(ENB_SS, "ERROR [SS_SRB][EUTRA_RRC_PDU_IND] received in SS state %d \n", SS_context.SSCell_list[cell_index].State);
}
}
......
This diff is collapsed.
......@@ -29,6 +29,7 @@
#include "ss_eNB_proxy_iface.h"
#include "SIDL_EUTRA_VNG_PORT.h"
#include "acpVng.h"
#include "ss_eNB_multicell_helper.h"
extern SSConfigContext_t SS_context;
extern RAN_CONTEXT_t RC;
......@@ -110,12 +111,12 @@ void ss_vng_send_cnf(uint8_t status, EUTRA_CellId_Type CellId)
*/
static inline void
vng_ss_configure_cell (EUTRA_CellId_Type CellId, Dl_Bandwidth_Type Bandwidth,
int32_t NocLevel, VngProxyCmd_e cmd)
int32_t NocLevel, VngProxyCmd_e cmd,int cell_index)
{
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.SSCell_list[0].cellId;
SS_VNG_PROXY_REQ(message_p).cell_id = SS_context.SSCell_list[cell_index].PhysicalCellId;
SS_VNG_PROXY_REQ(message_p).bw = Bandwidth;
SS_VNG_PROXY_REQ(message_p).Noc_level = NocLevel;
SS_VNG_PROXY_REQ(message_p).cmd = cmd;
......@@ -192,6 +193,7 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx)
}
else if (userId == MSG_VngProcess_userId)
{
int cell_index;
LOG_A(ENB_SS, "[SS-VNG] Received VNG Control Request\n");
if (acpVngProcessDecSrv(ctx, buffer, msgSize, &req) != 0)
......@@ -200,8 +202,14 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx)
break;
}
if (SS_context.SSCell_list[0].State < SS_STATE_CELL_ACTIVE) {
LOG_A(ENB_SS, "[SS-VNG] Request received in an invalid state: %d \n", SS_context.SSCell_list[0].State);
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-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);
}
if (SS_context.SSCell_list[cell_index].State < SS_STATE_CELL_ACTIVE) {
LOG_A(ENB_SS, "[SS-VNG] Request received in an invalid state: %d \n", SS_context.SSCell_list[cell_index].State);
break;
}
/** TODO: Dump message here */
......@@ -210,17 +218,17 @@ ss_eNB_read_from_vng_socket(acpCtx_t ctx)
case EUTRA_VngConfigRequest_Type_Configure:
LOG_A(ENB_SS, "[SS-VNG] Received Configure request\n");
vng_ss_configure_cell(req->Common.CellId, req->Request.v.Configure.Bandwidth,
req->Request.v.Configure.NocLevel, (VngProxyCmd_e)EUTRA_VngConfigRequest_Type_Configure);
req->Request.v.Configure.NocLevel, (VngProxyCmd_e)EUTRA_VngConfigRequest_Type_Configure, cell_index);
break;
case EUTRA_VngConfigRequest_Type_Activate:
LOG_A(ENB_SS, "[SS-VNG] Received Activate request\n");
vng_ss_configure_cell(req->Common.CellId, (0xFF),
(0xFFFF), (VngProxyCmd_e)EUTRA_VngConfigRequest_Type_Activate);
(0xFFFF), (VngProxyCmd_e)EUTRA_VngConfigRequest_Type_Activate, cell_index);
break;
case EUTRA_VngConfigRequest_Type_Deactivate:
LOG_A(ENB_SS, "[SS-VNG] Received Deactivate request\n");
vng_ss_configure_cell(req->Common.CellId, (0xFF),
(0xFFFF), (VngProxyCmd_e)EUTRA_VngConfigRequest_Type_Deactivate);
(0xFFFF), (VngProxyCmd_e)EUTRA_VngConfigRequest_Type_Deactivate, cell_index);
break;
case EUTRA_VngConfigRequest_Type_UNBOUND_VALUE:
default:
......
......@@ -201,7 +201,7 @@ static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VTP_RESP;
req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_context.SSCell_list[0].cellId;
req->header.cell_id = SS_context.SSCell_list[0].PhysicalCellId;
req->tinfo.sfn = virtualTime->TimingInfo.SFN.v.Number;
req->tinfo.sf = virtualTime->TimingInfo.Subframe.v.Number;
......@@ -234,7 +234,7 @@ static inline void ss_enable_vtp()
req->header.preamble = 0xFEEDC0DE;
req->header.msg_id = SS_VTP_ENABLE;
req->header.length = sizeof(proxy_ss_header_t);
req->header.cell_id = SS_context.SSCell_list[0].cellId;
req->header.cell_id = SS_context.SSCell_list[0].PhysicalCellId;
/* Initialize with zero */
req->tinfo.sfn = 0;
......
......@@ -65,6 +65,7 @@ typedef struct ss_config_s {
int SysportNR;
uint8_t configured;
/** State info */
int State;
int vtp_ready;
int CBRA_flag;
int mac_rlc_data_ind_frame;
......
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