initial testing version of L1L-L1H split (RRU-RAU)

This commit is contained in:
Raymond Knopp
2017-04-17 10:40:23 -07:00
parent 71af8ce824
commit b42aed9ed9
134 changed files with 8669 additions and 10672 deletions
+30 -27
View File
@@ -40,6 +40,7 @@
#include "rrc_eNB_UE_context.h"
#include "pdcp.h"
#include "msc.h"
#include "common/ran_context.h"
#ifdef PHY_EMUL
#include "SIMULATION/simulation_defs.h"
@@ -57,6 +58,8 @@ extern UE_MAC_INST *UE_mac_inst;
mui_t mui=0;
extern RAN_CONTEXT_t RC;
//------------------------------------------------------------------------------
int8_t
mac_rrc_data_req(
@@ -83,25 +86,25 @@ mac_rrc_data_req(
if( enb_flagP == ENB_FLAG_YES) {
if((Srb_id & RAB_OFFSET) == BCCH) {
if(eNB_rrc_inst[Mod_idP].carrier[CC_id].SI.Active==0) {
if(RC.rrc[Mod_idP]->carrier[CC_id].SI.Active==0) {
return 0;
}
// All even frames transmit SIB in SF 5
if (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1 == 255) {
if (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1 == 255) {
LOG_E(RRC,"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP);
mac_xface->macphy_exit("mac_rrc_data_req: MAC Request for SIB1 and SIB1 not initialized");
}
if ((frameP%2) == 0) {
memcpy(&buffer_pP[0],
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB1,
eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1);
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int sib1_size = eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1;
int sib1_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1;
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
if (sib1_size > sdu_size) {
@@ -114,7 +117,7 @@ mac_rrc_data_req(
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib1_size;
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB1,
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
sib1_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
@@ -125,24 +128,24 @@ mac_rrc_data_req(
#ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP);
for (i=0; i<eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1; i++) {
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
} // All RFN mod 8 transmit SIB2-3 in SF 5
else if ((frameP%8) == 1) {
memcpy(&buffer_pP[0],
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB23,
eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23);
RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int sib23_size = eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23;
int sib23_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23;
int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu);
if (sib23_size > sdu_size) {
@@ -155,7 +158,7 @@ mac_rrc_data_req(
RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib23_size;
memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu,
eNB_rrc_inst[Mod_idP].carrier[CC_id].SIB23,
RC.rrc[Mod_idP]->carrier[CC_id].SIB23,
sib23_size);
RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index;
@@ -166,13 +169,13 @@ mac_rrc_data_req(
#ifdef DEBUG_RRC
LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP);
for (i=0; i<eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23; i++) {
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return(eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB23);
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
} else {
return(0);
}
@@ -181,12 +184,12 @@ mac_rrc_data_req(
if( (Srb_id & RAB_OFFSET ) == CCCH) {
LOG_T(RRC,"[eNB %d] Frame %d CCCH request (Srb_id %d)\n",Mod_idP,frameP, Srb_id);
if(eNB_rrc_inst[Mod_idP].carrier[CC_id].Srb0.Active==0) {
if(RC.rrc[Mod_idP]->carrier[CC_id].Srb0.Active==0) {
LOG_E(RRC,"[eNB %d] CCCH Not active\n",Mod_idP);
return -1;
}
Srb_info=&eNB_rrc_inst[Mod_idP].carrier[CC_id].Srb0;
Srb_info=&RC.rrc[Mod_idP]->carrier[CC_id].Srb0;
// check if data is there for MAC
if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer
@@ -225,7 +228,7 @@ mac_rrc_data_req(
#ifdef Rel10
if((Srb_id & RAB_OFFSET) == MCCH) {
if(eNB_rrc_inst[Mod_idP].carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) {
if(RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESS[mbsfn_sync_area].Active==0) {
return 0; // this parameter is set in function init_mcch in rrc_eNB.c
}
@@ -239,7 +242,7 @@ mac_rrc_data_req(
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
int mcch_size = eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];
int mcch_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area];
int sdu_size = sizeof(RRC_MAC_MCCH_DATA_REQ (message_p).sdu);
if (mcch_size > sdu_size) {
@@ -252,7 +255,7 @@ mac_rrc_data_req(
RRC_MAC_MCCH_DATA_REQ (message_p).sdu_size = mcch_size;
memset (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, 0, MCCH_SDU_SIZE);
memcpy (RRC_MAC_MCCH_DATA_REQ (message_p).sdu,
eNB_rrc_inst[Mod_idP].carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
mcch_size);
RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index;
RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area;
@@ -262,20 +265,20 @@ mac_rrc_data_req(
#endif
memcpy(&buffer_pP[0],
eNB_rrc_inst[Mod_idP].carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area],
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
#ifdef DEBUG_RRC
LOG_D(RRC,"[eNB %d] Frame %d : MCCH request => MCCH_MESSAGE \n",Mod_idP,frameP);
for (i=0; i<eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) {
for (i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
#endif
return (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]);
// }
//else
//return(0);
@@ -462,7 +465,7 @@ mac_rrc_data_ind(
#endif // Rel10
} else { // This is an eNB
Srb_info = &eNB_rrc_inst[module_idP].carrier[CC_id].Srb0;
Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0;
LOG_T(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id);
#if defined(ENABLE_ITTI)
@@ -706,7 +709,7 @@ mac_eNB_get_rrc_status(
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[Mod_idP],
RC.rrc[Mod_idP],
rntiP);
if (ue_context_p != NULL) {
@@ -724,7 +727,7 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[Mod_instP],
RC.rrc[Mod_instP],
rntiP);
if (ue_context_p != NULL) {
@@ -745,7 +748,7 @@ void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[Mod_instP],
RC.rrc[Mod_instP],
rntiP);
if (ue_context_p != NULL) {
+75 -229
View File
@@ -64,6 +64,7 @@
#endif
#include "RRC/LITE/defs.h"
#include "RRC/LITE/extern.h"
#include "RRCConnectionSetupComplete.h"
#include "RRCConnectionReconfigurationComplete.h"
#include "RRCConnectionReconfiguration.h"
@@ -87,6 +88,8 @@
# include "intertask_interface.h"
#endif
#include "common/ran_context.h"
//#include "PHY/defs.h"
#ifndef USER_MODE
#define msg printk
@@ -101,7 +104,6 @@ int errno;
//#define XER_PRINT
extern Enb_properties_array_t enb_properties;
typedef struct xer_sprint_string_s {
char *string;
size_t string_size;
@@ -111,6 +113,8 @@ typedef struct xer_sprint_string_s {
extern unsigned char NB_eNB_INST;
extern uint8_t usim_test;
extern RAN_CONTEXT_t RC;
uint16_t two_tier_hexagonal_cellIds[7] = {0,1,2,4,5,7,8};
uint16_t two_tier_hexagonal_adjacent_cellIds[7][6] = {{1,2,4,5,7,8}, // CellId 0
{11,18,2,0,8,15}, // CellId 1
@@ -186,186 +190,84 @@ uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId)
return 0xFF; //error!
}
/*
uint8_t do_SIB1(LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
SystemInformationBlockType1_t *sib1) {
PLMN_IdentityInfo_t PLMN_identity_info;
MCC_MNC_Digit_t dummy;
asn_enc_rval_t enc_rval;
SchedulingInfo_t schedulingInfo;
SIB_Type_t sib_type;
memset(sib1,0,sizeof(SystemInformationBlockType1_t));
memset(&PLMN_identity_info,0,sizeof(PLMN_IdentityInfo_t));
memset(&schedulingInfo,0,sizeof(SchedulingInfo_t));
memset(&sib_type,0,sizeof(SIB_Type_t));
PLMN_identity_info.plmn_Identity.mcc = CALLOC(1,sizeof(*PLMN_identity_info.plmn_Identity.mcc));
memset(PLMN_identity_info.plmn_Identity.mcc,0,sizeof(*PLMN_identity_info.plmn_Identity.mcc));
asn_set_empty(&PLMN_identity_info.plmn_Identity.mcc->list);//.size=0;
dummy=2;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy);
dummy=6;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy);
dummy=2;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mcc->list,&dummy);
PLMN_identity_info.plmn_Identity.mnc.list.size=0;
PLMN_identity_info.plmn_Identity.mnc.list.count=0;
dummy=8;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy);
dummy=0;ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&dummy);
//assign_enum(&PLMN_identity_info.cellReservedForOperatorUse,PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved);
PLMN_identity_info.cellReservedForOperatorUse=PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
ASN_SEQUENCE_ADD(&sib1->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info);
// 16 bits
sib1->cellAccessRelatedInfo.trackingAreaCode.buf = MALLOC(2);
sib1->cellAccessRelatedInfo.trackingAreaCode.buf[0]=0x00;
sib1->cellAccessRelatedInfo.trackingAreaCode.buf[1]=0x10;
sib1->cellAccessRelatedInfo.trackingAreaCode.size=2;
sib1->cellAccessRelatedInfo.trackingAreaCode.bits_unused=0;
// 28 bits
sib1->cellAccessRelatedInfo.cellIdentity.buf = MALLOC(8);
sib1->cellAccessRelatedInfo.cellIdentity.buf[0]=0x01;
sib1->cellAccessRelatedInfo.cellIdentity.buf[1]=0x48;
sib1->cellAccessRelatedInfo.cellIdentity.buf[2]=0x0f;
sib1->cellAccessRelatedInfo.cellIdentity.buf[3]=0x03;
sib1->cellAccessRelatedInfo.cellIdentity.size=4;
sib1->cellAccessRelatedInfo.cellIdentity.bits_unused=4;
// assign_enum(&sib1->cellAccessRelatedInfo.cellBarred,SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred);
sib1->cellAccessRelatedInfo.cellBarred=SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred;
// assign_enum(&sib1->cellAccessRelatedInfo.intraFreqReselection,SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_allowed);
sib1->cellAccessRelatedInfo.intraFreqReselection=SystemInformationBlockType1__cellAccessRelatedInfo__intraFreqReselection_allowed;
sib1->cellAccessRelatedInfo.csg_Indication=0;
sib1->cellSelectionInfo.q_RxLevMin=-70;
sib1->cellSelectionInfo.q_RxLevMinOffset=NULL;
sib1->freqBandIndicator = 2;
// assign_enum(&schedulingInfo.si_Periodicity,SchedulingInfo__si_Periodicity_rf8);
schedulingInfo.si_Periodicity=SchedulingInfo__si_Periodicity_rf8;
// assign_enum(&sib_type,SIB_Type_sibType3);
sib_type=SIB_Type_sibType3;
ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type);
ASN_SEQUENCE_ADD(&sib1->schedulingInfoList.list,&schedulingInfo);
sib1->tdd_Config = CALLOC(1,sizeof(struct TDD_Config));
//assign_enum(&sib1->tdd_Config->subframeAssignment,TDD_Config__subframeAssignment_sa3);
sib1->tdd_Config->subframeAssignment=frame_parms->tdd_config; //TDD_Config__subframeAssignment_sa3;
// assign_enum(&sib1->tdd_Config->specialSubframePatterns,TDD_Config__specialSubframePatterns_ssp0);
sib1->tdd_Config->specialSubframePatterns=frame_parms->tdd_config_S;//TDD_Config__specialSubframePatterns_ssp0;
// assign_enum(&sib1->si_WindowLength,SystemInformationBlockType1__si_WindowLength_ms10);
sib1->si_WindowLength=SystemInformationBlockType1__si_WindowLength_ms10;
sib1->systemInfoValueTag=0;
// sib1.nonCriticalExtension = calloc(1,sizeof(*sib1.nonCriticalExtension));
#ifdef USER_MODE
xer_fprint(stdout, &asn_DEF_SystemInformationBlockType1, (void*)sib1);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_SystemInformationBlockType1,
(void*)sib1,
buffer,
200);
#ifdef USER_MODE
LOG_D(RRC,"[eNB] SystemInformationBlockType1 Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
if (enc_rval.encoded==-1)
return(-1);
return((enc_rval.encoded+7)/8);
}
*/
// AT4 packet
uint8_t do_MIB(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t *buffer)
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame)
{
asn_enc_rval_t enc_rval;
BCCH_BCH_Message_t mib;
BCCH_BCH_Message_t *mib=&carrier->mib ;
uint8_t sfn = (uint8_t)((frame>>2)&0xff);
uint16_t spare=0;
switch (frame_parms->N_RB_DL) {
switch (N_RB_DL) {
case 6:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
break;
case 15:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n15;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n15;
break;
case 25:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n25;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n25;
break;
case 50:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n50;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n50;
break;
case 75:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n75;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n75;
break;
case 100:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n100;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n100;
break;
default:
mib.message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
mib->message.dl_Bandwidth = MasterInformationBlock__dl_Bandwidth_n6;
break;
}
switch (frame_parms->phich_config_common.phich_resource) {
switch (phich_Resource) {
case oneSixth:
mib.message.phich_Config.phich_Resource = 0;
mib->message.phich_Config.phich_Resource = 0;
break;
case half:
mib.message.phich_Config.phich_Resource = 1;
mib->message.phich_Config.phich_Resource = 1;
break;
case one:
mib.message.phich_Config.phich_Resource = 2;
mib->message.phich_Config.phich_Resource = 2;
break;
case two:
mib.message.phich_Config.phich_Resource = 3;
mib->message.phich_Config.phich_Resource = 3;
break;
}
printf("[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x,sfn %x\n",
(uint32_t)mib.message.dl_Bandwidth,
(uint32_t)frame_parms->phich_config_common.phich_duration,
(uint32_t)mib.message.phich_Config.phich_Resource,
LOG_I(RRC,"[MIB] systemBandwidth %x, phich_duration %x, phich_resource %x,sfn %x\n",
(uint32_t)mib->message.dl_Bandwidth,
(uint32_t)phich_duration,
(uint32_t)phich_Resource,
(uint32_t)sfn);
mib.message.phich_Config.phich_Duration = frame_parms->phich_config_common.phich_duration;
mib.message.systemFrameNumber.buf = &sfn;
mib.message.systemFrameNumber.size = 1;
mib.message.systemFrameNumber.bits_unused=0;
mib.message.spare.buf = (uint8_t *)&spare;
mib.message.spare.size = 2;
mib.message.spare.bits_unused = 6; // This makes a spare of 10 bits
mib->message.phich_Config.phich_Duration = phich_duration;
mib->message.systemFrameNumber.buf = &sfn;
mib->message.systemFrameNumber.size = 1;
mib->message.systemFrameNumber.bits_unused=0;
mib->message.spare.buf = (uint8_t *)&spare;
mib->message.spare.size = 2;
mib->message.spare.bits_unused = 6; // This makes a spare of 10 bits
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
(void*)&mib,
buffer,
(void*)mib,
&carrier->MIB,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
/*
#if defined(ENABLE_ITTI)
# if !defined(DISABLE_XER_SPRINT)
{
@@ -379,31 +281,21 @@ uint8_t do_MIB(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame,
msg_p->ittiMsg.rrc_dl_bcch.size = message_string_size;
memcpy(&msg_p->ittiMsg.rrc_dl_bcch.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p);
itti_send_msg_to_task(TASK_UNKNOWN, enb_module_idP, msg_p);
}
}
# endif
#endif
*/
if (enc_rval.encoded==-1) {
return(-1);
}
return((enc_rval.encoded+7)/8);
/*
printf("MIB: %x ((MIB>>10)&63)+(MIB&3<<6)=SFN %x, MIB>>2&3 = phich_resource %d, MIB>>4&1 = phich_duration %d, MIB>>5&7 = system_bandwidth %d)\n",*(uint32_t *)buffer,
(((*(uint32_t *)buffer)>>10)&0x3f)+(((*(uint32_t *)buffer)&3)<<6),
((*(uint32_t *)buffer)>>2)&0x3,
((*(uint32_t *)buffer)>>4)&0x1,
((*(uint32_t *)buffer)>>5)&0x7
);
*/
}
uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
BCCH_DL_SCH_Message_t *bcch_message,
SystemInformationBlockType1_t **sib1
uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
int Mod_id,int CC_id
#if defined(ENABLE_ITTI)
, RrcConfigurationReq *configuration
#endif
@@ -417,6 +309,11 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
SchedulingInfo_t schedulingInfo;
SIB_Type_t sib_type;
uint8_t *buffer = carrier->SIB1;
BCCH_DL_SCH_Message_t *bcch_message = &carrier->siblock1;
SystemInformationBlockType1_t **sib1 = &carrier->sib1;
memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_t));
bcch_message->message.present = BCCH_DL_SCH_MessageType_PR_c1;
bcch_message->message.choice.c1.present = BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1;
@@ -552,14 +449,14 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
#if defined(ENABLE_ITTI)
configuration->tdd_config[CC_id];
#else
frame_parms->tdd_config;
3;
#endif
(*sib1)->tdd_Config->specialSubframePatterns =
#if defined(ENABLE_ITTI)
configuration->tdd_config_s[CC_id];
#else
frame_parms->tdd_config_S;
0;
#endif
}
@@ -589,7 +486,6 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_BCCH, message_string_size + sizeof (IttiMsgText));
msg_p->ittiMsg.rrc_dl_bcch.size = message_string_size;
memcpy(&msg_p->ittiMsg.rrc_dl_bcch.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p);
}
}
@@ -608,17 +504,7 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
}
uint8_t do_SIB23(uint8_t Mod_id,
int CC_id,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *buffer,
BCCH_DL_SCH_Message_t *bcch_message,
SystemInformationBlockType2_t **sib2,
SystemInformationBlockType3_t **sib3
#ifdef Rel10
,
SystemInformationBlockType13_r9_t **sib13,
uint8_t MBMS_flag
#endif
int CC_id
#if defined(ENABLE_ITTI)
, RrcConfigurationReq *configuration
#endif
@@ -633,6 +519,15 @@ uint8_t do_SIB23(uint8_t Mod_id,
#endif
asn_enc_rval_t enc_rval;
uint8_t *buffer = RC.rrc[Mod_id]->carrier[CC_id].SIB23;
BCCH_DL_SCH_Message_t *bcch_message = &RC.rrc[Mod_id]->carrier[CC_id].systemInformation;
SystemInformationBlockType2_t **sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
SystemInformationBlockType3_t **sib3 = &RC.rrc[Mod_id]->carrier[CC_id].sib3;
#ifdef Rel10
SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
uint8_t MBMS_flag = RC.rrc[Mod_id]->carrier[CC_id].MBMS_flag;
#endif
if (bcch_message) {
memset(bcch_message,0,sizeof(BCCH_DL_SCH_Message_t));
} else {
@@ -864,12 +759,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
// PDSCH-Config
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.referenceSignalPower=0; // corresponds to 24.7 dBm 5 MHz/ 27.7 10 MHz/ 30.7 20 MHz
if (frame_parms->mode1_flag==1) {
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=0;
} else {
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=1;
}
(*sib2)->radioResourceConfigCommon.pdsch_ConfigCommon.p_b=0;
// PUSCH-Config
(*sib2)->radioResourceConfigCommon.pusch_ConfigCommon.pusch_ConfigBasic.n_SB=1;
@@ -947,11 +838,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.bits_unused= 2;
if (frame_parms->frame_type == TDD) {
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
} else { /// 111000
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
}
sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2;
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1);
@@ -968,11 +855,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.size= 1;
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.bits_unused= 2;
if (frame_parms->frame_type == TDD) {
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x08<<2;// shift 2 cuz 2last bits are unused.
} else { ///000111
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2;
}
sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2;
ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2);
}
@@ -1043,11 +927,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf= MALLOC(1);
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
if (frame_parms->frame_type == TDD) {//TDD: SF7
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x08<<2;
} else {
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1
}
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x20<<2; // FDD: SF1
MBSFN_Area1->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
@@ -1069,11 +950,8 @@ uint8_t do_SIB23(uint8_t Mod_id,
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.size= 1;
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.bits_unused= 2;
if (frame_parms->frame_type == TDD) {//TDD: SF7
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x08<<2;
} else {
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6
}
MBSFN_Area2->mcch_Config_r9.sf_AllocInfo_r9.buf[0]=0x04<<2; // FDD: SF6
MBSFN_Area2->mcch_Config_r9.signallingMCS_r9= MBSFN_AreaInfo_r9__mcch_Config_r9__signallingMCS_r9_n7;
@@ -1388,10 +1266,10 @@ uint8_t
do_RRCConnectionSetup(
const protocol_ctxt_t* const ctxt_pP,
rrc_eNB_ue_context_t* const ue_context_pP,
int CC_id,
int CC_id,
uint8_t* const buffer,
const uint8_t transmission_mode,
const uint8_t Transaction_id,
const uint8_t transmission_mode,
const uint8_t Transaction_id,
const LTE_DL_FRAME_PARMS* const frame_parms,
SRB_ToAddModList_t **SRB_configList,
struct PhysicalConfigDedicated **physicalConfigDedicated)
@@ -1399,6 +1277,7 @@ do_RRCConnectionSetup(
asn_enc_rval_t enc_rval;
uint8_t ecause=0;
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
long* logicalchannelgroup = NULL;
struct SRB_ToAddMod* SRB1_config = NULL;
@@ -1442,12 +1321,12 @@ do_RRCConnectionSetup(
SRB1_rlc_config->present = SRB_ToAddMod__rlc_Config_PR_explicitValue;
SRB1_rlc_config->choice.explicitValue.present=RLC_Config_PR_am;
#if defined(ENABLE_ITTI)
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_poll_retransmit;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = enb_properties.properties[ctxt_pP->module_id]->srb1_poll_pdu;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = enb_properties.properties[ctxt_pP->module_id]->srb1_poll_byte;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = enb_properties.properties[ctxt_pP->module_id]->srb1_max_retx_threshold;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_reordering;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = enb_properties.properties[ctxt_pP->module_id]->srb1_timer_status_prohibit;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = rrc->srb1_timer_poll_retransmit;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = rrc->srb1_poll_pdu;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollByte = rrc->srb1_poll_byte;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.maxRetxThreshold = rrc->srb1_max_retx_threshold;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_Reordering = rrc->srb1_timer_reordering;
SRB1_rlc_config->choice.explicitValue.choice.am.dl_AM_RLC.t_StatusProhibit = rrc->srb1_timer_status_prohibit;
#else
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.t_PollRetransmit = T_PollRetransmit_ms20;;
SRB1_rlc_config->choice.explicitValue.choice.am.ul_AM_RLC.pollPDU = PollPDU_p4;;
@@ -1493,7 +1372,7 @@ do_RRCConnectionSetup(
physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUCCH));
physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH = CALLOC(1,sizeof(*physicalConfigDedicated2->tpc_PDCCH_ConfigPUSCH));
physicalConfigDedicated2->cqi_ReportConfig = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
if (enb_properties.properties[ctxt_pP->module_id]->srs_enable[CC_id])
if (rrc->srs_enable[CC_id])
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
else
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = NULL;
@@ -1582,7 +1461,7 @@ do_RRCConnectionSetup(
*/
//soundingRS-UL-ConfigDedicated
if (enb_properties.properties[ctxt_pP->module_id]->srs_enable[CC_id]) {
if (rrc->srs_enable[CC_id]) {
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = SoundingRS_UL_ConfigDedicated_PR_setup;
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth =
SoundingRS_UL_ConfigDedicated__setup__srs_Bandwidth_bw0;
@@ -2759,36 +2638,3 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
return(&UECapability);
}
#ifndef USER_MODE
int init_module(void)
{
printk("Init asn1_msg module\n");
// A non 0 return means init_module failed; module can't be loaded.
return 0;
}
void cleanup_module(void)
{
printk("Stopping asn1_msg module\n");
}
EXPORT_SYMBOL(do_SIB1);
EXPORT_SYMBOL(do_SIB23);
EXPORT_SYMBOL(do_RRCConnectionRequest);
EXPORT_SYMBOL(do_RRCConnectionSetupComplete);
EXPORT_SYMBOL(do_RRCConnectionReconfigurationComplete);
EXPORT_SYMBOL(do_RRCConnectionSetup);
EXPORT_SYMBOL(do_RRCConnectionReestablishmentReject);
EXPORT_SYMBOL(do_RRCConnectionReconfiguration);
EXPORT_SYMBOL(asn_DEF_UL_DCCH_Message);
EXPORT_SYMBOL(asn_DEF_UL_CCCH_Message);
EXPORT_SYMBOL(asn_DEF_SystemInformation);
EXPORT_SYMBOL(asn_DEF_DL_DCCH_Message);
EXPORT_SYMBOL(asn_DEF_SystemInformationBlockType1);
EXPORT_SYMBOL(asn_DEF_DL_CCCH_Message);
EXPORT_SYMBOL(uper_decode_complete);
EXPORT_SYMBOL(uper_decode);
EXPORT_SYMBOL(transmission_mode_rrc);
#endif
+17 -22
View File
@@ -60,19 +60,24 @@ uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index);
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
/**
\brief Generate a default configuration for SIB1 (eNB).
@param frame_parms Used to store some basic parameters from PHY configuration
@param buffer Pointer to PER-encoded ASN.1 description of SIB1
@param sib1 Pointer to asn1c C representation of SIB1
\brief Generate configuration for SIB1 (eNB).
@param carrier pointer to Carrier information
@param N_RB_DL Number of downlink PRBs
@param phich_Resource PHICH resoure parameter
@param phich_duration PHICH duration parameter
@param frame radio frame number
@return size of encoded bit stream in bytes*/
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame);
/**
\brief Generate configuration for SIB1 (eNB).
@param carrier pointer to Carrier information
@param Mod_id Instance of eNB
@param Component carrier Component carrier to configure
@param configuration Pointer Configuration Request structure
@return size of encoded bit stream in bytes*/
uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer,
BCCH_DL_SCH_Message_t *bcch_message,
SystemInformationBlockType1_t **sib1
#if defined(ENABLE_ITTI)
, RrcConfigurationReq *configuration
#endif
uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,int Mod_id,int CC_id, RrcConfigurationReq *configuration
);
/**
@@ -87,17 +92,7 @@ uint8_t do_SIB1(uint8_t Mod_id, int CC_id,
@return size of encoded bit stream in bytes*/
uint8_t do_SIB23(uint8_t Mod_id,
int CC_id,
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t *buffer,
BCCH_DL_SCH_Message_t *systemInformation,
SystemInformationBlockType2_t **sib2,
SystemInformationBlockType3_t **sib3
#ifdef Rel10
,
SystemInformationBlockType13_r9_t **sib13,
uint8_t MBMS_flag
#endif
int CC_id
#if defined(ENABLE_ITTI)
, RrcConfigurationReq *configuration
#endif
+23 -1
View File
@@ -388,11 +388,17 @@ typedef struct rrc_eNB_ue_context_s {
} rrc_eNB_ue_context_t;
typedef struct {
uint8_t *MIB;
uint8_t sizeof_MIB;
uint8_t *SIB1;
uint8_t sizeof_SIB1;
uint8_t *SIB23;
uint8_t sizeof_SIB23;
uint16_t physCellId;
int physCellId;
int Ncp;
int p_eNB;
uint32_t dl_CarrierFreq;
uint32_t ul_CarrierFreq;
BCCH_BCH_Message_t mib;
BCCH_DL_SCH_Message_t siblock1;
BCCH_DL_SCH_Message_t systemInformation;
@@ -445,6 +451,22 @@ typedef struct eNB_RRC_INST_s {
#if defined(ENABLE_ITTI)
RrcConfigurationReq configuration;
#endif
// other PLMN parameters
/// Mobile country code
int mcc;
/// Mobile network code
int mnc;
/// number of mnc digits
int mnc_digit_length;
// other RAN parameters
int srb1_timer_poll_retransmit;
int srb1_poll_pdu;
int srb1_poll_byte;
int srb1_max_retx_threshold;
int srb1_timer_reordering;
int srb1_timer_status_prohibit;
int srs_enable[MAX_NUM_CCs];
} eNB_RRC_INST;
#define MAX_UE_CAPABILITY_SIZE 255
+1 -20
View File
@@ -37,27 +37,8 @@
#include "LAYER2/RLC/rlc.h"
extern UE_RRC_INST *UE_rrc_inst;
extern eNB_RRC_INST *eNB_rrc_inst;
//extern RRC_XFACE *Rrc_xface;
#ifndef USER_MODE
//extern MAC_RLC_XFACE *Mac_rlc_xface;
extern int S_rrc;
//extern int R_rrc;
#else
#include "LAYER2/MAC/extern.h"
#ifndef NO_RRM
extern sock_rrm_t S_rrc;
#endif
#endif
#ifndef NO_RRM
#ifndef USER_MODE
extern char *Header_buf;
extern char *Data;
extern unsigned short Header_read_idx,Data_read_idx,Header_size;
#endif
extern unsigned short Data_to_read;
#endif //NO_RRM
#include "LAYER2/MAC/extern.h"
extern uint8_t DRB2LCHAN[8];
+1
View File
@@ -461,4 +461,5 @@ long binary_search_int(int elements[], long numElem, int value);
long binary_search_float(float elements[], long numElem, float value);
void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active);
/** @}*/
+295 -234
View File
@@ -818,38 +818,38 @@ rrc_ue_process_measConfig(
}
LOG_I(RRC,"call rrc_mac_config_req \n");
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index],
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
UE_rrc_inst[ctxt_pP->module_id].MeasObj[eNB_index],
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
#ifdef Rel10
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
);
}
if (measConfig->reportConfigToRemoveList != NULL) {
@@ -1305,38 +1305,38 @@ rrc_ue_process_radioResourceConfigDedicated(
LOG_I(RRC, "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (SRB1 eNB %d) --->][MAC_UE][MOD %02d][]\n",
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
1,
SRB1_logicalChannelConfig,
(MeasGapConfig_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
1,
SRB1_logicalChannelConfig,
(MeasGapConfig_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
#ifdef Rel10
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
);
}
} else {
if (UE_rrc_inst[ctxt_pP->module_id].SRB2_config[eNB_index]) {
@@ -1363,38 +1363,38 @@ rrc_ue_process_radioResourceConfigDedicated(
ctxt_pP->module_id,
eNB_index,
ctxt_pP->module_id);
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
2,
SRB2_logicalChannelConfig,
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
2,
SRB2_logicalChannelConfig,
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
#ifdef Rel10
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
);
}
}
}
@@ -1470,43 +1470,43 @@ rrc_ue_process_radioResourceConfigDedicated(
radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity,
eNB_index,
ctxt_pP->module_id);
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index],
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
*UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelIdentity,
UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelConfig,
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
(TDD_Config_t*)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[ctxt_pP->module_id].mac_MainConfig[eNB_index],
*UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelIdentity,
UE_rrc_inst[ctxt_pP->module_id].DRB_config[eNB_index][DRB_id]->logicalChannelConfig,
UE_rrc_inst[ctxt_pP->module_id].measGapConfig[eNB_index],
(TDD_Config_t*)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
#ifdef Rel10
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
UE_rrc_inst[ue_mod_idP].num_active_cba_groups, //
UE_rrc_inst[ue_mod_idP].cba_rnti[0]
,
UE_rrc_inst[ue_mod_idP].num_active_cba_groups, //
UE_rrc_inst[ue_mod_idP].cba_rnti[0]
#endif
);
);
}
}
}
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_CONNECTED;
LOG_I(RRC,"[UE %d] State = RRC_CONNECTED (eNB %d)\n",ctxt_pP->module_id,eNB_index);
#if !defined(ENABLE_USE_MME) && defined(OAI_EMU)
@@ -2028,41 +2028,39 @@ rrc_ue_process_mobilityControlInfo(
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
// Reset MAC and configure PHY
rrc_mac_config_req(ctxt_pP->module_id,
0,
ENB_FLAG_NO,
0,
eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
rrc_mac_config_req_ue(ctxt_pP->module_id,
0,
eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
mobilityControlInfo,
(uint8_t *)NULL,
(uint16_t *)NULL,
NULL,
NULL,
NULL,
NULL
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
mobilityControlInfo,
(uint8_t *)NULL,
(uint16_t *)NULL,
NULL,
NULL,
NULL,
NULL
#ifdef Rel10
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,0,
0
,0,
0
#endif
);
);
// Re-establish PDCP for all RBs that are established
// rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD, ue_mod_idP+DCCH);
// rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD, ue_mod_idP+DCCH1);
@@ -2886,38 +2884,38 @@ static int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
LOG_I( RRC, "[FRAME unknown][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB1 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
ctxt_pP->module_id, eNB_index, ctxt_pP->module_id );
rrc_mac_config_req(ctxt_pP->module_id, 0, ENB_FLAG_NO, 0, eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
rrc_mac_config_req_ue(ctxt_pP->module_id, 0, eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->tdd_Config,
(MobilityControlInfo_t *) NULL,
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIwindowsize,
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIperiod,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->tdd_Config,
(MobilityControlInfo_t *) NULL,
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIwindowsize,
&UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIperiod,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL
#ifdef Rel10
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
);
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus = 1;
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag = sib1->systemInfoValueTag;
@@ -3522,35 +3520,35 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
dump_sib2( UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index] );
LOG_I( RRC, "[FRAME %05"PRIu32"][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB2 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id );
rrc_mac_config_req(ctxt_pP->module_id, 0, ENB_FLAG_NO, 0, eNB_index,
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->radioResourceConfigCommon,
(struct PhysicalConfigDedicated *)NULL,
rrc_mac_config_req_ue(ctxt_pP->module_id, 0, eNB_index,
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->radioResourceConfigCommon,
(struct PhysicalConfigDedicated *)NULL,
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
(SCellToAddMod_r10_t *)NULL,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_CarrierFreq,
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_Bandwidth,
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.additionalSpectrumEmission,
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->mbsfn_SubframeConfigList
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_CarrierFreq,
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.ul_Bandwidth,
&UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->freqInfo.additionalSpectrumEmission,
UE_rrc_inst[ctxt_pP->module_id].sib2[eNB_index]->mbsfn_SubframeConfigList
#ifdef Rel10
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,0,
0
,0,
0
#endif
);
);
// After SI is received, prepare RRCConnectionRequest
#ifdef Rel10
@@ -3705,31 +3703,31 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
// adding here function to store necessary parameters for using in decode_MCCH_Message + maybe transfer to PHY layer
LOG_I( RRC, "[FRAME %05"PRIu32"][RRC_UE][MOD %02"PRIu8"][][--- MAC_CONFIG_REQ (SIB13 params eNB %"PRIu8") --->][MAC_UE][MOD %02"PRIu8"][]\n",
ctxt_pP->frame, ctxt_pP->module_id, eNB_index, ctxt_pP->module_id);
rrc_mac_config_req(ctxt_pP->module_id,0,ENB_FLAG_NO,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
(SCellToAddMod_r10_t *)NULL,
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL,
0,
&UE_rrc_inst[ctxt_pP->module_id].sib13[eNB_index]->mbsfn_AreaInfoList_r9,
(PMCH_InfoList_r9_t *)NULL
rrc_mac_config_req_ue(ctxt_pP->module_id,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
(SCellToAddMod_r10_t *)NULL,
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL,
0,
&UE_rrc_inst[ctxt_pP->module_id].sib13[eNB_index]->mbsfn_AreaInfoList_r9,
(PMCH_InfoList_r9_t *)NULL
#ifdef CBA
,0,
0
,0,
0
#endif
);
);
break;
}
#endif
@@ -4163,39 +4161,39 @@ static void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_i
LOG_I(RRC,"[UE %d] Frame %d : Number of MCH(s) in the MBSFN Sync Area %d is %d\n",
ue_mod_idP, frameP, mbsfn_sync_area, UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9.list.count);
// store to MAC/PHY necessary parameters for receiving MTCHs
rrc_mac_config_req(ue_mod_idP,0,ENB_FLAG_NO,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
rrc_mac_config_req_ue(ue_mod_idP,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
#ifdef Rel10
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL
#ifdef Rel10
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
&UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9
,
0,
(MBSFN_AreaInfoList_r9_t *)NULL,
&UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
);
UE_rrc_inst[ue_mod_idP].Info[eNB_index].MCCHStatus[mbsfn_sync_area] = 1;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_idP, ENB_FLAG_NO, UE_rrc_inst[ue_mod_idP].Info[eNB_index].rnti, frameP, 0,eNB_index);
@@ -4713,3 +4711,66 @@ void *rrc_ue_task( void *args_p )
}
}
#endif
/*------------------------------------------------------------------------------*/
void
openair_rrc_top_init_ue(
int eMBMS_active,
char* uecap_xer,
uint8_t cba_group_active,
uint8_t HO_active
)
//-----------------------------------------------------------------------------
{
module_id_t module_id;
OAI_UECapability_t *UECap = NULL;
int CC_id;
/* for no gcc warnings */
(void)CC_id;
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
if (NB_UE_INST > 0) {
UE_rrc_inst = (UE_RRC_INST*) malloc16(NB_UE_INST*sizeof(UE_RRC_INST));
memset (UE_rrc_inst, 0, NB_UE_INST * sizeof(UE_RRC_INST));
LOG_D(RRC, "ALLOCATE %d Bytes for UE_RRC_INST @ %p\n", (unsigned int)(NB_UE_INST*sizeof(UE_RRC_INST)), UE_rrc_inst);
// fill UE capability
UECap = fill_ue_capability (uecap_xer);
for (module_id = 0; module_id < NB_UE_INST; module_id++) {
UE_rrc_inst[module_id].UECap = UECap;
UE_rrc_inst[module_id].UECapability = UECap->sdu;
UE_rrc_inst[module_id].UECapability_size = UECap->sdu_size;
}
#ifdef Rel10
LOG_I(RRC,"[UE] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_UE_INST; module_id++) {
UE_rrc_inst[module_id].MBMS_flag = (uint8_t)eMBMS_active;
}
#endif
} else {
UE_rrc_inst = NULL;
}
}
//-----------------------------------------------------------------------------
void
rrc_top_cleanup_ue(
void
)
//-----------------------------------------------------------------------------
{
if (NB_UE_INST > 0) free (UE_rrc_inst);
}
+13 -135
View File
@@ -41,13 +41,14 @@
#include "pdcp.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "rrc_eNB_UE_context.h"
#include "common/ran_context.h"
#ifdef LOCALIZATION
#include <sys/time.h>
#endif
#define DEBUG_RRC 1
extern eNB_MAC_INST *eNB_mac_inst;
extern RAN_CONTEXT_t RC;
extern UE_MAC_INST *UE_mac_inst;
extern mui_t rrc_eNB_mui;
@@ -67,10 +68,10 @@ openair_rrc_on(
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
rrc_config_buffer (&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SI, BCCH, 1);
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0, CCCH, 1);
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Active = 1;
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI, BCCH, 1);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SI.Active = 1;
rrc_config_buffer (&RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0, CCCH, 1);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].Srb0.Active = 1;
}
} else {
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" OPENAIR RRC IN....\n",
@@ -231,130 +232,7 @@ rrc_config_buffer(
Srb_info->Tx_buffer.payload_size = 0;
}
/*------------------------------------------------------------------------------*/
void
openair_rrc_top_init(
int eMBMS_active,
char* uecap_xer,
uint8_t cba_group_active,
uint8_t HO_active
)
//-----------------------------------------------------------------------------
{
module_id_t module_id;
OAI_UECapability_t *UECap = NULL;
int CC_id;
/* for no gcc warnings */
(void)CC_id;
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
if (NB_UE_INST > 0) {
UE_rrc_inst = (UE_RRC_INST*) malloc16(NB_UE_INST*sizeof(UE_RRC_INST));
memset (UE_rrc_inst, 0, NB_UE_INST * sizeof(UE_RRC_INST));
LOG_D(RRC, "ALLOCATE %d Bytes for UE_RRC_INST @ %p\n", (unsigned int)(NB_UE_INST*sizeof(UE_RRC_INST)), UE_rrc_inst);
// fill UE capability
UECap = fill_ue_capability (uecap_xer);
for (module_id = 0; module_id < NB_UE_INST; module_id++) {
UE_rrc_inst[module_id].UECap = UECap;
UE_rrc_inst[module_id].UECapability = UECap->sdu;
UE_rrc_inst[module_id].UECapability_size = UECap->sdu_size;
}
#ifdef Rel10
LOG_I(RRC,"[UE] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_UE_INST; module_id++) {
UE_rrc_inst[module_id].MBMS_flag = (uint8_t)eMBMS_active;
}
#endif
} else {
UE_rrc_inst = NULL;
}
if (NB_eNB_INST > 0) {
eNB_rrc_inst = (eNB_RRC_INST*) malloc16(NB_eNB_INST*sizeof(eNB_RRC_INST));
memset (eNB_rrc_inst, 0, NB_eNB_INST * sizeof(eNB_RRC_INST));
LOG_I(RRC,"[eNB] handover active state is %d \n", HO_active);
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
eNB_rrc_inst[module_id].HO_flag = (uint8_t)HO_active;
}
#ifdef Rel10
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_rrc_inst[module_id].carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
}
}
#endif
#ifdef CBA
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_rrc_inst[module_id].carrier[CC_id].num_active_cba_groups = cba_group_active;
}
}
#endif
#ifdef LOCALIZATION
/* later set this from xml or enb.config file*/
struct timeval ts; // time struct
gettimeofday(&ts, NULL); // get the current epoch timestamp
for (module_id=0; module_id<NB_eNB_INST; module_id++) {
eNB_rrc_inst[module_id].reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
initialize(&eNB_rrc_inst[module_id].loc_list);
eNB_rrc_inst[module_id].loc_type=0;
eNB_rrc_inst[module_id].aggregation_period_ms = 5000;
}
#endif
LOG_D(RRC,
"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n", (unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)), eNB_rrc_inst);
} else {
eNB_rrc_inst = NULL;
}
#ifndef NO_RRM
#ifndef USER_MODE
Header_buf=(char*)malloc16(sizeof(msg_head_t));
Data=(char*)malloc16(2400);
Header_read_idx=0;
Data_read_idx=0;
Header_size=sizeof(msg_head_t);
#endif //NO_RRM
Data_to_read = 0;
#endif //USER_MODE
}
//-----------------------------------------------------------------------------
void
rrc_top_cleanup(
void
)
//-----------------------------------------------------------------------------
{
if (NB_UE_INST > 0) {
free (UE_rrc_inst);
}
if (NB_eNB_INST > 0) {
free (eNB_rrc_inst);
}
}
//-----------------------------------------------------------------------------
@@ -517,7 +395,7 @@ rrc_rx_tx(
// counetr, and get the value and aggregate
// check for UL failure
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
if ((ctxt_pP->frame == 0) && (ctxt_pP->subframe==0)) {
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) {
LOG_I(RRC,"UE rnti %x:S-TMSI %x failure timer %d/20000\n",
@@ -558,16 +436,16 @@ rrc_rx_tx(
/* for the localization, only primary CC_id might be relevant*/
gettimeofday(&ts, NULL);
current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
ref_timestamp_ms = eNB_rrc_inst[ctxt_pP->module_id].reference_timestamp_ms;
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
ref_timestamp_ms = RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms;
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) {
ctxt = *ctxt_pP;
ctxt.rnti = ue_context_p->ue_context.rnti;
estimated_distance = rrc_get_estimated_ue_distance(
&ctxt,
CC_id,
eNB_rrc_inst[ctxt_pP->module_id].loc_type);
RC.rrc[ctxt_pP->module_id]->loc_type);
if ((current_timestamp_ms - ref_timestamp_ms > eNB_rrc_inst[ctxt_pP->module_id].aggregation_period_ms) &&
if ((current_timestamp_ms - ref_timestamp_ms > RC.rrc[ctxt_pP->module_id]->aggregation_period_ms) &&
estimated_distance != -1) {
LOG_D(LOCALIZE, " RRC [UE/id %d -> eNB/id %d] timestamp %d frame %d estimated r = %f\n",
ctxt.rnti,
@@ -576,9 +454,9 @@ rrc_rx_tx(
ctxt_pP->frame,
estimated_distance);
LOG_D(LOCALIZE, " RRC status %d\n", ue_context_p->ue_context.Status);
push_front(&eNB_rrc_inst[ctxt_pP->module_id].loc_list,
push_front(&RC.rrc[ctxt_pP->module_id]->loc_list,
estimated_distance);
eNB_rrc_inst[ctxt_pP->module_id].reference_timestamp_ms = current_timestamp_ms;
RC.rrc[ctxt_pP->module_id]->reference_timestamp_ms = current_timestamp_ms;
}
}
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -40,6 +40,10 @@
# include "intertask_interface.h"
# endif
# include "common/ran_context.h"
extern RAN_CONTEXT_t RC;
int
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t* const ctxt_pP,
@@ -57,7 +61,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
rnti = create_tunnel_resp_pP->rnti;
ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[ctxt_pP->module_id],
RC.rrc[ctxt_pP->module_id],
ctxt_pP->rnti);
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
+19 -13
View File
@@ -37,6 +37,7 @@
# include "rrc_eNB_UE_context.h"
# include "rrc_eNB_S1AP.h"
# include "enb_config.h"
# include "common/ran_context.h"
# if defined(ENABLE_ITTI)
# include "asn1_conversions.h"
@@ -58,6 +59,8 @@
#include "gtpv1u_eNB_task.h"
#include "RRC/LITE/rrc_eNB_GTPV1U.h"
extern RAN_CONTEXT_t RC;
/* Value to indicate an invalid UE initial id */
static const uint16_t UE_INITIAL_ID_INVALID = 0;
@@ -116,7 +119,7 @@ rrc_eNB_S1AP_get_ue_ids(
result2);
if (h_rc != HASH_TABLE_OK) {
LOG_E(S1AP, "[eNB %ld] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32"\n",
rrc_instance_pP - eNB_rrc_inst, eNB_ue_s1ap_id);
rrc_instance_pP - RC.rrc[0], eNB_ue_s1ap_id);
}
}
}
@@ -209,14 +212,14 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
rrc_ue_s1ap_ids_t* temp = NULL;
temp =
rrc_eNB_S1AP_get_ue_ids(
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
ue_initial_idP,
eNB_ue_s1ap_idP);
if (temp) {
return rrc_eNB_get_ue_context(
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
RC.rrc[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
temp->ue_rnti);
}
@@ -627,7 +630,10 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
)
//------------------------------------------------------------------------------
{
eNB_RRC_INST *rrc=RC.rrc[ctxt_pP->module_id];
#if defined(ENABLE_ITTI)
{
MessageDef* message_p = NULL;
@@ -645,7 +651,7 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
h_rc = hashtable_insert(eNB_rrc_inst[ctxt_pP->module_id].initial_id2_s1ap_ids,
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
rrc_ue_s1ap_ids_p);
if (h_rc != HASH_TABLE_OK) {
@@ -708,13 +714,13 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
ue_context_pP->ue_context.rnti);
}
} else {
const Enb_properties_array_t *enb_properties_p = NULL;
enb_properties_p = enb_config_get();
// const Enb_properties_array_t *enb_properties_p = NULL;
// enb_properties_p = enb_config_get();
// actually the eNB configuration contains only one PLMN (can be up to 6)
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = enb_properties_p->properties[ctxt_pP->module_id]->mcc;
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = enb_properties_p->properties[ctxt_pP->module_id]->mnc;
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len = enb_properties_p->properties[ctxt_pP->module_id]->mnc_digit_length;
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = rrc->mcc;
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = rrc->mnc;
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len = rrc->mnc_digit_length;
}
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code = BIT_STRING_to_uint8 (&r_mme->mmec);
@@ -1172,13 +1178,13 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p);
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(
&eNB_rrc_inst[instance],
RC.rrc[instance],
UE_INITIAL_ID_INVALID,
eNB_ue_s1ap_id);
if (NULL != rrc_ue_s1ap_ids) {
rrc_eNB_S1AP_remove_ue_ids(
&eNB_rrc_inst[instance],
RC.rrc[instance],
rrc_ue_s1ap_ids);
}
return (-1);
@@ -1236,13 +1242,13 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p);
rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids(
&eNB_rrc_inst[instance],
RC.rrc[instance],
UE_INITIAL_ID_INVALID,
eNB_ue_s1ap_id);
if (NULL != rrc_ue_s1ap_ids) {
rrc_eNB_S1AP_remove_ue_ids(
&eNB_rrc_inst[instance],
RC.rrc[instance],
rrc_ue_s1ap_ids);
}
}
-23
View File
@@ -36,31 +36,8 @@
#include "COMMON/mac_rrc_primitives.h"
#include "LAYER2/MAC/defs.h"
eNB_RRC_INST *eNB_rrc_inst;
UE_RRC_INST *UE_rrc_inst;
//RRC_XFACE *Rrc_xface;
#ifndef USER_MODE
//MAC_RLC_XFACE *Mac_rlc_xface;
#ifndef NO_RRM
int S_rrc= RRC2RRM_FIFO;
#endif //NO_RRM
//int R_rrc= RRM2RRC_FIFO;
#else
#include "LAYER2/MAC/extern.h"
#ifndef NO_RRM
sock_rrm_t S_rrc;
#endif
#endif
#ifndef NO_RRM
#ifndef USER_MODE
char *Header_buf;
char *Data;
unsigned short Header_read_idx,Data_read_idx,Header_size;
#endif
unsigned short Data_to_read;
#endif //NO_RRM
#define MAX_U32 0xFFFFFFFF
uint8_t DRB2LCHAN[8];