Commit 1378c4fb authored by winckel's avatar winckel
Browse files

Added an RRC UE task and inserted some message based communications between...

Added an RRC UE task and inserted some message based communications between MAC or PDCP and RRC when ITTI is enabled.
Uniformized some parameter types.
Fixed some warnings.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4286 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 06665e9d
...@@ -331,8 +331,8 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS ...@@ -331,8 +331,8 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
char (*openair_rrc_eNB_init)(u8 ); char (*openair_rrc_eNB_init)(u8 );
char (*openair_rrc_UE_init)(u8, u8); char (*openair_rrc_UE_init)(u8, u8);
RRC_status_t (*rrc_rx_tx)(u8,u32,u8,u8); RRC_status_t (*rrc_rx_tx)(u8,u32,u8,u8);
u8 (*mac_rrc_data_ind)(u8,u32,unsigned short,char *,unsigned short,u8 eNB_flag, u8 eNB_index); u8 (*mac_rrc_data_ind)(u8,u32,u16,u8 *,u16,u8 eNB_flag, u8 eNB_index);
u8 (*mac_rrc_data_req)(u8,u32,unsigned short,u8,char *,u8 eNB_flag, u8 eNB_index); u8 (*mac_rrc_data_req)(u8,u32,u16,u8,u8 *,u8 eNB_flag, u8 eNB_index);
void (*mac_rrc_meas_ind)(u8,MAC_MEAS_REQ_ENTRY*); void (*mac_rrc_meas_ind)(u8,MAC_MEAS_REQ_ENTRY*);
void (*def_meas_ind)(u8, u8); void (*def_meas_ind)(u8, u8);
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*); void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
......
...@@ -265,7 +265,7 @@ void terminate_ra_proc(u8 Mod_id,u32 frame,u16 rnti,unsigned char *msg3, u16 msg ...@@ -265,7 +265,7 @@ void terminate_ra_proc(u8 Mod_id,u32 frame,u16 rnti,unsigned char *msg3, u16 msg
} }
if (Is_rrc_registered == 1) if (Is_rrc_registered == 1)
mac_rrc_data_ind(Mod_id,frame,CCCH,(char *)payload_ptr,rx_lengths[0],1,Mod_id,0); mac_rrc_data_ind(Mod_id,frame,CCCH,(u8 *)payload_ptr,rx_lengths[0],1,Mod_id,0);
// add_user. This is needed to have the rnti for configuring UE (PHY). The UE is removed if RRC // add_user. This is needed to have the rnti for configuring UE (PHY). The UE is removed if RRC
// doesn't provide a CCCH SDU // doesn't provide a CCCH SDU
...@@ -979,7 +979,7 @@ void schedule_SI(unsigned char Mod_id,u32 frame, unsigned char *nprb,unsigned in ...@@ -979,7 +979,7 @@ void schedule_SI(unsigned char Mod_id,u32 frame, unsigned char *nprb,unsigned in
bcch_sdu_length = mac_rrc_data_req(Mod_id, bcch_sdu_length = mac_rrc_data_req(Mod_id,
frame, frame,
BCCH,1, BCCH,1,
(char*)&eNB_mac_inst[Mod_id].BCCH_pdu.payload[0], &eNB_mac_inst[Mod_id].BCCH_pdu.payload[0],
1, 1,
Mod_id, Mod_id,
0); // not used in this case 0); // not used in this case
...@@ -1595,7 +1595,7 @@ void schedule_RA(unsigned char Mod_id,u32 frame, unsigned char subframe,unsigned ...@@ -1595,7 +1595,7 @@ void schedule_RA(unsigned char Mod_id,u32 frame, unsigned char subframe,unsigned
rrc_sdu_length = mac_rrc_data_req(Mod_id, rrc_sdu_length = mac_rrc_data_req(Mod_id,
frame, frame,
CCCH,1, CCCH,1,
(char*)&eNB_mac_inst[Mod_id].CCCH_pdu.payload[0], &eNB_mac_inst[Mod_id].CCCH_pdu.payload[0],
1, 1,
Mod_id, Mod_id,
0); // not used in this case 0); // not used in this case
...@@ -3376,7 +3376,7 @@ void schedule_ue_spec(unsigned char Mod_id, ...@@ -3376,7 +3376,7 @@ void schedule_ue_spec(unsigned char Mod_id,
u16 sdu_length_total=0; u16 sdu_length_total=0;
// unsigned char loop_count; // unsigned char loop_count;
unsigned char DAI; unsigned char DAI;
u16 i=0,ii=0,tpmi0=1; u16 i=0;
u8 dl_pow_off[NUMBER_OF_UE_MAX]; u8 dl_pow_off[NUMBER_OF_UE_MAX];
unsigned char rballoc_sub_UE[NUMBER_OF_UE_MAX][N_RBGS_MAX]; unsigned char rballoc_sub_UE[NUMBER_OF_UE_MAX][N_RBGS_MAX];
// unsigned char rballoc_sub[N_RBGS_MAX]; // unsigned char rballoc_sub[N_RBGS_MAX];
...@@ -4191,7 +4191,9 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf ...@@ -4191,7 +4191,9 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf
unsigned int nCCE=0; unsigned int nCCE=0;
int mbsfn_status=0; int mbsfn_status=0;
u32 RBalloc=0; u32 RBalloc=0;
#ifdef EXMIMO
int ret; int ret;
#endif
DCI_PDU *DCI_pdu= &eNB_mac_inst[Mod_id].DCI_pdu; DCI_PDU *DCI_pdu= &eNB_mac_inst[Mod_id].DCI_pdu;
// LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler\n",Mod_id, frame, subframe); // LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler\n",Mod_id, frame, subframe);
......
...@@ -240,7 +240,7 @@ PRACH_RESOURCES_t *ue_get_rach(u8 Mod_id,u32 frame, u8 eNB_index,u8 subframe){ ...@@ -240,7 +240,7 @@ PRACH_RESOURCES_t *ue_get_rach(u8 Mod_id,u32 frame, u8 eNB_index,u8 subframe){
Size = mac_rrc_data_req(Mod_id, Size = mac_rrc_data_req(Mod_id,
frame, frame,
CCCH,1, CCCH,1,
(char*)&UE_mac_inst[Mod_id].CCCH_pdu.payload[sizeof(SCH_SUBHEADER_SHORT)+1],0, &UE_mac_inst[Mod_id].CCCH_pdu.payload[sizeof(SCH_SUBHEADER_SHORT)+1],0,
eNB_index); eNB_index);
Size16 = (u16)Size; Size16 = (u16)Size;
......
...@@ -348,13 +348,13 @@ void ue_send_sdu(u8 Mod_id,u32 frame,u8 *sdu,u16 sdu_len,u8 eNB_index) { ...@@ -348,13 +348,13 @@ void ue_send_sdu(u8 Mod_id,u32 frame,u8 *sdu,u16 sdu_len,u8 eNB_index) {
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
int j; int j;
for (j=0;j<rx_lengths[i];j++) for (j=0;j<rx_lengths[i];j++)
LOG_T(MAC,"%x.",(unsigned char)payload_ptr[j]); LOG_T(MAC,"%x.",(u8)payload_ptr[j]);
LOG_T(MAC,"\n"); LOG_T(MAC,"\n");
#endif #endif
mac_rrc_data_ind(Mod_id, mac_rrc_data_ind(Mod_id,
frame, frame,
CCCH, CCCH,
(char *)payload_ptr,rx_lengths[i],0,eNB_index,0); (u8 *)payload_ptr,rx_lengths[i],0,eNB_index,0);
} }
else if (rx_lcids[i] == DCCH) { else if (rx_lcids[i] == DCCH) {
...@@ -415,7 +415,7 @@ void ue_decode_si(u8 Mod_id,u32 frame, u8 eNB_index, void *pdu,u16 len) { ...@@ -415,7 +415,7 @@ void ue_decode_si(u8 Mod_id,u32 frame, u8 eNB_index, void *pdu,u16 len) {
mac_rrc_data_ind(Mod_id, mac_rrc_data_ind(Mod_id,
frame, frame,
BCCH, BCCH,
(char *)pdu, (u8 *)pdu,
len, len,
0, 0,
eNB_index, eNB_index,
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
#include "openair_rrc_L2_interface.h" #include "openair_rrc_L2_interface.h"
/********************************************************************************************************************/ /********************************************************************************************************************/
s8 mac_rrc_data_req(u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area){ s8 mac_rrc_data_req(u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,u8 *Buffer,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area){
/********************************************************************************************************************/ /********************************************************************************************************************/
#ifdef CELLULAR #ifdef CELLULAR
return(rrc_L2_data_req_rx(Mod_id,Srb_id,Nb_tb,Buffer,eNB_index)); return(rrc_L2_data_req_rx(Mod_id,Srb_id,Nb_tb,Buffer,eNB_index));
...@@ -96,7 +96,7 @@ s8 mac_rrc_data_req(u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 e ...@@ -96,7 +96,7 @@ s8 mac_rrc_data_req(u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 e
#endif //CELLULAR #endif //CELLULAR
} }
s8 mac_rrc_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu,u16 Sdu_len,u8 eNB_flag, u8 eNB_index,u8 mbsfn_sync_area){ s8 mac_rrc_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, u8 *Sdu,u16 Sdu_len,u8 eNB_flag, u8 eNB_index,u8 mbsfn_sync_area){
#ifdef CELLULAR #ifdef CELLULAR
return(rrc_L2_mac_data_ind_rx(Mod_id, Srb_id, Sdu, Sdu_len, eNB_index)); return(rrc_L2_mac_data_ind_rx(Mod_id, Srb_id, Sdu, Sdu_len, eNB_index));
#else #else
......
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
#include "COMMON/mac_rrc_primitives.h" #include "COMMON/mac_rrc_primitives.h"
s8 mac_rrc_data_req( u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area); s8 mac_rrc_data_req( u8 Mod_id, u32 frame, u16 Srb_id, u8 Nb_tb,u8 *Buffer,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area);
s8 mac_rrc_data_ind( u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_len,u8 eNB_flag, u8 eNB_index,u8 mbsfn_sync_area); s8 mac_rrc_data_ind( u8 Mod_id, u32 frame, u16 Srb_id, u8 *Sdu, u16 Sdu_len,u8 eNB_flag, u8 eNB_index,u8 mbsfn_sync_area);
void mac_lite_sync_ind( u8 Mod_id, u8 status); void mac_lite_sync_ind( u8 Mod_id, u8 status);
void mac_rrc_meas_ind(u8,MAC_MEAS_REQ_ENTRY*); void mac_rrc_meas_ind(u8,MAC_MEAS_REQ_ENTRY*);
void rlcrrc_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,unsigned int Rb_id, u32 sdu_size,u8 *Buffer); void rlcrrc_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,unsigned int Rb_id, u32 sdu_size,u8 *Buffer);
......
...@@ -52,6 +52,10 @@ extern eNB_MAC_INST *eNB_mac_inst; ...@@ -52,6 +52,10 @@ extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst; extern UE_MAC_INST *UE_mac_inst;
#endif #endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
//#define RRC_DATA_REQ_DEBUG //#define RRC_DATA_REQ_DEBUG
#define DEBUG_RRC #define DEBUG_RRC
...@@ -178,23 +182,44 @@ s8 mac_rrc_lite_data_req( u8 Mod_id, ...@@ -178,23 +182,44 @@ s8 mac_rrc_lite_data_req( u8 Mod_id,
return(0); return(0);
} }
s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_len,u8 eNB_flag,u8 eNB_index,u8 mbsfn_sync_area){ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, u8 *Sdu, u16 sdu_size,u8 eNB_flag,u8 eNB_index,u8 mbsfn_sync_area){
SRB_INFO *Srb_info; SRB_INFO *Srb_info;
/*
int si_window; int si_window;
*/
if(eNB_flag == 0){ if(eNB_flag == 0){
if(Srb_id == BCCH){ if(Srb_id == BCCH){
LOG_T(RRC,"[UE %d] Received SDU for BCCH on SRB %d from eNB %d\n",Mod_id,Srb_id,eNB_index); LOG_T(RRC,"[UE %d] Received SDU for BCCH on SRB %d from eNB %d\n",Mod_id,Srb_id,eNB_index);
decode_BCCH_DLSCH_Message(Mod_id,frame,eNB_index,Sdu,Sdu_len);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
// Uses a new buffer to avoid issue with MAC buffer content that could be changed by MAC (asynchronous message handling).
u8 *message_buffer;
message_buffer = malloc (sdu_size);
memcpy (message_buffer, Sdu, sdu_size);
message_p = itti_alloc_new_message (TASK_MAC, RRC_MAC_BCCH_DATA_IND);
RRC_MAC_BCCH_DATA_IND (message_p).frame = frame;
RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size;
RRC_MAC_BCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_MAC_BCCH_DATA_IND (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id, message_p);
}
#else
decode_BCCH_DLSCH_Message(Mod_id,frame,eNB_index,Sdu,sdu_size);
/* /*
if ((frame %2) == 0) { if ((frame %2) == 0) {
if (UE_rrc_inst[Mod_id].Info[eNB_index].SIB1Status == 0) { if (UE_rrc_inst[Mod_id].Info[eNB_index].SIB1Status == 0) {
LOG_D(RRC,"[UE %d] Frame %d : Received SIB1 from eNB %d (%d bytes)\n",Mod_id,frame,eNB_index,Sdu_len); LOG_D(RRC,"[UE %d] Frame %d : Received SIB1 from eNB %d (%d bytes)\n",Mod_id,frame,eNB_index,sdu_size);
if (UE_rrc_inst[Mod_id].SIB1[eNB_index]) if (UE_rrc_inst[Mod_id].SIB1[eNB_index])
memcpy(UE_rrc_inst[Mod_id].SIB1[eNB_index],&Sdu[0],Sdu_len); memcpy(UE_rrc_inst[Mod_id].SIB1[eNB_index],&Sdu[0],sdu_size);
else { else {
LOG_E(RRC,"[FATAL ERROR] SIB1 buffer for eNB %d not allocated, exiting ...\n",eNB_index); LOG_E(RRC,"[FATAL ERROR] SIB1 buffer for eNB %d not allocated, exiting ...\n",eNB_index);
mac_xface->macphy_exit(""); mac_xface->macphy_exit("");
...@@ -208,8 +233,8 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le ...@@ -208,8 +233,8 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le
if ((UE_rrc_inst[Mod_id].Info[eNB_index].SIB1Status == 1) && if ((UE_rrc_inst[Mod_id].Info[eNB_index].SIB1Status == 1) &&
(UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus == 0)) { (UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus == 0)) {
si_window = (frame%UE_rrc_inst[Mod_id].Info[eNB_index].SIperiod)/frame%UE_rrc_inst[Mod_id].Info[eNB_index].SIwindowsize; si_window = (frame%UE_rrc_inst[Mod_id].Info[eNB_index].SIperiod)/frame%UE_rrc_inst[Mod_id].Info[eNB_index].SIwindowsize;
LOG_D(RRC,"[UE %d] Frame %d : Received SI (%d bytes), in window %d (SIperiod %d, SIwindowsize %d)\n",Mod_id,frame,Sdu_len,si_window,UE_rrc_inst[Mod_id].Info[eNB_index].SIperiod,UE_rrc_inst[Mod_id].Info[eNB_index].SIwindowsize); LOG_D(RRC,"[UE %d] Frame %d : Received SI (%d bytes), in window %d (SIperiod %d, SIwindowsize %d)\n",Mod_id,frame,sdu_size,si_window,UE_rrc_inst[Mod_id].Info[eNB_index].SIperiod,UE_rrc_inst[Mod_id].Info[eNB_index].SIwindowsize);
memcpy(UE_rrc_inst[Mod_id].SI[eNB_index],&Sdu[0],Sdu_len); memcpy(UE_rrc_inst[Mod_id].SI[eNB_index],&Sdu[0],sdu_size);
if (decode_SI(Mod_id,frame,eNB_index,si_window)==0) { if (decode_SI(Mod_id,frame,eNB_index,si_window)==0) {
LOG_D(RRC,"[UE %d] Frame %d :Decoded SI successfully\n",Mod_id,frame); LOG_D(RRC,"[UE %d] Frame %d :Decoded SI successfully\n",Mod_id,frame);
UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus = 1; UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus = 1;
...@@ -229,17 +254,37 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le ...@@ -229,17 +254,37 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le
} }
} }
*/ */
#endif
} }
if((Srb_id & RAB_OFFSET) == CCCH){ if((Srb_id & RAB_OFFSET) == CCCH){
Srb_info = &UE_rrc_inst[Mod_id].Srb0[eNB_index]; if (sdu_size>0) {
LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",Mod_id,Srb_id & RAB_OFFSET,eNB_index);
if (Sdu_len>0) {
LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",Mod_id,Srb_id & RAB_OFFSET,eNB_index); #if defined(ENABLE_ITTI)
memcpy(Srb_info->Rx_buffer.Payload,Sdu,Sdu_len); {
Srb_info->Rx_buffer.payload_size = Sdu_len; MessageDef *message_p;
rrc_ue_decode_ccch(Mod_id,frame,Srb_info,eNB_index); // Uses a new buffer to avoid issue with MAC buffer content that could be changed by MAC (asynchronous message handling).
u8 *message_buffer;
message_buffer = malloc (sdu_size);
memcpy (message_buffer, Sdu, sdu_size);
message_p = itti_alloc_new_message (TASK_MAC, RRC_MAC_CCCH_DATA_IND);
RRC_MAC_CCCH_DATA_IND (message_p).frame = frame;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_MAC_CCCH_DATA_IND (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id, message_p);
}
#else
Srb_info = &UE_rrc_inst[Mod_id].Srb0[eNB_index];
memcpy(Srb_info->Rx_buffer.Payload,Sdu,sdu_size);
Srb_info->Rx_buffer.payload_size = sdu_size;
rrc_ue_decode_ccch(Mod_id, frame, Srb_info, eNB_index);
#endif
} }
} }
...@@ -247,7 +292,28 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le ...@@ -247,7 +292,28 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le
if ((Srb_id & RAB_OFFSET) == MCCH) { if ((Srb_id & RAB_OFFSET) == MCCH) {
LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %d from eNB %d\n", LOG_T(RRC,"[UE %d] Frame %d: Received SDU on MBSFN sync area %d for MCCH on SRB %d from eNB %d\n",
Mod_id,frame, mbsfn_sync_area, Srb_id & RAB_OFFSET,eNB_index); Mod_id,frame, mbsfn_sync_area, Srb_id & RAB_OFFSET,eNB_index);
decode_MCCH_Message(Mod_id, frame, eNB_index, Sdu, Sdu_len,mbsfn_sync_area);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
// Uses a new buffer to avoid issue with MAC buffer content that could be changed by MAC (asynchronous message handling).
u8 *message_buffer;
message_buffer = malloc (sdu_size);
memcpy (message_buffer, Sdu, sdu_size);
message_p = itti_alloc_new_message (TASK_MAC, RRC_MAC_MCCH_DATA_IND);
RRC_MAC_MCCH_DATA_IND (message_p).frame = frame;
RRC_MAC_MCCH_DATA_IND (message_p).sdu_size = sdu_size;
RRC_MAC_MCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_MAC_MCCH_DATA_IND (message_p).enb_index = eNB_index;
RRC_MAC_MCCH_DATA_IND (message_p).mbsfn_sync_area = mbsfn_sync_area;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id, message_p);
}
#else
decode_MCCH_Message(Mod_id, frame, eNB_index, Sdu, sdu_size, mbsfn_sync_area);
#endif
} }
#endif // Rel10 #endif // Rel10
...@@ -269,6 +335,16 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le ...@@ -269,6 +335,16 @@ s8 mac_rrc_lite_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, char *Sdu, u16 Sdu_le
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
void mac_lite_sync_ind(u8 Mod_id,u8 Status){ void mac_lite_sync_ind(u8 Mod_id,u8 Status){
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_MAC, RRC_MAC_SYNC_IND);
RRC_MAC_SYNC_IND(message_p).status = Status;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id, message_p);
}
#endif
} }
// this function is Not USED anymore // this function is Not USED anymore
...@@ -281,18 +357,52 @@ void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u32 sdu_si ...@@ -281,18 +357,52 @@ void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u32 sdu_si
(eNB_flag == 1)? "eNB": "UE", (eNB_flag == 1)? "eNB": "UE",
(eNB_flag == 1)? Mod_id : UE_index, (eNB_flag == 1)? Mod_id : UE_index,
frame, DCCH_index,Srb_id-1,sdu_size); frame, DCCH_index,Srb_id-1,sdu_size);
if (eNB_flag ==1)
if (eNB_flag ==1) {
rrc_eNB_decode_dcch(Mod_id,frame,DCCH_index,UE_index,Buffer,sdu_size); rrc_eNB_decode_dcch(Mod_id,frame,DCCH_index,UE_index,Buffer,sdu_size);
else }
else {
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
u8 *message_buffer;
message_buffer = malloc (sdu_size);
memcpy (message_buffer, Buffer, sdu_size);
message_p = itti_alloc_new_message (TASK_PDCP, RRC_DCCH_DATA_IND);
RRC_DCCH_DATA_IND (message_p).frame = frame;
RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index;
RRC_DCCH_DATA_IND (message_p).sdu_size = sdu_size;
RRC_DCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_DCCH_DATA_IND (message_p).ue_index = UE_index;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id - NB_eNB_INST, message_p);
}
#else
rrc_ue_decode_dcch(Mod_id-NB_eNB_INST,frame,DCCH_index,Buffer,UE_index); rrc_ue_decode_dcch(Mod_id-NB_eNB_INST,frame,DCCH_index,Buffer,UE_index);
#endif
}
} }
void rrc_lite_in_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index) { void rrc_lite_in_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index) {
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_MAC, RRC_MAC_IN_SYNC_IND);
RRC_MAC_IN_SYNC_IND (message_p).frame = frame;
RRC_MAC_IN_SYNC_IND (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id, message_p);
}
#else
UE_rrc_inst[Mod_id].Info[eNB_index].N310_cnt=0; UE_rrc_inst[Mod_id].Info[eNB_index].N310_cnt=0;
if (UE_rrc_inst[Mod_id].Info[eNB_index].T310_active==1) if (UE_rrc_inst[Mod_id].Info[eNB_index].T310_active==1)
UE_rrc_inst[Mod_id].Info[eNB_index].N311_cnt++; UE_rrc_inst[Mod_id].Info[eNB_index].N311_cnt++;
#endif
} }
void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index){ void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index){
...@@ -305,7 +415,19 @@ void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index){ ...@@ -305,7 +415,19 @@ void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index){
UE_rrc_inst[Mod_id].Info[eNB_index].N310_cnt, UE_rrc_inst[Mod_id].Info[eNB_index].N310_cnt,
UE_rrc_inst[Mod_id].Info[eNB_index].N311_cnt); UE_rrc_inst[Mod_id].Info[eNB_index].N311_cnt);
#if defined(ENABLE_ITTI)
{
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_MAC, RRC_MAC_OUT_OF_SYNC_IND);
RRC_MAC_OUT_OF_SYNC_IND (message_p).frame = frame;
RRC_MAC_OUT_OF_SYNC_IND (message_p).enb_index = eNB_index;
itti_send_msg_to_task (TASK_RRC_UE, Mod_id, message_p);
}
#else
UE_rrc_inst[Mod_id].Info[eNB_index].N310_cnt++; UE_rrc_inst[Mod_id].Info[eNB_index].N310_cnt++;
#endif
} }
......
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
#include "ReportConfigToAddModList.h" #include "ReportConfigToAddModList.h"
#include "MeasIdToAddModList.h" #include "MeasIdToAddModList.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
#endif
//#include "PHY/defs.h" //#include "PHY/defs.h"
#ifndef USER_MODE #ifndef USER_MODE
#define msg printk #define msg printk
...@@ -1627,7 +1631,7 @@ uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1627,7 +1631,7 @@ uint8_t do_MBSFNAreaConfig(LTE_DL_FRAME_PARMS *frame_parms,
} }
#endif #endif
uint8_t do_MeasurementReport(uint8_t *buffer,int measid,int phy_id,int rsrp_s,int rsrq_s,int rsrp_t,int rsrq_t) { uint8_t do_MeasurementReport(uint8_t *buffer,int measid,int phy_id,int rsrp_s,int rsrq_s,long rsrp_t,long rsrq_t) {
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
...@@ -1725,7 +1729,7 @@ uint8_t do_MeasurementReport(uint8_t *buffer,int measid,int phy_id,int rsrp_s,in ...@@ -1725,7 +1729,7 @@ uint8_t do_MeasurementReport(uint8_t *buffer,int measid,int phy_id,int rsrp_s,in
return((enc_rval.encoded+7)/8); return((enc_rval.encoded+7)/8);
} }
OAI_UECapability_t UECapability; static OAI_UECapability_t UECapability; /* TODO declared static to allow returning this has an address should be allocated in a cleaner way. */
SupportedBandEUTRA_t Bandlist[4]; SupportedBandEUTRA_t Bandlist[4];
BandInfoEUTRA_t BandInfo_meas[4]; BandInfoEUTRA_t BandInfo_meas[4];
InterFreqBandInfo_t InterFreqBandInfo[4][4]; InterFreqBandInfo_t InterFreqBandInfo[4][4];
...@@ -1778,7 +1782,7 @@ OAI_UECapability_t *fill_ue_capability() { ...@@ -1778,7 +1782,7 @@ OAI_UECapability_t *fill_ue_capability() {
UE_EUTRA_Capability = CALLOC(1,sizeof(*UE_EUTRA_Capability)); UE_EUTRA_Capability = CALLOC(1,sizeof(*UE_EUTRA_Capability));
memset(UE_EUTRA_Capability,0,sizeof(*UE_EUTRA_Capability)); memset(UE_EUTRA_Capability,0,sizeof(*UE_EUTRA_Capability));
// UE_EUTRA_Capability->accessStratumRelease = 0;//AccessStratumRelease_rel8; UE_EUTRA_Capability->accessStratumRelease = 0;//AccessStratumRelease_rel8;
UE_EUTRA_Capability->ue_Category = 4; UE_EUTRA_Capability->ue_Category = 4;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001=0; UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002=0; UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002=0;
...@@ -1837,11 +1841,31 @@ OAI_UECapability_t *fill_ue_capability() { ...@@ -1837,11 +1841,31 @@ OAI_UECapability_t *fill_ue_capability() {
(void*)UE_EUTRA_Capability, (void*)UE_EUTRA_Capability,
&UECapability.sdu[0], &UECapability.sdu[0],
MAX_UE_CAPABILITY_SIZE); MAX_UE_CAPABILITY_SIZE);
UECapability.sdu_size = (enc_rval.encoded+7)/8;
LOG_I(PHY,"[RRC]UE Capability encoded, %d bytes (%d bits)\n",UECapability.sdu_size,enc_rval.encoded+7); #if defined(ENABLE_ITTI)
for (i=0;i<UECapability.sdu_size;i++) /* Test code */
printf("%02x.",UECapability.sdu[i]); {
printf("\n"); MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_UE, RRC_UE_EUTRA_CAPABILITY);
memcpy (&message_p->msg, UE_EUTRA_Capability, sizeof(RrcUeEutraCapability));
itti_send_msg_to_task (TASK_RRC_UE, INSTANCE_DEFAULT, message_p);
}
#endif
UECapability.sdu_size = (enc_rval.encoded + 7) / 8;
LOG_I(PHY, "[RRC]UE Capability encoded, %d bytes (%d bits)\n", UECapability.sdu_size, enc_rval.encoded+7);
{
char *sdu;
sdu = malloc (3 * UECapability.sdu_size);
for (i = 0; i < UECapability.sdu_size; i++)
sprintf (&sdu[3 * i], "%02x.", UECapability.sdu[i]);
LOG_D(PHY, "[RRC]UE Capability encoded, %s\n", sdu);
}
return(&UECapability); return(&UECapability);
} }
......
...@@ -459,10 +459,15 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(u8 Mod_id,u32 frame,u8 ...@@ -459,10 +459,15 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(u8 Mod_id,u32 frame,u8
\param UE_index Index of UE transmitting the messages*/ \param UE_index Index of UE transmitting the messages*/
void rrc_eNB_generate_defaultRRCConnectionReconfiguration(u8 Mod_id, u32 frame, u16 UE_index, u8 *nas_pdu, u32 nas_length); void rrc_eNB_generate_defaultRRCConnectionReconfiguration(u8 Mod_id, u32 frame, u16 UE_index, u8 *nas_pdu, u32 nas_length);
#if defined(ENABLE_ITTI)
/**\brief RRC UE task.
\param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p);
#endif
//L2_interface.c //L2_interface.c
s8 mac_rrc_lite_data_req( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag, u8 eNB_index, u8 mbsfn_sync_area); s8 mac_rrc_lite_data_req( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 Nb_tb,char *Buffer,u8 eNB_flag, u8 eNB_index, u8 mbsfn_sync_area);
s8 mac_rrc_lite_data_ind( u8 Mod_id, u32 frame, unsigned short Srb_id, char *Sdu, unsigned short Sdu_len,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area); s8 mac_rrc_lite_data_ind( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 *Sdu, unsigned short Sdu_len,u8 eNB_flag,u8 eNB_index, u8 mbsfn_sync_area);
void mac_sync_ind( u8 Mod_id, u8 status); void mac_sync_ind( u8 Mod_id, u8 status);
void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag, u32 Rb_id, u32 sdu_size,u8 *Buffer); void rrc_lite_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag, u32 Rb_id, u32 sdu_size,u8 *Buffer);
void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, unsigned short eNB_index); void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, unsigned short eNB_index);
...@@ -470,7 +475,9 @@ void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, unsigned short eNB_index); ...@@ -470,7 +475,9 @@ void rrc_lite_out_of_sync_ind(u8 Mod_id, u32 frame, unsigned short eNB_index);