Commit bbda7379 authored by Cedric Roux's avatar Cedric Roux

- Fix incorrent eNB/UE transport pointers

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4020 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent ae568a84
...@@ -155,7 +155,7 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg, ...@@ -155,7 +155,7 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg,
{ {
eNB_transport_info_t *eNB_info; eNB_transport_info_t *eNB_info;
int total_header = 0, total_tbs = 0; int total_header = 0, total_tbs = 0;
int n_dci, n_enb; int n_dci, n_enb, enb_info_ix = 0;
DevAssert(bytes_read >= 0); DevAssert(bytes_read >= 0);
DevAssert(messg != NULL); DevAssert(messg != NULL);
...@@ -175,10 +175,12 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg, ...@@ -175,10 +175,12 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg,
oai_emulation.info.master[messg->master_id].nb_enb; oai_emulation.info.master[messg->master_id].nb_enb;
n_enb ++) n_enb ++)
{ {
for (n_dci = 0; n_dci < (eNB_info->num_ue_spec_dci + eNB_info->num_common_dci); n_dci ++) { for (n_dci = 0; n_dci < (eNB_info[enb_info_ix].num_ue_spec_dci + eNB_info[enb_info_ix].num_common_dci); n_dci ++) {
total_tbs += eNB_info->tbs[n_dci]; total_tbs += eNB_info[enb_info_ix].tbs[n_dci];
} }
enb_info_ix++;
if ((total_tbs + total_header) > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ) { if ((total_tbs + total_header) > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ) {
LOG_W(EMU,"RX eNB Transport buffer total size %d (header%d,tbs %d) \n", LOG_W(EMU,"RX eNB Transport buffer total size %d (header%d,tbs %d) \n",
total_header+total_tbs, total_header,total_tbs); total_header+total_tbs, total_header,total_tbs);
...@@ -187,7 +189,8 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg, ...@@ -187,7 +189,8 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg,
memcpy(&eNB_transport_info[n_enb], eNB_info, total_header + total_tbs); memcpy(&eNB_transport_info[n_enb], eNB_info, total_header + total_tbs);
/* Go to the next eNB info */ /* Go to the next eNB info */
eNB_info += (total_header + total_tbs); eNB_info = (eNB_transport_info_t *)((unsigned int)eNB_info + total_header+
total_tbs);
bytes_read += (total_header + total_tbs); bytes_read += (total_header + total_tbs);
} }
...@@ -215,7 +218,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, ...@@ -215,7 +218,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
{ {
UE_transport_info_t *UE_info; UE_transport_info_t *UE_info;
int n_ue, n_enb; int n_ue, n_enb;
int total_tbs = 0, total_header = 0; int total_tbs = 0, total_header = 0, ue_info_ix =0;
DevAssert(bytes_read >= 0); DevAssert(bytes_read >= 0);
DevAssert(messg != NULL); DevAssert(messg != NULL);
...@@ -235,10 +238,12 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, ...@@ -235,10 +238,12 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
n_ue < oai_emulation.info.master[messg->master_id].first_ue + n_ue < oai_emulation.info.master[messg->master_id].first_ue +
oai_emulation.info.master[messg->master_id].nb_ue; n_ue ++) { oai_emulation.info.master[messg->master_id].nb_ue; n_ue ++) {
total_tbs = 0; total_tbs = 0;
for (n_enb = 0; n_enb < UE_info->num_eNB; n_enb ++) { for (n_enb = 0; n_enb < UE_info[ue_info_ix].num_eNB; n_enb ++) {
total_tbs += UE_info->tbs[n_enb]; total_tbs += UE_info[ue_info_ix].tbs[n_enb];
} }
ue_info_ix++;
if (total_tbs + total_header > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ) { if (total_tbs + total_header > MAX_TRANSPORT_BLOCKS_BUFFER_SIZE ) {
LOG_W(EMU,"RX [UE %d] Total size of buffer is %d (header%d,tbs %d) \n", LOG_W(EMU,"RX [UE %d] Total size of buffer is %d (header%d,tbs %d) \n",
n_ue, total_header+total_tbs,total_header,total_tbs); n_ue, total_header+total_tbs,total_header,total_tbs);
...@@ -247,7 +252,8 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, ...@@ -247,7 +252,8 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
memcpy(&UE_transport_info[n_ue], UE_info, total_header + total_tbs); memcpy(&UE_transport_info[n_ue], UE_info, total_header + total_tbs);
/* Go to the next UE info */ /* Go to the next UE info */
UE_info += (total_header + total_tbs); UE_info = (UE_transport_info_t *)((unsigned int)UE_info + total_header+
total_tbs);
bytes_read += (total_header + total_tbs); bytes_read += (total_header + total_tbs);
} }
......
...@@ -1605,15 +1605,15 @@ void schedule_RA(unsigned char Mod_id,u32 frame, unsigned char subframe,unsigned ...@@ -1605,15 +1605,15 @@ void schedule_RA(unsigned char Mod_id,u32 frame, unsigned char subframe,unsigned
&eNB_mac_inst[Mod_id].CCCH_pdu.payload[0], &eNB_mac_inst[Mod_id].CCCH_pdu.payload[0],
rrc_sdu_length); rrc_sdu_length);
// #if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
// if (oai_emulation.info.opt_enabled){ if (oai_emulation.info.opt_enabled){
// trace_pdu(1, (char*)eNB_mac_inst[Mod_id].DLSCH_pdu[(unsigned char)UE_id][0].payload[0], trace_pdu(1, (char*)eNB_mac_inst[Mod_id].DLSCH_pdu[(unsigned char)UE_id][0].payload[0],
// rrc_sdu_length, UE_id, 3, find_UE_RNTI(Mod_id, UE_id), rrc_sdu_length, UE_id, 3, find_UE_RNTI(Mod_id, UE_id),
// eNB_mac_inst[Mod_id].subframe,0,0); eNB_mac_inst[Mod_id].subframe,0,0);
// LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n",
// Mod_id, frame, find_UE_RNTI(Mod_id,UE_id), rrc_sdu_length); Mod_id, frame, find_UE_RNTI(Mod_id,UE_id), rrc_sdu_length);
// } }
// #endif #endif
*nprb= (*nprb) + 3; *nprb= (*nprb) + 3;
*nCCE = (*nCCE) + 4; *nCCE = (*nCCE) + 4;
} }
...@@ -3167,10 +3167,10 @@ void schedule_ue_spec(unsigned char Mod_id,u32 frame, unsigned char subframe,u16 ...@@ -3167,10 +3167,10 @@ void schedule_ue_spec(unsigned char Mod_id,u32 frame, unsigned char subframe,u16
#if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
/* Tracing of PDU is done on UE side */ /* Tracing of PDU is done on UE side */
// if (oai_emulation.info.opt_enabled) if (oai_emulation.info.opt_enabled)
// trace_pdu(1, (char*)eNB_mac_inst[Mod_id].DLSCH_pdu[(unsigned char)next_ue][0].payload[0], trace_pdu(1, (char*)eNB_mac_inst[Mod_id].DLSCH_pdu[(unsigned char)next_ue][0].payload[0],
// TBS, Mod_id, 3, find_UE_RNTI(Mod_id,next_ue), TBS, Mod_id, 3, find_UE_RNTI(Mod_id,next_ue),
// eNB_mac_inst[Mod_id].subframe,0,0); eNB_mac_inst[Mod_id].subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n",
Mod_id, frame, find_UE_RNTI(Mod_id,next_ue), TBS); Mod_id, frame, find_UE_RNTI(Mod_id,next_ue), TBS);
#endif #endif
......
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