Commit 5521ba10 authored by winckel's avatar winckel

Reorganized RTAI and SIMU makefiles to factorize some common code.

Added some NAS primitive handling on UE side.

pre-ci Ok.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4625 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4711d8da
......@@ -60,6 +60,10 @@ void *nas_ue_task(void *args_p) {
LOG_I(NAS, "[UE %d] Received %s\n", Mod_id, msg_name);
break;
case NAS_DOWNLINK_DATA_IND:
LOG_I(NAS, "[UE %d] Received %s: UEid %u, lenght %u\n", Mod_id, msg_name,
NAS_DOWNLINK_DATA_IND (msg_p).UEid, NAS_DOWNLINK_DATA_IND (msg_p).nasMsg.length);
break;
default:
LOG_E(NAS, "[UE %d] Received unexpected message %s\n", Mod_id, msg_name);
......
......@@ -109,7 +109,7 @@ void init_SI_UE(u8 Mod_id,u8 eNB_index) {
UE_rrc_inst[Mod_id].SI[eNB_index] = (u8 *)malloc16(64);
for (i=0;i<NB_CNX_UE;i++) {
UE_rrc_inst[Mod_id].si[eNB_index][i] = (SystemInformation_t *)malloc16(sizeof(SystemInformation_t));
UE_rrc_inst[Mod_id].si[eNB_index][i] = (SystemInformation_t *)malloc16(sizeof(SystemInformation_t));
}
UE_rrc_inst[Mod_id].Info[eNB_index].SIB1Status = 0;
......@@ -134,8 +134,8 @@ static
void openair_rrc_lite_ue_init_security(u8 Mod_id)
{
#if defined(ENABLE_SECURITY)
uint8_t *kRRCenc;
uint8_t *kRRCint;
// uint8_t *kRRCenc;
// uint8_t *kRRCint;
char ascii_buffer[65];
uint8_t i;
......@@ -145,8 +145,7 @@ void openair_rrc_lite_ue_init_security(u8 Mod_id)
sprintf(&ascii_buffer[2 * i], "%02X", UE_rrc_inst[Mod_id].kenb[i]);
}
LOG_T(RRC, "[OSA][UE %02d] kenb = %s\n",
Mod_id, ascii_buffer);
LOG_T(RRC, "[OSA][UE %02d] kenb = %s\n", Mod_id, ascii_buffer);
#endif
}
......@@ -196,7 +195,6 @@ char openair_rrc_lite_ue_init(u8 Mod_id, unsigned char eNB_index){
return 0;
}
/*------------------------------------------------------------------------------*/
void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index){
/*------------------------------------------------------------------------------*/
......@@ -209,10 +207,10 @@ void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index){
// Generate random byte stream for contention resolution
for (i=0;i<6;i++) {
#ifdef SMBV
// if SMBV is configured the contention resolution needs to be fix for the connection procedure to succeed
rv[i]=i;
// if SMBV is configured the contention resolution needs to be fix for the connection procedure to succeed
rv[i]=i;
#else
rv[i]=taus()&0xff;
rv[i]=taus()&0xff;
#endif
LOG_T(RRC,"%x.",rv[i]);
}
......@@ -220,7 +218,7 @@ void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index){
UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size = do_RRCConnectionRequest((u8 *)UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.Payload,rv);
LOG_I(RRC,"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCConnectionRequest (bytes %d, eNB %d)\n",
Mod_id, frame, UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size, eNB_index);
Mod_id, frame, UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size, eNB_index);
for (i=0;i<UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size;i++) {
LOG_T(RRC,"%x.",UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.Payload[i]);
......@@ -278,7 +276,7 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind
size = do_RRCConnectionSetupComplete(buffer, Transaction_id, sizeof(nas_attach_req_guti), nas_attach_req_guti);
LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n",
Mod_id,frame, size, eNB_index);
Mod_id,frame, size, eNB_index);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frame, Mod_id+NB_eNB_INST, size, eNB_index, rrc_mui, Mod_id+NB_eNB_INST, DCCH);
......@@ -288,8 +286,6 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind
}
void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index, uint8_t Transaction_id) {
u8 buffer[32], size;
......@@ -297,9 +293,9 @@ void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame,
size = do_RRCConnectionReconfigurationComplete(buffer, Transaction_id);
LOG_I(RRC,"[UE %d] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionReconfigurationComplete (bytes %d, eNB_index %d)\n",
Mod_id,frame, size, eNB_index);
Mod_id,frame, size, eNB_index);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionReconfigurationComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frame, Mod_id+NB_eNB_INST, size, eNB_index, rrc_mui, Mod_id+NB_eNB_INST, DCCH);
frame, Mod_id+NB_eNB_INST, size, eNB_index, rrc_mui, Mod_id+NB_eNB_INST, DCCH);
//rrc_rlc_data_req(Mod_id+NB_eNB_INST,frame, 0 ,DCCH,rrc_mui++,0,size,(char*)buffer);
pdcp_rrc_data_req (Mod_id + NB_eNB_INST, frame, 0, DCCH, rrc_mui++, 0, size, buffer, 1);
......@@ -319,13 +315,13 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){
//memset(dl_ccch_msg,0,sizeof(DL_CCCH_Message_t));
// LOG_D(RRC,"[UE %d] Decoding DL-CCCH message (%d bytes), State %d\n",Mod_id,Srb_info->Rx_buffer.payload_size,
// UE_rrc_inst[Mod_id].Info[eNB_index].State);
// UE_rrc_inst[Mod_id].Info[eNB_index].State);
dec_rval = uper_decode(NULL,
&asn_DEF_DL_CCCH_Message,
(void**)&dl_ccch_msg,
(uint8_t*)Srb_info->Rx_buffer.Payload,
100,0,0);
&asn_DEF_DL_CCCH_Message,
(void**)&dl_ccch_msg,
(uint8_t*)Srb_info->Rx_buffer.Payload,
100,0,0);
#ifdef XER_PRINT
xer_fprint(stdout,&asn_DEF_DL_CCCH_Message,(void*)dl_ccch_msg);
......@@ -432,9 +428,8 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){
return rval;
}
s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index,
struct SRB_ToAddMod *SRB_config) { // add descriptor from RRC PDU
s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index, struct SRB_ToAddMod *SRB_config) {
// add descriptor from RRC PDU
u8 lchan_id = DCCH;
......@@ -458,8 +453,8 @@ s32 rrc_ue_establish_srb1(u8 Mod_id,u32 frame,u8 eNB_index,
return(0);
}
s32 rrc_ue_establish_srb2(u8 Mod_id,u32 frame,u8 eNB_index,
struct SRB_ToAddMod *SRB_config) { // add descriptor from RRC PDU
s32 rrc_ue_establish_srb2(u8 Mod_id,u32 frame,u8 eNB_index, struct SRB_ToAddMod *SRB_config) {
// add descriptor from RRC PDU
u8 lchan_id = DCCH1;
......@@ -484,20 +479,20 @@ s32 rrc_ue_establish_srb2(u8 Mod_id,u32 frame,u8 eNB_index,
}
s32 rrc_ue_establish_drb(u8 Mod_id,u32 frame,u8 eNB_index,
struct DRB_ToAddMod *DRB_config) { // add descriptor from RRC PDU
struct DRB_ToAddMod *DRB_config) { // add descriptor from RRC PDU
#ifdef NAS_NETLINK
int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
#endif
LOG_I(RRC,"[UE] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
frame,DRB_config->drb_Identity,(int)*DRB_config->logicalChannelIdentity);
frame,DRB_config->drb_Identity,(int)*DRB_config->logicalChannelIdentity);
/*
rrc_pdcp_config_req (Mod_id+NB_eNB_INST, frame, 0, ACTION_ADD,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE);
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE);
rrc_rlc_config_req(Mod_id+NB_eNB_INST,frame,0,ACTION_ADD,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
RADIO_ACCESS_BEARER,Rlc_info_um);
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
RADIO_ACCESS_BEARER,Rlc_info_um);
*/
#ifdef NAS_NETLINK
# ifdef OAI_EMU
......@@ -509,27 +504,27 @@ s32 rrc_ue_establish_drb(u8 Mod_id,u32 frame,u8 eNB_index,
# endif
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO)
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", Mod_id, ip_addr_offset3+Mod_id,
ip_addr_offset3+Mod_id+1,ip_addr_offset4+Mod_id+1);
ip_addr_offset3+Mod_id+1,ip_addr_offset4+Mod_id+1);
oip_ifup=nas_config(ip_addr_offset3+Mod_id, // interface_id
ip_addr_offset3+Mod_id+1, // third_octet
ip_addr_offset4+Mod_id+1); // fourth_octet
ip_addr_offset3+Mod_id+1, // third_octet
ip_addr_offset4+Mod_id+1); // fourth_octet
if (oip_ifup == 0 ){ // interface is up --> send a config the DRB
# ifdef OAI_EMU
oai_emulation.info.oai_ifup[Mod_id]=1;
# endif
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
Mod_id,
ip_addr_offset3+Mod_id,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity);
rb_conf_ipv4(0,//add
Mod_id,//cx align with the UE index
ip_addr_offset3+Mod_id,//inst num_enb+ue_index
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,//rb
0,//dscp
ipv4_address(ip_addr_offset3+Mod_id+1,ip_addr_offset4+Mod_id+1),//saddr
ipv4_address(ip_addr_offset3+Mod_id+1,eNB_index+1));//daddr
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",Mod_id,eNB_index);
Mod_id,
ip_addr_offset3+Mod_id,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity);
rb_conf_ipv4(0,//add
Mod_id,//cx align with the UE index
ip_addr_offset3+Mod_id,//inst num_enb+ue_index
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,//rb
0,//dscp
ipv4_address(ip_addr_offset3+Mod_id+1,ip_addr_offset4+Mod_id+1),//saddr
ipv4_address(ip_addr_offset3+Mod_id+1,eNB_index+1));//daddr
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",Mod_id,eNB_index);
}
# else
# ifdef OAI_EMU
......@@ -562,53 +557,51 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
ind = measConfig->measObjectToAddModList->list.array[i]->measObjectId;
if (UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1]) {
LOG_D(RRC,"Modifying measurement object %d\n",ind);
memcpy((char*)UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1],
(char*)measObj,
sizeof(MeasObjectToAddMod_t));
LOG_D(RRC,"Modifying measurement object %d\n",ind);
memcpy((char*)UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1],
(char*)measObj,
sizeof(MeasObjectToAddMod_t));
}
else {
LOG_I(RRC,"Adding measurement object %d\n",ind);
if (measObj->measObject.present == MeasObjectToAddMod__measObject_PR_measObjectEUTRA) {
LOG_I(RRC,"EUTRA Measurement : carrierFreq %d, allowedMeasBandwidth %d,presenceAntennaPort1 %d, neighCellConfig %d\n",
measObj->measObject.choice.measObjectEUTRA.carrierFreq,
measObj->measObject.choice.measObjectEUTRA.allowedMeasBandwidth,
measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1,
measObj->measObject.choice.measObjectEUTRA.neighCellConfig.buf[0]);
UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1]=measObj;
}
LOG_I(RRC,"Adding measurement object %d\n",ind);
if (measObj->measObject.present == MeasObjectToAddMod__measObject_PR_measObjectEUTRA) {
LOG_I(RRC,"EUTRA Measurement : carrierFreq %d, allowedMeasBandwidth %d,presenceAntennaPort1 %d, neighCellConfig %d\n",
measObj->measObject.choice.measObjectEUTRA.carrierFreq,
measObj->measObject.choice.measObjectEUTRA.allowedMeasBandwidth,
measObj->measObject.choice.measObjectEUTRA.presenceAntennaPort1,
measObj->measObject.choice.measObjectEUTRA.neighCellConfig.buf[0]);
UE_rrc_inst[Mod_id].MeasObj[eNB_index][ind-1]=measObj;
}
}
}
rrc_mac_config_req(Mod_id,0,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
UE_rrc_inst[Mod_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
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
UE_rrc_inst[Mod_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
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
);
}
if (measConfig->reportConfigToRemoveList != NULL) {
for (i=0;i<measConfig->reportConfigToRemoveList->list.count;i++) {
......@@ -621,14 +614,14 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
for (i=0;i<measConfig->reportConfigToAddModList->list.count;i++) {
ind = measConfig->reportConfigToAddModList->list.array[i]->reportConfigId;
if (UE_rrc_inst[Mod_id].ReportConfig[eNB_index][ind-1]) {
LOG_I(RRC,"Modifying Report Configuration %d\n",ind-1);
memcpy((char*)UE_rrc_inst[Mod_id].ReportConfig[eNB_index][ind-1],
(char*)measConfig->reportConfigToAddModList->list.array[i],
sizeof(ReportConfigToAddMod_t));
LOG_I(RRC,"Modifying Report Configuration %d\n",ind-1);
memcpy((char*)UE_rrc_inst[Mod_id].ReportConfig[eNB_index][ind-1],
(char*)measConfig->reportConfigToAddModList->list.array[i],
sizeof(ReportConfigToAddMod_t));
}
else {
LOG_D(RRC,"Adding Report Configuration %d %p \n",ind-1,measConfig->reportConfigToAddModList->list.array[i]);
UE_rrc_inst[Mod_id].ReportConfig[eNB_index][ind-1] = measConfig->reportConfigToAddModList->list.array[i];
LOG_D(RRC,"Adding Report Configuration %d %p \n",ind-1,measConfig->reportConfigToAddModList->list.array[i]);
UE_rrc_inst[Mod_id].ReportConfig[eNB_index][ind-1] = measConfig->reportConfigToAddModList->list.array[i];
}
}
}
......@@ -637,8 +630,8 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
if (UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]) {
LOG_D(RRC,"Modifying Quantity Configuration \n");
memcpy((char*)UE_rrc_inst[Mod_id].QuantityConfig[eNB_index],
(char*)measConfig->quantityConfig,
sizeof(QuantityConfig_t));
(char*)measConfig->quantityConfig,
sizeof(QuantityConfig_t));
}
else {
LOG_D(RRC,"Adding Quantity configuration\n");
......@@ -657,14 +650,14 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
for (i=0;i<measConfig->measIdToAddModList->list.count;i++) {
ind = measConfig->measIdToAddModList->list.array[i]->measId;
if (UE_rrc_inst[Mod_id].MeasId[eNB_index][ind-1]) {
LOG_D(RRC,"Modifying Measurement ID %d\n",ind-1);
memcpy((char*)UE_rrc_inst[Mod_id].MeasId[eNB_index][ind-1],
(char*)measConfig->measIdToAddModList->list.array[i],
sizeof(MeasIdToAddMod_t));
LOG_D(RRC,"Modifying Measurement ID %d\n",ind-1);
memcpy((char*)UE_rrc_inst[Mod_id].MeasId[eNB_index][ind-1],
(char*)measConfig->measIdToAddModList->list.array[i],
sizeof(MeasIdToAddMod_t));
}
else {
LOG_D(RRC,"Adding Measurement ID %d %p\n",ind-1,measConfig->measIdToAddModList->list.array[i]);
UE_rrc_inst[Mod_id].MeasId[eNB_index][ind-1] = measConfig->measIdToAddModList->list.array[i];
LOG_D(RRC,"Adding Measurement ID %d %p\n",ind-1,measConfig->measIdToAddModList->list.array[i]);
UE_rrc_inst[Mod_id].MeasId[eNB_index][ind-1] = measConfig->measIdToAddModList->list.array[i];
}
}
}
......@@ -672,8 +665,8 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
if (measConfig->measGapConfig !=NULL) {
if (UE_rrc_inst[Mod_id].measGapConfig[eNB_index]) {
memcpy((char*)UE_rrc_inst[Mod_id].measGapConfig[eNB_index],
(char*)measConfig->measGapConfig,
sizeof(MeasGapConfig_t));
(char*)measConfig->measGapConfig,
sizeof(MeasGapConfig_t));
}
else {
UE_rrc_inst[Mod_id].measGapConfig[eNB_index] = measConfig->measGapConfig;
......@@ -684,8 +677,8 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
if (UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]) {
LOG_I(RRC,"Modifying Quantity Configuration \n");
memcpy((char*)UE_rrc_inst[Mod_id].QuantityConfig[eNB_index],
(char*)measConfig->quantityConfig,
sizeof(QuantityConfig_t));
(char*)measConfig->quantityConfig,
sizeof(QuantityConfig_t));
}
else {
LOG_I(RRC,"Adding Quantity configuration\n");
......@@ -696,11 +689,11 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
UE_rrc_inst[Mod_id].filter_coeff_rsrq = 1./pow(2,(*UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRQ)/4);
LOG_I(RRC,"[UE %d] set rsrp-coeff for eNB %d: %d rsrq-coeff: %d rsrp_factor: %f rsrq_factor: %f \n",
Mod_id, eNB_index, // UE_rrc_inst[Mod_id].Info[eNB_index].UE_index,
*UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRP,
*UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRQ,
UE_rrc_inst[Mod_id].filter_coeff_rsrp, UE_rrc_inst[Mod_id].filter_coeff_rsrp,
UE_rrc_inst[Mod_id].filter_coeff_rsrp, UE_rrc_inst[Mod_id].filter_coeff_rsrq);
Mod_id, eNB_index, // UE_rrc_inst[Mod_id].Info[eNB_index].UE_index,
*UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRP,
*UE_rrc_inst[Mod_id].QuantityConfig[eNB_index]->quantityConfigEUTRA->filterCoefficientRSRQ,
UE_rrc_inst[Mod_id].filter_coeff_rsrp, UE_rrc_inst[Mod_id].filter_coeff_rsrp,
UE_rrc_inst[Mod_id].filter_coeff_rsrp, UE_rrc_inst[Mod_id].filter_coeff_rsrq);
}
if (measConfig->s_Measure != NULL) {
......@@ -713,14 +706,13 @@ void rrc_ue_process_measConfig(u8 Mod_id,u32 frame, u8 eNB_index,MeasConfig_t *
else
UE_rrc_inst[Mod_id].speedStatePars = measConfig->speedStatePars;
LOG_I(RRC,"[UE %d] Configuring mobility optimization params for UE %d \n",
Mod_id,UE_rrc_inst[Mod_id].Info[0].UE_index);
Mod_id,UE_rrc_inst[Mod_id].Info[0].UE_index);
}
}
void
void
rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated) {
RadioResourceConfigDedicated_t *radioResourceConfigDedicated) {
long SRB_id,DRB_id;
int i,cnt;
......@@ -734,7 +726,7 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
if (radioResourceConfigDedicated->physicalConfigDedicated) {
if (UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index]) {
memcpy((char*)UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index],(char*)radioResourceConfigDedicated->physicalConfigDedicated,
sizeof(struct PhysicalConfigDedicated));
sizeof(struct PhysicalConfigDedicated));
}
else {
......@@ -745,11 +737,11 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
if (radioResourceConfigDedicated->mac_MainConfig) {
if (radioResourceConfigDedicated->mac_MainConfig->present == RadioResourceConfigDedicated__mac_MainConfig_PR_explicitValue) {
if (UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index]) {
memcpy((char*)UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index],(char*)&radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue,
sizeof(MAC_MainConfig_t));
memcpy((char*)UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index],(char*)&radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue,
sizeof(MAC_MainConfig_t));
}
else
UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index] = &radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index] = &radioResourceConfigDedicated->mac_MainConfig->choice.explicitValue;
}
}
......@@ -757,7 +749,7 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
if (radioResourceConfigDedicated->sps_Config) {
if (UE_rrc_inst[Mod_id].sps_Config[eNB_index]) {
memcpy(UE_rrc_inst[Mod_id].sps_Config[eNB_index],radioResourceConfigDedicated->sps_Config,
sizeof(struct SPS_Config));
sizeof(struct SPS_Config));
}
else {
UE_rrc_inst[Mod_id].sps_Config[eNB_index] = radioResourceConfigDedicated->sps_Config;
......@@ -766,19 +758,19 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
#ifdef CBA
if (radioResourceConfigDedicated->cba_RNTI_vlola) {
cba_RNTI = (uint16_t) (((radioResourceConfigDedicated->cba_RNTI_vlola->buf[1]&0xff) << 8) |
(radioResourceConfigDedicated->cba_RNTI_vlola->buf[0]&0xff));
(radioResourceConfigDedicated->cba_RNTI_vlola->buf[0]&0xff));
for (i=0 ; i< NUM_MAX_CBA_GROUP; i++) {
if (UE_rrc_inst[Mod_id].cba_rnti[i] == cba_RNTI ) {
cba_found=1;
break;
cba_found=1;
break;
} else if (UE_rrc_inst[Mod_id].cba_rnti[i] == 0 )
break;
break;
}
if (cba_found==0) {
UE_rrc_inst[Mod_id].num_active_cba_groups++;
UE_rrc_inst[Mod_id].cba_rnti[i]=cba_RNTI;
LOG_D(RRC, "[UE %d] Frame %d: radioResourceConfigDedicated reveived CBA_RNTI = %x for group %d from eNB %d \n",
Mod_id,frame, UE_rrc_inst[Mod_id].cba_rnti[i], i, eNB_index);
Mod_id,frame, UE_rrc_inst[Mod_id].cba_rnti[i], i, eNB_index);
}
}
#endif
......@@ -806,133 +798,132 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
kRRCint,
NULL
#ifdef Rel10
,(PMCH_InfoList_r9_t *)NULL
,(PMCH_InfoList_r9_t *)NULL
#endif
);
);
// Refresh SRBs
rrc_rlc_config_asn1_req(NB_eNB_INST+Mod_id,frame,0,eNB_index,
radioResourceConfigDedicated->srb_ToAddModList,
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL
radioResourceConfigDedicated->srb_ToAddModList,
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL
#ifdef Rel10
,(PMCH_InfoList_r9_t *)NULL
,(PMCH_InfoList_r9_t *)NULL
#endif
);
);
for (cnt=0;cnt<radioResourceConfigDedicated->srb_ToAddModList->list.count;cnt++) {
SRB_id = radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt]->srb_Identity;
LOG_D(RRC,"[UE %d]: Frame %d SRB config cnt %d (SRB%ld)\n",Mod_id,frame,cnt,SRB_id);
if (SRB_id == 1) {
if (UE_rrc_inst[Mod_id].SRB1_config[eNB_index]) {
memcpy(UE_rrc_inst[Mod_id].SRB1_config[eNB_index],radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt],
sizeof(struct SRB_ToAddMod));
}
else {
UE_rrc_inst[Mod_id].SRB1_config[eNB_index] = radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt];
rrc_ue_establish_srb1(Mod_id,frame,eNB_index,radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt]);
if (UE_rrc_inst[Mod_id].SRB1_config[eNB_index]->logicalChannelConfig) {
if (UE_rrc_inst[Mod_id].SRB1_config[eNB_index]->logicalChannelConfig->present == SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) {
SRB1_logicalChannelConfig = &UE_rrc_inst[Mod_id].SRB1_config[eNB_index]->logicalChannelConfig->choice.explicitValue;
}
else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
}
else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
if (UE_rrc_inst[Mod_id].SRB1_config[eNB_index]) {
memcpy(UE_rrc_inst[Mod_id].SRB1_config[eNB_index],radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt],
sizeof(struct SRB_ToAddMod));
}
else {
UE_rrc_inst[Mod_id].SRB1_config[eNB_index] = radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt];
rrc_ue_establish_srb1(Mod_id,frame,eNB_index,radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt]);
if (UE_rrc_inst[Mod_id].SRB1_config[eNB_index]->logicalChannelConfig) {
if (UE_rrc_inst[Mod_id].SRB1_config[eNB_index]->logicalChannelConfig->present == SRB_ToAddMod__logicalChannelConfig_PR_explicitValue) {
SRB1_logicalChannelConfig = &UE_rrc_inst[Mod_id].SRB1_config[eNB_index]->logicalChannelConfig->choice.explicitValue;
}
else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
}
else {
SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
}
LOG_D(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (SRB1 eNB %d) --->][MAC_UE][MOD %02d][]\n",
frame, Mod_id, eNB_index, Mod_id);
rrc_mac_config_req(Mod_id,0,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index],
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index],
1,
SRB1_logicalChannelConfig,
(MeasGapConfig_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
rrc_mac_config_req(Mod_id,0,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index],
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[Mod_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[Mod_id].SRB2_config[eNB_index]) {
memcpy(UE_rrc_inst[Mod_id].SRB2_config[eNB_index],radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt],
sizeof(struct SRB_ToAddMod));
}
else {
if (UE_rrc_inst[Mod_id].SRB2_config[eNB_index]) {
memcpy(UE_rrc_inst[Mod_id].SRB2_config[eNB_index],radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt],
sizeof(struct SRB_ToAddMod));
}
else {
UE_rrc_inst[Mod_id].SRB2_config[eNB_index] = radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt];
UE_rrc_inst[Mod_id].SRB2_config[eNB_index] = radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt];
rrc_ue_establish_srb2(Mod_id,frame,eNB_index,radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt]);
if (UE_rrc_inst[Mod_id].SRB2_config[eNB_index]->logicalChannelConfig) {
if (UE_rrc_inst[Mod_id].SRB2_config[eNB_index]->logicalChannelConfig->present == SRB_ToAddMod__logicalChannelConfig_PR_explicitValue){
LOG_I(RRC,"Applying Explicit SRB2 logicalChannelConfig\n");
SRB2_logicalChannelConfig = &UE_rrc_inst[Mod_id].SRB2_config[eNB_index]->logicalChannelConfig->choice.explicitValue;
}
else {
LOG_I(RRC,"Applying default SRB2 logicalChannelConfig\n");
SRB2_logicalChannelConfig = &SRB2_logicalChannelConfig_defaultValue;
}
}
else {
SRB2_logicalChannelConfig = &SRB2_logicalChannelConfig_defaultValue;
}
rrc_ue_establish_srb2(Mod_id,frame,eNB_index,radioResourceConfigDedicated->srb_ToAddModList->list.array[cnt]);
if (UE_rrc_inst[Mod_id].SRB2_config[eNB_index]->logicalChannelConfig) {
if (UE_rrc_inst[Mod_id].SRB2_config[eNB_index]->logicalChannelConfig->present == SRB_ToAddMod__logicalChannelConfig_PR_explicitValue){
LOG_I(RRC,"Applying Explicit SRB2 logicalChannelConfig\n");
SRB2_logicalChannelConfig = &UE_rrc_inst[Mod_id].SRB2_config[eNB_index]->logicalChannelConfig->choice.explicitValue;
}
else {
LOG_I(RRC,"Applying default SRB2 logicalChannelConfig\n");
SRB2_logicalChannelConfig = &SRB2_logicalChannelConfig_defaultValue;
}
}
else {
SRB2_logicalChannelConfig = &SRB2_logicalChannelConfig_defaultValue;
}
LOG_D(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_CONFIG_REQ (SRB2 eNB %d) --->][MAC_UE][MOD %02d][]\n",
frame, Mod_id, eNB_index, Mod_id);
rrc_mac_config_req(Mod_id,0,0,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index],
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index],
2,
SRB2_logicalChannelConfig,
UE_rrc_inst[Mod_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
(RadioResourceConfigCommonSIB_t *)NULL,
UE_rrc_inst[Mod_id].physicalConfigDedicated[eNB_index],
(MeasObjectToAddMod_t **)NULL,
UE_rrc_inst[Mod_id].mac_MainConfig[eNB_index],
2,
SRB2_logicalChannelConfig,
UE_rrc_inst[Mod_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
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
);
}
);
}
}
}
}
......@@ -957,60 +948,60 @@ rrc_ue_process_radioResourceConfigDedicated(u8 Mod_id,u32 frame, u8 eNB_index,
NULL,
kUPenc
#ifdef Rel10
,(PMCH_InfoList_r9_t *)NULL
,(PMCH_InfoList_r9_t *)NULL
#endif
);
);
// Refresh DRBs
rrc_rlc_config_asn1_req(NB_eNB_INST+Mod_id,frame,0,eNB_index,
(SRB_ToAddModList_t*)NULL,
radioResourceConfigDedicated->drb_ToAddModList,
(DRB_ToReleaseList_t*)NULL