Commit 81fff5d6 authored by wetterwa's avatar wetterwa

Update to support 2 mobiles. Requires an update in RLC and PDCP.


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4166 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 351a385a
...@@ -301,6 +301,7 @@ void rrc_rg_init_mac (unsigned char Mod_id){ ...@@ -301,6 +301,7 @@ void rrc_rg_init_mac (unsigned char Mod_id){
else{ else{
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ (SIB1-SIB2)--->][MAC_eNB]\n"); msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ (SIB1-SIB2)--->][MAC_eNB]\n");
msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
//msg ("[RRC-RG-FRONTEND] Frame TDD config %d, protocol_bs value %d\n", mac_xface->lte_frame_parms->tdd_config, protocol_bs->rrc.rg_bch_asn1.tdd_Config.subframeAssignment); //msg ("[RRC-RG-FRONTEND] Frame TDD config %d, protocol_bs value %d\n", mac_xface->lte_frame_parms->tdd_config, protocol_bs->rrc.rg_bch_asn1.tdd_Config.subframeAssignment);
#endif #endif
...@@ -361,12 +362,13 @@ void rrc_rg_init_mac (unsigned char Mod_id){ ...@@ -361,12 +362,13 @@ void rrc_rg_init_mac (unsigned char Mod_id){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int UE_index =0; int UE_index = protocol_bs->rrc.ccch_current_UE_Id;
int eNB_index = 0; int eNB_index = 0;
int eNB_flag = 1; //1=eNB, 0=UE int eNB_flag = 1; //1=eNB, 0=UE
int srb1 = 1; int srb1 = 1;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("\n[RRC-RG-FRONTEND] rrc_rg_config_LTE_srb1\n"); msg ("\n[RRC-RG-FRONTEND] rrc_rg_config_LTE_srb1\n");
msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
// get the parameters values SRB1_config, SRB2_config, physicalConfigDedicated // get the parameters values SRB1_config, SRB2_config, physicalConfigDedicated
...@@ -386,7 +388,8 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){ ...@@ -386,7 +388,8 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){
protocol_bs->rrc.ccch_buffer_size = do_RRCConnectionSetup((u8 *)protocol_bs->rrc.ccch_buffer, protocol_bs->rrc.ccch_buffer_size = do_RRCConnectionSetup((u8 *)protocol_bs->rrc.ccch_buffer,
mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)), //mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)),
1, // TEMP - hardcoded in RG as well
UE_index,0, UE_index,0,
mac_xface->lte_frame_parms, mac_xface->lte_frame_parms,
/* //&eNB_rrc_inst[Mod_id].SRB1_config[UE_index], /* //&eNB_rrc_inst[Mod_id].SRB1_config[UE_index],
...@@ -405,7 +408,8 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){ ...@@ -405,7 +408,8 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){
protocol_bs->rrc.rg_rb_asn1.SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; protocol_bs->rrc.rg_rb_asn1.SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ (SRB1 UE 0)--->][MAC_eNB]\n"); msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ (SRB1 UE %d)--->][MAC_eNB]\n", UE_index);
msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
//Apply configurations to MAC and RLC for SRB1 and SRB2 //Apply configurations to MAC and RLC for SRB1 and SRB2
/* /*
...@@ -481,15 +485,16 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){ ...@@ -481,15 +485,16 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){
void rrc_rg_rcve_ccch(u8 Mod_id, char *Sdu, u16 Sdu_len){ void rrc_rg_rcve_ccch(u8 Mod_id, char *Sdu, u16 Sdu_len){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("\n[RRC-RG-FRONTEND] rrc_rg_rcve_ccch , ConnReq, length %d\n", Sdu_len); msg ("\n[RRC-RG-FRONTEND] rrc_rg_rcve_ccch , ConnReq, length %d, Mod_id %d\n", Sdu_len, Mod_id);
#endif #endif
protocol_bs->rrc.ccch_current_UE_Id ++;
rrc_rg_config_LTE_srb1((unsigned char)Mod_id); rrc_rg_config_LTE_srb1((unsigned char)Mod_id);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int UE_index =0; int UE_index = protocol_bs->rrc.ccch_current_UE_Id;
int eNB_index = 0; int eNB_index = 0;
int eNB_flag = 1; //1=eNB, 0=UE int eNB_flag = 1; //1=eNB, 0=UE
int srb2 = 2; int srb2 = 2;
...@@ -503,6 +508,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){ ...@@ -503,6 +508,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ (SRB2 UE 0)--->][MAC_eNB]\n"); msg ("[RRC-RG-FRONTEND] MAC_CONFIG_REQ (SRB2 UE 0)--->][MAC_eNB]\n");
msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, //OK rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, //OK
(RadioResourceConfigCommonSIB_t *)NULL, //OK (RadioResourceConfigCommonSIB_t *)NULL, //OK
...@@ -549,7 +555,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){ ...@@ -549,7 +555,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){
,(MBMS_SessionInfoList_r9_t *)NULL ,(MBMS_SessionInfoList_r9_t *)NULL
#endif #endif
); );
protocol_bs->rrc.rg_rb_asn1.SRB2_active = 1; protocol_bs->rrc.rg_rb_asn1.SRB2_active[UE_index] = 1;
// TEMP Next lines have been transferred from rrc_rg_rrm_connected_init // TEMP Next lines have been transferred from rrc_rg_rrm_connected_init
// because MCCH is using srb2 // because MCCH is using srb2
//Initialise MBMS //Initialise MBMS
...@@ -560,7 +566,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){ ...@@ -560,7 +566,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int UE_index =0; int UE_index = protocol_bs->rrc.ccch_current_UE_Id;
int eNB_index = 0; int eNB_index = 0;
int eNB_flag = 1; //1=eNB, 0=UE int eNB_flag = 1; //1=eNB, 0=UE
int drb_ix=0; // default DRB int drb_ix=0; // default DRB
...@@ -569,7 +575,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -569,7 +575,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
u8 DRB2LCHAN[8]; u8 DRB2LCHAN[8];
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("\n[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: begin\n"); msg ("\n[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: begin for UE %d eNB mod id %d\n", UE_index, Mod_id);
#endif #endif
/* /*
uint8_t do_RRCConnectionReconfiguration(uint8_t Mod_id, uint8_t do_RRCConnectionReconfiguration(uint8_t Mod_id,
...@@ -612,7 +618,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -612,7 +618,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
DRB2LCHAN[drb_ix] = (u8)*protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelIdentity; DRB2LCHAN[drb_ix] = (u8)*protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->logicalChannelIdentity;
if (protocol_bs->rrc.rg_rb_asn1.DRB1_active == 0) { if (protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] == 0) {
msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: Frame %d: Establish PDCP + RLC UM Bidirectional, DRB %d Active\n", msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: Frame %d: Establish PDCP + RLC UM Bidirectional, DRB %d Active\n",
protocol_bs->rrc.current_SFN, (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity); protocol_bs->rrc.current_SFN, (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity);
...@@ -638,9 +644,12 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -638,9 +644,12 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
,(MBMS_SessionInfoList_r9_t *)NULL ,(MBMS_SessionInfoList_r9_t *)NULL
#endif #endif
); );
protocol_bs->rrc.rg_rb_asn1.DRB1_active = 1; protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] = 1;
#ifdef DEBUG_RRC_STATE
msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index); msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index);
msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d\n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif
/* RRC Lite l 1357 /* RRC Lite l 1357
...@@ -693,7 +702,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -693,7 +702,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
}else{ // remove LCHAN from MAC/PHY }else{ // remove LCHAN from MAC/PHY
// Initialized here because it is a local variable (global in RRC Lite) // Initialized here because it is a local variable (global in RRC Lite)
//DRB2LCHAN[drb_ix] = (u8)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity; //DRB2LCHAN[drb_ix] = (u8)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity;
if (protocol_bs->rrc.rg_rb_asn1.DRB1_active ==1) { if (protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] ==1) {
// DRB has just been removed so remove RLC + PDCP for DRB // DRB has just been removed so remove RLC + PDCP for DRB
msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: Frame %d: Remove PDCP + RLC UM Bidirectional, DRB 0 \n", msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb: Frame %d: Remove PDCP + RLC UM Bidirectional, DRB 0 \n",
// protocol_bs->rrc.current_SFN, (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity); // protocol_bs->rrc.current_SFN, (int)protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index]->list.array[0]->drb_Identity);
...@@ -706,8 +715,11 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -706,8 +715,11 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
RADIO_ACCESS_BEARER,Rlc_info_um); RADIO_ACCESS_BEARER,Rlc_info_um);
} }
protocol_bs->rrc.rg_rb_asn1.DRB1_active = 0; protocol_bs->rrc.rg_rb_asn1.DRB1_active[UE_index] = 0;
#ifdef DEBUG_RRC_STATE
msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index); msg("[RRC-RG-FRONTEND] rrc_rg_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index);
msg ("[RRC-RG-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif
rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL, (RadioResourceConfigCommonSIB_t *)NULL,
protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated, protocol_bs->rrc.rg_rb_asn1.physicalConfigDedicated,
......
...@@ -72,6 +72,7 @@ void rrc_rg_init (u8 Mod_id){ ...@@ -72,6 +72,7 @@ void rrc_rg_init (u8 Mod_id){
protocol_bs->rrc.rg_cell_id = 5; // Temp protocol_bs->rrc.rg_cell_id = 5; // Temp
#endif #endif
protocol_bs->rrc.mod_id =0; protocol_bs->rrc.mod_id =0;
protocol_bs->rrc.ccch_current_UE_Id = -1;
// initialise NAS global variables // initialise NAS global variables
pt_nas_rg_irq = &(protocol_bs->rrc.ip_rx_irq); pt_nas_rg_irq = &(protocol_bs->rrc.ip_rx_irq);
......
...@@ -241,7 +241,7 @@ int rrc_rg_read_DCin_FIFO (int UE_Id, u8 *buffer, int count){ ...@@ -241,7 +241,7 @@ int rrc_rg_read_DCin_FIFO (int UE_Id, u8 *buffer, int count){
if (count > 0) { if (count > 0) {
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC_RG] Message Received from NAS: -%hx- \n", buffer[0]); msg ("[RRC_RG] Message Received from NAS: -%hx- for UE %d\n", buffer[0], UE_Id);
#endif #endif
p = (struct nas_rg_dc_element *) buffer; p = (struct nas_rg_dc_element *) buffer;
prim_length = (int) (p->length); prim_length = (int) (p->length);
......
...@@ -345,10 +345,10 @@ void rrc_rg_read_FIFO (void){ ...@@ -345,10 +345,10 @@ void rrc_rg_read_FIFO (void){
rrc_rg_read_DCin_FIFO (0, rcve_buffer, count); rrc_rg_read_DCin_FIFO (0, rcve_buffer, count);
break; break;
case RRC_NAS_DC1_IN: case RRC_NAS_DC1_IN:
rrc_rg_read_DCin_FIFO (0, rcve_buffer, count); rrc_rg_read_DCin_FIFO (1, rcve_buffer, count);
break; break;
case RRC_NAS_DC2_IN: case RRC_NAS_DC2_IN:
rrc_rg_read_DCin_FIFO (0, rcve_buffer, count); rrc_rg_read_DCin_FIFO (2, rcve_buffer, count);
break; break;
break; break;
default: default:
......
...@@ -239,7 +239,7 @@ void RRC_RG_O_O_NAS_RB_ESTAB_CNF (int UE_Id){ ...@@ -239,7 +239,7 @@ void RRC_RG_O_O_NAS_RB_ESTAB_CNF (int UE_Id){
msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.sapId = protocol_bs->rrc.Mobile_List[UE_Id].requested_sapid; msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.sapId = protocol_bs->rrc.Mobile_List[UE_Id].requested_sapid;
msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.status = ACCEPTED; msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.status = ACCEPTED;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC_RG][FSM-OUT] RB_ESTABLISH_Cnf primitive sent to NAS, for mobile %d.\n", UE_Id); msg ("[RRC_RG][FSM-OUT] RB_ESTABLISH_Cnf primitive sent to NAS, for mobile %d, RB %u.\n", UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
#endif #endif
} }
...@@ -263,7 +263,7 @@ void RRC_RG_O_O_NAS_RB_Failure (int UE_Id){ ...@@ -263,7 +263,7 @@ void RRC_RG_O_O_NAS_RB_Failure (int UE_Id){
msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.status = FAILURE; msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.status = FAILURE;
msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.fail_code = protocol_bs->rrc.curr_rb_failure_code; msgToBuild->nasRgPrimitive.dc_sap_prim.nasRGDCPrimitive.rb_establish_conf.fail_code = protocol_bs->rrc.curr_rb_failure_code;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC_RG][FSM-OUT] RB_Establish_Failure primitive sent to NAS, for mobile %d.\n", UE_Id); msg ("[RRC_RG][FSM-OUT] RB_Establish_Failure primitive sent to NAS, for mobile %d, RB %u.\n", UE_Id, protocol_bs->rrc.Mobile_List[UE_Id].requested_rbId);
#endif #endif
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
void encode_message (int *Message_Id, int UE_Id, int Message_Type){ void encode_message (int *Message_Id, int UE_Id, int Message_Type){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC][FSM-PROC]encode message %d \n", Message_Type); msg ("[RRC][FSM-PROC]encode message %d for UE %d\n", Message_Type, UE_Id);
#endif #endif
if (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length) { if (protocol_bs->rrc.Mobile_List[UE_Id].rg_msg_infos.msg_length) {
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
......
...@@ -128,11 +128,13 @@ int rrc_ue_send_to_srb_rlc (int rb_id, char * data_buffer, int data_length){ ...@@ -128,11 +128,13 @@ int rrc_ue_send_to_srb_rlc (int rb_id, char * data_buffer, int data_length){
char tx_data[500]; char tx_data[500];
int stxtlen = 0; int stxtlen = 0;
int result =0; int result =0;
int Mod_id =0; //int Mod_id = protocol_ms->rrc.mod_id;
int Mod_id = rrc_ue_mobileId;
int eNB_flag = 0; //1=eNB, 0=UE int eNB_flag = 0; //1=eNB, 0=UE
int srb1 =1; int srb1 =1;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("\n[RRC-UE-FRONTEND] Send Data to RLC, srb %d\n",rb_id); msg ("\n[RRC-UE-FRONTEND] Send Data to PDCP-RLC, srb %d at frame %d\n",rb_id, protocol_ms->rrc.current_SFN );
rrc_print_buffer (data_buffer, data_length); rrc_print_buffer (data_buffer, data_length);
#endif #endif
...@@ -188,7 +190,7 @@ int rrc_ue_receive_from_srb_rlc (char* sduP, u8 ch_idP, unsigned int Sdu_size){ ...@@ -188,7 +190,7 @@ int rrc_ue_receive_from_srb_rlc (char* sduP, u8 ch_idP, unsigned int Sdu_size){
#ifndef DEBUG_RRC_MBMS #ifndef DEBUG_RRC_MBMS
if (srb_id != RRC_MCCH_ID) if (srb_id != RRC_MCCH_ID)
#endif #endif
msg ("\n[RRC-UE-FRONTEND] Begin rrc_ue_receive_from_srb_rlc, lchannel %d, srb %d for UE %d\n", ch_idP, srb_id, UE_Id); msg ("\n[RRC-UE-FRONTEND] Begin rrc_ue_receive_from_srb_rlc, lchannel %d, srb %d for UE %d at frame %d\n", ch_idP, srb_id, UE_Id, protocol_ms->rrc.current_SFN);
//rrc_print_buffer ((char*)&sduP[0], Sdu_size); //rrc_print_buffer ((char*)&sduP[0], Sdu_size);
#endif #endif
...@@ -210,7 +212,7 @@ int rrc_ue_receive_from_srb_rlc (char* sduP, u8 ch_idP, unsigned int Sdu_size){ ...@@ -210,7 +212,7 @@ int rrc_ue_receive_from_srb_rlc (char* sduP, u8 ch_idP, unsigned int Sdu_size){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_ue_simu_receive_ack_from_rlc (void){ void rrc_ue_simu_receive_ack_from_rlc (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
unsigned char Mod_id =0; unsigned char Mod_id =protocol_ms->rrc.mod_id;
rrc_L2_rlc_confirm_ind_rx (Mod_id, protocol_ms->rrc.rrc_ue_ackSimu_srbid, protocol_ms->rrc.rrc_ue_ackSimu_mui); rrc_L2_rlc_confirm_ind_rx (Mod_id, protocol_ms->rrc.rrc_ue_ackSimu_srbid, protocol_ms->rrc.rrc_ue_ackSimu_mui);
protocol_ms->rrc.rrc_ue_ackSimu_mui = 0; protocol_ms->rrc.rrc_ue_ackSimu_mui = 0;
...@@ -232,9 +234,10 @@ void rrc_ue_L2_setupFachRach(void){ ...@@ -232,9 +234,10 @@ void rrc_ue_L2_setupFachRach(void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_ue_config_common_channels (void){ void rrc_ue_config_common_channels (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int Mod_id =0; //int Mod_id = protocol_ms->rrc.mod_id;
int Mod_id = rrc_ue_mobileId;
int eNB_flag=0; int eNB_flag=0;
int UE_index=0; int UE_index=rrc_ue_mobileId;
int eNB_index=0; int eNB_index=0;
// int eNB_index = 0; // int eNB_index = 0;
// int Mod_id = 0; // int Mod_id = 0;
...@@ -244,7 +247,7 @@ void rrc_ue_config_common_channels (void){ ...@@ -244,7 +247,7 @@ void rrc_ue_config_common_channels (void){
u16 SIperiod=8; u16 SIperiod=8;
// Simulate decoding SIB1 // Simulate decoding SIB1
#ifdef DEBUG_RRC_DETAILS #ifdef DEBUG_RRC_STATE
msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_common_channels \n"); msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_common_channels \n");
#endif #endif
...@@ -257,6 +260,7 @@ void rrc_ue_config_common_channels (void){ ...@@ -257,6 +260,7 @@ void rrc_ue_config_common_channels (void){
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-UE-FRONTEND] Frame TDD config %d, protocol_ms value %d\n", (int)mac_xface->lte_frame_parms->tdd_config, (int)protocol_ms->rrc.ue_bch_asn1.tdd_Config.subframeAssignment); msg ("[RRC-UE-FRONTEND] Frame TDD config %d, protocol_ms value %d\n", (int)mac_xface->lte_frame_parms->tdd_config, (int)protocol_ms->rrc.ue_bch_asn1.tdd_Config.subframeAssignment);
msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SIB1)--->][MAC_UE]\n"); msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SIB1)--->][MAC_UE]\n");
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
// After Decoding SIB1 (l. 776) // After Decoding SIB1 (l. 776)
...@@ -274,7 +278,7 @@ void rrc_ue_config_common_channels (void){ ...@@ -274,7 +278,7 @@ void rrc_ue_config_common_channels (void){
rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
NULL, //(RadioResourceConfigCommonSIB_t *) NULL, //(RadioResourceConfigCommonSIB_t *)
NULL, //(struct PhysicalConfigDedicated *) NULL, //(struct PhysicalConfigDedicated *)
(MeasObjectToAddMod_t **)NULL, (MeasObjectToAddMod_t **)NULL,
NULL, // (MAC_MainConfig_t *) NULL, // (MAC_MainConfig_t *)
0, 0,
NULL, // (struct LogicalChannelConfig *) NULL, // (struct LogicalChannelConfig *)
...@@ -315,6 +319,7 @@ void rrc_ue_config_common_channels (void){ ...@@ -315,6 +319,7 @@ void rrc_ue_config_common_channels (void){
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SIB2)--->][MAC_UE]\n"); msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SIB2)--->][MAC_UE]\n");
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
// After Decoding SIB2 (l. 1363) // After Decoding SIB2 (l. 1363)
/* rrc_mac_config_req(Mod_id,0,0,eNB_index, /* rrc_mac_config_req(Mod_id,0,0,eNB_index,
...@@ -383,7 +388,7 @@ void rrc_ue_xmit_ccch (void){ ...@@ -383,7 +388,7 @@ void rrc_ue_xmit_ccch (void){
if(protocol_ms->rrc.ccch_buffer_size ==0){ if(protocol_ms->rrc.ccch_buffer_size ==0){
for (i=0;i<6;i++) { for (i=0;i<6;i++) {
rv[i]=i; rv[i]=i+rrc_ue_mobileId;
} }
protocol_ms->rrc.ccch_buffer_size = do_RRCConnectionRequest((u8 *)protocol_ms->rrc.ccch_buffer,rv); protocol_ms->rrc.ccch_buffer_size = do_RRCConnectionRequest((u8 *)protocol_ms->rrc.ccch_buffer,rv);
} }
...@@ -392,8 +397,9 @@ void rrc_ue_xmit_ccch (void){ ...@@ -392,8 +397,9 @@ void rrc_ue_xmit_ccch (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_ue_config_LTE_srb1 (void){ void rrc_ue_config_LTE_srb1 (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
char Mod_id = 0; // char Mod_id = protocol_ms->rrc.mod_id;
int UE_index =0; char Mod_id = rrc_ue_mobileId;
int UE_index = rrc_ue_mobileId;
int eNB_index = 0; int eNB_index = 0;
int eNB_flag = 0; //1=eNB, 0=UE int eNB_flag = 0; //1=eNB, 0=UE
int srb1 = 1; int srb1 = 1;
...@@ -409,7 +415,8 @@ void rrc_ue_config_LTE_srb1 (void){ ...@@ -409,7 +415,8 @@ void rrc_ue_config_LTE_srb1 (void){
msg ("[RRC-UE-FRONTEND] do_RRCConnectionSetup\n"); msg ("[RRC-UE-FRONTEND] do_RRCConnectionSetup\n");
#endif #endif
do_RRCConnectionSetup(buffer, do_RRCConnectionSetup(buffer,
mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)), //mac_xface->get_transmission_mode(Mod_id,find_UE_RNTI(Mod_id,UE_index)),
1, // TEMP - hardcoded in UE
UE_index,0, UE_index,0,
mac_xface->lte_frame_parms, mac_xface->lte_frame_parms,
//&eNB_rrc_inst[Mod_id].SRB1_config[UE_index], //&eNB_rrc_inst[Mod_id].SRB1_config[UE_index],
...@@ -428,7 +435,8 @@ void rrc_ue_config_LTE_srb1 (void){ ...@@ -428,7 +435,8 @@ void rrc_ue_config_LTE_srb1 (void){
protocol_ms->rrc.ue_rb_asn1.SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue; protocol_ms->rrc.ue_rb_asn1.SRB1_logicalChannelConfig = &SRB1_logicalChannelConfig_defaultValue;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SRB1 UE 0)--->][MAC_eNB]\n"); msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SRB1 UE %d)--->][MAC_eNB]\n", UE_index);
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
//Apply configurations to MAC and RLC for SRB1 and SRB2 //Apply configurations to MAC and RLC for SRB1 and SRB2
/* /*
...@@ -471,6 +479,7 @@ void rrc_ue_config_LTE_srb1 (void){ ...@@ -471,6 +479,7 @@ void rrc_ue_config_LTE_srb1 (void){
); );
msg("[UE %d], CONFIG_SRB1 %d corresponding to eNB_index %d\n", Mod_id,srb1,eNB_index); msg("[UE %d], CONFIG_SRB1 %d corresponding to eNB_index %d\n", Mod_id,srb1,eNB_index);
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, NB_eNB_INST %d \n",Mod_id, eNB_flag, UE_index, NB_eNB_INST);
// rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1); // rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1);
// rrc_rlc_config_req(Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1, SIGNALLING_RADIO_BEARER, Rlc_info_am_config); // rrc_rlc_config_req(Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1, SIGNALLING_RADIO_BEARER, Rlc_info_am_config);
rrc_pdcp_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index, rrc_pdcp_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
...@@ -499,8 +508,8 @@ void rrc_ue_config_LTE_srb1 (void){ ...@@ -499,8 +508,8 @@ void rrc_ue_config_LTE_srb1 (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_ue_config_LTE_srb2 (void){ void rrc_ue_config_LTE_srb2 (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
char Mod_id = 0; char Mod_id = protocol_ms->rrc.mod_id;
int UE_index =0; int UE_index = rrc_ue_mobileId;
int eNB_index = 0; int eNB_index = 0;
int eNB_flag = 0; //1=eNB, 0=UE int eNB_flag = 0; //1=eNB, 0=UE
int srb2 = 2; int srb2 = 2;
...@@ -520,6 +529,7 @@ void rrc_ue_config_LTE_srb2 (void){ ...@@ -520,6 +529,7 @@ void rrc_ue_config_LTE_srb2 (void){
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SRB2 UE 0)--->][MAC_eNB]\n"); msg ("[RRC-UE-FRONTEND] MAC_CONFIG_REQ (SRB2 UE 0)--->][MAC_eNB]\n");
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
#endif #endif
rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, //OK rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, //OK
(RadioResourceConfigCommonSIB_t *)NULL, //OK (RadioResourceConfigCommonSIB_t *)NULL, //OK
...@@ -574,7 +584,7 @@ void rrc_ue_config_LTE_srb2 (void){ ...@@ -574,7 +584,7 @@ void rrc_ue_config_LTE_srb2 (void){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int UE_index =0; int UE_index = rrc_ue_mobileId;
int eNB_index = 0; int eNB_index = 0;
int eNB_flag = 0; //1=eNB, 0=UE int eNB_flag = 0; //1=eNB, 0=UE
int drb_ix=0; // default DRB int drb_ix=0; // default DRB
...@@ -584,8 +594,6 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -584,8 +594,6 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){
//DL_DCCH_Message_t *dl_dcch_msg=NULL;//&dldcchmsg; //DL_DCCH_Message_t *dl_dcch_msg=NULL;//&dldcchmsg;
struct PhysicalConfigDedicated physicalConfigDedicated_drb; struct PhysicalConfigDedicated physicalConfigDedicated_drb;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: begin\n"); msg ("\n[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: begin\n");
#endif #endif
...@@ -644,7 +652,7 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -644,7 +652,7 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){
protocol_ms->rrc.ue_rb_asn1.DRB1_active = 1; protocol_ms->rrc.ue_rb_asn1.DRB1_active = 1;
msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index); msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index);
msg("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
//DRB2LCHAN[drb_ix] = (u8)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity; //DRB2LCHAN[drb_ix] = (u8)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity;
rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
...@@ -677,15 +685,17 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -677,15 +685,17 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){
msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: Frame %d: Remove PDCP + RLC UM Bidirectional, DRB 0 \n", msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb: Frame %d: Remove PDCP + RLC UM Bidirectional, DRB 0 \n",
//protocol_ms->rrc.current_SFN, (int)protocol_ms->rrc.ue_rb_asn1.DRB1_config->drb_Identity); //protocol_ms->rrc.current_SFN, (int)protocol_ms->rrc.ue_rb_asn1.DRB1_config->drb_Identity);
protocol_ms->rrc.current_SFN); protocol_ms->rrc.current_SFN);
msg(" COMMENTED - not yet supported with ASN1 \n");
/* rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_REMOVE, /* rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_REMOVE,
(UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix]);*/ (UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix]);*/
rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_REMOVE, /* rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_REMOVE,
(UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix], (UE_index * NB_RB_MAX) + DRB2LCHAN[drb_ix],
RADIO_ACCESS_BEARER,Rlc_info_um); RADIO_ACCESS_BEARER,Rlc_info_um);*/
} }
protocol_ms->rrc.ue_rb_asn1.DRB1_active = 0; protocol_ms->rrc.ue_rb_asn1.DRB1_active = 0;
msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index); msg("[RRC-UE-FRONTEND] rrc_ue_config_LTE_default_drb:[--- MAC_CONFIG_REQ (DRB UE %d) --->][MAC_eNB]\n", UE_index);
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, eNB_index %d \n",Mod_id, eNB_flag, UE_index, eNB_index);
rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index, rrc_mac_config_req(Mod_id,eNB_flag,UE_index,eNB_index,
(RadioResourceConfigCommonSIB_t *)NULL, (RadioResourceConfigCommonSIB_t *)NULL,
protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated, protocol_ms->rrc.ue_rb_asn1.physicalConfigDedicated,
......
...@@ -357,7 +357,7 @@ int rrc_init_global_param(void){ ...@@ -357,7 +357,7 @@ int rrc_init_global_param(void){
*/ */
//register with rlc -1st function= data_ind/srb_rx, 2nd function = srb_confirm //register with rlc -1st function= data_ind/srb_rx, 2nd function = srb_confirm
printk("[RRC]INIT_GLOBAL_PARAM: rrc_rlc_register_rrc %p,rlcrrc_data_ind %p, rrc_L2_rlc_confirm_ind_rx %p\n", rrc_rlc_register_rrc, rlcrrc_data_ind, rrc_L2_rlc_confirm_ind_rx ); printk("[RRC CELL]INIT_GLOBAL_PARAM: rrc_rlc_register_rrc %p,rlcrrc_data_ind %p, rrc_L2_rlc_confirm_ind_rx %p\n", rrc_rlc_register_rrc, rlcrrc_data_ind, rrc_L2_rlc_confirm_ind_rx );
if( rrc_rlc_register_rrc==NULL||rlcrrc_data_ind==NULL|| rrc_L2_rlc_confirm_ind_rx==NULL) if( rrc_rlc_register_rrc==NULL||rlcrrc_data_ind==NULL|| rrc_L2_rlc_confirm_ind_rx==NULL)
return -1; return -1;
rrc_rlc_register_rrc(rlcrrc_data_ind , rrc_L2_rlc_confirm_ind_rx); rrc_rlc_register_rrc(rlcrrc_data_ind , rrc_L2_rlc_confirm_ind_rx);
......
...@@ -52,11 +52,19 @@ void rrc_ue_get_mobile_id (void){ ...@@ -52,11 +52,19 @@ void rrc_ue_get_mobile_id (void){
// Later, will be retrieved from configuration to allow sevearl mobile terminals // Later, will be retrieved from configuration to allow sevearl mobile terminals
rrc_ue_mobileId = 0; rrc_ue_mobileId = 0;
//#ifdef OAI_EMU
#ifdef RRC_OAI_EMU
rrc_ue_mobileId = rrc_ethernet_id - 1;
msg ("[RRC CELL]rrc_ue_get_mobile_id - EMULATION - UE_ID initialized to: %d\n", rrc_ue_mobileId);
#endif
#ifndef RRC_OAI_EMU
msg ("[RRC CELL]rrc_ue_get_mobile_id - UE_ID not initialized. Use default value: %d\n", rrc_ue_mobileId);
#endif
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------
int rrc_ue_get_initial_id (void){ int rrc_ue_get_initial_id (void){
//------------------------------------------------------------------- //-------------------------------------------------------------------
int UE_Id = 32; int UE_Id = 99;
// #ifdef USER_MODE // #ifdef USER_MODE
// int uni; // int uni;
...@@ -99,10 +107,11 @@ int rrc_ue_get_initial_id (void){ ...@@ -99,10 +107,11 @@ int rrc_ue_get_initial_id (void){
protocol_ms->rrc.IMEI[13] = rrc_ue_mobileId; protocol_ms->rrc.IMEI[13] = rrc_ue_mobileId;
// protocol_ms->rrc.IMEI[13] = IMEI_D13; // protocol_ms->rrc.IMEI[13] = IMEI_D13;
// #endif // #endif
UE_Id = 32- rrc_ue_mobileId;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC CELL]rrc_ue_get_initial_id (UE_ID %d) IMEI initialized to:", UE_Id); msg ("[RRC CELL]rrc_ue_get_initial_id (UE_ID %d) IMEI initialized to:", UE_Id);
rrc_print_buffer (protocol_ms->rrc.IMEI, 14); rrc_print_buffer ((char *)protocol_ms->rrc.IMEI, 14);
#endif #endif
return UE_Id; return UE_Id;
} }
...@@ -132,16 +141,17 @@ void rrc_ue_init (u8 Mod_id){ ...@@ -132,16 +141,17 @@ void rrc_ue_init (u8 Mod_id){
protocol_ms->rrc.protocol_state = RRC_UE_IDLE; protocol_ms->rrc.protocol_state = RRC_UE_IDLE;
protocol_ms->rrc.u_rnti = 0; protocol_ms->rrc.u_rnti = 0;
protocol_ms->rrc.cell_id = 0; protocol_ms->rrc.cell_id = 0;
protocol_ms->rrc.mod_id =1; protocol_ms->rrc.mod_id = Mod_id; //Saved for future use in rrc_ue_L2_frontend.c
//list2_init (&protocol_ms->rrc.rrc_timers, NULL); //list2_init (&protocol_ms->rrc.rrc_timers, NULL);
rrc_ue_bch_init (); rrc_ue_bch_init ();
rrc_rb_ue_init (); rrc_rb_ue_init ();
// initialise NAS global variables // initialise NAS global variables
pt_nas_ue_irq = &(protocol_ms->rrc.ip_rx_irq); pt_nas_ue_irq = (int *) &(protocol_ms->rrc.ip_rx_irq);
rrc_ue_get_mobile_id(); // Read mobile Id from command line parameters
protocol_ms->rrc.ue_initial_id = rrc_ue_get_initial_id (); protocol_ms->rrc.ue_initial_id = rrc_ue_get_initial_id ();
memcpy (nas_IMEI, protocol_ms->rrc.IMEI, 14); memcpy (nas_IMEI, (char *)protocol_ms->rrc.IMEI, 14);
rrc_ue_fsm_init (protocol_ms->rrc.ue_initial_id); rrc_ue_fsm_init (protocol_ms->rrc.ue_initial_id);
protocol_ms->rrc.rrc_currently_updating = FALSE; protocol_ms->rrc.rrc_currently_updating = FALSE;
...@@ -154,12 +164,12 @@ void rrc_ue_init (u8 Mod_id){ ...@@ -154,12 +164,12 @@ void rrc_ue_init (u8 Mod_id){
#endif #endif
#endif #endif
//Initialise MBMS //Initialise MBMS
#ifdef ALLOW_MBMS_PROTOCOL
rrc_ue_mbms_init(); rrc_ue_mbms_init();
#endif
rrc_init_mac_config(); rrc_init_mac_config();
// TEMP : Only one MT is supported in the MAC interface
//Rrc_xface->UE_index[0][0]=1;
// //
printk("\n[RRC CELL][UE-INIT] cell_id %d\n",protocol_ms->rrc.cell_id ); printk("\n[RRC CELL][UE-INIT] cell_id %d\n",protocol_ms->rrc.cell_id );
printk("[RRC CELL][UE-INIT] Init UE function completed\n"); printk("[RRC CELL][UE-INIT] Init UE function completed\n");
......
...@@ -46,14 +46,6 @@ int rrc_ue_main_scheduler(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index){ ...@@ -46,14 +46,6 @@ int rrc_ue_main_scheduler(u8 Mod_id,u32 frame, u8 eNB_flag,u8 index){
// protocol_ms->rrc.current_SFN = Mac_rlc_xface->frame; // protocol_ms->rrc.current_SFN = Mac_rlc_xface->frame;
// protocol_ms->rrc.current_SFN = frame; // protocol_ms->rrc.current_SFN = frame;
/*************/
// TODO TO BE REMOVED TEMP -- stop the loop
/* if (protocol_ms->rrc.current_SFN > 50000)
exit(1);*/
//if (Mac_rlc_xface->frame < 100)
//s return;
//if (protocol_ms->rrc.current_SFN == 100)
//msg("\n\n[RRC] [TEMP-OPENAIR-DEBUG] RRC-UE resuming its operation at frame %d\n\n ", protocol_ms->rrc.current_SFN);
/*************/ /*************/
// TODO TO BE REMOVED TEMP -- stop RRC process action (for early traces) // TODO TO BE REMOVED TEMP -- stop RRC process action (for early traces)
......
...@@ -108,6 +108,10 @@ void rrc_ue_netlink_init (void){ ...@@ -108,6 +108,10 @@ void rrc_ue_netlink_init (void){
int ret; int ret;
rrcnl_sock_fd = socket(PF_NETLINK, SOCK_RAW, NAS_RRCNL_ID); rrcnl_sock_fd = socket(PF_NETLINK, SOCK_RAW, NAS_RRCNL_ID);
if (rrcnl_sock_fd == -1) {
fprintf(stderr, "socket failed (%d:%s)\n", errno, strerror(errno));
exit(EXIT_FAILURE);
}
printf("rrc_ue_netlink_init - Opened socket with fd %d\n", rrcnl_sock_fd); printf("rrc_ue_netlink_init - Opened socket with fd %d\n", rrcnl_sock_fd);
ret = fcntl(rrcnl_sock_fd,F_SETFL,O_NONBLOCK); ret = fcntl(rrcnl_sock_fd,F_SETFL,O_NONBLOCK);
......
...@@ -318,12 +318,14 @@ void RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (int rb_id){ ...@@ -318,12 +318,14 @@ void RRC_RB_UE_O_O_NAS_RB_ESTABLISH_Ind (int rb_id){
msgToBuild->nasUePrimitive.dc_sap_prim.type = RB_ESTABLISH_IND; msgToBuild->nasUePrimitive.dc_sap_prim.type = RB_ESTABLISH_IND;
msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length; msgToBuild->nasUePrimitive.dc_sap_prim.length = msgToBuild->prim_length;
msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref; msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.localConnectionRef = protocol_ms->rrc.local_connection_ref;
// Temp MW 19/9/13 - Next parameter to be hard coded and should be revised for support of multiple DRBs (transferred at arrival in NAS)
msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId = protocol_ms->rrc.requested_rbId; msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId = protocol_ms->rrc.requested_rbId;
//msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId = RRC_OAI_DRB0_ID;
msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.QoSclass = protocol_ms->rrc.requested_QoSclass; msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.QoSclass = protocol_ms->rrc.requested_QoSclass;
msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.dscp = protocol_ms->rrc.requested_dscp; msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.dscp = protocol_ms->rrc.requested_dscp;
msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.sapId = protocol_ms->rrc.requested_sapid; msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.sapId = protocol_ms->rrc.requested_sapid;
#ifdef DEBUG_RRC_STATE #ifdef DEBUG_RRC_STATE
msg ("[RRC_RB][FSM-OUT] RB_ESTABLISH_Ind primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length); msg ("[RRC_RB][FSM-OUT] RB_ESTABLISH_Ind primitive ready to send to NAS, length %d.\n", msgToBuild->prim_length, msgToBuild->nasUePrimitive.dc_sap_prim.nasUEDCPrimitive.rb_establish_ind.rbId);
#endif #endif
//Temp - to be put back in clear_transaction //Temp - to be put back in clear_transaction
protocol_ms->rrc.requested_rbId = 0; protocol_ms->rrc.requested_rbId = 0;
......
...@@ -45,15 +45,15 @@ void encode_message (int *Message_Id, int Message_Type){ ...@@ -45,15 +45,15 @@ void encode_message (int *Message_Id, int Message_Type){
rrc_ue_msg_connrelUL (Message_Id); rrc_ue_msg_connrelUL (Message_Id);
break; break;
case RB_SETUP_COMPLETE: case RB_SETUP_COMPLETE:
rrc_ue_config_LTE_default_drb(0); //TEMP OpenAir rrc_ue_config_LTE_default_drb(protocol_ms->rrc.mod_id); //TEMP OpenAir
rrc_ue_config_LTE_srb2(0); rrc_ue_config_LTE_srb2(protocol_ms->rrc.mod_id);
rrc_ue_msg_rbsetupcompl (Message_Id); rrc_ue_msg_rbsetupcompl (Message_Id);
break; break;
case RB_SETUP_FAILURE: case RB_SETUP_FAILURE:
rrc_ue_msg_rbsetupfail (Message_Id); rrc_ue_msg_rbsetupfail (Message_Id);
break; break;
case RB_RELEASE_COMPLETE: case RB_RELEASE_COMPLETE:
rrc_ue_config_LTE_default_drb(0); //TEMP OpenAir rrc_ue_config_LTE_default_drb(protocol_ms->rrc.mod_id); //TEMP OpenAir
rrc_ue_msg_rbreleasecompl (Message_Id); rrc_ue_msg_rbreleasecompl (Message_Id);
break; break;
case RB_RELEASE_FAILURE: case RB_RELEASE_FAILURE:
......
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