diff --git a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c index 088828b877f5e33ab83f8eb1d6b1eb5360b9065c..446865612b644e7da67d0c3bde33d6bb0746e1c2 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c @@ -155,7 +155,7 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg, { eNB_transport_info_t *eNB_info; 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(messg != NULL); @@ -175,10 +175,12 @@ int emu_transport_handle_enb_info(bypass_msg_header_t *messg, oai_emulation.info.master[messg->master_id].nb_enb; n_enb ++) { - for (n_dci = 0; n_dci < (eNB_info->num_ue_spec_dci + eNB_info->num_common_dci); n_dci ++) { - total_tbs += eNB_info->tbs[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[enb_info_ix].tbs[n_dci]; } + enb_info_ix++; + 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", total_header+total_tbs, total_header,total_tbs); @@ -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); /* 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); } @@ -215,7 +218,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg, { UE_transport_info_t *UE_info; 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(messg != NULL); @@ -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 + oai_emulation.info.master[messg->master_id].nb_ue; n_ue ++) { total_tbs = 0; - for (n_enb = 0; n_enb < UE_info->num_eNB; n_enb ++) { - total_tbs += UE_info->tbs[n_enb]; + for (n_enb = 0; n_enb < UE_info[ue_info_ix].num_eNB; 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 ) { 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); @@ -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); /* 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); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index ede5a6f8ea003ce73f1a86d5f09fc5db6a50ed4d..b76be423f8dcc2ded087ea50a5caa6dc20e2e06f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -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], rrc_sdu_length); -// #if defined(USER_MODE) && defined(OAI_EMU) -// if (oai_emulation.info.opt_enabled){ -// 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), -// 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", -// Mod_id, frame, find_UE_RNTI(Mod_id,UE_id), rrc_sdu_length); -// } -// #endif +#if defined(USER_MODE) && defined(OAI_EMU) + if (oai_emulation.info.opt_enabled){ + 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), + 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", + Mod_id, frame, find_UE_RNTI(Mod_id,UE_id), rrc_sdu_length); + } +#endif *nprb= (*nprb) + 3; *nCCE = (*nCCE) + 4; } @@ -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) /* Tracing of PDU is done on UE side */ -// if (oai_emulation.info.opt_enabled) -// 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), -// eNB_mac_inst[Mod_id].subframe,0,0); + if (oai_emulation.info.opt_enabled) + 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), + eNB_mac_inst[Mod_id].subframe,0,0); 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); #endif