From b6d8faefa938731fece1b4cc4492d6441405fe50 Mon Sep 17 00:00:00 2001 From: Navid Nikaein <navid.nikaein@eurecom.fr> Date: Thu, 23 Apr 2015 10:40:49 +0000 Subject: [PATCH] Wireshark interface for MAC/RLC/PDCP/RRC of lte-softmodem (re-committing) git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7257 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- oaienv | 2 +- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 19 ++++++++----------- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 10 +++------- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 20 ++++++++------------ openair2/LAYER2/MAC/eNB_scheduler_mch.c | 14 +++++--------- openair2/UTIL/OPT/probe.c | 4 ++-- 6 files changed, 27 insertions(+), 42 deletions(-) diff --git a/oaienv b/oaienv index 1142976cd9..4aae35ca5b 100644 --- a/oaienv +++ b/oaienv @@ -14,7 +14,7 @@ alias oai1='cd $OPENAIR1_DIR' alias oai2='cd $OPENAIR2_DIR' alias oai3='cd $OPENAIR3_DIR' alias oait='cd $OPENAIR_TARGETS' -alias oaiu='cd $OPENAIR2_DIR/UTIL' +alias oailte='cd $OPENAIR_TARGETS/RT/USER' alias oais='cd $OPENAIR_TARGETS/SIMU/USER' alias oaiex='cd $OPENAIR_TARGETS/SIMU/EXAMPLES' alias oaicn='cd OPENAIRCN_DIR' diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index ed8273bcd1..37d687c7f8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -348,7 +348,6 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9; TBsize = 57; } - break; } } @@ -383,17 +382,15 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], &eNB->common_channels[CC_id].CCCH_pdu.payload[0], rrc_sdu_length); -#if defined(USER_MODE) && defined(OAI_EMU) - - if (oai_emulation.info.opt_enabled) { - trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], - rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), - eNB->subframe,0,0); - LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n", - module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); - } -#endif + if (opt_enabled==1){ + trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0], + rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), + eNB->subframe,0,0); + LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n", + module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length); + } + nprb[CC_id]= nprb[CC_id] + 3; nCCE[CC_id] = nCCE[CC_id] + 4; } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 6cbc3aa6d0..131e287cdb 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -164,9 +164,7 @@ schedule_SI( } } -#if defined(USER_MODE) && defined(OAI_EMU) - - if (oai_emulation.info.opt_enabled) { + if (opt_enabled == 1) { trace_pdu(1, &eNB->common_channels[CC_id].BCCH_pdu.payload[0], bcch_sdu_length, @@ -176,11 +174,9 @@ schedule_SI( eNB->subframe, 0, 0); + LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for rnti %x with size %d\n", + module_idP, frameP, 0xffff, bcch_sdu_length); } - LOG_D(OPT,"[eNB %d][BCH] Frame %d trace pdu for rnti %x with size %d\n", - module_idP, frameP, 0xffff, bcch_sdu_length); -#endif - if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) { LOG_D(MAC,"[eNB] Frame %d : Scheduling BCCH->DLSCH (TDD) for SI %d bytes (mcs %d, rb 3, TBS %d)\n", frameP, diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 8f286cecd0..f3f9be377b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -1104,18 +1104,14 @@ schedule_ue_spec( } //eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset+sdu_lengths[0]+j] = (char)(taus()&0xff); -#if defined(USER_MODE) && defined(OAI_EMU) - - /* Tracing of PDU is done on UE side */ - if (oai_emulation.info.opt_enabled) - trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], - TBS, module_idP, 3, UE_RNTI(module_idP,UE_id), - eNB->subframe,0,0); - LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n", - module_idP, frameP, UE_RNTI(module_idP,UE_id), TBS); -#endif - - aggregation = process_ue_cqi(module_idP,UE_id); + if (opt_enabled == 1){ + trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], + TBS, module_idP, 3, UE_RNTI(module_idP,UE_id), + eNB->subframe,0,0); + LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n", + module_idP, frameP, UE_RNTI(module_idP,UE_id), TBS); + } + aggregation = process_ue_cqi(module_idP,UE_id); nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE nCCE_used[CC_id]+=(1<<aggregation); // adjust the remaining nCCE UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index 63c5eb22cc..c84c42f39b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -619,18 +619,14 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra for (j=0; j<(TBS-sdu_length_total-offset); j++) { eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff); } - -#if defined(USER_MODE) && defined(OAI_EMU) - /* Tracing of PDU is done on UE side */ - if (oai_emulation.info.opt_enabled) + if (opt_enabled ==1 ){ trace_pdu(1, (uint8_t *)eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload, - TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark - eNB_mac_inst[module_idP].subframe,0,0); + TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark + eNB_mac_inst[module_idP].subframe,0,0); LOG_D(OPT,"[eNB %d][MCH] Frame %d : MAC PDU with size %d\n", - module_idP, frameP, TBS); -#endif - + module_idP, frameP, TBS); + } /* for (j=0;j<sdu_length_total;j++) printf("%2x.",eNB_mac_inst[module_idP].MCH_pdu.payload[j+offset]); diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index 8d070eec55..f2db12b4f4 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -562,18 +562,18 @@ int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p) LOG_D(OPT, "Failed to open file \"%s\" for writing\n", in_path); return (-1); } - /* Write the file header */ fwrite(&file_header, sizeof(pcap_hdr_t), 1, file_fd); break; case OPT_TSHARK: - LOG_D(OPT, "Tshark is currently not supported\n"); + LOG_W(OPT, "Tshark is currently not supported\n"); opt_type = OPT_NONE; break; default: opt_type = OPT_NONE; + LOG_W(OPT, "supported Option\n"); break; } -- 2.26.2