From b016bc229abd9ac8626ea0c838d8419a5b626734 Mon Sep 17 00:00:00 2001 From: bruno mongazon <bruno.mongazon-cazavet@nokia-bell-labs.com> Date: Mon, 25 Jun 2018 18:23:36 +0200 Subject: [PATCH] fixed #320 issue --- common/utils/T/T.h | 44 -- .../utils/T/tracer/extract_input_subframe.c | 7 +- .../utils/T/tracer/extract_output_subframe.c | 6 - common/utils/T/tracer/gui/test.c | 6 - common/utils/T/tracer/gui/x.c | 22 - common/utils/T/tracer/gui/xy_plot.c | 159 ----- common/utils/T/tracer/logger/iqlog.c | 36 -- common/utils/T/tracer/packet-mac-lte.h | 249 -------- common/utils/itti/intertask_interface.c | 28 - .../utils/itti_analyzer/libparser/xml_parse.c | 19 - nfapi/oai_integration/nfapi_pnf.c | 12 - nfapi/oai_integration/nfapi_vnf.c | 12 - nfapi/open-nFAPI/pnf/src/pnf_p7.c | 4 - nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c | 14 - .../CODING/3gpplte_turbo_decoder_avx2_16bit.c | 130 ---- .../CODING/3gpplte_turbo_decoder_sse_16bit.c | 10 - .../CODING/3gpplte_turbo_decoder_sse_8bit.c | 264 -------- openair1/PHY/INIT/lte_init.c | 7 +- .../lte_ul_channel_estimation.c | 2 +- .../PHY/LTE_UE_TRANSPORT/dlsch_decoding.c | 37 +- .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 3 +- .../LTE_UE_TRANSPORT/dlsch_llr_computation.c | 11 - .../PHY/LTE_UE_TRANSPORT/srs_modulation.c | 107 ---- openair1/PHY/TOOLS/lte_dfts.c | 76 --- openair1/SCHED/ru_procedures.c | 5 - openair1/SCHED_UE/phy_procedures_lte_ue.c | 40 +- openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 5 - openair1/SIMULATION/TOOLS/rangen_double.c | 27 - openair1/SIMULATION/TOOLS/taus.c | 29 - openair2/LAYER2/MAC/eNB_scheduler.c | 10 - openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 44 -- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 49 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 15 - openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 28 - openair2/LAYER2/MAC/mac.h | 4 - openair2/LAYER2/MAC/pre_processor.c | 224 ------- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 33 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 11 - .../PDCP_v10.1.0/pdcp_sequence_manager.c | 14 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c | 588 ------------------ .../LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h | 27 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c | 453 -------------- .../LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h | 11 - .../RLC/AM_v9.3.0/rlc_am_segments_holes.c | 299 +-------- .../RLC/AM_v9.3.0/rlc_am_segments_holes.h | 77 +-- .../RLC/AM_v9.3.0/rlc_am_status_report.c | 342 ---------- openair2/PHY_INTERFACE/IF_Module.c | 20 - openair2/RRC/LTE/L2_interface.c | 144 ----- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 41 -- openair2/RRC/LTE/rrc_UE.c | 34 - openair2/RRC/LTE/rrc_eNB.c | 87 --- openair2/RRC/LTE/rrc_eNB_S1AP.c | 57 -- openair2/RRC/LTE/rrc_eNB_UE_context.c | 3 - openair2/UTIL/LOG/log.c | 303 --------- openair2/UTIL/OPT/packet-mac-lte.h | 40 -- openair3/COMMON/security_types.h | 9 - .../ActivateDefaultEpsBearerContextRequest.c | 25 - openair3/NAS/COMMON/IES/EsmMessageContainer.c | 4 - openair3/NAS/COMMON/IES/MobileIdentity.h | 31 - openair3/NAS/COMMON/UTIL/device.c | 12 - openair3/NAS/COMMON/commonDef.h | 11 - openair3/NAS/COMMON/networkDef.h | 9 - openair3/NAS/TEST/AS_SIMULATOR/nas_process.c | 10 +- openair3/NAS/TEST/USER/user_simulator.c | 17 - openair3/S1AP/s1ap_eNB_handlers.c | 117 ---- openair3/SCTP/sctp_eNB_task.c | 15 - openair3/UDP/udp_eNB_task.c | 5 +- .../EXMIMO/DRIVER/telecomparistech/em1_drv.h | 17 - targets/ARCH/mobipass/queues.c | 14 - targets/ARCH/tcp_bridge/tcp_bridge.c | 8 - targets/RT/USER/lte-enb.c | 51 -- targets/RT/USER/lte-ue.c | 8 - targets/SIMU/USER/oaisim_functions.c | 27 - targets/TEST/PDCP/test_pdcp.c | 3 - 74 files changed, 36 insertions(+), 4686 deletions(-) diff --git a/common/utils/T/T.h b/common/utils/T/T.h index cab246a6ff..c44b9013cd 100644 --- a/common/utils/T/T.h +++ b/common/utils/T/T.h @@ -151,50 +151,6 @@ extern T_cache_t *T_cache; abort(); \ } -#if 0 -#define T_PUT(type, var, argnum) \ - do { \ - if (T_LOCAL_size + sizeof(var) > T_BUFFER_MAX) { \ - printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \ - ", consider increasing T_BUFFER_MAX (%d)\n", \ - __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \ - abort(); \ - } \ - memcpy(T_LOCAL_buf + T_LOCAL_size, &var, sizeof(var)); \ - T_LOCAL_size += sizeof(var); \ - } while (0) -#endif - -#if 0 -#define T_PROCESS(x, argnum) \ - do { \ - T_PUT(typeof(x), x, argnum); \ - } while (0) -#endif - -#if 0 -#define T_PROCESS(x, argnum) \ - do { \ - if (__builtin_types_compatible_p(typeof(x), int)) \ - { T_PUT(int, (intptr_t)(x), argnum); printf("int\n"); } \ - else if (__builtin_types_compatible_p(typeof(x), short)) \ - { T_PUT(short, (intptr_t)(x), argnum); printf("short\n"); } \ - else if (__builtin_types_compatible_p(typeof(x), float)) \ - { T_PUT(float, (x), argnum); printf("float\n"); } \ - else if (__builtin_types_compatible_p(typeof(x), char *)) \ - { T_PUT(char *, (char *)(intptr_t)(x), argnum); printf("char *\n"); } \ - else if (__builtin_types_compatible_p(typeof(x), float *)) \ - { T_PUT(float *, (float *)(intptr_t)(x), argnum); printf("float *\n"); } \ - else if (__builtin_types_compatible_p(typeof(x), void *)) \ - { T_PUT(void *, (void *)(intptr_t)(x), argnum); printf("void *\n"); } \ - else { \ - printf("%s:%d:%s: unsupported type for argument %d in T macro\n", \ - __FILE__, __LINE__, __FUNCTION__, argnum); \ - abort(); \ - } \ - } while (0) -#endif - /* we have 4 versions of T_HEADER: * - bad quality C++ version with time * - good quality C version with time diff --git a/common/utils/T/tracer/extract_input_subframe.c b/common/utils/T/tracer/extract_input_subframe.c index d742318201..48e3ec07f9 100644 --- a/common/utils/T/tracer/extract_input_subframe.c +++ b/common/utils/T/tracer/extract_input_subframe.c @@ -117,12 +117,7 @@ err: e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize); if (!(frame == e.e[frame_arg].i && subframe == e.e[subframe_arg].i)) continue; -#if 0 -for (i = 0; i < e.e[buffer_arg].bsize/2; i++) { -short *x = e.e[buffer_arg].b; -x[i] *= 14; -} -#endif + if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1) { perror(output_file); exit(1); } processed_subframes++; diff --git a/common/utils/T/tracer/extract_output_subframe.c b/common/utils/T/tracer/extract_output_subframe.c index d24393553c..d7f9ff95ed 100644 --- a/common/utils/T/tracer/extract_output_subframe.c +++ b/common/utils/T/tracer/extract_output_subframe.c @@ -124,12 +124,6 @@ err: } last_frame = frame; last_subframe = subframe; -#if 0 -for (i = 0; i < e.e[buffer_arg].bsize/2; i++) { -short *x = e.e[buffer_arg].b; -x[i] *= 14; -} -#endif if (verbose) printf("save output frame %d subframe %d size %d\n", e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize); diff --git a/common/utils/T/tracer/gui/test.c b/common/utils/T/tracer/gui/test.c index f64d02347e..f0429cba17 100644 --- a/common/utils/T/tracer/gui/test.c +++ b/common/utils/T/tracer/gui/test.c @@ -22,13 +22,7 @@ int main(void) widget_add_child(g, c1, c2, 0); plot = new_xy_plot(g, 100, 100, "xy plot test", 30); -#if 0 - c2 = new_container(g, HORIZONTAL); - widget_add_child(g, c2, plot, -1); - widget_add_child(g, c1, c2, -1); -#else widget_add_child(g, c1, plot, -1); -#endif tlcol = new_color(g, "#ddf"); tl = new_textlist(g, 300, 10, tlcol); diff --git a/common/utils/T/tracer/gui/x.c b/common/utils/T/tracer/gui/x.c index af3d05cc14..94448eb666 100644 --- a/common/utils/T/tracer/gui/x.c +++ b/common/utils/T/tracer/gui/x.c @@ -124,20 +124,6 @@ x_window *x_create_window(x_connection *_x, int width, int height, XMapWindow(x->d, ret->w); -#if 0 - /* wait for window to be mapped */ - LOGD("wait for map\n"); - while (1) { - XEvent ev; - //XWindowEvent(x->d, ret->w, StructureNotifyMask, &ev); - XWindowEvent(x->d, ret->w, ExposureMask, &ev); - LOGD("got ev %d\n", ev.type); - //if (ev.type == MapNotify) break; - if (ev.type == Expose) break; - } - LOGD("XXX create connection %p window %p (win id %d pixmap %d) w h %d %d\n", x, ret, (int)ret->w, (int)ret->p, width, height); -#endif - return ret; } @@ -265,14 +251,6 @@ void x_events(gui *_gui) ev.xbutton.button, 1); } break; -#if 0 - case MapNotify: - if ((w = find_x_window(g, ev.xmap.window)) != NULL) { - struct x_window *xw = w->x; - xw->repaint = 1; - } - break; -#endif default: if (gui_logd) WARN("TODO: X event type %d\n", ev.type); break; } } diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c index 4115f92103..0f15f4862a 100644 --- a/common/utils/T/tracer/gui/xy_plot.c +++ b/common/utils/T/tracer/gui/xy_plot.c @@ -7,165 +7,6 @@ #include <string.h> #include <math.h> -#if 0 -/* this version behaves differently when you resize the XY plot. Say - * you increase the size. The old (smaller) view is put at the center - * of the new view. Everything inside keeps the same size/aspect ratio. - * The other version below resizes the old view so that it fully occupies - * the new view. It may introduce aspect ratio changes, but usage seems - * to suggest it's a better behaviour. - */ -static void paint(gui *_gui, widget *_this) -{ - struct gui *g = _gui; - struct xy_plot_widget *this = _this; - int wanted_plot_width, allocated_plot_width; - int wanted_plot_height, allocated_plot_height; - float pxsize; - float ticdist; - float tic; - float ticstep; - int k, kmin, kmax; - float allocated_xmin, allocated_xmax; - float allocated_ymin, allocated_ymax; - float center; - int i; - int n; - -# define FLIP(v) (-(v) + allocated_plot_height-1) - - LOGD("PAINT xy plot xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height); - -//x_draw_rectangle(g->x, g->xwin, 1, this->common.x, this->common.y, this->common.width, this->common.height); - - wanted_plot_width = this->wanted_width; - allocated_plot_width = this->common.width - this->vrule_width; - wanted_plot_height = this->wanted_height; - allocated_plot_height = this->common.height - this->label_height * 2; - - /* plot zone */ - /* TODO: refine height - height of hrule text may be != from label */ - x_draw_rectangle(g->x, g->xwin, 1, - this->common.x + this->vrule_width, - this->common.y, - this->common.width - this->vrule_width -1, /* -1 to see right border */ - this->common.height - this->label_height * 2); - - /* horizontal tics */ - pxsize = (this->xmax - this->xmin) / wanted_plot_width; - ticdist = 100; - tic = floor(log10(ticdist * pxsize)); - ticstep = powf(10, tic); - center = (this->xmax + this->xmin) / 2; - allocated_xmin = center - ((this->xmax - this->xmin) * - allocated_plot_width / wanted_plot_width) / 2; - allocated_xmax = center + ((this->xmax - this->xmin) * - allocated_plot_width / wanted_plot_width) / 2; - /* adjust tic if too tight */ - LOGD("pre x ticstep %g\n", ticstep); - while (1) { - if (ticstep / (allocated_xmax - allocated_xmin) - * (allocated_plot_width - 1) > 40) break; - ticstep *= 2; - } - LOGD("post x ticstep %g\n", ticstep); - LOGD("xmin/max %g %g width wanted allocated %d %d alloc xmin/max %g %g ticstep %g\n", this->xmin, this->xmax, wanted_plot_width, allocated_plot_width, allocated_xmin, allocated_xmax, ticstep); - kmin = ceil(allocated_xmin / ticstep); - kmax = floor(allocated_xmax / ticstep); - for (k = kmin; k <= kmax; k++) { -/* - (k * ticstep - allocated_xmin) / (allocated_max - allocated_xmin) = - (x - 0) / (allocated_plot_width-1 - 0) - */ - char v[64]; - int vwidth, dummy; - int x = (k * ticstep - allocated_xmin) / - (allocated_xmax - allocated_xmin) * - (allocated_plot_width - 1); - x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, - this->common.x + this->vrule_width + x, - this->common.y + this->common.height - this->label_height * 2, - this->common.x + this->vrule_width + x, - this->common.y + this->common.height - this->label_height * 2 - 5); - sprintf(v, "%g", k * ticstep); - x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); - x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, - this->common.x + this->vrule_width + x - vwidth/2, - this->common.y + this->common.height - this->label_height * 2 + - this->label_baseline, - v); - LOGD("tic k %d val %g x %d\n", k, k * ticstep, x); - } - - /* vertical tics */ - pxsize = (this->ymax - this->ymin) / wanted_plot_height; - ticdist = 30; - tic = floor(log10(ticdist * pxsize)); - ticstep = powf(10, tic); - center = (this->ymax + this->ymin) / 2; - allocated_ymin = center - ((this->ymax - this->ymin) * - allocated_plot_height / wanted_plot_height) / 2; - allocated_ymax = center + ((this->ymax - this->ymin) * - allocated_plot_height / wanted_plot_height) / 2; - /* adjust tic if too tight */ - LOGD("pre y ticstep %g\n", ticstep); - while (1) { - if (ticstep / (allocated_ymax - allocated_ymin) - * (allocated_plot_height - 1) > 20) break; - ticstep *= 2; - } - LOGD("post y ticstep %g\n", ticstep); - LOGD("ymin/max %g %g height wanted allocated %d %d alloc ymin/max %g %g ticstep %g\n", this->ymin, this->ymax, wanted_plot_height, allocated_plot_height, allocated_ymin, allocated_ymax, ticstep); - kmin = ceil(allocated_ymin / ticstep); - kmax = floor(allocated_ymax / ticstep); - for (k = kmin; k <= kmax; k++) { - char v[64]; - int vwidth, dummy; - int y = (k * ticstep - allocated_ymin) / - (allocated_ymax - allocated_ymin) * - (allocated_plot_height - 1); - sprintf(v, "%g", k * ticstep); - x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy); - x_draw_line(g->x, g->xwin, FOREGROUND_COLOR, - this->common.x + this->vrule_width, - this->common.y + FLIP(y), - this->common.x + this->vrule_width + 5, - this->common.y + FLIP(y)); - x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, - this->common.x + this->vrule_width - vwidth - 2, - this->common.y + FLIP(y) - this->label_height/2+this->label_baseline, - v); - } - - /* label at bottom, in the middle */ - x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR, - this->common.x + (this->common.width - this->label_width) / 2, - this->common.y + this->common.height - this->label_height - + this->label_baseline, - this->label); - - for (n = 0; n < this->nplots; n++) { - /* points */ - float ax, bx, ay, by; - ax = (allocated_plot_width-1) / (allocated_xmax - allocated_xmin); - bx = -ax * allocated_xmin; - ay = (allocated_plot_height-1) / (allocated_ymax - allocated_ymin); - by = -ay * allocated_ymin; - for (i = 0; i < this->plots[n].npoints; i++) { - int x, y; - x = ax * this->plots[n].x[i] + bx; - y = ay * this->plots[n].y[i] + by; - if (x >= 0 && x < allocated_plot_width && - y >= 0 && y < allocated_plot_height) - x_add_point(g->x, - this->common.x + this->vrule_width + x, - this->common.y + FLIP(y)); - } - x_plot_points(g->x, g->xwin, this->plots[n].color); - } -} -#endif - static void paint(gui *_gui, widget *_this) { struct gui *g = _gui; diff --git a/common/utils/T/tracer/logger/iqlog.c b/common/utils/T/tracer/logger/iqlog.c index bea8adccc5..168c50e39b 100644 --- a/common/utils/T/tracer/logger/iqlog.c +++ b/common/utils/T/tracer/logger/iqlog.c @@ -20,42 +20,6 @@ struct iqlog { int max_length; }; -#if 0 -/* this function passes all received IQ samples to the views */ -static void _event(void *p, event e) -{ - struct iqlog *l = p; - int i; - void *buffer; - int bsize; - int nsamples; - - if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0) - return; - - buffer = e.e[l->buffer_arg].b; - bsize = e.e[l->buffer_arg].bsize; - - nsamples = bsize / (2*sizeof(int16_t)); - - if (nsamples > l->max_length) { - l->i = realloc(l->i, nsamples * sizeof(float)); - if (l->i == NULL) abort(); - l->q = realloc(l->q, nsamples * sizeof(float)); - if (l->q == NULL) abort(); - l->max_length = nsamples; - } - - for (i = 0; i < nsamples; i++) { - l->i[i] = ((int16_t *)buffer)[i*2]; - l->q[i] = ((int16_t *)buffer)[i*2+1]; - } - - for (i = 0; i < l->common.vsize; i++) - l->common.v[i]->append(l->common.v[i], l->i, l->q, nsamples); -} -#endif - static void _event(void *p, event e) { struct iqlog *l = p; diff --git a/common/utils/T/tracer/packet-mac-lte.h b/common/utils/T/tracer/packet-mac-lte.h index e418f3417e..1bc6df632b 100644 --- a/common/utils/T/tracer/packet-mac-lte.h +++ b/common/utils/T/tracer/packet-mac-lte.h @@ -56,176 +56,6 @@ #define SC_RNTI 9 #define G_RNTI 10 -#if 0 -typedef enum mac_lte_oob_event { - ltemac_send_preamble, - ltemac_send_sr, - ltemac_sr_failure -} mac_lte_oob_event; - -typedef enum mac_lte_dl_retx { - dl_retx_no, - dl_retx_yes, - dl_retx_unknown -} mac_lte_dl_retx; - -typedef enum mac_lte_crc_status { - crc_fail = 0, - crc_success = 1, - crc_high_code_rate = 2, - crc_pdsch_lost = 3, - crc_duplicate_nonzero_rv = 4, - crc_false_dci = 5 -} mac_lte_crc_status; - -typedef enum mac_lte_carrier_id { - carrier_id_primary, - carrier_id_secondary_1, - carrier_id_secondary_2, - carrier_id_secondary_3, - carrier_id_secondary_4 -} mac_lte_carrier_id; - -typedef enum mac_lte_ce_mode { - no_ce_mode = 0, - ce_mode_a = 1, - ce_mode_b = 2 -} mac_lte_ce_mode; - -typedef enum mac_lte_nb_mode { - no_nb_mode = 0, - nb_mode = 1 -} mac_lte_nb_mode; - -/* Context info attached to each LTE MAC frame */ -typedef struct mac_lte_info -{ - /* Needed for decode */ - guint8 radioType; - guint8 direction; - guint8 rntiType; - - /* Extra info to display */ - guint16 rnti; - guint16 ueid; - - /* Timing info */ - guint16 sysframeNumber; - guint16 subframeNumber; - - /* Optional field. More interesting for TDD (FDD is always -4 subframeNumber) */ - gboolean subframeNumberOfGrantPresent; - guint16 subframeNumberOfGrant; - - /* Flag set only if doing PHY-level data test - i.e. there may not be a - well-formed MAC PDU so just show as raw data */ - gboolean isPredefinedData; - - /* Length of DL PDU or UL grant size in bytes */ - guint16 length; - - /* 0=newTx, 1=first-retx, etc */ - guint8 reTxCount; - guint8 isPHICHNACK; /* FALSE=PDCCH retx grant, TRUE=PHICH NACK */ - - /* UL only. Indicates if the R10 extendedBSR-Sizes parameter is set */ - gboolean isExtendedBSRSizes; - - /* UL only. Indicates if the R10 simultaneousPUCCH-PUSCH parameter is set for PCell */ - gboolean isSimultPUCCHPUSCHPCell; - - /* UL only. Indicates if the R10 extendedBSR-Sizes parameter is set for PSCell */ - gboolean isSimultPUCCHPUSCHPSCell; - - /* Status of CRC check. For UE it is DL only. For eNodeB it is UL - only. For an analyzer, it is present for both DL and UL. */ - gboolean crcStatusValid; - mac_lte_crc_status crcStatus; - - /* Carrier ID */ - mac_lte_carrier_id carrierId; - - /* DL only. Is this known to be a retransmission? */ - mac_lte_dl_retx dl_retx; - - /* DL only. CE mode to be used for RAR decoding */ - mac_lte_ce_mode ceMode; - - /* DL and UL. NB-IoT mode of the UE */ - mac_lte_nb_mode nbMode; - - /* More Physical layer info (see direction above for which side of union to use) */ - union { - struct mac_lte_ul_phy_info - { - guint8 present; /* Remaining UL fields are present and should be displayed */ - guint8 modulation_type; - guint8 tbs_index; - guint8 resource_block_length; - guint8 resource_block_start; - guint8 harq_id; - gboolean ndi; - } ul_info; - struct mac_lte_dl_phy_info - { - guint8 present; /* Remaining DL fields are present and should be displayed */ - guint8 dci_format; - guint8 resource_allocation_type; - guint8 aggregation_level; - guint8 mcs_index; - guint8 redundancy_version_index; - guint8 resource_block_length; - guint8 harq_id; - gboolean ndi; - guint8 transport_block; /* 0..1 */ - } dl_info; - } detailed_phy_info; - - /* Relating to out-of-band events */ - /* N.B. dissector will only look to these fields if length is 0... */ - mac_lte_oob_event oob_event; - guint8 rapid; - guint8 rach_attempt_number; - #define MAX_SRs 20 - guint16 number_of_srs; - guint16 oob_ueid[MAX_SRs]; - guint16 oob_rnti[MAX_SRs]; -} mac_lte_info; - - -typedef struct mac_lte_tap_info { - /* Info from context */ - guint16 rnti; - guint16 ueid; - guint8 rntiType; - guint8 isPredefinedData; - gboolean crcStatusValid; - mac_lte_crc_status crcStatus; - guint8 direction; - - guint8 isPHYRetx; - guint16 ueInTTI; - - nstime_t mac_lte_time; - - /* Number of bytes (which part is used depends upon context settings) */ - guint32 single_number_of_bytes; - guint32 bytes_for_lcid[11]; - guint32 sdus_for_lcid[11]; - guint8 number_of_rars; - guint8 number_of_paging_ids; - - /* Number of padding bytes includes padding subheaders and trailing padding */ - guint16 padding_bytes; - guint16 raw_length; -} mac_lte_tap_info; - - -/* Accessor function to check if a frame was considered to be ReTx */ -int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction); - -#endif - /*****************************************************************/ /* UDP framing format */ /* ----------------------- */ @@ -309,82 +139,3 @@ int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction); continues until the end of the frame) */ #define MAC_LTE_PAYLOAD_TAG 0x01 - -#if 0 - -/* Type to store parameters for configuring LCID->RLC channel settings for DRB */ -/* Some are optional, and may not be seen (e.g. on reestablishment) */ -typedef struct drb_mapping_t -{ - guint16 ueid; /* Mandatory */ - guint8 drbid; /* Mandatory */ - gboolean lcid_present; - guint8 lcid; /* Part of LogicalChannelConfig - optional */ - gboolean rlcMode_present; - guint8 rlcMode; /* Part of RLC config - optional */ - gboolean rlc_ul_ext_li_field; /* Part of RLC config - optional */ - gboolean rlc_dl_ext_li_field; /* Part of RLC config - optional */ - gboolean rlc_ul_ext_am_sn; /* Part of RLC config - optional */ - gboolean rlc_dl_ext_am_sn; /* Part of RLC config - optional */ - gboolean um_sn_length_present; - guint8 um_sn_length; /* Part of RLC config - optional */ - gboolean ul_priority_present; - guint8 ul_priority; /* Part of LogicalChannelConfig - optional */ - gboolean pdcp_sn_size_present; - guint8 pdcp_sn_size; /* Part of pdcp-Config - optional */ -} drb_mapping_t; - - -/* Set details of an LCID -> drb channel mapping. To be called from - configuration protocol (e.g. RRC) */ -void set_mac_lte_channel_mapping(drb_mapping_t *drb_mapping); - - -/* Dedicated DRX config. Used to verify that a sensible config is given. - Also, beginning to configure MAC with this config and (optionally) show - DRX config and state (cycles/timers) attached to each UL/DL PDU! */ -typedef struct drx_config_t { - gboolean configured; - guint32 frameNum; - guint32 previousFrameNum; - - guint32 onDurationTimer; - guint32 inactivityTimer; - guint32 retransmissionTimer; - guint32 longCycle; - guint32 cycleOffset; - /* Optional Short cycle */ - gboolean shortCycleConfigured; - guint32 shortCycle; - guint32 shortCycleTimer; -} drx_config_t; - -/* Functions to set/release up dedicated DRX config */ -void set_mac_lte_drx_config(guint16 ueid, drx_config_t *drx_config, packet_info *pinfo); -void set_mac_lte_drx_config_release(guint16 ueid, packet_info *pinfo); - -/* RRC can tell this dissector which RAPIDs are Group A, Group A&B */ -void set_mac_lte_rapid_ranges(guint groupA, guint all_RA); - -/* RRC can indicate whether extended BSR sizes are used */ -void set_mac_lte_extended_bsr_sizes(guint16 ueid, gboolean use_ext_bsr_sizes, packet_info *pinfo); - -/* RRC can indicate whether simultaneous PUCCH/PUSCH is used */ -typedef enum { - SIMULT_PUCCH_PUSCH_PCELL = 0, - SIMULT_PUCCH_PUSCH_PSCELL -} simult_pucch_pusch_cell_type; -void set_mac_lte_simult_pucch_pusch(guint16 ueid, simult_pucch_pusch_cell_type cell_type, gboolean use_simult_pucch_pusch, packet_info *pinfo); - -/* Functions to be called from outside this module (e.g. in a plugin, where mac_lte_info - isn't available) to get/set per-packet data */ -WS_DLL_PUBLIC -mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo); -WS_DLL_PUBLIC -void set_mac_lte_proto_data(packet_info *pinfo, mac_lte_info *p_mac_lte_info); - -/* Function to attempt to populate p_mac_lte_info using framing definition above */ -gboolean dissect_mac_lte_context_fields(struct mac_lte_info *p_mac_lte_info, tvbuff_t *tvb, - gint *p_offset); - -#endif diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 05e5e8c3dc..9dc7876d9f 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -328,12 +328,6 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me /* Increment the global message number */ message_number = itti_increment_message_number (); -#if 0 - /* itti dump is disabled */ - itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name, - sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize); -#endif - if (destination_task_id != TASK_UNKNOWN) { if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED) { @@ -429,12 +423,6 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance /* Increment the global message number */ message_number = itti_increment_message_number (); -#if 0 - /* itti dump is disabled */ - itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name, - sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize); -#endif - if (destination_task_id != TASK_UNKNOWN) { if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED) { @@ -727,12 +715,6 @@ void itti_mark_task_ready(task_id_t task_id) AssertFatal (thread_id < itti_desc.thread_max, "Thread id (%d) is out of range (%d)!\n", thread_id, itti_desc.thread_max); -#if 0 - /* itti dump is disabled */ - /* Register the thread in itti dump */ - itti_dump_thread_use_ring_buffer(); -#endif - /* Mark the thread as using LFDS queue */ lfds611_queue_use(itti_desc.tasks[task_id].message_queue); @@ -871,11 +853,6 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i itti_desc.wait_tasks = 0; itti_desc.created_tasks = 0; itti_desc.ready_tasks = 0; -#if 0 - /* itti dump is disabled */ - itti_dump_init (messages_definition_xml, dump_file_name); -#endif - CHECK_INIT_RETURN(timer_init ()); return 0; @@ -940,11 +917,6 @@ void itti_wait_tasks_end(void) ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Some threads are still running, force exit\n"); exit (0); } - -#if 0 - /* itti dump is disabled */ - itti_dump_exit(); -#endif } void itti_send_terminate_message(task_id_t task_id) diff --git a/common/utils/itti_analyzer/libparser/xml_parse.c b/common/utils/itti_analyzer/libparser/xml_parse.c index 352b10d616..72447e7669 100644 --- a/common/utils/itti_analyzer/libparser/xml_parse.c +++ b/common/utils/itti_analyzer/libparser/xml_parse.c @@ -740,25 +740,6 @@ int xml_parse_buffer(char *xml_buffer, const int size) { return xml_parse_doc(doc); } -#if 0 /* Not used anymore */ -int xml_parse_file(const char *filename) { - xmlDocPtr doc; /* the resulting document tree */ - - if (filename == NULL) { - return RC_NULL_POINTER; - } - - doc = xmlReadFile (filename, NULL, 0); - - if (doc == NULL) { - ui_notification_dialog(GTK_MESSAGE_ERROR, FALSE, "parse messages format definition", "Failed to parse file \"%s\"", filename); - return RC_FAIL; - } - - return xml_parse_doc(doc); -} -#endif - static int update_filters() { types_t *types; diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 09f37b9945..a2f49ddb7c 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -527,18 +527,6 @@ int config_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfap fp = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS)); } - -#if 0 - //DJP - auto found = std::find_if(pnf->phys.begin(), pnf->phys.end(), [&](phy_info& item) - { return item.id == req->header.phy_id; }); - - if(found != pnf->phys.end()) - { - phy_info& phy_info = (*found); - } -#endif - //DJP phy_info* phy_info = pnf->phys; if(req->nfapi_config.timing_window.tl.tag == NFAPI_NFAPI_TIMING_WINDOW_TAG) { diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 74e999528c..5380d340a3 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -357,18 +357,6 @@ int wake_eNB_rxtx(PHY_VARS_eNB *eNB, uint16_t sfn, uint16_t sf) { wait.tv_sec=0; wait.tv_nsec=5000000L; -#if 0 - /* accept some delay in processing - up to 5ms */ - for (i = 0; i < 10 && proc_rxtx->instance_cnt_rxtx == 0; i++) { - LOG_W( PHY,"[eNB] sfn/sf:%d:%d proc_rxtx[%d]:TXsfn:%d/%d eNB RXn-TXnp4 thread busy!! (cnt_rxtx %i)\n", sfn, sf, sf&1, proc_rxtx->frame_tx, proc_rxtx->subframe_tx, proc_rxtx->instance_cnt_rxtx); - usleep(500); - } - if (proc_rxtx->instance_cnt_rxtx == 0) { - exit_fun( "TX thread busy" ); - return(-1); - } -#endif - // wake up TX for subframe n+sf_ahead // lock the TX mutex and make sure the thread is ready if (pthread_mutex_timedlock(&proc_rxtx->mutex_rxtx,&wait) != 0) { diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index 02b828d382..8d94c23476 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -1624,10 +1624,6 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time) // need to update the time as we would only use the value from the // select -#if 0 -// DJP - why do this here and not on return from recv??? - now_hr_time = pnf_get_current_time_hr(); -#endif } while(recvfrom_result > 0); } diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c index a35d8e3c1d..4a85f7e4b3 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7_interface.c @@ -200,13 +200,6 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config) // still time before the end of the subframe wait pselect_timeout = timespec_sub(sf_start, pselect_start); -#if 0 - NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sf_start:%d.%ld pselect_start:%d.%ld pseclect_timeout:%d.%ld\n", - __FUNCTION__, - sf_start.tv_sec, sf_start.tv_nsec, - pselect_start.tv_sec, pselect_start.tv_nsec, - pselect_timeout.tv_sec, pselect_timeout.tv_nsec); -#endif } //original_pselect_timeout = pselect_timeout; @@ -266,13 +259,6 @@ if (selectRetval==-1 && errno == 22) phy->insync_minor_adjustment_duration, phy->insync_minor_adjustment, sf_duration.tv_sec, sf_duration.tv_nsec); } -#if 0 - if (selectRetval != 0 || phy->insync_minor_adjustment_duration != 0) - NFAPI_TRACE(NFAPI_TRACE_NOTE, "pselect()=%d maxSock:%d vnf_p7->socket:%d pselect_timeout:%u.%u original_pselect_timeout:%u.%u\n", - selectRetval, maxSock, vnf_p7->socket, pselect_timeout.tv_sec, pselect_timeout.tv_nsec, - original_pselect_timeout.tv_sec, original_pselect_timeout.tv_nsec); -#endif - if(selectRetval == 0) { // calculate the start of the next subframe diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c index a541c22393..83d28576e0 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c @@ -989,134 +989,6 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, yp1 = yparity1; yp2 = yparity2; - -#if 0 - __m128i *yp128,*yp128_cw2; - __m128i tmpe,tmpe_cw2; - yp128 = (__m128i*)y; - yp128_cw2 = (__m128i*)y2; - - - - for (i=0; i<n; i+=8) { - pi2_p = &pi2tab16avx2[iind][i]; - - j=pi2_p[0]; - - - tmpe = _mm_load_si128(yp128); - tmpe_cw2 = _mm_load_si128(yp128_cw2); - // fprintf(fdavx2,"yp128 %p\n",yp128); - // print_shorts("tmpe",(int16_t*)&tmpe); - - s[j] = _mm_extract_epi16(tmpe,0); - yp1[j] = _mm_extract_epi16(tmpe,1); - yp2[j] = _mm_extract_epi16(tmpe,2); - s[j+8] = _mm_extract_epi16(tmpe_cw2,0); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,1); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,2); - -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - - j=pi2_p[1]; - - s[j] = _mm_extract_epi16(tmpe,3); - yp1[j] = _mm_extract_epi16(tmpe,4); - yp2[j] = _mm_extract_epi16(tmpe,5); - s[j+8] = _mm_extract_epi16(tmpe_cw2,3); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,4); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,5); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - j=pi2_p[2]; - - s[j] = _mm_extract_epi16(tmpe,6); - yp1[j] = _mm_extract_epi16(tmpe,7); - tmpe = _mm_load_si128(&yp128[1]); - yp2[j] = _mm_extract_epi16(tmpe,0); - s[j+8] = _mm_extract_epi16(tmpe_cw2,6); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,7); - tmpe_cw2 = _mm_load_si128(&yp128_cw2[1]); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,0); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - j=pi2_p[3]; - - s[j] = _mm_extract_epi16(tmpe,1); - yp1[j] = _mm_extract_epi16(tmpe,2); - yp2[j] = _mm_extract_epi16(tmpe,3); - s[j+8] = _mm_extract_epi16(tmpe_cw2,1); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,2); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,3); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - j=pi2_p[4]; - - s[j] = _mm_extract_epi16(tmpe,4); - yp1[j] = _mm_extract_epi16(tmpe,5); - yp2[j] = _mm_extract_epi16(tmpe,6); - s[j+8] = _mm_extract_epi16(tmpe_cw2,4); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,5); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,6); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - j=pi2_p[5]; - - s[j] = _mm_extract_epi16(tmpe,7); - tmpe = _mm_load_si128(&yp128[2]); - yp1[j] = _mm_extract_epi16(tmpe,0); - yp2[j] = _mm_extract_epi16(tmpe,1); - s[j+8] = _mm_extract_epi16(tmpe_cw2,7); - tmpe_cw2 = _mm_load_si128(&yp128_cw2[2]); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,0); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,1); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - j=pi2_p[6]; - - s[j] = _mm_extract_epi16(tmpe,2); - yp1[j] = _mm_extract_epi16(tmpe,3); - yp2[j] = _mm_extract_epi16(tmpe,4); - s[j+8] = _mm_extract_epi16(tmpe_cw2,2); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,3); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,4); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - j=pi2_p[7]; - - s[j] = _mm_extract_epi16(tmpe,5); - yp1[j] = _mm_extract_epi16(tmpe,6); - yp2[j] = _mm_extract_epi16(tmpe,7); - s[j+8] = _mm_extract_epi16(tmpe_cw2,5); - yp1[j+8] = _mm_extract_epi16(tmpe_cw2,6); - yp2[j+8] = _mm_extract_epi16(tmpe_cw2,7); -#ifdef DEBUG_LOGMAP - fprintf(fdavx2,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]); - fprintf(fdavx2b,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]); -#endif - yp128+=3; - yp128_cw2+=3; - - } - yp=(llr_t*)yp128; - yp_cw2=(llr_t*)yp128_cw2; -#else - pi2_p = &pi2tab16avx2[iind][0]; for (i=0,j=0; i<n; i++) { s[*pi2_p] = y[j]; @@ -1128,8 +1000,6 @@ unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y, } yp=(llr_t*)&y[j]; yp_cw2=(llr_t*)&y2[j]; -#endif - // Termination for (i=0; i<3; i++) { diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c index 7daa86b8bb..ca0cb2d42b 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c @@ -233,9 +233,6 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s #if defined(__x86_64__) || defined(__i386__) alpha128 = (__m128i *)alpha; //#ifdef __AVX2__ -#if 0 - alpha256 = (__m256i *)alpha; -#endif #elif defined(__arm__) alpha128 = (int16x8_t *)alpha; #endif @@ -317,10 +314,6 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha_ptr = &alpha128[0]; //#ifdef __AVX2__ -#if 0 - alpha_ptr256 = &alpha256[0]; -#endif - #if defined(__x86_64__) || defined(__i386__) m11p = (__m128i*)m_11; m10p = (__m128i*)m_10; @@ -450,9 +443,6 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s alpha_ptr+=8; //#ifdef __AVX2__ -#if 0 - alpha_ptr256+=4; -#endif m11p++; m10p++; #if defined(__x86_64__) || defined(__i386__) diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c index f22ec21ff0..cef6f3b09b 100644 --- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c +++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c @@ -427,67 +427,6 @@ void compute_beta8(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sho llr_t beta2,beta3,beta4,beta5,beta6,beta7; - -#if 0 - int16_t m11,m10; - int16_t beta0_16,beta1_16,beta2_16,beta3_16,beta4_16,beta5_16,beta6_16,beta7_16,beta0_2,beta1_2,beta2_2,beta3_2,beta_m; - __m128i beta_16; - // termination for beta initialization - - m11=(int16_t)m_11[2+frame_length]; - m10=(int16_t)m_10[2+frame_length]; - - beta0 = -m11;//M0T_TERM; - beta1 = m11;//M1T_TERM; - m11=(int16_t)m_11[1+frame_length]; - m10=(int16_t)m_10[1+frame_length]; - - beta0_2 = beta0-m11;//+M0T_TERM; - beta1_2 = beta0+m11;//+M1T_TERM; - beta2_2 = beta1+m10;//M2T_TERM; - beta3_2 = beta1-m10;//+M3T_TERM; - m11=(int16_t)m_11[frame_length]; - m10=(int16_t)m_10[frame_length]; - - beta0_16 = beta0_2-m11;//+M0T_TERM; - beta1_16 = beta0_2+m11;//+M1T_TERM; - beta2_16 = beta1_2+m10;//+M2T_TERM; - beta3_16 = beta1_2-m10;//+M3T_TERM; - beta4_16 = beta2_2-m10;//+M4T_TERM; - beta5_16 = beta2_2+m10;//+M5T_TERM; - beta6_16 = beta3_2+m11;//+M6T_TERM; - beta7_16 = beta3_2-m11;//+M7T_TERM; - - beta_m = (beta0_16>beta1_16) ? beta0_16 : beta1_16; - beta_m = (beta_m>beta2_16) ? beta_m : beta2_16; - beta_m = (beta_m>beta3_16) ? beta_m : beta3_16; - beta_m = (beta_m>beta4_16) ? beta_m : beta4_16; - beta_m = (beta_m>beta5_16) ? beta_m : beta5_16; - beta_m = (beta_m>beta6_16) ? beta_m : beta6_16; - beta_m = (beta_m>beta7_16) ? beta_m : beta7_16; - - beta0_16=beta0_16-beta_m; - beta1_16=beta1_16-beta_m; - beta2_16=beta2_16-beta_m; - beta3_16=beta3_16-beta_m; - beta4_16=beta4_16-beta_m; - beta5_16=beta5_16-beta_m; - beta6_16=beta6_16-beta_m; - beta7_16=beta7_16-beta_m; - - beta_16 = _mm_set_epi16(beta7_16,beta6_16,beta5_16,beta4_16,beta3_16,beta2_16,beta1_16,beta0_16); - beta_16 = _mm_packs_epi16(beta_16,beta_16); - beta0 = _mm_extract_epi8(beta_16,0); - beta1 = _mm_extract_epi8(beta_16,1); - beta2 = _mm_extract_epi8(beta_16,2); - beta3 = _mm_extract_epi8(beta_16,3); - beta4 = _mm_extract_epi8(beta_16,4); - beta5 = _mm_extract_epi8(beta_16,5); - beta6 = _mm_extract_epi8(beta_16,6); - beta7 = _mm_extract_epi8(beta_16,7); - -#endif - if (frame_length > 6144) { LOG_E(PHY,"compute_beta: frame_length %d\n",frame_length); return; @@ -1085,209 +1024,6 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y, yp2[k]=*yp++; } -#endif -#if 0 - - for (i=0; i<n2; i+=16) { - pi2_p = &pi2tab8[iind][i]; - - j=pi2_p[0]; -#if defined(__x86_64__) || defined(__i386__) - s[j] = _mm_extract_epi8(yp128[0],0); - yp1[j] = _mm_extract_epi8(yp128[0],1); - yp2[j] = _mm_extract_epi8(yp128[0],2); - - - j=pi2_p[1]; - s[j] = _mm_extract_epi8(yp128[0],3); - yp1[j] = _mm_extract_epi8(yp128[0],4); - yp2[j] = _mm_extract_epi8(yp128[0],5); - - - j=pi2_p[2]; - s[j] = _mm_extract_epi8(yp128[0],6); - yp1[j] = _mm_extract_epi8(yp128[0],7); - yp2[j] = _mm_extract_epi8(yp128[0],8); - - - j=pi2_p[3]; - s[j] = _mm_extract_epi8(yp128[0],9); - yp1[j] = _mm_extract_epi8(yp128[0],10); - yp2[j] = _mm_extract_epi8(yp128[0],11); - - - j=pi2_p[4]; - s[j] = _mm_extract_epi8(yp128[0],12); - yp1[j] = _mm_extract_epi8(yp128[0],13); - yp2[j] = _mm_extract_epi8(yp128[0],14); - - - j=pi2_p[5]; - s[j] = _mm_extract_epi8(yp128[0],15); - yp1[j] = _mm_extract_epi8(yp128[1],0); - yp2[j] = _mm_extract_epi8(yp128[1],1); - - - j=pi2_p[6]; - s[j] = _mm_extract_epi8(yp128[1],2); - yp1[j] = _mm_extract_epi8(yp128[1],3); - yp2[j] = _mm_extract_epi8(yp128[1],4); - - - j=pi2_p[7]; - s[j] = _mm_extract_epi8(yp128[1],5); - yp1[j] = _mm_extract_epi8(yp128[1],6); - yp2[j] = _mm_extract_epi8(yp128[1],7); - - - j=pi2_p[8]; - s[j] = _mm_extract_epi8(yp128[1],8); - yp1[j] = _mm_extract_epi8(yp128[1],9); - yp2[j] = _mm_extract_epi8(yp128[1],10); - - - j=pi2_p[9]; - s[j] = _mm_extract_epi8(yp128[1],11); - yp1[j] = _mm_extract_epi8(yp128[1],12); - yp2[j] = _mm_extract_epi8(yp128[1],13); - - - j=pi2_p[10]; - s[j] = _mm_extract_epi8(yp128[1],14); - yp1[j] = _mm_extract_epi8(yp128[1],15); - yp2[j] = _mm_extract_epi8(yp128[2],0); - - - j=pi2_p[11]; - s[j] = _mm_extract_epi8(yp128[2],1); - yp1[j] = _mm_extract_epi8(yp128[2],2); - yp2[j] = _mm_extract_epi8(yp128[2],3); - - - j=pi2_p[12]; - s[j] = _mm_extract_epi8(yp128[2],4); - yp1[j] = _mm_extract_epi8(yp128[2],5); - yp2[j] = _mm_extract_epi8(yp128[2],6); - - - j=pi2_p[13]; - s[j] = _mm_extract_epi8(yp128[2],7); - yp1[j] = _mm_extract_epi8(yp128[2],8); - yp2[j] = _mm_extract_epi8(yp128[2],9); - - - j=pi2_p[14]; - s[j] = _mm_extract_epi8(yp128[2],10); - yp1[j] = _mm_extract_epi8(yp128[2],11); - yp2[j] = _mm_extract_epi8(yp128[2],12); - - - j=pi2_p[15]; - s[j] = _mm_extract_epi8(yp128[2],13); - yp1[j] = _mm_extract_epi8(yp128[2],14); - yp2[j] = _mm_extract_epi8(yp128[2],15); - - -#elif defined(__arm__) - s[j] = vgetq_lane_s8(yp128[0],0); - yp1[j] = vgetq_lane_s8(yp128[0],1); - yp2[j] = vgetq_lane_s8(yp128[0],2); - - - j=pi2_p[1]; - s[j] = vgetq_lane_s8(yp128[0],3); - yp1[j] = vgetq_lane_s8(yp128[0],4); - yp2[j] = vgetq_lane_s8(yp128[0],5); - - - j=pi2_p[2]; - s[j] = vgetq_lane_s8(yp128[0],6); - yp1[j] = vgetq_lane_s8(yp128[0],7); - yp2[j] = vgetq_lane_s8(yp128[0],8); - - - j=pi2_p[3]; - s[j] = vgetq_lane_s8(yp128[0],9); - yp1[j] = vgetq_lane_s8(yp128[0],10); - yp2[j] = vgetq_lane_s8(yp128[0],11); - - - j=pi2_p[4]; - s[j] = vgetq_lane_s8(yp128[0],12); - yp1[j] = vgetq_lane_s8(yp128[0],13); - yp2[j] = vgetq_lane_s8(yp128[0],14); - - - j=pi2_p[5]; - s[j] = vgetq_lane_s8(yp128[0],15); - yp1[j] = vgetq_lane_s8(yp128[1],0); - yp2[j] = vgetq_lane_s8(yp128[1],1); - - - j=pi2_p[6]; - s[j] = vgetq_lane_s8(yp128[1],2); - yp1[j] = vgetq_lane_s8(yp128[1],3); - yp2[j] = vgetq_lane_s8(yp128[1],4); - - - j=pi2_p[7]; - s[j] = vgetq_lane_s8(yp128[1],5); - yp1[j] = vgetq_lane_s8(yp128[1],6); - yp2[j] = vgetq_lane_s8(yp128[1],7); - - - j=pi2_p[8]; - s[j] = vgetq_lane_s8(yp128[1],8); - yp1[j] = vgetq_lane_s8(yp128[1],9); - yp2[j] = vgetq_lane_s8(yp128[1],10); - - - j=pi2_p[9]; - s[j] = vgetq_lane_s8(yp128[1],11); - yp1[j] = vgetq_lane_s8(yp128[1],12); - yp2[j] = vgetq_lane_s8(yp128[1],13); - - - j=pi2_p[10]; - s[j] = vgetq_lane_s8(yp128[1],14); - yp1[j] = vgetq_lane_s8(yp128[1],15); - yp2[j] = vgetq_lane_s8(yp128[2],0); - - - j=pi2_p[11]; - s[j] = vgetq_lane_s8(yp128[2],1); - yp1[j] = vgetq_lane_s8(yp128[2],2); - yp2[j] = vgetq_lane_s8(yp128[2],3); - - - j=pi2_p[12]; - s[j] = vgetq_lane_s8(yp128[2],4); - yp1[j] = vgetq_lane_s8(yp128[2],5); - yp2[j] = vgetq_lane_s8(yp128[2],6); - - - j=pi2_p[13]; - s[j] = vgetq_lane_s8(yp128[2],7); - yp1[j] = vgetq_lane_s8(yp128[2],8); - yp2[j] = vgetq_lane_s8(yp128[2],9); - - - j=pi2_p[14]; - s[j] = vgetq_lane_s8(yp128[2],10); - yp1[j] = vgetq_lane_s8(yp128[2],11); - yp2[j] = vgetq_lane_s8(yp128[2],12); - - - j=pi2_p[15]; - s[j] = vgetq_lane_s8(yp128[2],13); - yp1[j] = vgetq_lane_s8(yp128[2],14); - yp2[j] = vgetq_lane_s8(yp128[2],15); - -#endif - yp128+=3; - - } - #endif yp=(llr_t*)yp128; diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index b9522e050c..247204cb06 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -255,12 +255,7 @@ void phy_config_request(PHY_Config_t *phy_config) { "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]); -#if 0 - AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, - "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n"); -#else - LOG_D(PHY,"***DJP*** removed assert on preamble fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]:%d expecting >0 %s:%d\n\n\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], __FILE__, __LINE__); -#endif + fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c index 2d3acfce9b..973da15167 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c @@ -454,7 +454,7 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, &srs_vars->srs[eNB_id], 0x7FFF, subframe)==-1) { - LOG_E(PHY,"lte_srs_channel_estimation: Error in generate_srs_rx\n"); + LOG_E(PHY,"lte_srs_channel_estimation: Error in generate_srs\n"); return(-1); } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c index 30f7733be2..baa0210aea 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c @@ -184,32 +184,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, #ifdef DEBUG_DLSCH_DECODING uint16_t i; #endif - //#ifdef __AVX2__ -#if 0 - int Kr_last,skipped_last=0; - uint8_t (*tc_2cw)(int16_t *y, - int16_t *y2, - uint8_t *, - uint8_t *, - uint16_t, - uint16_t, - uint16_t, - uint8_t, - uint8_t, - uint8_t, - time_stats_t *, - time_stats_t *, - time_stats_t *, - time_stats_t *, - time_stats_t *, - time_stats_t *, - time_stats_t *); - -#endif -decoder_if_t tc; - - - + decoder_if_t tc; if (!dlsch_llr) { printf("dlsch_decoding.c: NULL dlsch_llr pointer\n"); @@ -237,17 +212,13 @@ decoder_if_t tc; } if (llr8_flag == 0) { - //#ifdef __AVX2__ -#if 0 - tc_2cw = phy_threegpplte_turbo_decoder16avx2; -#endif tc = decoder16; } else { - AssertFatal (harq_process->TBS >= 256 , "Mismatch flag nbRB=%d TBS=%d mcs=%d Qm=%d RIV=%d round=%d \n", - harq_process->nb_rb, harq_process->TBS,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round); - tc = decoder8; + AssertFatal (harq_process->TBS >= 256 , "Mismatch flag nbRB=%d TBS=%d mcs=%d Qm=%d RIV=%d round=%d \n", + harq_process->nb_rb, harq_process->TBS,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round); + tc = decoder8; } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 0bb20dfdc4..81905eaeb1 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -1188,7 +1188,8 @@ int rx_pdsch(PHY_VARS_UE *ue, LOG_D(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[subframe]][slot].p_time/(cpuf*1000.0)); #endif #endif -// Please keep it: useful for debugging + + // Please keep it: useful for debugging #if 0 if( (symbol == 13) && (subframe==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index 525c8db676..a02e2f95fc 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -1208,7 +1208,6 @@ void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, #endif } -//#if 0 void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp, int32_t **sic_buffer, //Q15 @@ -8859,15 +8858,6 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, memcpy(ch_mag_i_256i, ch_mag_i, len*4); memcpy(rho_256i, rho, len*4); -#if 0 - qam64_qam16_avx2((short *)rxF_256i, - (short *)rxF_i_256i, - (short *)ch_mag_256i, - (short *)ch_mag_i_256i, - (short *)llr16, - (short *) rho_256i, - len); -#else qam64_qam64_avx2((int32_t *)rxF_256i, (int32_t *)rxF_i_256i, (int32_t *)ch_mag_256i, @@ -8875,7 +8865,6 @@ int dlsch_64qam_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms, (int16_t *)llr16, (int32_t *) rho_256i, len); -#endif free16(rxF_256i, sizeof(rxF_256i)); free16(rxF_i_256i, sizeof(rxF_i_256i)); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c index 45508fcff2..e3ad16978d 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.c @@ -220,113 +220,6 @@ int generate_srs_tx_emul(PHY_VARS_UE *phy_vars_ue,uint8_t subframe) return(0); } -#if 0 -int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms, - SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, - int *txdataF) -{ - - uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos; - uint16_t *Msc_idx_ptr; - int k0; - uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth; - uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig; - uint8_t n_RRC = soundingrs_ul_config_dedicated->freqDomainPosition; - uint8_t kTC = soundingrs_ul_config_dedicated->transmissionComb; - - if (frame_parms->N_RB_UL < 41) { - msrs0 = msrsb_6_40[Csrs][0]; - msrsb = msrsb_6_40[Csrs][Bsrs]; - Nb = Nb_6_40[Csrs][Bsrs]; - } else if (frame_parms->N_RB_UL < 61) { - msrs0 = msrsb_41_60[Csrs][0]; - msrsb = msrsb_41_60[Csrs][Bsrs]; - Nb = Nb_41_60[Csrs][Bsrs]; - } else if (frame_parms->N_RB_UL < 81) { - msrs0 = msrsb_61_80[Csrs][0]; - msrsb = msrsb_61_80[Csrs][Bsrs]; - Nb = Nb_61_80[Csrs][Bsrs]; - } else if (frame_parms->N_RB_UL <111) { - msrs0 = msrsb_81_110[Csrs][0]; - msrsb = msrsb_81_110[Csrs][Bsrs]; - Nb = Nb_81_110[Csrs][Bsrs]; - } - - Msc_RS = msrsb * 6; - k0 = (((frame_parms->N_RB_UL>>1)-(msrs0>>1))*12) + kTC; - nb = (4*n_RRC/msrsb)%Nb; - - for (b=0; b<=Bsrs; b++) { - k0 += 2*nb*Msc_RS; - } - - if (k0<0) { - LOG_E(PHY,"Invalid parameter set msrs0=%d, msrsb=%d, Nb=%d => nb=%d, k0=%d\n",msrs0,msrsb,Nb,nb,k0); - return(-1); - } - - Msc_idx_ptr = (uint16_t*) bsearch((uint16_t*) &Msc_RS, (uint16_t*) dftsizes, 33, sizeof(uint16_t), compareints); - - if (Msc_idx_ptr) - Msc_RS_idx = Msc_idx_ptr - dftsizes; - else { - LOG_E(PHY,"generate_srs: index for Msc_RS=%d not found\n",Msc_RS); - return(-1); - } - -#ifdef DEBUG_SRS - LOG_I(PHY,"generate_srs_rx: Msc_RS = %d, Msc_RS_idx = %d, k0=%d\n",Msc_RS, Msc_RS_idx,k0); -#endif - - carrier_pos = (frame_parms->first_carrier_offset + k0) % frame_parms->ofdm_symbol_size; - - for (k=0; k<Msc_RS; k++) { - ((short*) txdataF)[carrier_pos<<1] = ul_ref_sigs_rx[0][0][Msc_RS_idx][k<<1]; - ((short*) txdataF)[(carrier_pos<<1)+1] = ul_ref_sigs_rx[0][0][Msc_RS_idx][(k<<1)+1]; - carrier_pos+=2; - - if (carrier_pos >= frame_parms->ofdm_symbol_size) - carrier_pos=1; - } - - /* - for (k=0;k<Msc_RS;k++) { - if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) { - ((short*) txdataF)[4*(symbol_offset + carrier_pos)] = ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+1] = ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+2] = -ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+3] = ONE_OVER_SQRT2_Q15; - } - else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) { - ((short*) txdataF)[4*(symbol_offset + carrier_pos)] = ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+1] = -ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+2] = ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+3] = ONE_OVER_SQRT2_Q15; - } - else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0)) { - ((short*) txdataF)[4*(symbol_offset + carrier_pos)] = -ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+1] = ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+2] = -ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+3] = -ONE_OVER_SQRT2_Q15; - } - else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0)) { - ((short*) txdataF)[4*(symbol_offset + carrier_pos)] = -ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+1] = -ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+2] = ONE_OVER_SQRT2_Q15; - ((short*) txdataF)[4*(symbol_offset + carrier_pos)+3] = -ONE_OVER_SQRT2_Q15; - } - - carrier_pos+=2; - if (carrier_pos >= frame_parms->ofdm_symbol_size) - carrier_pos=0; - } - */ - - // write_output("srs_rx.m","srsrx",txdataF,1024,2,1); - return(0); -} -#endif - #ifdef MAIN main() { diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index 9a5a504ec4..524825e2bf 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -2511,25 +2511,6 @@ const static int16_t tw64[96] __attribute__((aligned(32))) = { -23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, -30273,12539,-25330,20787,-18205,27244,-9512,31356 }; - -#if 0 -/* this is defined but not used, let's comment */ -const static int16_t tw64rep[192] __attribute__((aligned(32))) = { -32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512, -30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788, -23169,-23170,20787,-25330,18204,-27245,15446,-28898,23169,-23170,20787,-25330,18204,-27245,15446,-28898, -12539,-30273,9511,-31357,6392,-32138,3211,-32610,12539,-30273,9511,-31357,6392,-32138,3211,-32610, -32767,0,32137,-6393,30272,-12540,27244,-18205,32767,0,32137,-6393,30272,-12540,27244,-18205, -23169,-23170,18204,-27245,12539,-30273,6392,-32138,23169,-23170,18204,-27245,12539,-30273,6392,-32138, -0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245, --23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393, -32767,0,31356,-9512,27244,-18205,20787,-25330,32767,0,31356,-9512,27244,-18205,20787,-25330, -12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898, --23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, --30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356 - }; -#endif - const static int16_t tw64a[96] __attribute__((aligned(32))) = { 32767,0,32609,3212,32137,6393,31356,9512, 30272,12540,28897,15447,27244,18205,25329,20788, @@ -2544,24 +2525,6 @@ const static int16_t tw64a[96] __attribute__((aligned(32))) = { -23170,23170,-28898,15447,-32138,6393,-32610,-3211, -30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 }; -#if 0 -/* this is defined but not used, let's comment */ -const static int16_t tw64arep[192] __attribute__((aligned(32))) = { -32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512, -30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788, -23169,23170,20787,25330,18204,27245,15446,28898,23169,23170,20787,25330,18204,27245,15446,28898, -12539,30273,9511,31357,6392,32138,3211,32610,12539,30273,9511,31357,6392,32138,3211,32610, -32767,0,32137,6393,30272,12540,27244,18205,32767,0,32137,6393,30272,12540,27244,18205, -23169,23170,18204,27245,12539,30273,6392,32138,23169,23170,18204,27245,12539,30273,6392,32138, -0,32767,-6393,32138,-12540,30273,-18205,27245,0,32767,-6393,32138,-12540,30273,-18205,27245, --23170,23170,-27245,18205,-30273,12540,-32138,6393,-23170,23170,-27245,18205,-30273,12540,-32138,6393, -32767,0,31356,9512,27244,18205,20787,25330,32767,0,31356,9512,27244,18205,20787,25330, -12539,30273,3211,32610,-6393,32138,-15447,28898,12539,30273,3211,32610,-6393,32138,-15447,28898, --23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211, --30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 - }; -#endif - const static int16_t tw64b[96] __attribute__((aligned(32))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356, -12540,30272,-15447,28897,-18205,27244,-20788,25329, @@ -2576,25 +2539,6 @@ const static int16_t tw64b[96] __attribute__((aligned(32))) = { -23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, 12539,-30273,20787,-25330,27244,-18205,31356,-9512 }; - -#if 0 -/* this is defined but not used, let's comment */ -const static int16_t tw64brep[192] __attribute__((aligned(32))) = { -0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356, --12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329, --23170,23169,-25330,20787,-27245,18204,-28898,15446,-23170,23169,-25330,20787,-27245,18204,-28898,15446, --30273,12539,-31357,9511,-32138,6392,-32610,3211,-30273,12539,-31357,9511,-32138,6392,-32610,3211, -0,32767,-6393,32137,-12540,30272,-18205,27244,0,32767,-6393,32137,-12540,30272,-18205,27244, --23170,23169,-27245,18204,-30273,12539,-32138,6392,-23170,23169,-27245,18204,-30273,12539,-32138,6392, --32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205, --23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138, -0,32767,-9512,31356,-18205,27244,-25330,20787,0,32767,-9512,31356,-18205,27244,-25330,20787, --30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447, --23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, -12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512 - }; -#endif - const static int16_t tw64c[96] __attribute__((aligned(32))) = { 0,32767,3212,32609,6393,32137,9512,31356, 12540,30272,15447,28897,18205,27244,20788,25329, @@ -2609,26 +2553,6 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = { 23170,-23170,15447,-28898,6393,-32138,-3211,-32610, -12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 }; - -#if 0 -/* this is defined but not used, let's comment */ -const static int16_t tw64crep[192] __attribute__((aligned(32))) = { -0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356, -12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329, -23170,23169,25330,20787,27245,18204,28898,15446,23170,23169,25330,20787,27245,18204,28898,15446, -30273,12539,31357,9511,32138,6392,32610,3211,30273,12539,31357,9511,32138,6392,32610,3211, -0,32767,6393,32137,12540,30272,18205,27244,0,32767,6393,32137,12540,30272,18205,27244, -23170,23169,27245,18204,30273,12539,32138,6392,23170,23169,27245,18204,30273,12539,32138,6392, -32767,0,32138,-6393,30273,-12540,27245,-18205,32767,0,32138,-6393,30273,-12540,27245,-18205, -23170,-23170,18205,-27245,12540,-30273,6393,-32138,23170,-23170,18205,-27245,12540,-30273,6393,-32138, -0,32767,9512,31356,18205,27244,25330,20787,0,32767,9512,31356,18205,27244,25330,20787, -30273,12539,32610,3211,32138,-6393,28898,-15447,30273,12539,32610,3211,32138,-6393,28898,-15447, -23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610, --12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 - }; -#endif - - #if defined(__x86_64__) || defined(__i386__) #define simd_q15_t __m128i #define simdshort_q15_t __m64 diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 5f65f81fbe..073610ffd2 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -410,11 +410,6 @@ void feptx_prec(RU_t *ru) { aa); } } -#if 0 - LOG_D(PHY,"feptx_prec: frame %d, subframe %d: txp (freq) %d dB\n", - ru->proc.frame_tx,subframe, - dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[0],2*fp->symbols_per_tti*fp->ofdm_symbol_size))); -#endif } } } diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index 215b93bd46..0bc76f795a 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -3601,16 +3601,14 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, stop_meas(&ue->dlsch_unscrambling_stats); #endif -#if 0 - LOG_I(PHY," ------ start turbo decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, subframe_rx, harq_pid); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->nb_rb); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->rb_alloc_even); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Qm); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); - LOG_I(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); -#endif + LOG_D(PHY," ------ start turbo decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, subframe_rx, harq_pid); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->nb_rb); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->rb_alloc_even); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Qm); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->Kmimo); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); #if UE_TIMING_TRACE start_meas(&ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]]); @@ -3667,15 +3665,13 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, stop_meas(&ue->dlsch_unscrambling_stats); #endif -#if 0 - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->nb_rb); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->rb_alloc_even); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Qm); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Nl); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->G); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->Kmimo); - LOG_I(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); -#endif + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->nb_rb); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->rb_alloc_even); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Qm); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Nl); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->G); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Kmimo %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->Kmimo); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, subframe_rx, harq_pid, ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->num_pdcch_symbols); #if UE_TIMING_TRACE start_meas(&ue->dlsch_decoding_stats[ue->current_thread_id[subframe_rx]]); @@ -4424,11 +4420,9 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr /**** End Subframe FE Processing ****/ -#if 0 //Trigger LLR parallelized for Slot 1 - proc->dci_slot0_available=1; - printf("Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); -#endif + //proc->dci_slot0_available=1; + //printf("Set available dci slot0 to 1 AbsSubframe %d.%d \n",frame_rx%1024,subframe_rx); /**** Pdsch Procedure Slot0 ****/ // start main thread for Pdsch Procedure (slot0) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 20682a57be..83154b95c1 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -5182,11 +5182,6 @@ int main(int argc, char **argv) #endif } -#if 0 - thr_cw0_tm4_nonconst = rate[0]*get_Qm(PHY_vars_eNB->dlsch[0][0]->harq_processes[0]->mcs)* \ - ((double)(round_trials[0][0]-dci_errors)/((double)round_trials[0][0] + round_trials[0][1] + round_trials[0][2] + round_trials[0][3])); - printf("Throughput cw0 noncnstr = %f \n", thr_cw0_tm4_nonconst); -#endif //FOR CW1 /*thr_cw1[0] = rate[1]*get_Qm(PHY_vars_eNB->dlsch[0][1]->harq_processes[0]->mcs)*(1-((double)errs[0][0]/(double)round_trials[0][0])) \ *(1-((double)errs[1][0]/(double)round_trials[1][0])); diff --git a/openair1/SIMULATION/TOOLS/rangen_double.c b/openair1/SIMULATION/TOOLS/rangen_double.c index 6dcdd9418e..82b1557a5b 100644 --- a/openair1/SIMULATION/TOOLS/rangen_double.c +++ b/openair1/SIMULATION/TOOLS/rangen_double.c @@ -63,33 +63,6 @@ void randominit(unsigned seed_init) } #endif -#if 0 -void randominit(unsigned seed_init) -{ - int i; - // this need to be integrated with the existing rng, like taus: navid - LOG_D(PHY,"Initializing random number generator, seed %x\n",seed_init); - - seed_init = 62110; - - if (seed_init == 0) { - srand((unsigned)time(NULL)); - - seed = (unsigned int) rand(); - } else { - seed = seed_init; - } - - if (seed % 2 == 0) seed += 1; /* seed and mod are relative prime */ - - for (i=1; i<=97; i++) { - seed = a*seed; /* mod 2**32 */ - ir[i]= seed; /* initialize the shuffle table */ - } - - iy=1; -} -#endif /*!\brief Uniform linear congruential random number generator on \f$[0,1)\f$. Returns a double-precision floating-point number.*/ double uniformrandom(void) diff --git a/openair1/SIMULATION/TOOLS/taus.c b/openair1/SIMULATION/TOOLS/taus.c index 0be7952da7..e2409df533 100644 --- a/openair1/SIMULATION/TOOLS/taus.c +++ b/openair1/SIMULATION/TOOLS/taus.c @@ -65,35 +65,6 @@ void set_taus_seed(unsigned int seed_init) } #endif -#if 0 - void set_taus_seed(unsigned int seed_init) -{ - - struct drand48_data buffer; - unsigned long result = 0; - s0 = (unsigned int)0x1e23d852; - s1 = (unsigned int)0x81f38a1c; - s2 = (unsigned int)0xfe1a133e; - - return; - - if (seed_init == 0) { - s0 = (unsigned int)time(NULL); - s1 = (unsigned int)time(NULL); - s2 = (unsigned int)time(NULL); - } else { - // Use reentrant version of rand48 to ensure that no conflicts with other generators occur */ - srand48_r((long int)seed_init, &buffer); - mrand48_r(&buffer, (long int *)&result); - s0 = result; - mrand48_r(&buffer, (long int *)&result); - s1 = result; - mrand48_r(&buffer, (long int *)&result); - s2 = result; - } -} -#endif - #ifdef MAIN main() diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index c222aff64b..9867f530cf 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -423,16 +423,6 @@ check_ul_failure(module_id_t module_idP, int CC_id, int UE_id, } } } // ul_failure_timer>0 - -#if 0 - /* U-plane inactivity timer is disabled. Uncomment to re-enable. */ - UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer++; - if(UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer > (U_PLANE_INACTIVITY_VALUE*subframe_num(&RC.eNB[module_idP][CC_id]->frame_parms))){ - LOG_D(MAC,"UE %d rnti %x: U-Plane Failure after repeated PDCCH orders: Triggering RRC \n",UE_id,rnti); - mac_eNB_rrc_uplane_failure(module_idP,CC_id,frameP,subframeP,rnti); - UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0; - }// time > 60s -#endif } void diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 93ecdc3d4f..e498b62a27 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -597,12 +597,6 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP, int header_length_last; int header_length_total; -#if 0 - if (UE_list->head == -1) { - return; - } -#endif - start_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME (VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_IN); @@ -761,14 +755,6 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP, CC_id, UE_id, subframeP, S_DL_NONE); continue; } -#warning RK->CR This old API call has to be revisited for FAPI, or logic must be changed -#if 0 - /* add "fake" DCI to have CCE_allocation_infeasible work properly for next allocations */ - /* if we don't add it, next allocations may succeed but overall allocations may fail */ - /* will be removed at the end of this function */ - add_ue_spec_dci(&eNB->common_channels[CC_id].DCI_pdu, &(char[]) { - 0}, rnti, 1, aggregation, 1, format1, 0); -#endif nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; @@ -1366,12 +1352,6 @@ schedule_ue_spec(module_id_t module_idP,slice_id_t slice_idP, dlsch_buffer, sdu_length_total); // memcpy(RC.mac[0].DLSCH_pdu[0][0].payload[0][offset],dcch_buffer,sdu_lengths[0]); -#if 0 - // fill remainder of DLSCH with random data - for (j = 0; j < (TBS - sdu_length_total - offset); j++) { - UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = (char) (taus() & 0xff); - } -#endif // fill remainder of DLSCH with 0 for (j = 0; j < (TBS - sdu_length_total - offset); j++) { UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = 0; @@ -1868,18 +1848,6 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) if ((subframeP == 0 || subframeP == 1 || subframeP == 2 || subframeP == 4 || subframeP == 6 || subframeP == 9) || (subframeP == 5 && ((frameP % 2) != 0 && (frameP % 8) != 1))) { switch (n_rb_dl) { -#if 0 - case 6: - n_gap = n_rb_dl/2; /* expect: 3 */ - n_vrb_dl = 2*((n_gap < (n_rb_dl - n_gap)) ? n_gap : (n_rb_dl - n_gap));; /* expect: 6 */ - first_rb = 0; - break; - case 15: - n_gap = GAP_MAP[2][0]; /* expect: 8 */ - n_vrb_dl = 2*((n_gap < (n_rb_dl - n_gap)) ? n_gap : (n_rb_dl - n_gap)); /* expect: 14 */ - first_rb = 6; - break; -#endif case 25: n_gap = GAP_MAP[3][0]; /* expect: 12 */ n_vrb_dl = 2*((n_gap < (n_rb_dl - n_gap)) ? n_gap : (n_rb_dl - n_gap)); /* expect: 24 */ @@ -1906,18 +1874,6 @@ void schedule_PCH(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP) } } else if (subframeP == 5 && ((frameP % 2) == 0 || (frameP % 8) == 1)) { // SIB + paging switch (n_rb_dl) { -#if 0 - case 6: - n_gap = n_rb_dl/2; /* expect: 3 */ - n_vrb_dl = 2*((n_gap < (n_rb_dl - n_gap)) ? n_gap : (n_rb_dl - n_gap));; /* expect: 6 */ - first_rb = 0; - break; - case 15: - n_gap = GAP_MAP[2][0]; /* expect: 8 */ - n_vrb_dl = 2*((n_gap < (n_rb_dl - n_gap)) ? n_gap : (n_rb_dl - n_gap)); /* expect: 14 */ - first_rb = 10; - break; -#endif case 25: n_gap = GAP_MAP[3][0]; /* expect: 12 */ n_vrb_dl = 2*((n_gap < (n_rb_dl - n_gap)) ? n_gap : (n_rb_dl - n_gap)); /* expect: 24 */ diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index a7f5afd51d..73a92147cf 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -220,11 +220,6 @@ void dlsch_scheduler_pre_ue_select_fairRR( } ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; -#if 0 - if (ue_sched_ctl->ul_out_of_sync == 1) { - continue; - } -#endif harq_pid = frame_subframe2_dl_harq_pid(cc[CC_id].tdd_Config,frameP ,subframeP); round = ue_sched_ctl->round[CC_id][harq_pid]; @@ -330,14 +325,9 @@ void dlsch_scheduler_pre_ue_select_fairRR( } ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; -#if 0 - if (ue_sched_ctl->ul_out_of_sync == 1) { - continue; - } -#endif - for(i = 0;i<dlsch_ue_select[CC_id].ue_num;i++){ + for(i = 0;i<dlsch_ue_select[CC_id].ue_num;i++){ if(dlsch_ue_select[CC_id].list[i].UE_id == UE_id){ - break; + break; } } if(i < dlsch_ue_select[CC_id].ue_num) @@ -447,11 +437,6 @@ void dlsch_scheduler_pre_ue_select_fairRR( } ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; -#if 0 - if (ue_sched_ctl->ul_out_of_sync == 1) { - continue; - } -#endif for(i = 0;i<dlsch_ue_select[CC_id].ue_num;i++){ if(dlsch_ue_select[CC_id].list[i].UE_id == UE_id){ break; @@ -830,12 +815,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP, int tdd_sfa; int ta_update; -#if 0 - if (UE_list->head == -1) { - return; - } -#endif - start_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME (VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_IN); @@ -972,16 +951,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP, // update UL DAI after DLSCH scheduling set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP); } -#warning RK->CR This old API call has to be revisited for FAPI, or logic must be changed -#if 0 - /* add "fake" DCI to have CCE_allocation_infeasible work properly for next allocations */ - /* if we don't add it, next allocations may succeed but overall allocations may fail */ - /* will be removed at the end of this function */ - add_ue_spec_dci(&eNB->common_channels[CC_id].DCI_pdu, &(char[]) { - 0}, rnti, 1, aggregation, 1, format1, 0); -#endif - - nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; + nb_available_rb = ue_sched_ctl->pre_nb_available_rbs[CC_id]; harq_pid = frame_subframe2_dl_harq_pid(cc->tdd_Config,frameP ,subframeP); @@ -2925,19 +2895,6 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, if(ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_FIRST) { UE_template->scheduled_ul_bytes += get_TBS_UL(UE_template->mcs_UL[harq_pid],rb_table[rb_table_index]); UE_template->ul_SR = 0; -#if 0 - LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,get_TBS_UL(UE_template->mcs_UL[harq_pid],rb_table[rb_table_index])); - if(ulsch_ue_select[CC_id].list[ulsch_ue_num].ul_total_buffer > 0){ - if (UE_template->ul_total_buffer > get_TBS_UL(UE_template->mcs_UL[harq_pid],rb_table[rb_table_index])) - UE_template->ul_total_buffer -= get_TBS_UL(UE_template->mcs_UL[harq_pid],rb_table[rb_table_index]); - else - UE_template->ul_total_buffer = 0; - LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); - } else { - UE_template->ul_SR = 0; - } - LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer); -#endif } if((ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE) && (ULSCH_first_end == 0)) { ULSCH_first_end = 1; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1ac7003723..e9c54c7c7b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1339,13 +1339,6 @@ fill_nfapi_harq_information(module_id_t module_idP, AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n"); AssertFatal(UE_list != NULL, "UE_list is null\n"); -#if 0 - /* TODO: revisit, don't use Assert, it's perfectly possible to - * have physicalConfigDedicated NULL here - */ - AssertFatal(UE_list->UE_template[CC_idP][UE_id].physicalConfigDedicated != NULL, - "physicalConfigDedicated for rnti %x is null\n", rntiP); -#endif harq_information->harq_information_rel11.tl.tag = NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG; harq_information->harq_information_rel11.num_ant_ports = 1; @@ -4298,14 +4291,6 @@ SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, "[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n", mod_idP, rntiP, frameP, subframeP, UE_id, cc_idP); -#if 0 - UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; - - /* for the moment don't use ul_cqi from SR, value is too different from harq */ - sched_ctl->pucch1_snr[cc_idP] = ul_cqi; - sched_ctl->pucch1_cqi_update[cc_idP] = 1; -#endif - UE_list->UE_template[cc_idP][UE_id].ul_SR = 1; UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index e58972c5e7..53d9647c5b 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1575,34 +1575,6 @@ schedule_ulsch_rnti(module_id_t module_idP, T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]), T_INT(round)); -#if 0 - /* This is done in rx_sdu, as it has to. - * Since the code is a bit different, let's keep this version here for review, in case of problem. - */ - // fill in NAK information - - hi_dci0_pdu = &hi_dci0_req_body->hi_dci0_pdu_list[hi_dci0_req_body->number_of_dci + hi_dci0_req_body->number_of_hi]; - memset((void *) hi_dci0_pdu, 0, - sizeof(nfapi_hi_dci0_request_pdu_t)); - hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_HI_PDU_TYPE; - hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_hi_pdu); - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.tl.tag = NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.resource_block_start = UE_template->first_rb_ul[harq_pid]; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms = UE_template->cshift[harq_pid]; - hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; - hi_dci0_req_body->number_of_hi++; - hi_dci0_req_body->sfnsf = sfnsf_add_subframe(sched_frame, sched_subframeP, 0); - hi_dci0_req->sfn_sf = frameP<<4|subframeP; - hi_dci0_req->header.message_id = NFAPI_HI_DCI0_REQUEST; - - LOG_D(MAC, - "[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, round %d)\n", - module_idP, harq_pid, rnti, CC_id, frameP, - subframeP, UE_id, UE_template->mcs_UL[harq_pid], - UE_template->first_rb_ul[harq_pid], - UE_template->nb_rb_ul[harq_pid], - UE_template->TBS_UL[harq_pid], round); -#endif // Add UL_config PDUs LOG_D(MAC, "[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for UE %d/%x, ulsch_frame %d, ulsch_subframe %d\n", diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index 333dfb3b88..022f56643b 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -130,11 +130,7 @@ /*!\brief Maximum number od control elemenets */ #define MAX_NUM_CE 5 /*!\brief Maximum number of random access process */ -#if 0 // #if defined(USRP_REC_PLAY) -#define NB_RA_PROC_MAX 1 -#else #define NB_RA_PROC_MAX 4 -#endif /*!\brief size of buffer status report table */ #define BSR_TABLE_SIZE 64 /*!\brief The power headroom reporting range is from -23 ...+40 dB and beyond, with step 1 */ diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index 76c87e798b..c9fef11fc2 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -430,36 +430,6 @@ static int ue_dl_compare(const void *_a, const void *_b, void *_params) } return 0; -#if 0 - /* The above order derives from the following. */ - if (round2 > round1) { // Check first if one of the UEs has an active HARQ process which needs service and swap order - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (round2 == round1) { - // RK->NN : I guess this is for fairness in the scheduling. This doesn't make sense unless all UEs have the same configuration of logical channels. This should be done on the sum of all information that has to be sent. And still it wouldn't ensure fairness. It should be based on throughput seen by each UE or maybe using the head_sdu_creation_time, i.e. swap UEs if one is waiting longer for service. - // for(j=0;j<MAX_NUM_LCID;j++){ - // if (eNB_mac_inst[Mod_id][pCC_id1].UE_template[UE_id1].dl_buffer_info[j] < - // eNB_mac_inst[Mod_id][pCC_id2].UE_template[UE_id2].dl_buffer_info[j]){ - - // first check the buffer status for SRB1 and SRB2 - - if ((UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + - UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2]) < - (UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + - UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2])) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (UE_list->UE_template[pCC_id1] - [UE_id1].dl_buffer_head_sdu_creation_time_max < - UE_list->UE_template[pCC_id2] - [UE_id2].dl_buffer_head_sdu_creation_time_max) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total < - UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (cqi1 < cqi2) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } - } -#endif } void decode_sorting_policy(module_id_t Mod_idP, slice_id_t slice_id) { @@ -499,10 +469,6 @@ void sort_UEs(module_id_t Mod_idP, slice_id_t slice_id, int frameP, sub_frame_t continue; if ((rnti = UE_RNTI(Mod_idP, i)) == NOT_A_RNTI) continue; -#if 0 - if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) - continue; -#endif if (!ue_slice_membership(i, slice_id)) continue; @@ -522,78 +488,6 @@ void sort_UEs(module_id_t Mod_idP, slice_id_t slice_id, int frameP, sub_frame_t } else { UE_list->head = -1; } - -#if 0 - - - int UE_id1, UE_id2; - int pCC_id1, pCC_id2; - int cqi1, cqi2, round1, round2; - int i = 0, ii = 0; //,j=0; - rnti_t rnti1, rnti2; - - UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list; - - for (i = UE_list->head; i >= 0; i = UE_list->next[i]) { - - for (ii = UE_list->next[i]; ii >= 0; ii = UE_list->next[ii]) { - - UE_id1 = i; - rnti1 = UE_RNTI(Mod_idP, UE_id1); - if (rnti1 == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1) - continue; - pCC_id1 = UE_PCCID(Mod_idP, UE_id1); - cqi1 = maxcqi(Mod_idP, UE_id1); // - round1 = maxround(Mod_idP, rnti1, frameP, subframeP, 0); - - UE_id2 = ii; - rnti2 = UE_RNTI(Mod_idP, UE_id2); - if (rnti2 == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) - continue; - cqi2 = maxcqi(Mod_idP, UE_id2); - round2 = maxround(Mod_idP, rnti2, frameP, subframeP, 0); //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0); - pCC_id2 = UE_PCCID(Mod_idP, UE_id2); - - if (round2 > round1) { // Check first if one of the UEs has an active HARQ process which needs service and swap order - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (round2 == round1) { - // RK->NN : I guess this is for fairness in the scheduling. This doesn't make sense unless all UEs have the same configuration of logical channels. This should be done on the sum of all information that has to be sent. And still it wouldn't ensure fairness. It should be based on throughput seen by each UE or maybe using the head_sdu_creation_time, i.e. swap UEs if one is waiting longer for service. - // for(j=0;j<MAX_NUM_LCID;j++){ - // if (eNB_mac_inst[Mod_id][pCC_id1].UE_template[UE_id1].dl_buffer_info[j] < - // eNB_mac_inst[Mod_id][pCC_id2].UE_template[UE_id2].dl_buffer_info[j]){ - - // first check the buffer status for SRB1 and SRB2 - - if ((UE_list->UE_template[pCC_id1][UE_id1]. - dl_buffer_info[1] + - UE_list->UE_template[pCC_id1][UE_id1]. - dl_buffer_info[2]) < - (UE_list->UE_template[pCC_id2][UE_id2]. - dl_buffer_info[1] + - UE_list->UE_template[pCC_id2][UE_id2]. - dl_buffer_info[2])) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (UE_list->UE_template[pCC_id1] - [UE_id1].dl_buffer_head_sdu_creation_time_max < - UE_list->UE_template[pCC_id2] - [UE_id2].dl_buffer_head_sdu_creation_time_max) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (UE_list->UE_template[pCC_id1][UE_id1]. - dl_buffer_total < - UE_list->UE_template[pCC_id2][UE_id2]. - dl_buffer_total) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } else if (cqi1 < cqi2) { - swap_UEs(UE_list, UE_id1, UE_id2, 0); - } - } - } - } -#endif } void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, @@ -638,10 +532,6 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, if (rnti == NOT_A_RNTI) continue; -#if 0 - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) - continue; -#endif if (!ue_slice_membership(UE_id, slice_id)) continue; @@ -721,10 +611,6 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, if (rnti == NOT_A_RNTI) continue; -#if 0 - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) - continue; -#endif if (!ue_slice_membership(UE_id, slice_id)) continue; @@ -797,10 +683,6 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id, // LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti ); if (rnti == NOT_A_RNTI) continue; -#if 0 - if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) - continue; -#endif if (!ue_slice_membership(UE_id, slice_id)) continue; @@ -1604,20 +1486,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, } } } - -#if 0 - /* this logging is wrong, ue_sched_ctl may not be valid here - * TODO: fix - */ - for (CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++) { - - if (total_allocated_rbs[CC_id] > 0) { - LOG_D(MAC, "[eNB %d] total RB allocated for all UEs = %d/%d\n", - module_idP, total_allocated_rbs[CC_id], - ue_sched_ctl->max_rbs_allowed_slice_uplink[CC_id][slice_id] - first_rb[CC_id]); - } - } -#endif } void @@ -1803,31 +1671,6 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) return 1; return 0; - -#if 0 - /* The above order derives from the following. - * The last case is not handled: "if (UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer > 0 )" - * I don't think it makes a big difference. - */ - if (round2 > round1) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } else if (round2 == round1) { - if (UE_list->UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] < - UE_list->UE_template[pCCid2][UE_id2].ul_buffer_info[LCGID0]) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } else if (UE_list->UE_template[pCCid1][UE_id1].ul_total_buffer < - UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } else if (UE_list->UE_template[pCCid1][UE_id1]. - pre_assigned_mcs_ul < - UE_list->UE_template[pCCid2][UE_id2]. - pre_assigned_mcs_ul) { - if (UE_list->UE_template[pCCid2][UE_id2].ul_total_buffer > 0) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } - } - } -#endif } void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP) @@ -1862,71 +1705,4 @@ void sort_ue_ul(module_id_t module_idP, int frameP, sub_frame_t subframeP) } else { UE_list->head_ul = -1; } - -#if 0 - int UE_id1, UE_id2; - int pCCid1, pCCid2; - int round1, round2; - int i = 0, ii = 0; - rnti_t rnti1, rnti2; - - UE_list_t *UE_list = &RC.mac[module_idP]->UE_list; - - for (i = UE_list->head_ul; i >= 0; i = UE_list->next_ul[i]) { - - //LOG_I(MAC,"sort ue ul i %d\n",i); - for (ii = UE_list->next_ul[i]; ii >= 0; ii = UE_list->next_ul[ii]) { - //LOG_I(MAC,"sort ul ue 2 ii %d\n",ii); - - UE_id1 = i; - rnti1 = UE_RNTI(module_idP, UE_id1); - - if (rnti1 == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) - continue; - - - pCCid1 = UE_PCCID(module_idP, UE_id1); - round1 = maxround(module_idP, rnti1, frameP, subframeP, 1); - - UE_id2 = ii; - rnti2 = UE_RNTI(module_idP, UE_id2); - - if (rnti2 == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) - continue; - - pCCid2 = UE_PCCID(module_idP, UE_id2); - round2 = maxround(module_idP, rnti2, frameP, subframeP, 1); - - if (round2 > round1) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } else if (round2 == round1) { - if (UE_list-> - UE_template[pCCid1][UE_id1].ul_buffer_info[LCGID0] < - UE_list->UE_template[pCCid2][UE_id2]. - ul_buffer_info[LCGID0]) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } else if (UE_list->UE_template[pCCid1][UE_id1]. - ul_total_buffer < - UE_list->UE_template[pCCid2][UE_id2]. - ul_total_buffer) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } else if (UE_list-> - UE_template[pCCid1][UE_id1].pre_assigned_mcs_ul - < - UE_list-> - UE_template[pCCid2][UE_id2].pre_assigned_mcs_ul) - { - if (UE_list->UE_template[pCCid2][UE_id2]. - ul_total_buffer > 0) { - swap_UEs(UE_list, UE_id1, UE_id2, 1); - } - } - } - } - } -#endif } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index ccee62df97..33422c1fea 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -595,9 +595,7 @@ pdcp_data_ind( } if (pdcp_is_rx_seq_number_valid(sequence_number, pdcp_p, srb_flagP) == TRUE) { -#if 0 LOG_T(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number); -#endif /* if (dc == PDCP_DATA_PDU ) LOG_D(PDCP, "Passing piggybacked SDU to NAS driver...\n"); else @@ -612,13 +610,9 @@ pdcp_data_ind( * XXX Till we implement in-sequence delivery and duplicate discarding * mechanism all out-of-order packets will be delivered to RRC/IP */ -#if 0 - LOG_D(PDCP, "Ignoring PDU...\n"); - free_mem_block(sdu_buffer, __func__); + LOG_W(PDCP, "Ignoring PDU...\n"); + free_mem_block(sdu_buffer_pP, __func__); return FALSE; -#else - //LOG_W(PDCP, "Delivering out-of-order SDU to upper layer...\n"); -#endif } // SRB1/2: control-plane data @@ -1019,29 +1013,6 @@ pdcp_run ( } } while(msg_p != NULL); -# if 0 - { - MessageDef *msg_resp_p; - - msg_resp_p = itti_alloc_new_message(TASK_PDCP_ENB, MESSAGE_TEST); - - itti_send_msg_to_task(TASK_RRC_ENB, 1, msg_resp_p); - } - { - MessageDef *msg_resp_p; - - msg_resp_p = itti_alloc_new_message(TASK_PDCP_ENB, MESSAGE_TEST); - - itti_send_msg_to_task(TASK_ENB_APP, 2, msg_resp_p); - } - { - MessageDef *msg_resp_p; - - msg_resp_p = itti_alloc_new_message(TASK_PDCP_ENB, MESSAGE_TEST); - - itti_send_msg_to_task(TASK_MAC_ENB, 3, msg_resp_p); - } -# endif #endif // IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index 7e26ceda52..cf99af604e 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -497,17 +497,6 @@ typedef struct { #endif - -#if 0 -/* - * Missing PDU information struct, a copy of this will be enqueued - * into pdcp.missing_pdus for every missing PDU - */ -typedef struct pdcp_missing_pdu_info_t { - pdcp_sn_t sequence_number; -} pdcp_missing_pdu_info_t; -#endif - /* * PDCP limit values */ diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c index 949858c1e5..1d4d02c7ea 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c @@ -128,9 +128,7 @@ boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity) * Update sequence numbering state and Hyper Frame Number if SN has already reached * its max value (see 5.1 PDCP Data Transfer Procedures) */ -#if 0 LOG_D(PDCP, "Advancing RX window...\n"); -#endif if (pdcp_entity->next_pdcp_rx_sn == pdcp_calculate_max_seq_num_for_given_size(pdcp_entity->seq_num_size)) { pdcp_entity->next_pdcp_rx_sn = 0; @@ -152,9 +150,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_ uint16_t reordering_window = 0; -#if 0 LOG_D(PDCP, "Incoming RX Sequence number is %04d\n", seq_num); -#endif if (pdcp_is_seq_num_size_valid(pdcp_entity) == FALSE || pdcp_is_seq_num_valid(seq_num, pdcp_entity->seq_num_size) == FALSE) { return FALSE; @@ -165,9 +161,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_ * (and to build PDCP Control PDU for PDCP status report) */ if (pdcp_mark_current_pdu_as_received(seq_num, pdcp_entity) == TRUE) { -#if 0 LOG_I(PDCP, "Received sequence number successfuly marked\n"); -#endif } else { LOG_W(PDCP, "Cannot mark received sequence number on the bitmap!\n"); } @@ -192,13 +186,11 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_ // same the old next_pdcp_rx_sn to revert otherwise pdcp_entity->next_pdcp_rx_sn_before_integrity = pdcp_entity->next_pdcp_rx_sn; -#if 0 if (seq_num != pdcp_entity->next_pdcp_rx_sn) { LOG_D(PDCP,"Re-adjusting the sequence number to %d\n", seq_num); } -#endif //set Next_PDCP_RX_SN to the received PDCP SN +1 ; pdcp_entity->next_pdcp_rx_sn = seq_num; pdcp_advance_rx_window(pdcp_entity); // + 1, and check if it is larger than Maximum_PDCP_SN: @@ -247,9 +239,7 @@ boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_ //set Next_PDCP_RX_SN to the received PDCP SN +1 ; pdcp_entity->next_pdcp_rx_sn = seq_num; pdcp_advance_rx_window(pdcp_entity); // + 1, anc check if it is larger than Maximum_PDCP_SN: -#if 0 LOG_D(PDCP,"Re-adjusting the sequence number to %d\n", seq_num); -#endif } else if (seq_num < pdcp_entity->next_pdcp_rx_sn) { // use COUNT based on RX_HFN and the received PDCP SN for deciphering the PDCP PDU; pdcp_entity->rx_hfn_offset = 0; @@ -311,12 +301,8 @@ boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entit /* * Set relevant bit */ -#if 0 LOG_D(PDCP, "Marking %d. bit of %d. octet of status bitmap\n", (seq_num % 8) + 1, octet_index); -#endif util_mark_nth_bit_of_octet(&pdcp_entity->missing_pdu_bitmap[octet_index], seq_num % 8); -#if 0 util_print_binary_representation((uint8_t*)"Current state of relevant octet: ", pdcp_entity->missing_pdu_bitmap[octet_index]); -#endif return TRUE; } diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c index 827bf1b627..cdf93a7af6 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c @@ -172,36 +172,6 @@ boolean_t rlc_am_nack_pdu ( rlc_pP->retrans_num_pdus ++; } } - - /* TODO: Move this part in UL SCH processing */ -#if 0 - if (rlc_pP->tx_data_pdu_buffer[snP].retx_count >= rlc_pP->max_retx_threshold) { - for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP].nb_sdus; pdu_sdu_index++) { - sdu_index = rlc_pP->tx_data_pdu_buffer[snP].sdus_index[pdu_sdu_index]; - assert(pdu_sdu_index < RLC_AM_MAX_SDU_IN_PDU); - assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE); - rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1; - - if (rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) { -#if TEST_RLC_AM - rlc_am_v9_3_0_test_data_conf (rlc_pP->module_id, rlc_pP->rb_id, rlc_pP->input_sdus[sdu_index].mui, RLC_SDU_CONFIRM_NO); -#else - rlc_data_conf(ctxt_pP, rlc_pP->rb_id, rlc_pP->input_sdus[sdu_index].mui, RLC_SDU_CONFIRM_NO, rlc_pP->is_data_plane); -#endif - rlc_pP->stat_tx_pdcp_sdu_discarded += 1; - rlc_pP->stat_tx_pdcp_bytes_discarded += rlc_pP->input_sdus[sdu_index].sdu_size; - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" Dropped SDU mui %u cause max_retx %u reached",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), - rlc_pP->input_sdus[sdu_index].mui, - rlc_pP->max_retx_threshold); - - rlc_am_free_in_sdu(ctxt_pP, rlc_pP, sdu_index); - - } - } - } -#endif } else { LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU SN %05d\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), @@ -768,473 +738,6 @@ mem_block_t* rlc_am_retransmit_get_am_segment( return mem_pdu_segment_p; } -#if 0 -//----------------------------------------------------------------------------- -mem_block_t* rlc_am_retransmit_get_subsegment( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP, - sdu_size_t * const sizeP /* in-out*/) -{ - - // 5.2 ARQ procedures - // ARQ procedures are only performed by an AM RLC entity. - // 5.2.1 Retransmission - // The transmitting side of an AM RLC entity can receive a negative acknowledgement (notification of reception failure - // by its peer AM RLC entity) for an AMD PDU or a portion of an AMD PDU by the following: - // - STATUS PDU from its peer AM RLC entity. - // - // When receiving a negative acknowledgement for an AMD PDU or a portion of an AMD PDU by a STATUS PDU from - // its peer AM RLC entity, the transmitting side of the AM RLC entity shall: - // - if the SN of the corresponding AMD PDU falls within the range VT(A) <= SN < VT(S): - // - consider the AMD PDU or the portion of the AMD PDU for which a negative acknowledgement was - // received for retransmission. - // - // When an AMD PDU or a portion of an AMD PDU is considered for retransmission, the transmitting side of the AM - // RLC entity shall: - // - if the AMD PDU is considered for retransmission for the first time: - // - set the RETX_COUNT associated with the AMD PDU to zero; - // - else, if it (the AMD PDU or the portion of the AMD PDU that is considered for retransmission) is not pending - // for retransmission already, or a portion of it is not pending for retransmission already: - // - increment the RETX_COUNT; - // - if RETX_COUNT = maxRetxThreshold: - // - indicate to upper layers that max retransmission has been reached. - // - // When retransmitting an AMD PDU, the transmitting side of an AM RLC entity shall: - // - if the AMD PDU can entirely fit within the total size of RLC PDU(s) indicated by lower layer at the particular - // transmission opportunity: - // - deliver the AMD PDU as it is except for the P field (the P field should be set according to sub clause 5.2.2) to - // lower layer; - // - otherwise: - // - segment the AMD PDU, form a new AMD PDU segment which will fit within the total size of RLC PDU(s) - // indicated by lower layer at the particular transmission opportunity and deliver the new AMD PDU segment - // to lower layer. - // - // When retransmitting a portion of an AMD PDU, the transmitting side of an AM RLC entity shall: - // - segment the portion of the AMD PDU as necessary, form a new AMD PDU segment which will fit within the - // total size of RLC PDU(s) indicated by lower layer at the particular transmission opportunity and deliver the new - // AMD PDU segment to lower layer. - // - // When forming a new AMD PDU segment, the transmitting side of an AM RLC entity shall: - // - only map the Data field of the original AMD PDU to the Data field of the new AMD PDU segment; - // - set the header of the new AMD PDU segment in accordance with the description in sub clause 6.; - // - set the P field according to sub clause 5.2.2. - - mem_block_t* mb_original_p = rlc_pP->tx_data_pdu_buffer[snP].mem_block; - - if (mb_original_p != NULL) { - mem_block_t* mb_sub_segment_p = get_free_mem_block(*sizeP + sizeof(struct mac_tb_req), __func__); - if(mb_sub_segment_p == NULL) return NULL; - rlc_am_pdu_sn_10_t* pdu_original_p = (rlc_am_pdu_sn_10_t*) (&mb_original_p->data[sizeof(struct mac_tb_req)]); - rlc_am_pdu_sn_10_t* pdu_sub_segment_p = (rlc_am_pdu_sn_10_t*) (&mb_sub_segment_p->data[sizeof(struct mac_tb_req)]); - rlc_am_pdu_info_t pdu_info; - int max_copy_payload_size; - //LG avoid WARNING int test_max_copy_payload_size; - int test_pdu_copy_size = 0; - - ((struct mac_tb_req*)(mb_sub_segment_p->data))->data_ptr = (uint8_t*)&(mb_sub_segment_p->data[sizeof(struct mac_tb_req)]); - - if (rlc_am_get_data_pdu_infos(ctxt_pP, rlc_pP, pdu_original_p, rlc_pP->tx_data_pdu_buffer[snP].header_and_payload_size, &pdu_info) >= 0) { - int li_index = 0; - int start_offset = rlc_pP->tx_data_pdu_buffer[snP].nack_so_start; - int stop_offset = rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop; - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ORIGINAL PDU SN %04d:\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP); - rlc_am_display_data_pdu_infos(ctxt_pP, rlc_pP, &pdu_info); - - // all 15 bits set to 1 (indicate that the missing portion of the AMD PDU includes all bytes - // to the last byte of the AMD PDU) - if (stop_offset == 0x7FFF) { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1; - stop_offset = rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop; - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] UPDATED RETRANS PDU SN %04d nack_so_stop FROM 0x7FFF to %05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - stop_offset); - } - - // FIXED PART AMD PDU SEGMENT HEADER - // 6.2.1.5 AMD PDU segment - // AMD PDU segment consists of a Data field and an AMD PDU segment header. - // - // AMD PDU segment header consists of a fixed part (fields that are present for every AMD PDU segment) and an - // extension part (fields that are present for an AMD PDU segment when necessary). The fixed part of the AMD PDU - // segment header itself is byte aligned and consists of a D/C, a RF, a P, a FI, an E, a SN, a LSF and a SO. The extension - // part of the AMD PDU segment header itself is byte aligned and consists of E(s) and LI(s). - // - // An AMD PDU segment header consists of an extension part only when more than one Data field elements are present - // in the AMD PDU segment, in which case an E and a LI are present for every Data field element except the last. - // Furthermore, when an AMD PDU segment header consists of an odd number of LI(s), four padding bits follow after the - // last LI. - - pdu_sub_segment_p->b1 = (pdu_original_p->b1 & 0x83) | 0x40; - pdu_sub_segment_p->b2 = pdu_original_p->b2; - pdu_sub_segment_p->data[0] = ((uint8_t)(start_offset >> 8)); - pdu_sub_segment_p->data[1] = ((uint8_t)(start_offset & 0xFF)); - - *sizeP = *sizeP - 4; - - - int continue_fill_pdu_with_pdu = 1; - int test_pdu_remaining_size = *sizeP; - int test_num_li = 0; - int fill_num_li ; - int test_li_sum = 0; - int not_test_fi = 0; // by default not 1st byte and not last byte af a SDU - int test_start_offset; - unsigned int test_li_length_in_bytes = 1; - int16_t test_li_list[RLC_AM_MAX_SDU_IN_PDU]; - uint8_t* fill_payload_p; - //int test_fi_last_byte_pdu_is_last_byte_sdu = 0; - //int test_fi_first_byte_pdu_is_first_byte_sdu = 0; - - rlc_am_e_li_t* e_li_sub_segment = (rlc_am_e_li_t*)(&pdu_sub_segment_p->data[2]); - //int first_enter_in_start_offset_lt_li_sum = 1; - int not_fi_original = ((pdu_original_p->b1 & 0x18) >> 3) ^ 3; - - //------------------------------------------------------- - // set MAX payload size that can be copied - // first constraint : the size of the hole to retransmit - rlc_am_get_next_hole(ctxt_pP, rlc_pP, snP, &start_offset, &stop_offset); - max_copy_payload_size = stop_offset - start_offset + 1; - assert(max_copy_payload_size > 0); - assert(test_pdu_remaining_size > 0); - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] HOLE FOUND SO %d -> %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - start_offset, - stop_offset); - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ORIGINAL FI %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - (pdu_original_p->b1 & 0x18) >> 3); - - // second constraint the size of the pdu_p requested by MAC layer - if (max_copy_payload_size > test_pdu_remaining_size) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] CUT max_copy_payload_size with test_pdu_remaining_size %d -> %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - max_copy_payload_size, - test_pdu_remaining_size); - max_copy_payload_size = test_pdu_remaining_size; - } - - - if (start_offset == 0) { - not_test_fi = (not_fi_original & 0x02); - } - - test_start_offset = start_offset; - - //.find the li corresponding to the nack_so_start (start_offset) - if (pdu_info.num_li > 0) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ORIGINAL NUM LI %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - pdu_info.num_li); - - while ((li_index < pdu_info.num_li) && (continue_fill_pdu_with_pdu)) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] FIND LI %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - pdu_info.li_list[li_index]); - - if (max_copy_payload_size > test_pdu_remaining_size) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] CUT max_copy_payload_size with test_pdu_remaining_size %d -> %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - max_copy_payload_size, - test_pdu_remaining_size); - max_copy_payload_size = test_pdu_remaining_size; - } - - assert(max_copy_payload_size >= 0); - assert(test_pdu_remaining_size >= 0); - - test_li_sum += pdu_info.li_list[li_index]; - - //--------------------------------------------------------------- - if (test_start_offset < test_li_sum) { - - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] test_start_offset < test_li_sum %d < %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_start_offset, - test_li_sum); - /*if (test_max_copy_payload_size > (test_li_sum - test_start_offset)) { - #if TRACE_RLC_AM_RESEGMENT - LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][RE-SEGMENT] CUT test_max_copy_payload_size with test_li_sum - test_start_offset %d -> %d\n",ctxt_pP->frame, rlc_pP->module_id, rlc_pP->rb_id, test_max_copy_payload_size, test_li_sum - test_start_offset); - #endif - test_max_copy_payload_size = test_li_sum - test_start_offset; - }*/ - - if ((max_copy_payload_size + test_start_offset) < test_li_sum) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] (max_copy_payload_size %d + test_start_offset %d) < test_li_sum %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - max_copy_payload_size, - test_start_offset, - test_li_sum); - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COPY SO %d -> %d %d BYTES\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_start_offset , - test_start_offset + max_copy_payload_size - 1, - max_copy_payload_size ); - assert(max_copy_payload_size > 0); - continue_fill_pdu_with_pdu = 0; - test_pdu_copy_size = test_pdu_copy_size + max_copy_payload_size; - test_start_offset = test_start_offset + max_copy_payload_size; - not_test_fi = not_test_fi & 0x02; // clear b0, last byte does not correspond to last byte of a SDU - max_copy_payload_size = 0; - - } else if ((max_copy_payload_size + test_start_offset) == test_li_sum) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] (max_copy_payload_size + test_start_offset) == test_li_sum %d == %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - (max_copy_payload_size + test_start_offset) , - test_li_sum); - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COPY SO %d -> %d %d BYTES\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_start_offset , - test_start_offset + max_copy_payload_size - 1, - max_copy_payload_size ); - assert(max_copy_payload_size > 0); - continue_fill_pdu_with_pdu = 0; - test_pdu_copy_size = test_pdu_copy_size + max_copy_payload_size; - test_start_offset = test_start_offset + max_copy_payload_size; - not_test_fi = not_test_fi | 0x01;// set b0, last byte does correspond to last byte of a SDU - max_copy_payload_size = 0; - - } else if ((max_copy_payload_size + test_start_offset - (test_li_length_in_bytes ^ 3)) > test_li_sum) { - LOG_T(RLC, - PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] (max_copy_payload_size + test_start_offset - (test_li_length_in_bytes ^ 3)) > test_li_sum %d > %d\n SET LI %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - (max_copy_payload_size + test_start_offset) + (test_li_length_in_bytes ^ 3), - test_li_sum, - test_li_sum - test_start_offset); - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COPY SO %d -> %d %d BYTES\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_start_offset , - test_li_sum - 1, - test_li_sum - test_start_offset ); - assert((test_li_sum - test_start_offset) > 0); - test_li_list[test_num_li++] = test_li_sum - test_start_offset; - test_pdu_copy_size = test_pdu_copy_size + test_li_sum - test_start_offset; - test_li_length_in_bytes = test_li_length_in_bytes ^ 3; - - test_pdu_remaining_size = test_pdu_remaining_size - test_li_sum + test_start_offset - - test_li_length_in_bytes; - - max_copy_payload_size = max_copy_payload_size - test_li_sum + test_start_offset - test_li_length_in_bytes; - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] NOW max_copy_payload_size %d BYTES test_start_offset %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - max_copy_payload_size, - test_li_sum); - // normally the next while itereation will add bytes to PDU - //not_test_fi = not_test_fi | 0x01; // set b0, last byte does correspond to last byte of a SDU - test_start_offset = test_li_sum; - - } else { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] (test_max_copy_payload_size + test_start_offset ) > test_li_sum %d > %d\n NO REMAINING SIZE FOR LI", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - (max_copy_payload_size + test_start_offset), - test_li_sum); - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COPY SO %d -> %d %d BYTES\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_start_offset , - test_li_sum - 1, - test_li_sum - test_start_offset ); - assert((test_li_sum - test_start_offset) > 0); - continue_fill_pdu_with_pdu = 0; - test_pdu_copy_size = test_pdu_copy_size + test_li_sum - test_start_offset; - - test_pdu_remaining_size = test_pdu_remaining_size - test_li_sum + test_start_offset; - - max_copy_payload_size = max_copy_payload_size - test_li_sum + test_start_offset; - test_start_offset = test_li_sum; - not_test_fi = not_test_fi | 0x01; // set b0, last byte does correspond to last byte of a SDU - } - - //--------------------------------------------------------------- - // start offset start at the begining of a SDU - // and it cant be the first data field of the original PDU - } else if (test_start_offset == test_li_sum) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] (test_start_offset == test_li_sum) %d == %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_start_offset , - test_li_sum); - - if ((test_num_li == 0) && (test_pdu_copy_size == 0)) { - not_test_fi = not_test_fi | 0x02; // set b1, first byte does correspond to first byte of a SDU - } - } - - li_index = li_index + 1; - } - - if ((continue_fill_pdu_with_pdu > 0) && - (li_index == pdu_info.num_li) && - (pdu_info.hidden_size > 0) && - (test_pdu_remaining_size > 0) && - (max_copy_payload_size > 0) ) { - - if (max_copy_payload_size > test_pdu_remaining_size) { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] TRYING HIDDEN SIZE...CUT max_copy_payload_size with test_pdu_remaining_size %d -> %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - max_copy_payload_size, - test_pdu_remaining_size); - max_copy_payload_size = test_pdu_remaining_size; - } - - // remaining bytes to fill, redundant check, but ... - if ((max_copy_payload_size + test_start_offset) >= (pdu_info.hidden_size + test_li_sum)) { - test_pdu_copy_size += (pdu_info.hidden_size + test_li_sum - test_start_offset); - LOG_T(RLC, - PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COPYING WHOLE REMAINING SIZE %d (max_copy_payload_size %d, test_start_offset %d, pdu_info.hidden_size %d test_li_sum %d test_pdu_copy_size %d)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - pdu_info.hidden_size + test_li_sum - test_start_offset, - max_copy_payload_size, - test_start_offset, - pdu_info.hidden_size, - test_li_sum, - test_pdu_copy_size); - test_start_offset = pdu_info.hidden_size + test_li_sum; - not_test_fi = (not_test_fi & 0x2) | (not_fi_original & 0x1); // set b0 idendical to the b0 of the non segmented PDU - } else { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COPYING REMAINING SIZE %d (/%d)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - max_copy_payload_size, - pdu_info.hidden_size); - test_pdu_copy_size += max_copy_payload_size; - test_start_offset = test_start_offset + max_copy_payload_size; - not_test_fi = not_test_fi & 0x2; // clear b0 because no SDU ending in this PDU - } - } - } else { // num_li == 0 - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] (num_li == 0)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); - test_pdu_copy_size = max_copy_payload_size; - - if ((stop_offset == (start_offset + max_copy_payload_size - 1)) && (stop_offset == rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1)) { - not_test_fi = (not_test_fi & 0x2) | (not_fi_original & 0x1); // set b0 idendical to the b0 of the non segmented PDU - } else { - not_test_fi = not_test_fi & 0x2; // clear b0 because no SDU ending in this PDU - } - } - - //--------------------------------------------------------------- - /*if (stop_offset == (rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1)) { - test_fi = (test_fi & 0x02) | (fi_original & 0x01); - }*/ - //--------------------------------------------------------------- - // write FI field in header - //--------------------------------------------------------------- - pdu_sub_segment_p->b1 = pdu_sub_segment_p->b1 | (((not_test_fi << 3) ^ 0x18) & 0x18); - //--------------------------------------------------------------- - // fill the segment pdu_p with Lis and data - //--------------------------------------------------------------- - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] fill the segment pdu_p with Lis and data, test_num_li %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), test_num_li); - - if (test_num_li > 0) { - pdu_sub_segment_p->b1 = pdu_sub_segment_p->b1 | 0x04; // set E bit - test_li_length_in_bytes = 1; - - for (fill_num_li=0; fill_num_li < test_num_li; fill_num_li++) { - test_li_length_in_bytes = test_li_length_in_bytes ^ 3; - - if (test_li_length_in_bytes == 2) { - if (fill_num_li == (test_num_li - 1)) { - e_li_sub_segment->b1 = 0; - } else { - e_li_sub_segment->b1 = 0x80; - } - - e_li_sub_segment->b1 = e_li_sub_segment->b1 | (test_li_list[fill_num_li] >> 4); - e_li_sub_segment->b2 = test_li_list[fill_num_li] << 4; - fill_payload_p = (uint8_t*)(&e_li_sub_segment->b3); - *sizeP = *sizeP - 2; - } else { - if (fill_num_li != (test_num_li - 1)) { - e_li_sub_segment->b2 = e_li_sub_segment->b2 | 0x08; - } - - e_li_sub_segment->b2 = e_li_sub_segment->b2 | (test_li_list[fill_num_li] >> 8); - e_li_sub_segment->b3 = test_li_list[fill_num_li] & 0xFF; - e_li_sub_segment++; - fill_payload_p = (uint8_t*)e_li_sub_segment; - *sizeP = *sizeP - 1; - } - - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ADD LI %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - test_li_list[fill_num_li]); - } - } else { - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ADD NO LI\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); - fill_payload_p = (uint8_t*)e_li_sub_segment; - } - - //--------------------------------------------------------------- - // copy payload to retransmit - //--------------------------------------------------------------- - memcpy(fill_payload_p, - &rlc_pP->tx_data_pdu_buffer[snP].payload[start_offset], - test_pdu_copy_size); - - ((struct mac_tb_req*)(mb_sub_segment_p->data))->tb_size = (tb_size_t)(((uint64_t)fill_payload_p)+ test_pdu_copy_size) - ((uint64_t)(&pdu_sub_segment_p->b1)); - - // set LSF - if ((test_pdu_copy_size + start_offset) == rlc_pP->tx_data_pdu_buffer[snP].payload_size) { - pdu_sub_segment_p->data[0] = pdu_sub_segment_p->data[0] | 0x80; - - rlc_pP->tx_data_pdu_buffer[snP].flags.retransmit = 0; - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES LSF!\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - start_offset, - ((struct mac_tb_req*)(mb_sub_segment_p->data))->tb_size, - test_pdu_copy_size); - } else { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - start_offset, - ((struct mac_tb_req*)(mb_sub_segment_p->data))->tb_size, - test_pdu_copy_size); - } - - LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] *sizeP %d = *sizeP %d - test_pdu_copy_size %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - *sizeP - test_pdu_copy_size, *sizeP, - test_pdu_copy_size); - - *sizeP = *sizeP - test_pdu_copy_size; - //--------------------------------------------------------------- - // update nack_so_start - //--------------------------------------------------------------- - rlc_am_remove_hole(ctxt_pP, rlc_pP, snP, start_offset, test_pdu_copy_size+start_offset - 1); - //rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = rlc_pP->tx_data_pdu_buffer[snP].nack_so_start + test_pdu_copy_size; - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d NOW nack_so_start %d nack_so_stop %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop); - /*if (rlc_pP->tx_data_pdu_buffer[snP].nack_so_start == rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop) { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = 0x7FFF; - }*/ - } else { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COULD NOT GET INFO FOR DATA PDU SN %04d -> RETURN NULL\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP); - return NULL; - } - return mb_sub_segment_p; - } else { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d BUT NO PDU AVAILABLE -> RETURN NULL\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP); - assert(3==4); - return NULL; - } -} -#endif //----------------------------------------------------------------------------- void rlc_am_tx_buffer_display ( const protocol_ctxt_t* const ctxt_pP, @@ -1456,94 +959,3 @@ mem_block_t * rlc_am_get_pdu_to_retransmit( return pdu_p; } - -#if 0 -//----------------------------------------------------------------------------- -void rlc_am_retransmit_any_pdu( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP) -{ - rlc_sn_t sn = (rlc_pP->vt_s - 1) & RLC_AM_SN_MASK; - rlc_sn_t sn_end = (rlc_pP->vt_a - 1) & RLC_AM_SN_MASK; - int found_pdu = 0; - rlc_sn_t found_pdu_sn = 0; // avoid warning - mem_block_t* pdu_p = NULL; - rlc_am_pdu_sn_10_t* pdu_sn_10_p = NULL; - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[FORCE-TRAFFIC] rlc_am_retransmit_any_pdu()\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); - - while (sn != sn_end) { - if (rlc_pP->tx_data_pdu_buffer[sn].mem_block != NULL) { - if (!found_pdu) { - found_pdu = 1; - found_pdu_sn = sn; - } - - if (rlc_pP->tx_data_pdu_buffer[sn].header_and_payload_size <= rlc_pP->nb_bytes_requested_by_mac) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[FORCE-TRAFFIC] RE-SEND DATA PDU SN %04d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - sn); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" RTX any pdu found SN %u",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), sn); -#endif - rlc_am_nack_pdu (ctxt_pP, rlc_pP, sn, 0, 0x7FFF); - // no need for update rlc_pP->nb_bytes_requested_by_mac - pdu_p = rlc_am_retransmit_get_copy(ctxt_pP, rlc_pP, sn); - pdu_sn_10_p = (rlc_am_pdu_sn_10_t*) (&pdu_p->data[sizeof(struct mac_tb_req)]); - rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sn_10_p, rlc_pP->tx_data_pdu_buffer[sn].header_and_payload_size,false); - //BugFix: polling is checked and done in function above ! - //pdu_sn_10_p->b1 = pdu_sn_10_p->b1 | 0x20; - //BugFix : pdu_without_poll and byte_without_poll are reset only if a Poll is transmitted - //rlc_pP->c_pdu_without_poll = 0; - //rlc_pP->c_byte_without_poll = 0; - //rlc_pP->poll_sn = (rlc_pP->vt_s -1) & RLC_AM_SN_MASK; - rlc_pP->stat_tx_data_pdu += 1; - rlc_pP->stat_tx_retransmit_pdu += 1; - rlc_pP->stat_tx_data_bytes += ((struct mac_tb_req*)(pdu_p->data))->tb_size; - rlc_pP->stat_tx_retransmit_bytes += ((struct mac_tb_req*)(pdu_p->data))->tb_size; - list_add_tail_eurecom (pdu_p, &rlc_pP->pdus_to_mac_layer); - return; - } - } - - sn = (sn - 1) & RLC_AM_SN_MASK; - } - - // no pdu_p with correct size has been found - // so re-segment a pdu_p if possible - if (found_pdu) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[FORCE-TRAFFIC] SEND SEGMENT OF DATA PDU SN %04d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - found_pdu_sn); - - if (rlc_pP->nb_bytes_requested_by_mac > 4) { -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" RTX any pdu found SN %u (subseg)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), found_pdu_sn); -#endif - rlc_am_nack_pdu (ctxt_pP, rlc_pP, found_pdu_sn, 0, 0x7FFF); - pdu_p = rlc_am_retransmit_get_subsegment(ctxt_pP, rlc_pP, found_pdu_sn, &rlc_pP->nb_bytes_requested_by_mac); - pdu_sn_10_p = (rlc_am_pdu_sn_10_t*) (&pdu_p->data[sizeof(struct mac_tb_req)]); - rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sn_10_p, rlc_pP->tx_data_pdu_buffer[found_pdu_sn].header_and_payload_size,false); - pdu_sn_10_p->b1 = pdu_sn_10_p->b1 | 0x20; - rlc_pP->c_pdu_without_poll = 0; - rlc_pP->c_byte_without_poll = 0; - //rlc_pP->poll_sn = (rlc_pP->vt_s -1) & RLC_AM_SN_MASK; - rlc_pP->stat_tx_data_pdu += 1; - rlc_pP->stat_tx_retransmit_pdu += 1; - rlc_pP->stat_tx_data_bytes += ((struct mac_tb_req*)(pdu_p->data))->tb_size; - rlc_pP->stat_tx_retransmit_bytes += ((struct mac_tb_req*)(pdu_p->data))->tb_size; - list_add_tail_eurecom (pdu_p, &rlc_pP->pdus_to_mac_layer); - return; - } else { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[FORCE-TRAFFIC] ... BUT NOT ENOUGH BYTES ALLOWED BY MAC %0d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - rlc_pP->nb_bytes_requested_by_mac); - } - } -} -#endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h index 60fefab84b..bbd69910ba 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h @@ -95,22 +95,6 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy ( rlc_am_entity_t *const rlcP, const rlc_sn_t snP)); -#if 0 -/*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP,rlc_sn_t snP, sdu_size_t *sizeP) -* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. -* \param[in] ctxtP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -* \param[in] snP Sequence number of the PDU to be copied. -* \param[in,out] sizeP Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment). -* \return A copy of a segment of the PDU having sequence number equal to parameter snP. -*/ -protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlcP, - const rlc_sn_t snP, - sdu_size_t *const sizeP)); -#endif - /*! \fn mem_block_t* rlc_am_get_pdu_to_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* rlcP) * \brief Find a PDU or PDU segment to retransmit. * \param[in] ctxtP Running context. @@ -120,17 +104,6 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment ( protected_rlc_am_retransmit(mem_block_t* rlc_am_get_pdu_to_retransmit( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP);) -#if 0 -/*! \fn void rlc_am_retransmit_any_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* rlcP) -* \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU. -* \param[in] ctxtP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -*/ -protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlcP);) -#endif - /*! \fn void rlc_am_tx_buffer_display (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* rlcP, char* message_pP) * \brief Display the dump of the retransmission buffer. * \param[in] ctxtP Running context. diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c index 301761c9e5..abe7d3310c 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c @@ -927,459 +927,6 @@ rlc_am_rx_list_check_duplicate_insert_pdu( return pdu_status; } -#if 0 -// returns 0 if success -// returns neg value if failure -//----------------------------------------------------------------------------- -signed int -rlc_am_rx_list_insert_pdu( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP, - mem_block_t* const tb_pP) -{ - rlc_am_pdu_info_t* pdu_info_p = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info; - rlc_am_pdu_info_t* pdu_info_cursor_p = NULL; - rlc_am_pdu_info_t* pdu_info_previous_cursor_p = NULL; - mem_block_t* cursor_p = NULL; - mem_block_t* previous_cursor_p = NULL; - cursor_p = rlc_pP->receiver_buffer.head; - // it is assumed this pdu is in rx window - - //TODO : check for duplicate - // should be rewrite - /* look for previous SN */ - - if (cursor_p) { - if (rlc_pP->vr_mr < rlc_pP->vr_r) { - if (pdu_info_p->sn >= rlc_pP->vr_r) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - - while ((cursor_p != NULL) && (pdu_info_cursor_p->sn >= rlc_pP->vr_r)) { // LG added = - if (pdu_info_p->sn < pdu_info_cursor_p->sn) { - if (previous_cursor_p != NULL) { - pdu_info_previous_cursor_p = &((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info; - - if (pdu_info_previous_cursor_p->sn == pdu_info_p->sn) { - if (pdu_info_p->rf != pdu_info_previous_cursor_p->rf) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d WRONG RF -> DROPPED (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } else if (pdu_info_p->rf == 1) { - if ((pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - 1) >= pdu_info_p->so) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SO OVERLAP -> DROPPED (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - } - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) > vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - - } else if (pdu_info_p->sn == pdu_info_cursor_p->sn) { - if (pdu_info_cursor_p->rf == 0) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } else if (pdu_info_p->rf == 1) { - if ((pdu_info_p->so + pdu_info_p->payload_size - 1) < pdu_info_cursor_p->so) { - - if (previous_cursor_p != NULL) { - pdu_info_previous_cursor_p = &((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info; - - if (pdu_info_previous_cursor_p->sn == pdu_info_cursor_p->sn) { - if ((pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - 1) < pdu_info_p->so) { - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SEGMENT OFFSET %05d (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn, - pdu_info_p->so); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP PREVIOUS SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SEGMENT OFFSET %05d (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn, - pdu_info_p->so); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - - } else if (pdu_info_p->so <= pdu_info_cursor_p->so) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - - previous_cursor_p = cursor_p; - cursor_p = cursor_p->next; - - if (cursor_p != NULL) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - } - } - - if (cursor_p != NULL) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else { - if (pdu_info_cursor_p->rf == 0) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and vr(h) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } else if ((pdu_info_p->rf == 1) && (pdu_info_cursor_p->rf == 1) && (pdu_info_p->sn == pdu_info_cursor_p->sn)) { - if ((pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1) < pdu_info_p->so) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and vr(h) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else if (pdu_info_p->sn != pdu_info_cursor_p->sn) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and vr(h) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } - } - - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } else { // (pdu_info_p->sn < rlc_pP->vr_r) - cursor_p = rlc_pP->receiver_buffer.tail; - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - - while ((cursor_p != NULL) && (pdu_info_cursor_p->sn < rlc_pP->vr_r)) { - //pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - if (pdu_info_p->sn > pdu_info_cursor_p->sn) { - if (previous_cursor_p != NULL) { - pdu_info_previous_cursor_p = &((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info; - - if (pdu_info_previous_cursor_p->sn == pdu_info_cursor_p->sn) { - if (pdu_info_p->rf != pdu_info_previous_cursor_p->rf) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d WRONG RF -> DROPPED (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, pdu_info_p->sn); - return -2; - } else if (pdu_info_p->rf == 1) { - if ((pdu_info_p->so + pdu_info_p->payload_size - 1) >= pdu_info_previous_cursor_p->so) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SO OVERLAP -> DROPPED (vr(mr) < vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - } - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_insert_after_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else if (pdu_info_p->sn == pdu_info_cursor_p->sn) { - if (pdu_info_cursor_p->rf == 0) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } else if (pdu_info_p->rf == 1) { - if ((pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1) < pdu_info_p->so) { - - if (previous_cursor_p != NULL) { - pdu_info_previous_cursor_p = &((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info; - - if (pdu_info_previous_cursor_p->sn == pdu_info_cursor_p->sn) { - if ((pdu_info_p->so + pdu_info_p->payload_size - 1) < pdu_info_previous_cursor_p->so) { - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SEGMENT OFFSET %05d (vr(mr) < vr(r) and sn < vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn, - pdu_info_p->so); - list2_insert_after_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP PREVIOUS SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SEGMENT OFFSET %05d (vr(mr) < vr(r) and sn < vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn, - pdu_info_p->so); - list2_insert_after_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - - } else if (pdu_info_cursor_p->so <= pdu_info_p->so) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - - previous_cursor_p = cursor_p; - cursor_p = cursor_p->previous; - - if (cursor_p != NULL) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - } - } - - if (cursor_p != NULL) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and sn < vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_insert_after_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else { - if (pdu_info_cursor_p->rf == 0) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and vr(h) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } else if ((pdu_info_p->rf == 1) && (pdu_info_cursor_p->rf == 1) && (pdu_info_p->sn == pdu_info_cursor_p->sn)) { - if ((pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1) < pdu_info_p->so) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and vr(h) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else if (pdu_info_p->sn != pdu_info_cursor_p->sn) { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) < vr(r) and vr(h) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } - } - - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else { // (pdu_info_p->vr_mr > rlc_pP->vr_r), > and not >= - // FAR MORE SIMPLE CASE - while (cursor_p != NULL) { - //msg ("[FRAME %05u][%s][RLC_AM][MOD %u/%u][RB %u][INSERT PDU] LINE %d cursor_p %p\n", ctxt_pP->frame, rlc_pP->module_id, rlc_pP->rb_id, __LINE__, cursor_p); - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - - if (pdu_info_p->sn < pdu_info_cursor_p->sn) { - - if (previous_cursor_p != NULL) { - pdu_info_previous_cursor_p = &((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info; - - if (pdu_info_previous_cursor_p->sn == pdu_info_p->sn) { - if (pdu_info_p->rf != pdu_info_previous_cursor_p->rf) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d WRONG RF -> DROPPED (vr(mr) > vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } else if (pdu_info_p->rf == 1) { - if ((pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - 1) >= pdu_info_p->so) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SO OVERLAP -> DROPPED (vr(mr) > vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - } - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) > vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - - } else if (pdu_info_p->sn == pdu_info_cursor_p->sn) { - if (pdu_info_cursor_p->rf == 0) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d WRONG RF -> DROPPED (vr(mr) > vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } else if (pdu_info_p->rf == 1) { - - if ((pdu_info_p->so + pdu_info_p->payload_size - 1) < pdu_info_cursor_p->so) { - - if (previous_cursor_p != NULL) { - pdu_info_previous_cursor_p = &((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info; - - if (pdu_info_previous_cursor_p->sn == pdu_info_cursor_p->sn) { - if ((pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - 1) < pdu_info_p->so) { - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SEGMENT OFFSET %05d (vr(mr) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn, - pdu_info_p->so); - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] PREVIOUS SO %d PAYLOAD SIZE %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - pdu_info_previous_cursor_p->so, - pdu_info_previous_cursor_p->payload_size); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP PREVIOUS SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d SEGMENT OFFSET %05d (vr(mr) > vr(r) and sn >= vr(r))\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn, - pdu_info_p->so); - list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer); - return 0; - } else if (pdu_info_p->so <= pdu_info_cursor_p->so) { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } - - previous_cursor_p = cursor_p; - cursor_p = cursor_p->next; - } - - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (vr(mr) > vr(r))(last inserted)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - - // pdu_info_cursor_p can not be NULL here - if (pdu_info_p->sn == pdu_info_cursor_p->sn) { - if ((pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1) < pdu_info_p->so) { - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } else { - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d OVERLAP SO DUPLICATE -> DROPPED\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -2; - } - } else { - list2_add_tail(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } - } - } else { - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (only inserted)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - list2_add_head(tb_pP, &rlc_pP->receiver_buffer); - return 0; - } - - LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d DROPPED @4\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_info_p->sn); - return -1; -} -#endif //----------------------------------------------------------------------------- void diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h index 9dcc75223d..b02befdab8 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h @@ -68,17 +68,6 @@ */ protected_rlc_am_rx_list( rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,mem_block_t* const tb_pP);) -#if 0 -/*! \fn signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP , mem_block_t* const tbP) -* \brief Insert a PDU in the RX buffer (implemented with a list). -* \param[in] ctxt_pP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -* \param[in] tbP A PDU embedded in a mem_block_t. -* \return Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted. -*/ -protected_rlc_am_rx_list( signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP);) -#endif - /*! \fn boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP) * \brief Check if reassembly taking into account potential new vrR value * \param[in] ctxt_pP Running context. diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c index 1da5bbc441..a696f9a9f1 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c @@ -19,301 +19,4 @@ * contact@openairinterface.org */ -#if 0 -#define RLC_AM_MODULE 1 -#define RLC_AM_SEGMENT_HOLES_C 1 -//----------------------------------------------------------------------------- -#include "rlc_am.h" -#include "LAYER2/MAC/extern.h" -#include "UTIL/LOG/log.h" - -//----------------------------------------------------------------------------- -void rlc_am_clear_holes ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP) -{ - rlc_pP->tx_data_pdu_buffer[snP].num_holes = 0; -} -//----------------------------------------------------------------------------- -void rlc_am_shift_down_holes ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP, - const int indexP) -{ - int i; - - for (i=indexP; i < rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1; i++) { - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i+1]; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i+1]; - } - - rlc_pP->tx_data_pdu_buffer[snP].num_holes = rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1; -} -//----------------------------------------------------------------------------- -void rlc_am_shift_up_holes ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP, - const int indexP) -{ - // shift include indexP - int i; - - for (i=rlc_pP->tx_data_pdu_buffer[snP].num_holes; i > indexP; i--) { - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i-1]; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i-1]; - } - - rlc_pP->tx_data_pdu_buffer[snP].num_holes = rlc_pP->tx_data_pdu_buffer[snP].num_holes + 1; - assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU); -} -//----------------------------------------------------------------------------- -void rlc_am_remove_hole ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP, - const sdu_size_t so_startP, - const sdu_size_t so_stopP) -{ - int i; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, - PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d so_startP %05d so_stopP %05d rlc_pP->tx_data_pdu_buffer[snP].nack_so_start %05d rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop %05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - so_startP, - so_stopP, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop); -#endif - assert(so_startP <= so_stopP); - - if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) { - assert(so_startP == rlc_pP->tx_data_pdu_buffer[snP].nack_so_start); - assert(so_stopP <= rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop); -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d MODIFIED nack_so_start %05d->%05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start, - so_stopP+1); -#endif - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_stopP+1; - - if (rlc_pP->tx_data_pdu_buffer[snP].nack_so_start >= rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop) { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = 0x7FFF; - } - } else { - // normally should be removed in increasing order... - for (i = 0; i < rlc_pP->tx_data_pdu_buffer[snP].num_holes; i++) { - if (so_startP <= rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]) { - if (so_stopP >= rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]) { - rlc_am_shift_down_holes(ctxt_pP, rlc_pP, snP, i); - i = i - 1; - } else { - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i] = so_stopP; - - if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = 0x7FFF; - } else { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0]; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1]; - } - -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d NOW nack_so_start %05d nack_so_stop %05d num holes %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop, - rlc_pP->tx_data_pdu_buffer[snP].num_holes); -#endif - return; - } - } else if (so_startP > rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]) { - if (so_startP <= rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]) { - if (so_stopP < rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]) { - // BAD CASE: 1 HOLE IS SPLITTED IN 2 HOLES - rlc_am_shift_up_holes(ctxt_pP, rlc_pP, snP, i+1); - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i+1] = so_startP+1; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i+1] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = so_startP - 1; - } else { - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = so_startP; - } - } - } - } - - if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = 0x7FFF; - } else { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0]; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1]; - } - } - -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d NOW nack_so_start %05d nack_so_stop %05d num holes %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start, - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop, - rlc_pP->tx_data_pdu_buffer[snP].num_holes); -#endif - assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size); -} -//----------------------------------------------------------------------------- -void rlc_am_get_next_hole ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP, - sdu_size_t* const so_startP, - sdu_size_t* const so_stopP) -{ - if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) { - *so_startP = rlc_pP->tx_data_pdu_buffer[snP].nack_so_start; - *so_stopP = rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] rlc_am_get_next_hole(SN %04d) %05d->%05d (NUM HOLES == 0)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - *so_startP, - *so_stopP); -#endif - } else { - *so_startP = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0]; - *so_stopP = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[0]; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] rlc_am_get_next_hole(SN %04d) %05d->%05d (NUM HOLES == %d)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - *so_startP, - *so_stopP, - rlc_pP->tx_data_pdu_buffer[snP].num_holes); -#endif - } -} -//----------------------------------------------------------------------------- -void rlc_am_add_hole ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP, - const rlc_sn_t snP, - const sdu_size_t so_startP, - sdu_size_t so_stopP) -{ - int i, hole_index; - - assert(so_startP <= so_stopP); - assert(so_startP < 0x7FFF); - assert(so_stopP <= 0x7FFF); - - - // if global NACK - if ((so_startP == 0) && ((so_stopP == 0x7FFF) || (so_stopP == rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1))) { - rlc_pP->tx_data_pdu_buffer[snP].num_holes = 0; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_startP; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = so_stopP; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] SN %04d GLOBAL NACK 0->%05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - so_stopP); -#endif - assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size); - return; - } - - if (so_stopP == 0x7FFF) { - so_stopP = rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1; - } - - // first hole - if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) { - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0] = so_startP; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop [0] = so_stopP; - - rlc_pP->tx_data_pdu_buffer[snP].num_holes = 1; - - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_startP; - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = so_stopP; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] FIRST HOLE SN %04d GLOBAL NACK %05d->%05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - snP, - so_startP, - so_stopP); -#endif - assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size); - return; - } - - hole_index = 0; - - while (hole_index < rlc_pP->tx_data_pdu_buffer[snP].num_holes) { - if (so_stopP < rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[hole_index]) { - assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU); - - if (hole_index > 0) { - assert(so_startP > rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index-1]); - } - - for (i=rlc_pP->tx_data_pdu_buffer[snP].num_holes; i >= hole_index; i--) { - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i-1]; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i-1]; - } - - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[hole_index] = so_startP; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index] = so_stopP; - - // update nack "window" vars nack_so_start, nack_so_stop - if (hole_index == 0) { - rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_startP; - } - - rlc_pP->tx_data_pdu_buffer[snP].num_holes += 1; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] INSERT %d th HOLE SN %04d GLOBAL NACK %05d->%05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - rlc_pP->tx_data_pdu_buffer[snP].num_holes, - snP, - so_startP, - so_stopP); -#endif - assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size); - assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU); - return; - } - - hole_index = hole_index + 1; - } - - // if here insert to the "tail" - if (so_startP > rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index - 1]) { - assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU); - rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[hole_index] = so_startP; - rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index] = so_stopP; - rlc_pP->tx_data_pdu_buffer[snP].num_holes += 1; - // update nack "window" vars nack_so_start, nack_so_stop - rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = so_stopP; -#if TRACE_RLC_AM_HOLE - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] INSERT THE %d th LAST HOLE SN %04d GLOBAL NACK %05d->%05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - rlc_pP->tx_data_pdu_buffer[snP].num_holes, - snP, - so_startP, - so_stopP); -#endif - } else { - assert(1==2); - } - - assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU); - assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size); -} -#endif +/* This file is empty. Might be deleted ? */ diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h index 7c22697ac4..39971888c2 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h @@ -32,80 +32,5 @@ * @ingroup _rlc_am_internal_segment_impl_ * @{ */ -#if 0 -#ifndef __RLC_AM_SEGMENT_HOLES_H__ -# define __RLC_AM_SEGMENT_HOLES_H__ -//----------------------------------------------------------------------------- -# ifdef RLC_AM_SEGMENT_HOLES_C -# define private_rlc_am_segments_holes(x) x -# define protected_rlc_am_segments_holes(x) x -# define public_rlc_am_segments_holes(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_segments_holes(x) -# define protected_rlc_am_segments_holes(x) extern x -# define public_rlc_am_segments_holes(x) extern x -# else -# define private_rlc_am_segments_holes(x) -# define protected_rlc_am_segments_holes(x) -# define public_rlc_am_segments_holes(x) extern x -# endif -# endif -/*! \fn void rlc_am_clear_holes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP) -* \brief Remove all marked holes for PDU with sequence number "snP". -* \param[in] ctxt_pP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -* \param[in] snP Sequence number. -*/ -protected_rlc_am_segments_holes(void rlc_am_clear_holes ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlcP, - const rlc_sn_t snP);) - -/*! \fn void rlc_am_remove_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP) -* \brief Remove for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. -* \param[in] ctxt_pP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -* \param[in] snP Sequence number. -* \param[in] so_startP Start of segment offset. -* \param[in] so_stopP End of segment offset. -*/ -protected_rlc_am_segments_holes(void rlc_am_remove_hole ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlcP, - const rlc_sn_t snP, - const sdu_size_t so_startP, - const sdu_size_t so_stopP);) +/* This file is empty. Should be removed */ -/*! \fn void rlc_am_get_next_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t* so_startP, sdu_size_t* so_stopP) -* \brief Get for PDU with sequence number "snP" the first hole start and stop parameters. -* \param[in] ctxt_pP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -* \param[in] snP Sequence number. -* \param[in,out] so_startP Start of segment offset. -* \param[in,out] so_stopP End of segment offset. -*/ -protected_rlc_am_segments_holes(void rlc_am_get_next_hole ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlcP, - const rlc_sn_t snP, - sdu_size_t* const so_startP, - sdu_size_t* const so_stopP);) - -/*! \fn void rlc_am_add_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP) -* \brief Mark for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. -* \param[in] ctxt_pP Running context. -* \param[in] rlcP RLC AM protocol instance pointer. -* \param[in] snP Sequence number. -* \param[in,out] so_startP Start of segment offset. -* \param[in,out] so_stopP End of segment offset. -*/ -protected_rlc_am_segments_holes(void rlc_am_add_hole ( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlcP, - const rlc_sn_t snP, - const sdu_size_t so_startP, - sdu_size_t so_stopP);) -/** @} */ -#endif -#endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c index a9059df11c..7def8e01fc 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c @@ -873,345 +873,3 @@ rlc_am_send_status_pdu( } -#if 0 -//----------------------------------------------------------------------------- -void -rlc_am_send_status_pdu_backup( - const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP -) -{ - // When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall: - // - if t-StatusProhibit is not running: - // - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer; - // - else: - // - at the first transmission opportunity indicated by lower layer after t-StatusProhibit expires, construct a single - // STATUS PDU even if status reporting was triggered several times while t-StatusProhibit was running and - // deliver it to lower layer; - // - // When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall: - // - start t-StatusProhibit. - // - // When constructing a STATUS PDU, the AM RLC entity shall: - // - for the AMD PDUs with SN such that VR(R) <= SN < VR(MR) that has not been completely received yet, in - // increasing SN of PDUs and increasing byte segment order within PDUs, starting with SN = VR(R) up to - // the point where the resulting STATUS PDU still fits to the total size of RLC PDU(s) indicated by lower layer: - // - for an AMD PDU for which no byte segments have been received yet:: - // - include in the STATUS PDU a NACK_SN which is set to the SN of the AMD PDU; - // - for a continuous sequence of byte segments of a partly received AMD PDU that have not been received yet: - // - include in the STATUS PDU a set of NACK_SN, SOstart and SOend - // - set the ACK_SN to the SN of the next not received RLC Data PDU which is not indicated as missing in the - // resulting STATUS PDU. - - signed int nb_bits_to_transmit = rlc_pP->nb_bytes_requested_by_mac << 3; - rlc_am_control_pdu_info_t control_pdu_info; - rlc_am_pdu_info_t *pdu_info_cursor_p = NULL; - rlc_sn_t previous_sn_cursor = (rlc_pP->vr_r - 1) & RLC_AM_SN_MASK; - rlc_sn_t sn_cursor = 0; - mem_block_t *cursor_p = rlc_pP->receiver_buffer.head; - int all_segments_received = 0; - int waited_so = 0; - mem_block_t *tb_p = NULL; - sdu_size_t pdu_size = 0; - - memset(&control_pdu_info, 0, sizeof(rlc_am_control_pdu_info_t)); - // header size - nb_bits_to_transmit = nb_bits_to_transmit - 15; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] nb_bits_to_transmit %d (15 already allocated for header)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - nb_bits_to_transmit); - rlc_am_rx_list_display(rlc_pP, " DISPLAY BEFORE CONSTRUCTION OF STATUS REPORT"); -#endif - - - if (cursor_p != NULL) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - sn_cursor = pdu_info_cursor_p->sn; - - while (!(RLC_AM_SN_IN_WINDOW(sn_cursor, rlc_pP->vr_r))) { - cursor_p = cursor_p->next; - previous_sn_cursor = sn_cursor; - - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - sn_cursor = pdu_info_cursor_p->sn; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d FIND VR(R) <= SN sn_cursor %04d -> %04d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - previous_sn_cursor, - sn_cursor); -#endif - } - - // 12 bits = size of NACK_SN field + E1, E2 bits - // 42 bits = size of NACK_SN field + SO_START, SO_END fields, E1, E2 bits - while ((cursor_p != NULL) && (nb_bits_to_transmit >= 12)) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - all_segments_received = ((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received; - sn_cursor = pdu_info_cursor_p->sn; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d LOOPING sn_cursor %04d previous sn_cursor %04d \n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - sn_cursor, - previous_sn_cursor); -#endif - - // ------------------------------------------------------------------------------- - // case resegmentation : several PDUs related to the same SN queued in list - // ------------------------------------------------------------------------------- - if (sn_cursor == previous_sn_cursor) { - do { - cursor_p = cursor_p->next; - - if (cursor_p != NULL) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - all_segments_received = ((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received; - sn_cursor = pdu_info_cursor_p->sn; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d NOW sn_cursor %04d \n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - sn_cursor); -#endif - } else { - if (all_segments_received) { - control_pdu_info.ack_sn = (sn_cursor + 1) & RLC_AM_SN_MASK; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK SN %04d \n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - control_pdu_info.ack_sn); -#endif - } else { - control_pdu_info.ack_sn = (previous_sn_cursor + 1) & RLC_AM_SN_MASK; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK SN %04d (CASE PREVIOUS SN)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - control_pdu_info.ack_sn); -#endif - } - - goto end_push_nack; - } - } while ((cursor_p != NULL) && (sn_cursor == previous_sn_cursor)); - } - - // ------------------------------------------------------------------------------- - // simple case, PDU(s) is/are missing - // ------------------------------------------------------------------------------- - while (((previous_sn_cursor + 1) & RLC_AM_SN_MASK) != sn_cursor) { - if (nb_bits_to_transmit > 12) { - previous_sn_cursor = (previous_sn_cursor + 1) & RLC_AM_SN_MASK; - control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn = previous_sn_cursor; - control_pdu_info.nack_list[control_pdu_info.num_nack].so_start = 0; - control_pdu_info.nack_list[control_pdu_info.num_nack].so_end = 0x7ff; - control_pdu_info.nack_list[control_pdu_info.num_nack].e1 = 1; - control_pdu_info.nack_list[control_pdu_info.num_nack].e2 = 0; - control_pdu_info.num_nack += 1; - nb_bits_to_transmit = nb_bits_to_transmit - 12; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING NACK %04d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - previous_sn_cursor); -#endif - } else { - control_pdu_info.ack_sn = (previous_sn_cursor + 1) & RLC_AM_SN_MASK; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d NO MORE BITS FOR SENDING NACK %04d -> ABORT AND SET FINAL ACK %04d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - previous_sn_cursor, - control_pdu_info.ack_sn); -#endif - goto end_push_nack; - } - } - - // ------------------------------------------------------------------------------- - // not so simple case, a resegmented PDU(s) is missing - // ------------------------------------------------------------------------------- - if (all_segments_received == 0) { - waited_so = 0; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] if (all_segments_received == 0) \n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); -#endif - - do { - if (pdu_info_cursor_p->so > waited_so) { - if (nb_bits_to_transmit >= 42) { - control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn = sn_cursor; - control_pdu_info.nack_list[control_pdu_info.num_nack].so_start = waited_so; - control_pdu_info.nack_list[control_pdu_info.num_nack].so_end = pdu_info_cursor_p->so - 1; - control_pdu_info.nack_list[control_pdu_info.num_nack].e1 = 1; - control_pdu_info.nack_list[control_pdu_info.num_nack].e2 = 1; - control_pdu_info.num_nack += 1; - nb_bits_to_transmit = nb_bits_to_transmit - 42; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING NACK %04d SO START %05d SO END %05d (CASE SO %d > WAITED SO %d)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - sn_cursor, - waited_so, - pdu_info_cursor_p->so - 1, - pdu_info_cursor_p->so, - waited_so); -#endif - - if (pdu_info_cursor_p->lsf == 1) { // last segment flag - //waited_so = 0x7FF; - waited_so = 0x7FFF; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d SN %04d SET WAITED SO 0x7FFF)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, sn_cursor); -#endif - //break; - } else { - waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d SN %04d SET WAITED SO %d @1\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - sn_cursor, - waited_so); -#endif - } - } else { - control_pdu_info.ack_sn = sn_cursor; - goto end_push_nack; - } - } else { //else { // pdu_info_cursor_p->so <= waited_so - waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size; - - if (pdu_info_cursor_p->lsf == 1) { // last segment flag - //waited_so = 0x7FF; - waited_so = 0x7FFF; - } - -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d SN %04d SET WAITED SO %d @2\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - sn_cursor, waited_so); -#endif - } - - cursor_p = cursor_p->next; - - if (cursor_p != NULL) { - pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; - all_segments_received = ((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received; - previous_sn_cursor = sn_cursor; - sn_cursor = pdu_info_cursor_p->sn; - } else { - // LG control_pdu_info.ack_sn = (previous_sn_cursor + 1) & RLC_AM_SN_MASK; - control_pdu_info.ack_sn = previous_sn_cursor; - goto end_push_nack; - } - } while ((cursor_p != NULL) && (sn_cursor == previous_sn_cursor)); - - // may be last segment of PDU not received - //if ((sn_cursor != previous_sn_cursor) && (waited_so != 0x7FF)) { - if ((sn_cursor != previous_sn_cursor) && (waited_so != 0x7FFF)) { - if (nb_bits_to_transmit >= 42) { - control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn = previous_sn_cursor; - control_pdu_info.nack_list[control_pdu_info.num_nack].so_start = waited_so; - //control_pdu_info.nack_list[control_pdu_info.num_nack].so_end = 0x7FF; - control_pdu_info.nack_list[control_pdu_info.num_nack].so_end = 0x7FFF; - control_pdu_info.nack_list[control_pdu_info.num_nack].e1 = 1; - control_pdu_info.nack_list[control_pdu_info.num_nack].e2 = 1; - control_pdu_info.num_nack += 1; - nb_bits_to_transmit = nb_bits_to_transmit - 42; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING NACK %04d SO START %05d SO END %05d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - previous_sn_cursor, - waited_so, - 0x7FFF); -#endif - } else { - control_pdu_info.ack_sn = previous_sn_cursor; - goto end_push_nack; - } - } - - waited_so = 0; - } else { - waited_so = 0; - cursor_p = cursor_p->next; - previous_sn_cursor = sn_cursor; - } - } - - control_pdu_info.ack_sn = (previous_sn_cursor + 1) & RLC_AM_SN_MASK; - } else { - control_pdu_info.ack_sn = rlc_pP->vr_r; -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK %04d = VR(R)\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - control_pdu_info.ack_sn); -#endif - } - -end_push_nack: - - if (control_pdu_info.num_nack > 0) { - control_pdu_info.nack_list[control_pdu_info.num_nack - 1].e1 = 0; - } - - //msg ("[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] nb_bits_to_transmit %d\n", - // rlc_pP->module_id, rlc_pP->rb_id, ctxt_pP->frame,nb_bits_to_transmit); - -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK %04d NUM NACK %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - control_pdu_info.ack_sn, - control_pdu_info.num_nack); -#endif - // encode the control pdu - pdu_size = rlc_pP->nb_bytes_requested_by_mac - ((nb_bits_to_transmit - 7 )>> 3); - -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d forecast pdu_size %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - __LINE__, - pdu_size); -#endif - tb_p = get_free_mem_block(sizeof(struct mac_tb_req) + pdu_size, __func__); - if(tb_p == NULL) return; - memset(tb_p->data, 0, sizeof(struct mac_tb_req) + pdu_size); - //estimation only ((struct mac_tb_req*)(tb_p->data))->tb_size = pdu_size; - ((struct mac_tb_req*)(tb_p->data))->data_ptr = (uint8_t*)&(tb_p->data[sizeof(struct mac_tb_req)]); - - // warning reuse of pdu_size - pdu_size = rlc_am_write_status_pdu(ctxt_pP, rlc_pP,(rlc_am_pdu_sn_10_t*)(((struct mac_tb_req*)(tb_p->data))->data_ptr), &control_pdu_info); - ((struct mac_tb_req*)(tb_p->data))->tb_size = pdu_size; - //assert((((struct mac_tb_req*)(tb_p->data))->tb_size) < 3000); - -#if TRACE_RLC_AM_STATUS_CREATION - LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] SEND STATUS PDU SIZE %d, rlc_pP->nb_bytes_requested_by_mac %d, nb_bits_to_transmit>>3 %d\n", - PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), - pdu_size, - rlc_pP->nb_bytes_requested_by_mac, - nb_bits_to_transmit >> 3); -#endif - assert(pdu_size == (rlc_pP->nb_bytes_requested_by_mac - (nb_bits_to_transmit >> 3))); - - // remaining bytes to transmit for RLC (retrans pdus and new data pdus) - rlc_pP->nb_bytes_requested_by_mac = rlc_pP->nb_bytes_requested_by_mac - pdu_size; - // put pdu in trans - list_add_head(tb_p, &rlc_pP->control_pdu_list); - rlc_pP->stat_tx_control_pdu += 1; - rlc_pP->stat_tx_control_bytes += pdu_size; - -} -#endif - diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index b8529d5036..bd9f4bb8b2 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -237,24 +237,6 @@ void handle_ulsch(UL_IND_t *UL_info) { #define C do { size = 0; put(0); } while (0) #define A(...) do { char t[4096]; sprintf(t, __VA_ARGS__); append_string(t); } while (0) -#if 0 - -/* eats lots of ms at startup, disrupts realtime */ -static char *s; -static int size; -static int maxsize; - -static void put(char x) -{ - if (size == maxsize) { - maxsize += 32768; - s = realloc(s, maxsize); if (s == NULL) abort(); - } - s[size++] = x; -} - -#else - /* eats nothing at startup, but fixed size */ #define SMAX 65536 static char s[SMAX]; @@ -267,8 +249,6 @@ static void put(char x) s[size++] = x; } -#endif - static void append_string(char *t) { size--; diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index d0e185ca9d..650f51905c 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -96,30 +96,6 @@ mac_rrc_data_req( RC.rrc[Mod_idP]->carrier[CC_id].SIB1, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1); -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int sib1_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1; - int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu); - - if (sib1_size > sdu_size) { - LOG_E(RRC, "SIB1 SDU larger than BCCH SDU buffer size (%d, %d)", sib1_size, sdu_size); - sib1_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ); - RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib1_size; - memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE); - memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, - RC.rrc[Mod_idP]->carrier[CC_id].SIB1, - sib1_size); - RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - #ifdef DEBUG_RRC LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 1\n",Mod_idP,frameP); @@ -137,30 +113,6 @@ mac_rrc_data_req( RC.rrc[Mod_idP]->carrier[CC_id].SIB23, RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23); -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int sib23_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23; - int sdu_size = sizeof(RRC_MAC_BCCH_DATA_REQ (message_p).sdu); - - if (sib23_size > sdu_size) { - LOG_E(RRC, "SIB23 SDU larger than BCCH SDU buffer size (%d, %d)", sib23_size, sdu_size); - sib23_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_BCCH_DATA_REQ); - RRC_MAC_BCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_BCCH_DATA_REQ (message_p).sdu_size = sib23_size; - memset (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, 0, BCCH_SDU_SIZE); - memcpy (RRC_MAC_BCCH_DATA_REQ (message_p).sdu, - RC.rrc[Mod_idP]->carrier[CC_id].SIB23, - sib23_size); - RRC_MAC_BCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - #ifdef DEBUG_RRC LOG_T(RRC,"[eNB %d] Frame %d BCCH request => SIB 2-3\n",Mod_idP,frameP); @@ -205,28 +157,6 @@ mac_rrc_data_req( if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer LOG_D(RRC,"[eNB %d] CCCH (%p) has %d bytes (dest: %p, src %p)\n",Mod_idP,Srb_info,Srb_info->Tx_buffer.payload_size,buffer_pP,Srb_info->Tx_buffer.Payload); -#if 0 // defined(ENABLE_ITTI) - { - MessageDef *message_p; - int ccch_size = Srb_info->Tx_buffer.payload_size; - int sdu_size = sizeof(RRC_MAC_CCCH_DATA_REQ (message_p).sdu); - - if (ccch_size > sdu_size) { - LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", ccch_size, sdu_size); - ccch_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_CCCH_DATA_REQ); - RRC_MAC_CCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_CCCH_DATA_REQ (message_p).sdu_size = ccch_size; - memset (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, 0, CCCH_SDU_SIZE); - memcpy (RRC_MAC_CCCH_DATA_REQ (message_p).sdu, Srb_info->Tx_buffer.Payload, ccch_size); - RRC_MAC_CCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size); Sdu_size = Srb_info->Tx_buffer.payload_size; Srb_info->Tx_buffer.payload_size=0; @@ -243,28 +173,6 @@ mac_rrc_data_req( LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]); -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int pcch_size = RC.rrc[Mod_idP]->arrier[CC_id].sizeof_paging[mbsfn_sync_area]; - int sdu_size = sizeof(RRC_MAC_PCCH_DATA_REQ (message_p).sdu); - - if (pcch_size > sdu_size) { - LOG_E(RRC, "SDU larger than PCCH SDU buffer size (%d, %d)", pcch_size, sdu_size); - pcch_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_PCCH_DATA_REQ); - RRC_MAC_PCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_PCCH_DATA_REQ (message_p).sdu_size = pcch_size; - memset (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, 0, PCCH_SDU_SIZE); - memcpy (RRC_MAC_PCCH_DATA_REQ (message_p).sdu, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], pcch_size); - RRC_MAC_PCCH_DATA_REQ (message_p).enb_index = eNB_index; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - memcpy(buffer_pP, RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]); Sdu_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]; RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0; @@ -280,32 +188,6 @@ mac_rrc_data_req( return 0; // this parameter is set in function init_mcch in rrc_eNB.c } - -#if 0 // defined(ENABLE_ITTI) - { - MessageDef *message_p; - int mcch_size = RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]; - int sdu_size = sizeof(RRC_MAC_MCCH_DATA_REQ (message_p).sdu); - - if (mcch_size > sdu_size) { - LOG_E(RRC, "SDU larger than MCCH SDU buffer size (%d, %d)", mcch_size, sdu_size); - mcch_size = sdu_size; - } - - message_p = itti_alloc_new_message (TASK_RRC_ENB, RRC_MAC_MCCH_DATA_REQ); - RRC_MAC_MCCH_DATA_REQ (message_p).frame = frameP; - RRC_MAC_MCCH_DATA_REQ (message_p).sdu_size = mcch_size; - memset (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, 0, MCCH_SDU_SIZE); - memcpy (RRC_MAC_MCCH_DATA_REQ (message_p).sdu, - RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area], - mcch_size); - RRC_MAC_MCCH_DATA_REQ (message_p).enb_index = eNB_index; - RRC_MAC_MCCH_DATA_REQ (message_p).mbsfn_sync_area = mbsfn_sync_area; - - itti_send_msg_to_task (TASK_MAC_ENB, ENB_MODULE_ID_TO_INSTANCE(Mod_idP), message_p); - } -#endif - memcpy(&buffer_pP[0], RC.rrc[Mod_idP]->carrier[CC_id].MCCH_MESSAGE[mbsfn_sync_area], RC.rrc[Mod_idP]->carrier[CC_id].sizeof_MCCH_MESSAGE[mbsfn_sync_area]); @@ -380,31 +262,6 @@ mac_rrc_data_ind( Srb_info = &RC.rrc[module_idP]->carrier[CC_id].Srb0; LOG_D(RRC,"[eNB %d] Received SDU for CCCH on SRB %d\n",module_idP,Srb_info->Srb_id); -#if 0 //defined(ENABLE_ITTI) - { - MessageDef *message_p; - int msg_sdu_size = sizeof(RRC_MAC_CCCH_DATA_IND (message_p).sdu); - - if (sdu_lenP > msg_sdu_size) { - LOG_E(RRC, "SDU larger than CCCH SDU buffer size (%d, %d)", sdu_lenP, msg_sdu_size); - sdu_size = msg_sdu_size; - } else { - sdu_size = sdu_lenP; - } - - message_p = itti_alloc_new_message (TASK_MAC_ENB, RRC_MAC_CCCH_DATA_IND); - RRC_MAC_CCCH_DATA_IND (message_p).frame = frameP; - RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = sub_frameP; - RRC_MAC_CCCH_DATA_IND (message_p).rnti = rntiP; - RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = sdu_size; - RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id; - memset (RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE); - memcpy (RRC_MAC_CCCH_DATA_IND (message_p).sdu, sduP, sdu_size); - LOG_D(RRC,"[eNB %d] Sending message to RRC task\n",module_idP); - itti_send_msg_to_task (TASK_RRC_ENB, ctxt.instance, message_p); - } -#else - // msg("\n******INST %d Srb_info %p, Srb_id=%d****\n\n",Mod_id,Srb_info,Srb_info->Srb_id); if (sdu_lenP > 0) { memcpy(Srb_info->Rx_buffer.Payload,sduP,sdu_lenP); @@ -422,7 +279,6 @@ mac_rrc_data_ind( ue_context_p->ue_context.Status = RRC_RECONFIGURED; } } -#endif return(0); diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index d46f6b2701..c586f0aeb0 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -477,22 +477,6 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type); ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo); -#if 0 - /* TODO: this is disabled for the moment because OAI UE does - * not connect to OAI eNB with the current software. - * See also TODO comment in do_SIB23. - */ - //TTN - This is for SIB18 - sib_type=SIB_Type_sibType18_v1250; - ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type); - ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo); - - //TTN - This is for SIB19 - sib_type=SIB_Type_sibType19_v1250; - ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type); - ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo); -#endif - // ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,NULL); #if defined(ENABLE_ITTI) @@ -673,11 +657,6 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->ac_BarringInfo = NULL; #if (RRC_VERSION >= MAKE_VERSION(10, 0, 0)) -#if 0 - (*sib2)->ssac_BarringForMMTEL_Voice_r9 = NULL; - (*sib2)->ssac_BarringForMMTEL_Video_r9 = NULL; - (*sib2)->ac_BarringForCSFB_r10 = NULL; -#endif (*sib2)->ext1 = NULL; (*sib2)->ext2 = NULL; #endif @@ -970,12 +949,6 @@ uint8_t do_SIB23(uint8_t Mod_id, /// (*SIB3) #if (RRC_VERSION >= MAKE_VERSION(10, 0, 0)) (*sib3)->ext1 = NULL; -#if 0 - (*sib3)->s_IntraSearch_v920=NULL; - (*sib3)->s_NonIntraSearch_v920=NULL; - (*sib3)->q_QualMin_r9=NULL; - (*sib3)->threshServingLowQ_r9=NULL; -#endif #endif (*sib3)->cellReselectionInfoCommon.q_Hyst=SystemInformationBlockType3__cellReselectionInfoCommon__q_Hyst_dB4; @@ -1375,20 +1348,6 @@ uint8_t do_SIB23(uint8_t Mod_id, if (MBMS_flag > 0) { ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list,sib13_part); } - -#if 0 - /* TODO: this is disabled for the moment. - * Maybe we shouldn't put this together with SIBs 2/3. - * The problem is that the MAC message is now 92 bytes, which - * is too much in the SIB scheduler (the scheduler allocates - * 4 RBs with max MCS 8). - */ - //for D2D - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib18_part); - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib19_part); - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib21_part); -#endif - #endif #ifdef XER_PRINT diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 32f4f05aae..d31a389401 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -472,24 +472,6 @@ void init_SL_preconfig(UE_RRC_INST *UE, const uint8_t eNB_index ) #endif -#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0)) -//----------------------------------------------------------------------------- -#if 0 -void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index) -{ - int i; - UE_rrc_inst[ue_mod_idP].sizeof_MCCH_MESSAGE[eNB_index] = 0; - UE_rrc_inst[ue_mod_idP].MCCH_MESSAGE[eNB_index] = (uint8_t *)malloc16(32); - UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index] = (MBSFNAreaConfiguration_r9_t *)malloc16(sizeof(MBSFNAreaConfiguration_r9_t)); - - for (i=0; i<8; i++) { // MAX MBSFN Area - UE_rrc_inst[ue_mod_idP].Info[eNB_index].MCCHStatus[i] = 0; - - } -} -#endif -#endif - //----------------------------------------------------------------------------- void openair_rrc_ue_init_security( const protocol_ctxt_t* const ctxt_pP ) { @@ -630,22 +612,6 @@ static const char const nas_attach_req_imsi[] = { }; #endif /* !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)) */ -#if 0 -/* NAS Attach request with GUTI */ -static const char const nas_attach_req_guti[] = { - 0x07, 0x41, - /* EPS Mobile identity = GUTI */ - 0x71, 0x0B, 0xF6, 0x12, 0xF2, 0x01, 0x80, 0x00, 0x01, 0xE0, 0x00, - 0xDA, 0x1F, - /* End of EPS Mobile Identity */ - 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03, - 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, - 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2, - 0x01, 0x27, 0x11, -}; -#endif - //----------------------------------------------------------------------------- void rrc_t310_expiration( diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 492e8536c4..539e316537 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -698,55 +698,6 @@ rrc_eNB_get_next_free_ue_context( } } -#if 0 //!defined(ENABLE_USE_MME) -void rrc_eNB_emulation_notify_ue_module_id( - const module_id_t ue_module_idP, - const rnti_t rntiP, - const uint8_t cell_identity_byte0P, - const uint8_t cell_identity_byte1P, - const uint8_t cell_identity_byte2P, - const uint8_t cell_identity_byte3P) -{ - LOG_I(RRC, "Panos-D: rrc_eNB_emulation_notify_ue_module_id 1 \n"); - module_id_t enb_module_id; - struct rrc_eNB_ue_context_s* ue_context_p = NULL; - int CC_id; - - // find enb_module_id - for (enb_module_id = 0; enb_module_id < NUMBER_OF_eNB_MAX; enb_module_id++) { - if(enb_module_id>0){ /*FIX LATER*/ - return; - } - for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - if (&RC.rrc[enb_module_id]->carrier[CC_id].sib1 != NULL) { - if ( - (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[0] == cell_identity_byte0P) && - (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[1] == cell_identity_byte1P) && - (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) && - (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P) - ) { - ue_context_p = rrc_eNB_get_ue_context( - RC.rrc[enb_module_id], - rntiP - ); - - if (NULL != ue_context_p) { - oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_module_id][ue_context_p->local_uid] = ue_module_idP; - } - - //return; - } - } - } - oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_id][ue_module_idP] = rntiP; - } - - AssertFatal(enb_module_id == NUMBER_OF_eNB_MAX, - "Cell identity not found for ue module id %u rnti %x", - ue_module_idP, rntiP); -} -#endif - //----------------------------------------------------------------------------- void rrc_eNB_free_mem_UE_context( @@ -7991,44 +7942,6 @@ rrc_rx_tx( #if defined(ENABLE_USE_MME) #if defined(ENABLE_ITTI) rrc_eNB_generate_RRCConnectionRelease(ctxt_pP, ue_context_p); -#if 0 - { - int e_rab; - MessageDef *msg_delete_tunnels_p = NULL; - uint32_t eNB_ue_s1ap_id = ue_context_p->ue_context.eNB_ue_s1ap_id; - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id); - msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ); - memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); - // do not wait response - GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; - for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { - GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = - ue_context_p->ue_context.enb_gtp_ebi[e_rab]; - // erase data - ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; - memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab])); - ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0; - } - itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->module_id, msg_delete_tunnels_p); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL,0, - "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ", - eNB_ue_s1ap_id); - - struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = NULL; - rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids( - RC.rrc[ctxt_pP->module_id], - 0, - eNB_ue_s1ap_id); - if (NULL != rrc_ue_s1ap_ids) { - rrc_eNB_S1AP_remove_ue_ids( - RC.rrc[ctxt_pP->module_id], - rrc_ue_s1ap_ids); - } - } -#endif #endif #else ue_to_be_removed = ue_context_p; diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 59a2c35294..ab5081d434 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -1289,63 +1289,6 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch instance, eNB_ue_s1ap_id); */ -#if 0 - { - int e_rab; - //int mod_id = 0; - MessageDef *msg_delete_tunnels_p = NULL; - - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_GTPU_ENB, - NULL,0, - "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", - eNB_ue_s1ap_id); - - msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_ENB, GTPV1U_ENB_DELETE_TUNNEL_REQ); - memset(>PV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), - 0, - sizeof(GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); - - // do not wait response - GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; - - for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { - GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] = - ue_context_p->ue_context.enb_gtp_ebi[e_rab]; - // erase data - ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; - memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab])); - ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0; - } - - itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p); - - - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL,0, - "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ", - eNB_ue_s1ap_id); - - MessageDef *msg_complete_p = NULL; - msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, S1AP_UE_CONTEXT_RELEASE_COMPLETE); - S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id; - itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p); - - rrc_ue_s1ap_ids = rrc_eNB_S1AP_get_ue_ids( - RC.rrc[instance], - UE_INITIAL_ID_INVALID, - eNB_ue_s1ap_id); - - if (NULL != rrc_ue_s1ap_ids) { - rrc_eNB_S1AP_remove_ue_ids( - RC.rrc[instance], - rrc_ue_s1ap_ids); - } - } -#endif return (0); } } diff --git a/openair2/RRC/LTE/rrc_eNB_UE_context.c b/openair2/RRC/LTE/rrc_eNB_UE_context.c index 0ae3d7ca15..1e344f2747 100644 --- a/openair2/RRC/LTE/rrc_eNB_UE_context.c +++ b/openair2/RRC/LTE/rrc_eNB_UE_context.c @@ -155,9 +155,6 @@ rrc_eNB_get_ue_context( memset(&temp, 0, sizeof(struct rrc_eNB_ue_context_s)); /* eNB ue rrc id = 24 bits wide */ temp.ue_id_rnti = rntiP; -#if 0 - return RB_FIND(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp); -#endif struct rrc_eNB_ue_context_s *ue_context_p = NULL; ue_context_p = RB_FIND(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, &temp); if ( ue_context_p != NULL) { diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 48e606522c..ee7db63a81 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -879,46 +879,6 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); } -#endif -#if 0 - LOG_params log_params; - int len; - - len = vsnprintf(log_params.l_buff_info, MAX_LOG_INFO-1, format, args); - - //2 first parameters must be passed as 'const' to the thread function - log_params.file = strdup(file); - log_params.func = strdup(func); - log_params.line = line; - log_params.comp = PHY;//comp; - log_params.level = 6; // INFO - level; - log_params.format = format; - log_params.len = len; - - if (pthread_mutex_lock(&log_lock) != 0) { - return; - } - - log_list_tail++; - log_list[log_list_tail - 1] = log_params; - - if (log_list_tail >= 1000) { - log_list_tail = 0; - } - - if (log_list_nb_elements < 1000) { - log_list_nb_elements++; - } - - if(pthread_cond_signal(&log_notify) != 0) { - pthread_mutex_unlock(&log_lock); - return; - } - - if(pthread_mutex_unlock(&log_lock) != 0) { - return; - } - #endif } @@ -1121,261 +1081,6 @@ void *log_thread_function(void *list) } #endif -#if 0 -/* This function does not work. When multiple threads call it at the same time - * for the same component, both threads end up using the same buffer. - * The output is the completely messed up/wrong. - * Kept in case the fix below is not correct or acceptable. - */ -//log record, format, and print: executed in the main thread (mt) -void logRecord_mt(const char *file, const char *func, int line, int comp, - int level, const char *format, ...) -{ - int len = 0; - va_list args; - log_component_t *c; - char *log_start; - char *log_end; - - /* for no gcc warnings */ - (void)log_start; - (void)log_end; - - c = &g_log->log_component[comp]; - - // do not apply filtering for LOG_F - // only log messages which are enabled and are below the global log level and component's level threshold - if ((level != LOG_FILE) && ((level > c->level) || (level > g_log->level))) { - /* if ((level != LOG_FILE) && - ((level > c->level) || - (level > g_log->level) || - ( c->level > g_log->level))) { - */ - return; - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, - VCD_FUNCTION_IN); - - va_start(args, format); - - // adjust syslog level for TRACE messages - if (g_log->syslog) { - if (g_log->level > LOG_DEBUG) { - g_log->level = LOG_DEBUG; - } - } - - // make sure that for log trace the extra info is only printed once, reset when the level changes - if ((level == LOG_FILE) || (c->flag == LOG_NONE) || (level == LOG_TRACE)) { - log_start = c->log_buffer; - len = vsnprintf(c->log_buffer, MAX_LOG_TOTAL-1, format, args); - log_end = c->log_buffer + len; - } else { - if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) { - len += snprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, "%s", - log_level_highlight_start[level]); - } - - log_start = c->log_buffer + len; - - if ( (g_log->flag & FLAG_COMP) || (c->flag & FLAG_COMP) ) { - len += snprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", - g_log->log_component[comp].name); - } - - if ( (g_log->flag & FLAG_LEVEL) || (c->flag & FLAG_LEVEL) ) { - len += snprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", - g_log->level2string[level]); - } - - if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) { - len += snprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ", - func); - } - - if ( (g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) { - len += snprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, "[%s:%d]", - file, line); - } - - len += vsnprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, format, args); - log_end = c->log_buffer + len; - - if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) { - len += snprintf(&c->log_buffer[len], MAX_LOG_TOTAL - len, "%s", - log_level_highlight_end[level]); - } - } - - va_end(args); - - // OAI printf compatibility - if ((g_log->onlinelog == 1) && (level != LOG_FILE)) - fwrite(c->log_buffer, len, 1, stdout); - - if (g_log->syslog) { - syslog(g_log->level, "%s", c->log_buffer); - } - - if (g_log->filelog) { - if (write(gfd, c->log_buffer, len) < len) { - // TODO assert ? - } - } - - if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) { - if (write(g_log->log_component[comp].fd, c->log_buffer, len) < len) { - // TODO assert ? - } - } - -#if defined(ENABLE_ITTI) - - if (level <= LOG_DEBUG) { - task_id_t origin_task_id = TASK_UNKNOWN; - MessagesIds messages_id; - MessageDef *message_p; - size_t message_string_size; - char *message_msg_p; - - message_string_size = log_end - log_start; - -#if !defined(DISABLE_ITTI_DETECT_SUB_TASK_ID) - - /* Try to identify sub task ID from log information (comp, log_instance_type) */ - switch (comp) { - case PHY: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_PHY_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_PHY_UE; - break; - - default: - break; - } - - break; - - case MAC: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_MAC_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_MAC_UE; - - default: - break; - } - - break; - - case RLC: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_RLC_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_RLC_UE; - - default: - break; - } - - break; - - case PDCP: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_PDCP_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_PDCP_UE; - - default: - break; - } - - break; - - default: - break; - } - -#endif - - switch (level) { - case LOG_EMERG: - case LOG_ALERT: - case LOG_CRIT: - case LOG_ERR: - messages_id = ERROR_LOG; - break; - - case LOG_WARNING: - messages_id = WARNING_LOG; - break; - - case LOG_NOTICE: - messages_id = NOTICE_LOG; - break; - - case LOG_INFO: - messages_id = INFO_LOG; - break; - - default: - messages_id = DEBUG_LOG; - break; - } - - message_p = itti_alloc_new_message_sized(origin_task_id, messages_id, message_string_size); - - switch (level) { - case LOG_EMERG: - case LOG_ALERT: - case LOG_CRIT: - case LOG_ERR: - message_msg_p = (char *) &message_p->ittiMsg.error_log; - break; - - case LOG_WARNING: - message_msg_p = (char *) &message_p->ittiMsg.warning_log; - break; - - case LOG_NOTICE: - message_msg_p = (char *) &message_p->ittiMsg.notice_log; - break; - - case LOG_INFO: - message_msg_p = (char *) &message_p->ittiMsg.info_log; - break; - - default: - message_msg_p = (char *) &message_p->ittiMsg.debug_log; - break; - } - - memcpy(message_msg_p, log_start, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); - } - -#endif - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, - VCD_FUNCTION_OUT); -} -#endif /* #if 0 */ - //log record, format, and print: executed in the main thread (mt) void logRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, ...) @@ -1729,15 +1434,7 @@ int set_comp_log(int component, int level, int verbosity, int interval) LOG_EMERG); DevCheck((interval >= 0) && (interval <= 0xFF), interval, 0, 0xFF); -#if 0 - if ((verbosity == LOG_NONE) || (verbosity == LOG_LOW) || - (verbosity == LOG_MED) || (verbosity == LOG_FULL) || - (verbosity == LOG_HIGH)) { - g_log->log_component[component].flag = verbosity; - } -#else g_log->log_component[component].flag = verbosity; -#endif g_log->log_component[component].level = level; g_log->log_component[component].interval = interval; diff --git a/openair2/UTIL/OPT/packet-mac-lte.h b/openair2/UTIL/OPT/packet-mac-lte.h index 84c6254d9f..d0bb60f6b5 100644 --- a/openair2/UTIL/OPT/packet-mac-lte.h +++ b/openair2/UTIL/OPT/packet-mac-lte.h @@ -46,17 +46,6 @@ #define DIRECTION_DOWNLINK 1 /* SR: no need to declare following part: */ -#if 0 -/* rntiType */ -#define NO_RNTI 0 -#define P_RNTI 1 -#define RA_RNTI 2 -#define C_RNTI 3 -#define SI_RNTI 4 -#define SPS_RNTI 5 -#define M_RNTI 6 -#endif - typedef enum mac_lte_oob_event { ltemac_send_preamble, ltemac_send_sr, @@ -153,35 +142,6 @@ typedef struct mac_lte_info { guint16 oob_rnti[MAX_SRs]; } mac_lte_info; -/* SR: no need to declare following part: */ -#if 0 -typedef struct mac_lte_tap_info { - /* Info from context */ - guint16 rnti; - guint16 ueid; - guint8 rntiType; - guint8 isPredefinedData; - guint8 crcStatusValid; - mac_lte_crc_status crcStatus; - guint8 direction; - - guint8 isPHYRetx; - guint16 ueInTTI; - - nstime_t time; - - /* Number of bytes (which part is used depends upon context settings) */ - guint32 single_number_of_bytes; - guint32 bytes_for_lcid[11]; - guint32 sdus_for_lcid[11]; - guint8 number_of_rars; - - /* Number of padding bytes includes padding subheaders and trailing padding */ - guint16 padding_bytes; - guint16 raw_length; -} mac_lte_tap_info; -#endif - /* Accessor function to check if a frame was considered to be ReTx */ //int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction); diff --git a/openair3/COMMON/security_types.h b/openair3/COMMON/security_types.h index 0eedc6201f..eb55e44d77 100644 --- a/openair3/COMMON/security_types.h +++ b/openair3/COMMON/security_types.h @@ -31,10 +31,6 @@ #include <stdint.h> #include <inttypes.h> -#if 0 -#include "queue.h" -#endif - #ifndef SECURITY_TYPES_H_ #define SECURITY_TYPES_H_ @@ -113,11 +109,6 @@ typedef struct eutran_vector_s { res_t xres; uint8_t autn[AUTN_LENGTH_OCTETS]; uint8_t kasme[KASME_LENGTH_OCTETS]; - - /* one UE can have multiple vectors so use STAILQ lists for easy management */ -#if 0 - STAILQ_ENTRY(eutran_vector_s) entries; -#endif } eutran_vector_t; #define FC_KASME (0x10) diff --git a/openair3/NAS/COMMON/ESM/MSG/ActivateDefaultEpsBearerContextRequest.c b/openair3/NAS/COMMON/ESM/MSG/ActivateDefaultEpsBearerContextRequest.c index 068ee5db6a..44c12659b8 100644 --- a/openair3/NAS/COMMON/ESM/MSG/ActivateDefaultEpsBearerContextRequest.c +++ b/openair3/NAS/COMMON/ESM/MSG/ActivateDefaultEpsBearerContextRequest.c @@ -290,31 +290,6 @@ int encode_activate_default_eps_bearer_context_request(activate_default_eps_bear encoded += encode_result; } -#if 0 /* LW: force Protocol Configuration Options to be included in the ESM message */ - { -#define CONFIGURATION_PROTOCOL_PPP 0 - -#define PROTOCOL_ID_IPCP 0x8021 -#define PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS 0x000D - - /* Force this item to be present */ - activate_default_eps_bearer_context_request->presencemask |= ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT; - /* Fill this item with data from PFT trace */ - activate_default_eps_bearer_context_request->protocolconfigurationoptions.configurationprotol = CONFIGURATION_PROTOCOL_PPP; - activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolid = PROTOCOL_ID_IPCP; - activate_default_eps_bearer_context_request->protocolconfigurationoptions.lengthofprotocolid = 16; /* Size of PROTOCOL_ID_IPCP */ - activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolidcontents.value = (uint8_t *) - /* PROTOCOL_ID_IPCP data */ - "\x03\x00\x00\x10\x81\x06\xC0\xA8\x0C\x64\x83\x06\xC0\xA8\x6A\x0C"; - /* Additional parameters PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS data */ - //"\x00\x0d\x04\x52\x61\x00\x78" - /* Additional parameters PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS data */ - //"\x00\x0d\x04\x52\x61\x01\x78"; - //activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolidcontents.length = 16 + 7 + 7; - activate_default_eps_bearer_context_request->protocolconfigurationoptions.protocolidcontents.length = 16; - } -#endif - if ((activate_default_eps_bearer_context_request->presencemask & ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) == ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) { if ((encode_result = diff --git a/openair3/NAS/COMMON/IES/EsmMessageContainer.c b/openair3/NAS/COMMON/IES/EsmMessageContainer.c index 2268b657f0..e33c06c71d 100644 --- a/openair3/NAS/COMMON/IES/EsmMessageContainer.c +++ b/openair3/NAS/COMMON/IES/EsmMessageContainer.c @@ -86,10 +86,6 @@ int encode_esm_message_container(EsmMessageContainer *esmmessagecontainer, uint8 encoded += encode_result; ENCODE_U16(lenPtr, encode_result, encoded); -#if 0 - lenPtr[1] = (((encoded - 2 - ((iei > 0) ? 1: 0))) & 0x0000ff00) >> 8; - lenPtr[0] = ((encoded - 2 - ((iei > 0) ? 1: 0))) & 0x000000ff; -#endif return encoded; } diff --git a/openair3/NAS/COMMON/IES/MobileIdentity.h b/openair3/NAS/COMMON/IES/MobileIdentity.h index 37f4d4ac30..fd747307de 100644 --- a/openair3/NAS/COMMON/IES/MobileIdentity.h +++ b/openair3/NAS/COMMON/IES/MobileIdentity.h @@ -97,37 +97,6 @@ typedef struct imeisv_s{ uint8_t parity:4; } imeisv_t; -#if 0 -typedef struct imeisv_s { - uint8_t length; - union { - struct { - uint8_t tac2:4; - uint8_t tac1:4; - uint8_t tac4:4; - uint8_t tac3:4; - uint8_t tac6:4; - uint8_t tac5:4; - uint8_t tac8:4; - uint8_t tac7:4; - uint8_t snr2:4; - uint8_t snr1:4; - uint8_t snr4:4; - uint8_t snr3:4; - uint8_t snr6:4; - uint8_t snr5:4; - uint8_t svn2:4; - uint8_t svn1:4; -#define EVEN_PARITY 0 -#define IMEI_ODD_PARITY 0xf - uint8_t parity:4; - } num; -#define IMEISV_BCD8_SIZE 9 - uint8_t value[IMEISV_BCD8_SIZE]; - } u; -} imeisv_t; -#endif - typedef ImsiMobileIdentity_t ImeiMobileIdentity_t; typedef imeisv_t ImeisvMobileIdentity_t; typedef ImsiMobileIdentity_t TmsiMobileIdentity_t; diff --git a/openair3/NAS/COMMON/UTIL/device.c b/openair3/NAS/COMMON/UTIL/device.c index 7ad2879b90..f8f1b9727b 100644 --- a/openair3/NAS/COMMON/UTIL/device.c +++ b/openair3/NAS/COMMON/UTIL/device.c @@ -175,16 +175,6 @@ void device_close(void* id) ssize_t device_read(void* id, char* buffer, size_t len) { const device_id_t* devid = (device_id_t*)(id); -#if 0 - ssize_t rbytes = read(devid->fd, buffer, len); - - if (rbytes < 0) { - return RETURNerror; - } - -#endif - - //#if 0 ssize_t rbytes = 0; do { @@ -198,8 +188,6 @@ ssize_t device_read(void* id, char* buffer, size_t len) } while ( (buffer[rbytes-1] != '\r') && (buffer[rbytes-1] != '\n') && (buffer[rbytes-1] != '\0') ); - //#endif - return rbytes; } diff --git a/openair3/NAS/COMMON/commonDef.h b/openair3/NAS/COMMON/commonDef.h index 84d97fc4a8..e9f769db55 100644 --- a/openair3/NAS/COMMON/commonDef.h +++ b/openair3/NAS/COMMON/commonDef.h @@ -314,17 +314,6 @@ typedef struct { */ #define TAI_LIST_T(SIZE) struct {Byte_t n_tais; tai_t tai[SIZE];} -#if 0 -/* - * User notification callback, executed whenever a change of data with - * respect of network information (e.g. network registration and/or - * location change, new PLMN becomes available) is notified by the - * EPS Mobility Management sublayer - */ -typedef int (*emm_indication_callback_t) (Stat_t, tac_t, ci_t, AcT_t, - const char*, size_t); -#endif - typedef enum eps_protocol_discriminator_e { /* Protocol discriminator identifier for EPS Mobility Management */ EPS_MOBILITY_MANAGEMENT_MESSAGE = 0x7, diff --git a/openair3/NAS/COMMON/networkDef.h b/openair3/NAS/COMMON/networkDef.h index e3e8e1f08b..5390eac2f0 100644 --- a/openair3/NAS/COMMON/networkDef.h +++ b/openair3/NAS/COMMON/networkDef.h @@ -260,15 +260,6 @@ typedef struct { network_pkf_t* pkf[NET_PACKET_FILTER_MAX]; } network_tft_t; -#if 0 -/* - * User notification callback, executed whenever a change of status with - * respect of PDN connection or EPS bearer context is notified by the EPS - * Session Management sublayer - */ -typedef int (*esm_indication_callback_t) (int, network_pdn_state_t); -#endif - /****************************************************************************/ /******************** G L O B A L V A R I A B L E S ********************/ /****************************************************************************/ diff --git a/openair3/NAS/TEST/AS_SIMULATOR/nas_process.c b/openair3/NAS/TEST/AS_SIMULATOR/nas_process.c index 17ad99715b..9b2245acd0 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/nas_process.c +++ b/openair3/NAS/TEST/AS_SIMULATOR/nas_process.c @@ -338,14 +338,8 @@ _attach_accept( { int index = 0; -#if 0 - /* T3412 timer value */ - index += snprintf(buffer + index, length - index, "T3412 = "); - index += gprsTimer(buffer + index, length - index, &msg->t3412value); - /* TAI list */ - index += snprintf(buffer + index, length - index, ", "); - index += taiList(buffer + index, length - index, &msg->tailist); -#endif + /* T3412 timer value (TBD) */ + /* TAI list (TBD) */ /* GUTI */ if (msg->presencemask & ATTACH_ACCEPT_GUTI_PRESENT) { diff --git a/openair3/NAS/TEST/USER/user_simulator.c b/openair3/NAS/TEST/USER/user_simulator.c index ec16b3453f..fa015df30a 100644 --- a/openair3/NAS/TEST/USER/user_simulator.c +++ b/openair3/NAS/TEST/USER/user_simulator.c @@ -225,23 +225,6 @@ int main (int argc, const char* argv[]) break; } -#if 0 - /* Send the AT command one byte at a time (serial port simulation) */ - const char* pbuffer = _user_simulator_send_buffer; - - while (*pbuffer) { - int sbytes = USER_SEND(pbuffer++, 1); - - if (sbytes == RETURNerror) { - perror("ERROR\t: Failed to send data to the NAS sublayer"); - break; - } - - (void)poll(0, 0, 10); - } - -#endif - (void)poll(0, 0, 100); } diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index ab5f93a16d..28fff9577e 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -384,60 +384,6 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id, mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb ++; s1ap_handle_s1_setup_message(mme_desc_p, 0); -#if 0 - /* We call back our self - * -> generate a dummy initial UE message - */ - { - s1ap_nas_first_req_t s1ap_nas_first_req; - - memset(&s1ap_nas_first_req, 0, sizeof(s1ap_nas_first_req_t)); - - s1ap_nas_first_req.rnti = 0xC03A; - s1ap_nas_first_req.establishment_cause = RRC_CAUSE_MO_DATA; - s1ap_nas_first_req.ue_identity.presenceMask = UE_IDENTITIES_gummei; - - s1ap_nas_first_req.ue_identity.gummei.mcc = 208; - s1ap_nas_first_req.ue_identity.gummei.mnc = 34; - s1ap_nas_first_req.ue_identity.gummei.mme_code = 0; - s1ap_nas_first_req.ue_identity.gummei.mme_group_id = 0; - - /* NAS Attach request with IMSI */ - static uint8_t nas_attach_req_imsi[] = { - 0x07, 0x41, - /* EPS Mobile identity = IMSI */ - 0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87, - 0xF9, - /* End of EPS Mobile Identity */ - 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03, - 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, - 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2, - 0x01, 0x27, 0x11, - }; - - /* NAS Attach request with GUTI */ - static uint8_t nas_attach_req_guti[] = { - 0x07, 0x41, - /* EPS Mobile identity = IMSI */ - 0x71, 0x0B, 0xF6, 0x12, 0xF2, 0x01, 0x80, 0x00, 0x01, 0xE0, 0x00, - 0xDA, 0x1F, - /* End of EPS Mobile Identity */ - 0x02, 0xE0, 0xE0, 0x00, 0x20, 0x02, 0x03, - 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, - 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2, - 0x01, 0x27, 0x11, - }; - - s1ap_nas_first_req.nas_pdu.buffer = nas_attach_req_guti; - s1ap_nas_first_req.nas_pdu.length = sizeof(nas_attach_req_guti); - - s1ap_eNB_handle_nas_first_req(mme_desc_p->s1ap_eNB_instance->instance, - &s1ap_nas_first_req); - } -#endif - return 0; } @@ -1078,29 +1024,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id, return -1; } -#if 0 - /* convert Paging DRX(optional) */ - if (paging_p->presenceMask & S1AP_PAGINGIES_PAGINGDRX_PRESENT) { - switch(paging_p->pagingDRX) { - case S1ap_PagingDRX_v32: - S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_32; - break; - case S1ap_PagingDRX_v64: - S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_64; - break; - case S1ap_PagingDRX_v128: - S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_128; - break; - case S1ap_PagingDRX_v256: - S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256; - break; - default: - // when UE Paging DRX is no value - S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256; - break; - } - } -#endif S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256; /* convert cnDomain */ @@ -1133,46 +1056,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id, S1AP_DEBUG("[SCTP %d] Received Paging: MCC %d, MNC %d, TAC %d\n", assoc_id, S1AP_PAGING_IND(message_p).plmn_identity[i].mcc, S1AP_PAGING_IND(message_p).plmn_identity[i].mnc, S1AP_PAGING_IND(message_p).tac[i]); } -#if 0 - // CSG Id(optional) List is not used - if (paging_p->presenceMask & S1AP_PAGINGIES_CSG_IDLIST_PRESENT) { - // TODO - } - - /* convert pagingPriority (optional) if has value */ - if (paging_p->presenceMask & S1AP_PAGINGIES_PAGINGPRIORITY_PRESENT) { - switch(paging_p->pagingPriority) { - case S1ap_PagingPriority_priolevel1: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL1; - break; - case S1ap_PagingPriority_priolevel2: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL2; - break; - case S1ap_PagingPriority_priolevel3: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL3; - break; - case S1ap_PagingPriority_priolevel4: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL4; - break; - case S1ap_PagingPriority_priolevel5: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL5; - break; - case S1ap_PagingPriority_priolevel6: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL6; - break; - case S1ap_PagingPriority_priolevel7: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL7; - break; - case S1ap_PagingPriority_priolevel8: - S1AP_PAGING_IND(message_p).paging_priority = PAGING_PRIO_LEVEL8; - break; - default: - /* invalid paging_p->pagingPriority */ - S1AP_ERROR("[SCTP %d] Received paging : pagingPriority(%ld) is invalid\n", assoc_id, paging_p->pagingPriority); - return -1; - } - } -#endif //paging parameter values S1AP_DEBUG("[SCTP %d] Received Paging parameters: ue_index_value %d cn_domain %d paging_drx %d paging_priority %d\n",assoc_id, S1AP_PAGING_IND(message_p).ue_index_value, S1AP_PAGING_IND(message_p).cn_domain, diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 256bee0cd1..168eb58b37 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -203,19 +203,6 @@ sctp_handle_new_association_req( if (s > 0 ) { if (((struct sockaddr_in*)ifa->ifa_addr)->sin_addr.s_addr == in.s_addr) { -#if 0 - memset(&ifr, 0, sizeof(ifr)); - snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s",ifa->ifa_name); - - if (setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) { - SCTP_ERROR("Setsockopt SOL_SOCKET failed: %s\n", - strerror(errno)); - } else { - SCTP_DEBUG("Setsockopt SOL_SOCKET socket bound to : %s\n", - ifa->ifa_name); - } - -#else struct sockaddr_in locaddr; locaddr.sin_family = AF_INET; locaddr.sin_port = htons(sctp_new_association_req_p->port); @@ -228,8 +215,6 @@ sctp_handle_new_association_req( SCTP_DEBUG("sctp_bindx SCTP_BINDX_ADD_ADDR socket bound to : %s\n", inet_ntoa(locaddr.sin_addr)); } - -#endif break; } diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c index 4d6bd6e033..2943ca4088 100644 --- a/openair3/UDP/udp_eNB_task.c +++ b/openair3/UDP/udp_eNB_task.c @@ -276,13 +276,10 @@ void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP) * if the queue is full. */ /* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */ - //if (itti_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) { if (itti_try_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) { -#if 0 - LOG_I(UDP_, "Failed to send message %d to task %d\n", + LOG_E(UDP_, "Failed to send message %d to task %d\n", UDP_DATA_IND, udp_sock_pP->task_id); -#endif itti_free(TASK_UDP, message_p); itti_free(TASK_UDP, forwarded_buffer); return; diff --git a/targets/ARCH/EXMIMO/DRIVER/telecomparistech/em1_drv.h b/targets/ARCH/EXMIMO/DRIVER/telecomparistech/em1_drv.h index 82cb69baba..22c01c47e6 100644 --- a/targets/ARCH/EXMIMO/DRIVER/telecomparistech/em1_drv.h +++ b/targets/ARCH/EXMIMO/DRIVER/telecomparistech/em1_drv.h @@ -135,12 +135,6 @@ struct em1_private_s { extern struct em1_private_s *em1_devices[MAX_EM1_DEVICES]; /* em1_drv.c */ -#if 0 -static int em1_open(struct inode *inode, struct file *file); -static int em1_release(struct inode *inode, struct file *file); -static int __init em1_init(void); -static void __exit em1_cleanup(void); -#endif int em1_user_op_enter(struct em1_private_s *pv, wait_queue_t *wait, wait_queue_head_t *wh, int busy_flag, int new_state); void em1_user_op_leave(struct em1_private_s *pv, wait_queue_t *wait, @@ -153,9 +147,6 @@ ssize_t em1_write(struct file *file, const char __user *buf, size_t size, loff_t ssize_t em1_read(struct file *file, char __user *buf, size_t size, loff_t *ppos); /* em1_dev.c */ -#if 0 -static irqreturn_t irq_handler(int irq, void *dev_id); -#endif int __devinit em1_probe(struct pci_dev *dev, const struct pci_device_id *id); void __devexit em1_remove(struct pci_dev *dev); @@ -184,14 +175,6 @@ struct em1_ioctl_fifo_params { size_t count; }; -#if 0 -static int em1_ioctl_fifo_write(struct em1_private_s *pv, - struct em1_ioctl_fifo_params *p); -static int em1_ioctl_fifo_read(struct em1_private_s *pv, - struct em1_ioctl_fifo_params *p); -static int em1_ioctl_alloc(struct em1_private_s *pv, void **buf); -#endif - /* * Local Variables: * c-file-style: "linux" diff --git a/targets/ARCH/mobipass/queues.c b/targets/ARCH/mobipass/queues.c index 27c9917084..68ed6ecbc9 100644 --- a/targets/ARCH/mobipass/queues.c +++ b/targets/ARCH/mobipass/queues.c @@ -182,16 +182,6 @@ static void get_sample_from_mobipass(queue_state_t *qstate, char *I, char *Q, ui struct mobipass_header *mh = NULL; uint32_t packet_timestamp = 0; -#if 0 -uint32_t old_start = qstate->from_mobipass.start; -uint32_t old_len = qstate->from_mobipass.len; -b = qstate->from_mobipass.buf[qstate->from_mobipass.start]; -mh = (struct mobipass_header *)(b+14); -uint32_t old_pts = qstate->from_mobipass.len ? ntohl(mh->timestamp) : -1; -b=NULL; -mh=NULL; -#endif - while (qstate->from_mobipass.len) { b = qstate->from_mobipass.buf[qstate->from_mobipass.start]; mh = (struct mobipass_header *)(b+14); @@ -222,10 +212,6 @@ nodata: *Q = 0; log_missed_sample(qstate, timestamp); - -#if 0 -printf("no sample timestamp %u pt %u start %d old_start %d old_pt %u len %d old len %d\n", timestamp, packet_timestamp, qstate->from_mobipass.start, old_start, old_pts, qstate->from_mobipass.len, old_len); -#endif } /* doesn't work with delay more than 1s */ diff --git a/targets/ARCH/tcp_bridge/tcp_bridge.c b/targets/ARCH/tcp_bridge/tcp_bridge.c index 127ba39bbc..a59b969da4 100644 --- a/targets/ARCH/tcp_bridge/tcp_bridge.c +++ b/targets/ARCH/tcp_bridge/tcp_bridge.c @@ -225,14 +225,6 @@ int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void b = &t->b[t->bstart]; -#if 0 -typedef struct { - int32_t data[30720]; /* max 20MHz */ - unsigned long timestamp; - int size; -} input_buffer; -#endif - if (b->timestamp != t->read_timestamp) abort(); if (b->size != nsamps * 4) abort(); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index a418d09a0f..13c2e9ae85 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -243,31 +243,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam eNB->if_inst->UL_indication(&eNB->UL_INFO); pthread_mutex_unlock(&eNB->UL_INFO_mutex); -#if 0 -/* TODO: find a correct solution for this conflict */ -<<<<<<< HEAD - - // ***************************************** - // TX processing for subframe n+sf_ahead - // run PHY TX procedures the one after the other for all CCs to avoid race conditions - // (may be relaxed in the future for performance reasons) - // ***************************************** - //if (wait_CCs(proc)<0) return(-1); - - if (oai_exit) return(-1); -#ifndef PHY_TX_THREAD - phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1); -#endif - if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1); -======= - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); - if(oai_exit) return(-1); - if(get_nprocs() <= 4){ - phy_procedures_eNB_TX(eNB, proc, 1); - } ->>>>>>> origin/develop -#endif /* #if 0 */ /* this conflict resolution may be totally wrong, to be tested */ /* CONFLICT RESOLUTION: BEGIN */ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 ); @@ -285,7 +260,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx); -#if 0 LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ", softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now, TICK_TO_US(eNB->phy_proc), @@ -325,7 +299,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam TICK_TO_US(eNB->ulsch_tc_intl1_stats), TICK_TO_US(eNB->ulsch_tc_intl2_stats) ); -#endif return(0); } @@ -466,30 +439,6 @@ static void* eNB_thread_rxtx( void* param ) { return &eNB_thread_rxtx_status; } - -#if 0 //defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) -// Wait for eNB application initialization to be complete (eNB registration to MME) -static void wait_system_ready (char *message, volatile int *start_flag) { - - static char *indicator[] = {". ", ".. ", "... ", ".... ", ".....", - " ....", " ...", " ..", " .", " "}; - int i = 0; - - while ((!oai_exit) && (*start_flag == 0)) { - LOG_N(EMU, message, indicator[i]); - fflush(stdout); - i = (i + 1) % (sizeof(indicator) / sizeof(indicator[0])); - usleep(200000); - } - - LOG_D(EMU,"\n"); -} -#endif - - - - - void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru) { eNB_proc_t *proc = &eNB->proc; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index a0174ea332..a5609f9903 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -275,14 +275,6 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti } printf("UE threads created by %ld\n", gettid()); -#if 0 -#if defined(ENABLE_USE_MME) - extern volatile int start_UE; - while (start_UE == 0) { - sleep(1); - } -#endif -#endif } // Panos: Initiating all UEs within a single set of threads for PHY_STUB. Future extensions -> multiple diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index a302c12ff3..3bc180a014 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -1562,33 +1562,6 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) } #else -#if 0 // defined(EXMIMO) || defined(OAI_USRP) - if (otg_enabled==1) { - ctime = frame * 100; - - for (dst_id = 0; dst_id < MAX_MOBILES_PER_ENB; dst_id++) { - if (mac_get_rrc_status(eNB_index, eNB_flag, dst_id ) > 2) { - otg_pkt = malloc (sizeof(Packet_otg_elt_t)); - (otg_pkt->otg_pkt).sdu_buffer = packet_gen(module_instP, dst_id, ctime, &pkt_size); - - if (otg_pkt != NULL) { - rb_id = DTCH-2; - (otg_pkt->otg_pkt).rb_id = rb_id; - (otg_pkt->otg_pkt).module_id = module_idP; - (otg_pkt->otg_pkt).is_ue = FALSE; - (otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_DATA; - //Adding the packet to the OTG-PDCP buffer - pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_idP])); - LOG_D(EMU, "[eNB %d] ADD pkt to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id); - } else { - //LOG_I(EMU, "OTG returns null \n"); - free(otg_pkt); - otg_pkt=NULL; - } - } - } - } -#endif } void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) diff --git a/targets/TEST/PDCP/test_pdcp.c b/targets/TEST/PDCP/test_pdcp.c index b07add73a6..a999bb254d 100644 --- a/targets/TEST/PDCP/test_pdcp.c +++ b/targets/TEST/PDCP/test_pdcp.c @@ -248,15 +248,12 @@ BOOL test_pdcp_data_req(void) * XXX mem_block_t doesn't hold buffer size, how do we keep the size * information if we pass mem_block_ts via a linked list? */ -#if 0 if (pdcp_test_pdu_buffer_size == 0 || pdcp_test_pdu_buffer == NULL) { msg("[TEST] PDU created by pdcp_data_req() is invalid!\n"); return FALSE; } -#endif - /* * Serialize incoming mem_block_t into an unsigned character array * and add removed PDU to RX list in order to use it in the next test -- GitLab