Commit 12a4de37 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch '320-code-cleanup-removal-of-if-0' into 'develop'

Resolve "Code cleanup - removal of "#if 0""

See merge request oai/openairinterface5g!329
parents 0a922508 7a5c40c1
......@@ -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
......
......@@ -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++;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
}
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......@@ -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)
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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++) {
......
......@@ -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__)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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)*/)
{
......
......@@ -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));
......
......@@ -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()
{
......
......@@ -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
......@@ -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
}
}
}
......
......@@ -3598,16 +3598,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]]);
......@@ -3664,15 +3662,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]]);
......@@ -4417,11 +4413,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)
......
......@@ -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]));
......
......@@ -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)
......
......@@ -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()
......
......@@ -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
......
......@@ -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 */
......
......@@ -224,11 +224,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];
......@@ -334,14 +329,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)
......@@ -451,11 +441,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;
......@@ -834,12 +819,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);
......@@ -976,14 +955,6 @@ 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];
......@@ -2929,19 +2900,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;
......
......@@ -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
......
......@@ -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",
......
......@@ -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 */
......
......@@ -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
}
......@@ -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
......
......@@ -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
*/
......
......@@ -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;
}
......@@ -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.
......
......@@ -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.
......
......@@ -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
......@@ -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--;
......
......@@ -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);
......
......@@ -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
......
......@@ -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(
......
......@@ -698,54 +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)
{
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(
......@@ -7990,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(&GTPV1U_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;
......
......@@ -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(&GTPV1U_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);
}
}
......
......@@ -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) {
......
......@@ -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;
......
This diff is collapsed.
This diff is collapsed.
......@@ -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;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment