Commit 30b4c553 authored by nguyennd's avatar nguyennd
Browse files

LGAUTHIER, Duy, OK for e-MBMS, may be one remaining problem with stats

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5121 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 42f7ca06
......@@ -68,7 +68,7 @@ result could be based on an event-driven measurement report.
*/
# define NB_SIG_CNX_CH 1
# define NB_CNX_CH MAX_MOBILES_PER_RG
# define NB_CNX_CH MAX_MOBILES_PER_ENB
# define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
# define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
......
......@@ -33,9 +33,9 @@
#else
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
* 1500 bytes IP packet + 12 bytes ethernet header
* 1500 bytes IP packet + 14 bytes ethernet header
*/
# define MAX_IP_PACKET_SIZE 1512
# define MAX_IP_PACKET_SIZE 1514
# else
# define MAX_IP_PACKET_SIZE 1500 // 3000
# endif
......@@ -45,17 +45,24 @@
# define MAX_MODULES NB_MODULES_MAX
#ifdef LARGE_SCALE
# define MAX_MOBILES_PER_RG 128
# define MAX_RG 2
# define MAX_MOBILES_PER_ENB 128
//# define MAX_RG 2
#else
# define MAX_MOBILES_PER_RG 16
# define MAX_RG 2
# define MAX_MOBILES_PER_ENB 16
//# define MAX_RG 2
#endif
#define MAX_MANAGED_RG_PER_MOBILE 2
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define DEFAULT_RAB_ID 3
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#if defined(Rel10)
#define NB_RB_MBMS_MAX (maxSessionPerPMCH*maxServiceCount)
#else
// Do not allocate unused memory
#define NB_RB_MBMS_MAX 1
#endif
#define NB_RAB_MAX maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
......
......@@ -1451,6 +1451,19 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
else { // only MTCH in this subframeP
TBS = mac_xface->get_TBS(eNB_mac_inst[module_idP].pmch_Config[0]->dataMCS_r9, mac_xface->lte_frame_parms->N_RB_DL);
}
// get MTCH data from RLC (like for DTCH)
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: Schedule MTCH (area %d, sfAlloc %d)\n",Mod_id,frame,subframe,i,j);
header_len_mtch = 3;
LOG_D(MAC,"[eNB %d], Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n",
Mod_id,frame,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(Mod_id,frame,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer);
*/
// get MTCH data from RLC (like for DTCH)
......@@ -1461,16 +1474,22 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP,frameP,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
//printf("frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",frameP,subframeP, rlc_status.bytes_in_buffer);
LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",
MTCH,frameP,subframeP, rlc_status.bytes_in_buffer);
if (rlc_status.bytes_in_buffer >0) {
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
module_idP,frameP,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,
MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG,
sdu_lengths[num_sdus] = mac_rlc_data_req(
module_idP,
0,
frameP,
ENB_FLAG_YES,
MBMS_FLAG_YES,
MTCH,
(char*)&mch_buffer[sdu_length_total]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] Got %d bytes for MTCH %d\n",module_idP,sdu_lengths[num_sdus],MTCH);
......
......@@ -525,7 +525,7 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1
frameP,
ENB_FLAG_NO,
MBMS_FLAG_YES,
MTCH + (maxDRB + 3),
MTCH, /*+ (maxDRB + 3),*/
(char *)payload_ptr,
rx_lengths[i],
1,
......@@ -533,7 +533,12 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1
}
} else {
LOG_W(MAC,"[UE %d] Frame %d : unknown sdu %d mcch status %d eNB %d \n",module_idP,frameP,rx_lengths[i],
LOG_W(MAC,"[UE %d] Frame %d : unknown sdu %d rx_lcids[%d]=%d mcch status %d eNB %d \n",
module_idP,
frameP,
rx_lengths[i],
i,
rx_lcids[i],
UE_mac_inst[module_idP].mcch_status, eNB_index);
}
......
......@@ -76,8 +76,17 @@ extern int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned in
* this mem_block_t to be dissected for testing purposes. For further details see test
* code at targets/TEST/PDCP/test_pdcp.c:test_pdcp_data_req()
*/
boolean_t pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t enb_flagP, rb_id_t rb_idP, mui_t muiP, confirm_t confirmP,
sdu_size_t sdu_buffer_sizeP, unsigned char* sdu_buffer_pP, pdcp_transmission_mode_t modeP)
boolean_t pdcp_data_req(
module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
frame_t frameP,
eNB_flag_t enb_flagP,
rb_id_t rb_idP,
mui_t muiP,
confirm_t confirmP,
sdu_size_t sdu_buffer_sizeP,
unsigned char *sdu_buffer_pP,
pdcp_transmission_mode_t modeP)
{
//-----------------------------------------------------------------------------
pdcp_t *pdcp_p = NULL;
......@@ -92,7 +101,11 @@ boolean_t pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
AssertError (enb_mod_idP < NUMBER_OF_eNB_MAX, return FALSE, "eNB id is too high (%u/%d) %u %u!\n", enb_mod_idP, NUMBER_OF_eNB_MAX, ue_mod_idP, rb_idP);
AssertError (ue_mod_idP < NUMBER_OF_UE_MAX, return FALSE, "UE id is too high (%u/%d) %u %u!\n", ue_mod_idP, NUMBER_OF_UE_MAX, enb_mod_idP, rb_idP);
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ue_mod_idP, enb_mod_idP);
} else {
AssertError (rb_idP < NB_RB_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MAX, ue_mod_idP, enb_mod_idP);
}
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_ue[ue_mod_idP][rb_idP];
......@@ -137,6 +150,10 @@ boolean_t pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
pdcp_pdu_p = get_free_mem_block(sdu_buffer_sizeP);
if (pdcp_pdu_p != NULL) {
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
rlc_util_print_hex_octets(PDCP,
(unsigned char*)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP);
rlc_status = rlc_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
} else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
......@@ -362,8 +379,20 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
oai_emulation.info.first_ue_local);
}
#endif
DevCheck4(rb_idP < NB_RB_MAX, rb_idP, NB_RB_MAX, enb_mod_idP, ue_mod_idP);
if (MBMS_flagP) {
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ue_mod_idP, enb_mod_idP);
if (enb_flagP == ENB_FLAG_NO) {
LOG_I(PDCP, "e-MBMS Data indication notification for PDCP entity from eNB %u to UE %u "
"and radio bearer ID %d rlc sdu size %d enb_flagP %d\n",
enb_mod_idP, ue_mod_idP, rb_idP, sdu_buffer_sizeP, enb_flagP);
} else {
LOG_I(PDCP, "Data indication notification for PDCP entity from UE %u to eNB %u "
"and radio bearer ID %d rlc sdu size %d enb_flagP %d eNB_id %d\n",
ue_mod_idP, enb_mod_idP , rb_idP, sdu_buffer_sizeP, enb_flagP, enb_mod_idP);
}
} else {
rb_idP = rb_idP % NB_RB_MAX;
AssertError (rb_idP < NB_RB_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MAX, ue_mod_idP, enb_mod_idP);
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_ue[ue_mod_idP][rb_idP];
......@@ -377,6 +406,8 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
"and radio bearer ID %d rlc sdu size %d enb_flagP %d eNB_id %d\n",
ue_mod_idP, enb_mod_idP , rb_idP, sdu_buffer_sizeP, enb_flagP, enb_mod_idP);
}
}
sdu_list_p = &pdcp_sdu_list;
......@@ -482,6 +513,9 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
if (oai_emulation.info.otg_enabled == 1) {
module_id_t src_id, dst_id;
int ctime;
rlc_util_print_hex_octets(PDCP,
&sdu_buffer_pP->data[payload_offset],
sdu_buffer_sizeP - payload_offset);
src_id = (enb_flagP != 0) ? ue_mod_idP : enb_mod_idP;
dst_id = (enb_flagP == ENB_FLAG_NO) ? ue_mod_idP : enb_mod_idP;
......@@ -924,7 +958,7 @@ boolean_t rrc_pdcp_config_asn1_req (module_id_t enb_mod_idP,
// can set the mch_id = i
if (enb_flagP) {
rb_id = (mch_id * maxSessionPerPMCH ) + lc_id; // 1
rb_id = (mch_id * maxSessionPerPMCH ) + lc_id + (maxDRB + 3)*MAX_MOBILES_PER_ENB; // 1
if (pdcp_mbms_array_eNB[enb_mod_idP][mch_id][lc_id].instanciated_instance == TRUE)
action = CONFIG_ACTION_MBMS_MODIFY;
else
......@@ -939,7 +973,8 @@ boolean_t rrc_pdcp_config_asn1_req (module_id_t enb_mod_idP,
pdcp_config_req_asn1 (NULL, // unused for MBMS
pdcp_config_req_asn1 (
NULL, // unused for MBMS
enb_mod_idP,
ue_mod_idP,
frameP,
......@@ -1110,8 +1145,8 @@ boolean_t pdcp_config_req_asn1 (pdcp_t *pdcp_pP,
pdcp_mbms_array_eNB[enb_mod_idP][mch_idP][lc_idP].instanciated_instance = TRUE ;
pdcp_mbms_array_eNB[enb_mod_idP][mch_idP][lc_idP].rb_id = rb_idP;
} else {
pdcp_mbms_array_eNB[ue_mod_idP][mch_idP][lc_idP].instanciated_instance = TRUE ;
pdcp_mbms_array_eNB[ue_mod_idP][mch_idP][lc_idP].rb_id = rb_idP;
pdcp_mbms_array_ue[ue_mod_idP][mch_idP][lc_idP].instanciated_instance = TRUE ;
pdcp_mbms_array_ue[ue_mod_idP][mch_idP][lc_idP].rb_id = rb_idP;
}
break;
#endif
......
......@@ -372,7 +372,7 @@ int pdcp_fifo_read_input_sdus_remaining_bytes (frame_t frameP, eNB_flag_t enb_fl
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_TRANSMISSION_MODE_DATA); //PDCP_TRANSMISSION_MODE_TRANSPARENT);
PDCP_TRANSMISSION_MODE_TRANSPARENT);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
......@@ -504,7 +504,7 @@ int pdcp_fifo_read_input_sdus (frame_t frameP, eNB_flag_t enb_flagP, module_id_t
(data->pdcp_read_header.traffic_type == TRAFFIC_IPV4_TYPE_MULTICAST) /*TRAFFIC_IPV4_TYPE_MULTICAST */ ||
(data->pdcp_read_header.traffic_type == TRAFFIC_IPV4_TYPE_BROADCAST) /*TRAFFIC_IPV4_TYPE_BROADCAST */ ) {
#if defined (Rel10)
pdcp_mode = PDCP_TRANSMISSION_MODE_DATA; //PDCP_TRANSMISSION_MODE_TRANSPARENT;
PDCP_TRANSMISSION_MODE_TRANSPARENT;
#else
pdcp_mode= PDCP_TRANSMISSION_MODE_DATA;
#endif
......@@ -829,6 +829,10 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL) {
if (is_ue == 0 ) {
rlc_util_print_hex_octets(PDCP,
(unsigned char*)otg_pkt,
pkt_size);
//rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n",
enb_mod_idP, frameP, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
......@@ -837,6 +841,8 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
}
else {
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
ue_mod_idP, src_id, rb_id, src_id, dst_id, pkt_size);
result = pdcp_data_req( enb_mod_idP,
......
......@@ -627,6 +627,10 @@ rlc_um_data_req (void *rlc_pP, frame_t frameP, mem_block_t *sdu_pP)
rlc_p->nb_sdu,
rlc_p->current_sdu_index,
rlc_p->next_sdu_index);
rlc_util_print_hex_octets(
RLC,
(uint8_t*)&sdu_pP->data[sizeof (struct rlc_um_data_req_alloc)],
((struct rlc_um_data_req *) (sdu_pP->data))->data_size);
/*#ifndef USER_MODE
rlc_um_time_us = (unsigned long int)(rt_get_time_ns ()/(RTIME)1000);
......
......@@ -100,12 +100,24 @@ void config_req_rlc_um_asn1 (frame_t frameP,
uint32_t dl_sn_FieldLength = 0;
uint32_t t_Reordering;
rlc_um_entity_t *rlc_p = NULL;
#if defined(rel10)
#if defined(Rel10)
if (mbms_flagP) {
if (eNB_flagP) {
rlc_p = &rlc_mbms_array_eNB[enb_module_idP][mbms_service_idP][mbms_session_idP].um;
LOG_D(RLC,"eNB config_req_rlc_um_asn1 rlc_um_p : %p RB %u service %u session %u",
rlc_p,
rb_idP,
mbms_service_idP,
mbms_session_idP
);
} else {
rlc_p = &rlc_mbms_array_ue[ue_module_idP][mbms_service_idP][mbms_session_idP].um;
LOG_D(RLC,"UE config_req_rlc_um_asn1 rlc_um_p : %p RB %u service %u session %u",
rlc_p,
rb_idP,
mbms_service_idP,
mbms_session_idP
);
}
}
else
......@@ -198,6 +210,9 @@ void config_req_rlc_um_asn1 (frame_t frameP,
ul_sn_FieldLength,
mbms_flagP);
}
if (mbms_flagP == MBMS_FLAG_YES) {
rlc_p->allocation = TRUE;
}
}
}
//-----------------------------------------------------------------------------
......@@ -379,8 +394,7 @@ void rlc_um_set_debug_infos(rlc_um_entity_t *rlc_pP,
{
LOG_D(RLC, "[FRAME %05d][%s][RLC_UM][SET DEBUG INFOS] enb_module_id %u ue_module_id %u rb_id %d rb_type %d\n",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
eNB_flagP,
(eNB_flagP) ? "eNB" : "UE",
enb_module_idP,
ue_module_idP,
rb_idP,
......@@ -389,7 +403,7 @@ void rlc_um_set_debug_infos(rlc_um_entity_t *rlc_pP,
rlc_pP->enb_module_id = enb_module_idP;
rlc_pP->ue_module_id = ue_module_idP;
rlc_pP->rb_id = rb_idP;
if (rb_typeP != SIGNALLING_RADIO_BEARER) {
if (rb_typeP == RADIO_ACCESS_BEARER) {
rlc_pP->is_data_plane = 1;
} else {
rlc_pP->is_data_plane = 0;
......
......@@ -89,7 +89,12 @@ rlc_um_segment_10 (rlc_um_entity_t *rlc_pP,frame_t frameP)
return;
}
#if defined(TRACE_RLC_UM_SEGMENT)
LOG_D(RLC, "[FRAME %05u][%s][RLC_UM][MOD %u/%u][RB %u] SEGMENT10\n", rlc_pP->module_id, rlc_pP->rb_id, frameP);
LOG_D(RLC, "[FRAME %05u][%s][RLC_UM][MOD %u/%u][RB %u] SEGMENT10\n",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
rlc_pP->rb_id);
#endif
list_init (&pdus, NULL); // param string identifying the list is NULL
pdu_mem_p = NULL;
......@@ -766,8 +771,8 @@ rlc_um_segment_5 (rlc_um_entity_t *rlc_pP,frame_t frameP)
rlc_pP->ue_module_id,
rlc_pP->rb_id,
pdu_remaining_size);
memcpy(data, data_sdu_p, pdu_remaining_size);
#endif
memcpy(data, data_sdu_p, pdu_remaining_size);
// free SDU
rlc_pP->buffer_occupancy -= sdu_mngt_p->sdu_remaining_size;
free_mem_block (rlc_pP->input_sdus[rlc_pP->current_sdu_index]);
......
......@@ -53,8 +53,11 @@ void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, uns
}
LOG_T(componentP, " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
LOG_T(componentP, "------+-------------------------------------------------|\n");
LOG_T(componentP, "+-----+-------------------------------------------------+\n");
LOG_T(componentP, "| | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
LOG_T(componentP, "+-----+-------------------------------------------------+\n");
for (octet_index = 0; octet_index < sizeP; octet_index++) {
if ((octet_index % 16) == 0){
if (octet_index != 0) {
......@@ -359,6 +362,8 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
#ifdef Rel10
rb_id_t mbms_rb_id = 0;
rlc_um_entity_t *rlc_um_p = NULL;
rlc_mbms_id_t *mbms_id_p = NULL;
logical_chan_id_t log_ch_id = 0;
#endif
#ifdef DEBUG_RLC_DATA_REQ
LOG_D(RLC,"rlc_data_req: %s enb id %u ue id %u, rb_id %u (MAX %d), muip %d, confirmP %d, sud_sizeP %d, sdu_pP %p\n",
......@@ -401,7 +406,11 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
oai_emulation.info.first_ue_local);
}
#endif
if (MBMS_flagP) {
AssertFatal (rb_idP < NB_RB_MBMS_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MBMS_MAX);
} else {
AssertFatal (rb_idP < NB_RB_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MAX);
}
DevAssert(sdu_pP != NULL);
DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
......@@ -409,6 +418,33 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
DevCheck(MBMS_flagP == 0, MBMS_flagP, 0, 0);
#endif
#ifdef Rel10
if (MBMS_flagP == TRUE) {
if (enb_flagP) {
log_ch_id = rlc_mbms_enb_get_lcid_by_rb_id(enb_mod_idP,rb_idP);
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][log_ch_id];
rlc_um_p = &rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
LOG_D(RLC,"eNB rlc_um_p : %p RB %u service %u session %u\n",
rlc_um_p,
rb_idP,
mbms_id_p->service_id,
mbms_id_p->session_id
);
} else {
log_ch_id = rlc_mbms_ue_get_lcid_by_rb_id(ue_mod_idP,rb_idP);
mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][log_ch_id];
rlc_um_p = &rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
LOG_D(RLC,"UE rlc_um_p : %p RB %u service %u session %u\n",
rlc_um_p,
rb_idP,
mbms_id_p->service_id,
mbms_id_p->session_id
);
}
} else
#endif
{
if (enb_flagP) {
rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_idP].mode;
switch (rlc_mode) {
......@@ -446,7 +482,7 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
AssertFatal (0 , "UE RLC internal memory error rb id %u module %u!\n", rb_idP, ue_mod_idP);
}
}
}
if (MBMS_flagP == 0) {
LOG_D(RLC, "[FRAME %5u][%s][RLC][INST %u/%u][RB %u] Display of rlc_data_req:\n",
......@@ -617,14 +653,6 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
#ifdef Rel10
} else { /* MBMS_flag != 0 */
if (rb_idP < (maxSessionPerPMCH * maxServiceCount)) {
if (enb_flagP) {
mbms_rb_id = rb_idP + (maxDRB + 3) * MAX_MOBILES_PER_RG;
//rlc_um_p = rlc_mbms_array_eNB[enb_mod_idP][mbms_rb_id].;
} else {
mbms_rb_id = rb_idP + (maxDRB + 3);
//rlc_um_p = rlc_mbms_array_ue[ue_mod_idP][mbms_rb_id];
}
// LOG_I(RLC,"DUY rlc_data_req: mbms_rb_id in RLC instant is: %d\n", mbms_rb_id);
if (sdu_pP != NULL) {
if (sdu_sizeP > 0) {
......@@ -644,15 +672,13 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
enb_mod_idP,
ue_mod_idP,
rb_idP,
mbms_rb_id,
sdu_sizeP,
enb_mod_idP,
ue_mod_idP,
rb_idP,
mbms_rb_id);
rb_idP);
} else {
if (enb_flagP) {
LOG_D(RLC, "[FRAME %5u][RRC_eNB][INST %u/%u][][--- RLC_UM_DATA_REQ/%d Bytes (MBMS) --->][RLC_UM][INST %u/%u][RB %u]\n",
LOG_D(RLC, "[FRAME %5u][RRC_eNB][INST %u/%u][%u][--- RLC_UM_DATA_REQ/%d Bytes (MBMS) --->][RLC_UM][INST %u/%u][RB %u]\n",
frameP,
enb_mod_idP,
ue_mod_idP,
......@@ -660,10 +686,9 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
sdu_sizeP,
enb_mod_idP,
ue_mod_idP,
rb_idP,
mbms_rb_id);
rb_idP);
} else {
LOG_D(RLC, "[FRAME %5u][RRC_UE][INST %u/%u][][--- RLC_UM_DATA_REQ/%d Bytes (MBMS) --->][RLC_UM][INST %u/%u][RB %u]\n",
LOG_D(RLC, "[FRAME %5u][RRC_UE][INST %u/%u][%u][--- RLC_UM_DATA_REQ/%d Bytes (MBMS) --->][RLC_UM][INST %u/%u][RB %u]\n",
frameP,
enb_mod_idP,
ue_mod_idP,
......@@ -671,8 +696,7 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
sdu_sizeP,
enb_mod_idP,
ue_mod_idP,
rb_idP,
mbms_rb_id);
rb_idP);
}
}
LOG_D(RLC, "%s\n",RLC_FG_COLOR_DEFAULT);
......@@ -689,9 +713,6 @@ rlc_op_status_t rlc_data_req (module_id_t enb_mod_idP,
} else {
return RLC_OP_STATUS_BAD_PARAMETER;
}
} else {
return RLC_OP_STATUS_BAD_PARAMETER;
}
}
#else
} else {/* MBMS_flag != 0 */
......@@ -708,11 +729,18 @@ void rlc_data_ind (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
//-----------------------------------------------------------------------------
rlc_mode_t rlc_mode = RLC_MODE_NONE;
#ifdef Rel10
if (MBMS_flagP == TRUE) {
rlc_mode = RLC_MODE_UM;
} else
#endif
{
if (enb_flagP) {
rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_idP].mode;
} else {
rlc_mode = rlc_array_ue[ue_mod_idP][rb_idP].mode;
}
}
LOG_D(RLC, "[FRAME %5u][%s][RLC][INST %u/%u][RB %u] Display of rlc_data_ind: size %u\n",
frameP,
......@@ -743,12 +771,13 @@ void rlc_data_ind (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
rb_idP);
break;
case RLC_MODE_UM:
LOG_D(RLC, "[FRAME %5u][%s][RLC_UM][INST %u/%u][RB %u][--- RLC_DATA_IND/%d Bytes --->][PDCP][INST %u/%u][RB %u]\n",
LOG_D(RLC, "[FRAME %5u][%s][RLC_UM][INST %u/%u][RB %u][--- RLC_DATA_IND %s/%d Bytes --->][PDCP][INST %u/%u][RB %u]\n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
rb_idP,
(MBMS_flagP) ? "(e-MBMS)" : "",
sdu_sizeP,
enb_mod_idP,
ue_mod_idP,
......@@ -767,7 +796,7 @@ void rlc_data_ind (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
rb_idP);
break;
}
pdcp_data_ind (enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_flagP, rb_idP % NB_RB_MAX, sdu_sizeP, sdu_pP, is_data_planeP);
pdcp_data_ind (enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_flagP, rb_idP, sdu_sizeP, sdu_pP, is_data_planeP);
}
//-----------------------------------------------------------------------------
void rlc_data_conf (module_id_t enb_mod_idP,
......@@ -781,13 +810,23 @@ void rlc_data_conf (module_id_t enb_mod_idP,
//-----------------------------------------------------------------------------
rlc_mode_t rlc_mode = RLC_MODE_NONE;
//TO DO (check if we can add MBMS flag in prototype)#ifdef Rel10
// if (MBMS_flagP == TRUE) {
// rlc_mode = RLC_MODE_UM;
// } else
//#endif
#if !defined(Rel10)
{
if (enb_flagP) {
rlc_mode = rlc_array_eNB[enb_mod_idP][ue_mod_idP][rb_idP].mode;
} else {
rlc_mode = rlc_array_ue[ue_mod_idP][rb_idP].mode;
}
}
#endif
if (!(is_data_planeP)) {
if (rlc_rrc_data_conf != NULL) {
#if !defined(Rel10)
LOG_D(RLC, "%s\n",RLC_FG_BRIGHT_COLOR_RED);
switch (rlc_mode) {
case RLC_MODE_NONE:
......@@ -798,6 +837,7 @@ void rlc_data_conf (module_id_t enb_mod_idP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
rb_idP,
muiP,
enb_mod_idP,
ue_mod_idP,
......@@ -809,6 +849,7 @@ void rlc_data_conf (module_id_t enb_mod_idP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
rb_idP,
muiP,
enb_mod_idP,
ue_mod_idP,
......@@ -820,6 +861,7 @@ void rlc_data_conf (module_id_t enb_mod_idP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
rb_idP,
muiP,
enb_mod_idP,
ue_mod_idP,
......@@ -827,6 +869,7 @@ void rlc_data_conf (module_id_t enb_mod_idP,
break;
}
LOG_D(RLC, "%s\n",RLC_FG_COLOR_DEFAULT);
#endif
rlc_rrc_data_conf (enb_mod_idP , ue_mod_idP, enb_flagP, rb_idP , muiP, statusP);
}
}
......@@ -864,6 +907,9 @@ rlc_module_init (void)
rlc_mbms_lcid2service_session_id_ue[module_id1][k].service_id = 0;
rlc_mbms_lcid2service_session_id_ue[module_id1][k].session_id = 0;
}
for (k=0; k < NB_RB_MBMS_MAX; k++) {
rlc_mbms_rbid2lcid_eNB[module_id1][k] = RLC_LC_UNALLOCATED;
}
#endif
for (rb_id=0; rb_id < NB_RB_MAX; rb_id++) {
memset(&rlc_array_ue[module_id1][rb_id], 0, sizeof(rlc_t));
......@@ -881,6 +927,9 @@ rlc_module_init (void)
rlc_mbms_lcid2service_session_id_eNB[module_id1][k].service_id = 0;
rlc_mbms_lcid2service_session_id_eNB[module_id1][k].session_id = 0;
}
for (k=0; k < NB_RB_MBMS_MAX; k++) {
rlc_mbms_rbid2lcid_ue[module_id1][k] = RLC_LC_UNALLOCATED;
}
#endif
for (module_id2=0; module_id2 < NUMBER_OF_UE_MAX; module_id2++) {