Commit 8ff745d3 authored by Siddharth Rana's avatar Siddharth Rana Committed by jperaldi

Initial changes for SIB4 Implementation

parent e44e3d7f
......@@ -352,9 +352,8 @@ typedef struct InterFreqCarrierFreqInfo_s {
}InterFreqCarrierFreqInfo_t;
typedef struct IntraFreqNeighCellInfo_s {
int intraFreqNeighCellListCount;
long physCellId;
e_LTE_Q_OffsetRange q_OffsetCell;
LTE_Q_OffsetRange_t q_OffsetCell;
}IntraFreqNeighCellInfo_t;
// eNB: ENB_APP -> RRC messages
......@@ -482,6 +481,7 @@ typedef struct RrcConfigurationReq_s {
//SIB4
bool sib4_Present[MAX_NUM_CCs];
bool intraFreqNeighCellListPresent;
int intraFreqNeighCellListCount;
IntraFreqNeighCellInfo_t *intraFreqNeighCellList[MAX_NUM_CCs];
//SIB5
......
......@@ -160,8 +160,23 @@ mac_rrc_data_req(
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
}
/* Schedule SIB5 when sib5_Scheduled is TRUE and SI periodicity(T) is taking 16 by deafult
so SIB5 Scheduled in every (frameP%16) == 3) Radio frame */
else if ((true == RC.rrc[Mod_idP]->carrier[CC_id].sib4_Scheduled) && ((frameP%16) == 3)) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB4,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB4);
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 4\n",Mod_idP,frameP);
for (int i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB4; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
} /* LOG_DEBUGFLAG(DEBUG_RRC) */
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB4);
}
else if ((true == RC.rrc[Mod_idP]->carrier[CC_id].sib5_Scheduled) && ((frameP%16) == 3)) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB5,
......
......@@ -1039,6 +1039,9 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
for(int i=0; i < configuration->schedulingInfo_count; i++) {
schedulingInfo[i].si_Periodicity=configuration->schedulingInfo[i].si_Periodicity;
sib_type[i]=configuration->schedulingInfo[i].sib_MappingInfo.LTE_SIB_Type[i];
if(sib_type[i] == 1) {
RC.rrc[Mod_id]->carrier[CC_id].sib4_Scheduled = true;
}
if(sib_type[i] == 2) {
RC.rrc[Mod_id]->carrier[CC_id].sib5_Scheduled = true;
}
......@@ -2331,7 +2334,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
uint8_t do_SIB4(uint8_t Mod_id,
int CC_id, BOOLEAN_t brOption,
RrcConfigurationReq *configuration
) {
) {
struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member *sib4_part;
LTE_SystemInformationBlockType4_t **sib4 = &RC.rrc[Mod_id]->carrier[CC_id].sib4;
LTE_BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
......@@ -2340,17 +2343,40 @@ uint8_t do_SIB4(uint8_t Mod_id,
buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB4;
if (!sib4) {
LOG_E(RRC,"[eNB %d] sib4 is null, exiting\n", Mod_id);
exit(-1);
}
if (bcch_message) {
memset(bcch_message,0,sizeof(LTE_BCCH_DL_SCH_Message_t));
} else {
LOG_E(RRC,"[eNB %d] BCCH_MESSAGE is null, exiting\n", Mod_id);
exit(-1);
}
LOG_I(RRC,"[eNB %d] Configuration SIB4, intraFreqNeighCellListPresent: %d \n", Mod_id, configuration->intraFreqNeighCellListPresent);
sib4_part = CALLOC(1,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
memset(sib4_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
sib4_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4;
*sib4 = &sib4_part->choice.sib4;
/* TODO: Need to optimize the below code same as do_SIB5 and verify the SIB4 */
LTE_IntraFreqNeighCellInfo_t *IntraFreqNeighCellInfo;
if(true == configuration->intraFreqNeighCellListPresent) {
ASN_SEQUENCE_ADD(&(*sib4)->intraFreqNeighCellList->list,configuration->InterFreqCarrierFreqInfo);
for(int i = 0; i < configuration->intraFreqNeighCellListCount; i++){
IntraFreqNeighCellInfo = CALLOC(1,sizeof(struct LTE_IntraFreqNeighCellInfo));
IntraFreqNeighCellInfo->physCellId = configuration->intraFreqNeighCellList[CC_id][i].physCellId;
IntraFreqNeighCellInfo->q_OffsetCell = configuration->intraFreqNeighCellList[CC_id][i].q_OffsetCell;
ASN_SEQUENCE_ADD(&(*sib4)->intraFreqNeighCellList,IntraFreqNeighCellInfo);
}
}
(*sib4)->intraFreqBlackCellList = NULL;
(*sib4)->csg_PhysCellIdRange = NULL;
(*sib4)->lateNonCriticalExtension = NULL;
(*sib4)->ext1 = NULL;
bcch_message->message.present = LTE_BCCH_DL_SCH_MessageType_PR_c1;
bcch_message->message.choice.c1.present = LTE_BCCH_DL_SCH_MessageType__c1_PR_systemInformation;
bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.present = LTE_SystemInformation__criticalExtensions_PR_systemInformation_r8;
......
......@@ -749,6 +749,7 @@ typedef struct {
LTE_MCCH_Message_t mcch_counting;
LTE_MBMSCountingRequest_r10_t *mcch_message_counting;
SRB_INFO MCCH_MESS_COUNTING[8];// MAX_MBSFN_AREA
bool sib4_Scheduled;
bool sib5_Scheduled;
//TTN - SIB 18,19,21 for D2D
......
......@@ -492,12 +492,12 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure)
if(SQN_SystemInformation_r8_IEs_sib_TypeAndInfo_s_sib4 == AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].d) {
RRC_CONFIGURATION_REQ(msg_p).sib4_Present[cell_index] = true;
if(true == AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.d) {
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index] = CALLOC(AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.d,sizeof(struct IntraFreqNeighCellInfo_s));
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellListCount = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.d;
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index] = CALLOC(RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellListCount,sizeof(struct IntraFreqNeighCellInfo_s));
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellListPresent = true;
for(int j=0;j < AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.d; j++) {
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index][j].intraFreqNeighCellListCount = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.d;
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index][j].physCellId = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.v[j].physCellId;
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index][j].q_OffsetCell = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.v[j].q_OffsetCell;
for(int k=0;k < AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.d; k++) {
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index][k].physCellId = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.v[k].physCellId;
RRC_CONFIGURATION_REQ(msg_p).intraFreqNeighCellList[cell_index][k].q_OffsetCell = AddOrReconfigure->Basic.v.BcchConfig.v.BcchInfo.v.SIs.v.v[i].message.v.c1.v.systemInformation.criticalExtensions.v.systemInformation_r8.sib_TypeAndInfo.v[j].v.sib4.intraFreqNeighCellList.v.v[k].q_OffsetCell;
}
}
}
......
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