Merge branch 'develop' into L1_renaming
Conflicts: common/utils/LOG/log.c targets/RT/USER/lte-enb.c targets/RT/USER/lte-softmodem.c
This commit is contained in:
+18
-1
@@ -436,7 +436,7 @@ class SSHConnection():
|
|||||||
self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, pcap_log_file, self.eNBSourceCodePath + '/cmake_targets/.')
|
self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, pcap_log_file, self.eNBSourceCodePath + '/cmake_targets/.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
self.command('stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | egrep --color=never -i "wait|sync"', '\$', 4)
|
self.command('stdbuf -o0 cat enb_' + SSH.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4)
|
||||||
if rruCheck:
|
if rruCheck:
|
||||||
result = re.search('wait RUs', str(self.ssh.before))
|
result = re.search('wait RUs', str(self.ssh.before))
|
||||||
else:
|
else:
|
||||||
@@ -1573,6 +1573,8 @@ class SSHConnection():
|
|||||||
rrcReestablishRequest = 0
|
rrcReestablishRequest = 0
|
||||||
rrcReestablishComplete = 0
|
rrcReestablishComplete = 0
|
||||||
rrcReestablishReject = 0
|
rrcReestablishReject = 0
|
||||||
|
rlcDiscardBuffer = 0
|
||||||
|
rachCanceledProcedure = 0
|
||||||
uciStatMsgCount = 0
|
uciStatMsgCount = 0
|
||||||
pdcpFailure = 0
|
pdcpFailure = 0
|
||||||
ulschFailure = 0
|
ulschFailure = 0
|
||||||
@@ -1625,6 +1627,12 @@ class SSHConnection():
|
|||||||
result = re.search('ULSCH in error in round', str(line))
|
result = re.search('ULSCH in error in round', str(line))
|
||||||
if result is not None:
|
if result is not None:
|
||||||
ulschFailure += 1
|
ulschFailure += 1
|
||||||
|
result = re.search('BAD all_segments_received', str(line))
|
||||||
|
if result is not None:
|
||||||
|
rlcDiscardBuffer += 1
|
||||||
|
result = re.search('Canceled RA procedure for UE rnti', str(line))
|
||||||
|
if result is not None:
|
||||||
|
rachCanceledProcedure += 1
|
||||||
enb_log_file.close()
|
enb_log_file.close()
|
||||||
self.htmleNBFailureMsg = ''
|
self.htmleNBFailureMsg = ''
|
||||||
if uciStatMsgCount > 0:
|
if uciStatMsgCount > 0:
|
||||||
@@ -1667,6 +1675,10 @@ class SSHConnection():
|
|||||||
rrcMsg = ' -- ' + str(rrcReestablishReject) + ' were rejected'
|
rrcMsg = ' -- ' + str(rrcReestablishReject) + ' were rejected'
|
||||||
logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m')
|
logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m')
|
||||||
self.htmleNBFailureMsg += rrcMsg + '\n'
|
self.htmleNBFailureMsg += rrcMsg + '\n'
|
||||||
|
if rachCanceledProcedure > 0:
|
||||||
|
rachMsg = 'eNB cancelled ' + str(rachCanceledProcedure) + ' RA procedure(s)'
|
||||||
|
logging.debug('\u001B[1;30;43m ' + rachMsg + ' \u001B[0m')
|
||||||
|
self.htmleNBFailureMsg += rachMsg + '\n'
|
||||||
if foundSegFault:
|
if foundSegFault:
|
||||||
logging.debug('\u001B[1;37;41m eNB ended with a Segmentation Fault! \u001B[0m')
|
logging.debug('\u001B[1;37;41m eNB ended with a Segmentation Fault! \u001B[0m')
|
||||||
return ENB_PROCESS_SEG_FAULT
|
return ENB_PROCESS_SEG_FAULT
|
||||||
@@ -1677,6 +1689,11 @@ class SSHConnection():
|
|||||||
if foundRealTimeIssue:
|
if foundRealTimeIssue:
|
||||||
logging.debug('\u001B[1;37;41m eNB faced real time issues! \u001B[0m')
|
logging.debug('\u001B[1;37;41m eNB faced real time issues! \u001B[0m')
|
||||||
return ENB_PROCESS_REALTIME_ISSUE
|
return ENB_PROCESS_REALTIME_ISSUE
|
||||||
|
if rlcDiscardBuffer > 0:
|
||||||
|
rlcMsg = 'eNB RLC discarded ' + str(rlcDiscardBuffer) + ' buffer(s)'
|
||||||
|
logging.debug('\u001B[1;37;41m ' + rlcMsg + ' \u001B[0m')
|
||||||
|
self.htmleNBFailureMsg += rlcMsg + '\n'
|
||||||
|
return ENB_PROCESS_REALTIME_ISSUE
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def TerminateeNB(self):
|
def TerminateeNB(self):
|
||||||
|
|||||||
@@ -21,17 +21,15 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<testCaseList>
|
<testCaseList>
|
||||||
<!-- Only 5MHz is tested since neither 10MHz nor 20MHz work in this configuration -->
|
<!-- Only 5MHz/10MHz is tested since 20MHz does not work as in monolithic -->
|
||||||
<!-- Also no UL iperf in 5MHz (040642) -->
|
|
||||||
<TestCaseRequestedList>
|
<TestCaseRequestedList>
|
||||||
010101
|
010101
|
||||||
050101 060101 070101 040101
|
050101 060101 070101 040101
|
||||||
030104 030105 040301 040501 040602 040401 040201 030201 030202
|
030104 030105 040301 040501 040602 040642 040401 040201 030201 030202
|
||||||
|
030114 030115 040301 040511 040612 040652 040401 040201 030201 030202
|
||||||
050201 060201 070201
|
050201 060201 070201
|
||||||
</TestCaseRequestedList>
|
</TestCaseRequestedList>
|
||||||
<!--
|
<!--
|
||||||
030104 030105 040301 040501 040602 040642 040401 040201 030201 030202
|
|
||||||
030114 030115 040301 040511 040612 040652 040401 040201 030201 030202
|
|
||||||
030124 030125 040301 040521 040622 040662 040401 040201 030201 030202
|
030124 030125 040301 040521 040622 040662 040401 040201 030201 030202
|
||||||
-->
|
-->
|
||||||
<TestCaseExclusionList>
|
<TestCaseExclusionList>
|
||||||
|
|||||||
@@ -21,17 +21,14 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
<testCaseList>
|
<testCaseList>
|
||||||
<!-- Only 5MHz is tested since neither 10MHz nor 20MHz work in this configuration -->
|
|
||||||
<TestCaseRequestedList>
|
<TestCaseRequestedList>
|
||||||
010101
|
010101
|
||||||
050101 060101 070101 040101
|
050101 060101 070101 040101
|
||||||
030101 030102 040301 040501 040604 040642 040401 040201 030201 030202
|
030101 030102 040301 040501 040604 040642 040401 040201 030201 030202
|
||||||
050201 060201 070201
|
|
||||||
</TestCaseRequestedList>
|
|
||||||
<!--
|
|
||||||
030111 030112 040301 040511 040614 040652 040401 040201 030201 030202
|
030111 030112 040301 040511 040614 040652 040401 040201 030201 030202
|
||||||
030121 030122 040301 040521 040624 040662 040401 040201 030201 030202
|
030121 030122 040301 040521 040624 040662 040401 040201 030201 030202
|
||||||
-->
|
050201 060201 070201
|
||||||
|
</TestCaseRequestedList>
|
||||||
<TestCaseExclusionList>
|
<TestCaseExclusionList>
|
||||||
</TestCaseExclusionList>
|
</TestCaseExclusionList>
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
|
|||||||
# Debug related options
|
# Debug related options
|
||||||
#########################################
|
#########################################
|
||||||
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
|
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
|
||||||
add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
|
add_boolean_option(ASN_EMIT_DEBUG False "ASN1 coder/decoder Debug")
|
||||||
add_boolean_option(MSG_PRINT False "print debug messages")
|
add_boolean_option(MSG_PRINT False "print debug messages")
|
||||||
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
|
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
|
||||||
add_boolean_option(XER_PRINT False "print XER Format")
|
add_boolean_option(XER_PRINT False "print XER Format")
|
||||||
|
|||||||
@@ -39,9 +39,8 @@
|
|||||||
#include "vcd_signal_dumper.h"
|
#include "vcd_signal_dumper.h"
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
# include <pthread.h>
|
#include <string.h>
|
||||||
# include <string.h>
|
|
||||||
#include <linux/prctl.h>
|
#include <linux/prctl.h>
|
||||||
#include "common/config/config_userapi.h"
|
#include "common/config/config_userapi.h"
|
||||||
// main log variables
|
// main log variables
|
||||||
|
|||||||
@@ -7,19 +7,17 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int x_connection_fd(x_connection *_x)
|
int x_connection_fd(x_connection *_x) {
|
||||||
{
|
|
||||||
struct x_connection *x = _x;
|
struct x_connection *x = _x;
|
||||||
return ConnectionNumber(x->d);
|
return ConnectionNumber(x->d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GC create_gc(Display *d, char *color)
|
static GC create_gc(Display *d, char *color) {
|
||||||
{
|
|
||||||
GC ret = XCreateGC(d, DefaultRootWindow(d), 0, NULL);
|
GC ret = XCreateGC(d, DefaultRootWindow(d), 0, NULL);
|
||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
XColor rcol, scol;
|
XColor rcol, scol;
|
||||||
|
|
||||||
XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, ret);
|
XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, ret);
|
||||||
|
|
||||||
if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)),
|
if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)),
|
||||||
color, &scol, &rcol)) {
|
color, &scol, &rcol)) {
|
||||||
gcv.foreground = scol.pixel;
|
gcv.foreground = scol.pixel;
|
||||||
@@ -29,17 +27,18 @@ static GC create_gc(Display *d, char *color)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x_new_color(x_connection *_x, char *color)
|
int x_new_color(x_connection *_x, char *color) {
|
||||||
{
|
|
||||||
struct x_connection *x = _x;
|
struct x_connection *x = _x;
|
||||||
x->ncolors++;
|
x->ncolors++;
|
||||||
|
|
||||||
x->colors = realloc(x->colors, x->ncolors * sizeof(GC));
|
x->colors = realloc(x->colors, x->ncolors * sizeof(GC));
|
||||||
if (x->colors == NULL) OOM;
|
|
||||||
x->colors[x->ncolors-1] = create_gc(x->d, color);
|
|
||||||
|
|
||||||
|
if (x->colors == NULL) OOM;
|
||||||
|
|
||||||
|
x->colors[x->ncolors-1] = create_gc(x->d, color);
|
||||||
x->xft_colors = realloc(x->xft_colors, x->ncolors * sizeof(XftColor));
|
x->xft_colors = realloc(x->xft_colors, x->ncolors * sizeof(XftColor));
|
||||||
|
|
||||||
if (x->xft_colors == NULL) OOM;
|
if (x->xft_colors == NULL) OOM;
|
||||||
|
|
||||||
if (XftColorAllocName(x->d, DefaultVisual(x->d, DefaultScreen(x->d)),
|
if (XftColorAllocName(x->d, DefaultVisual(x->d, DefaultScreen(x->d)),
|
||||||
DefaultColormap(x->d, DefaultScreen(x->d)),
|
DefaultColormap(x->d, DefaultScreen(x->d)),
|
||||||
color, &x->xft_colors[x->ncolors-1]) == False)
|
color, &x->xft_colors[x->ncolors-1]) == False)
|
||||||
@@ -48,45 +47,45 @@ int x_new_color(x_connection *_x, char *color)
|
|||||||
return x->ncolors - 1;
|
return x->ncolors - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x_new_font(x_connection *_x, char *font)
|
int x_new_font(x_connection *_x, char *font) {
|
||||||
{
|
|
||||||
struct x_connection *x = _x;
|
struct x_connection *x = _x;
|
||||||
/* TODO: allocate fonts only once */
|
/* TODO: allocate fonts only once */
|
||||||
x->nfonts++;
|
x->nfonts++;
|
||||||
x->fonts = realloc(x->fonts, x->nfonts * sizeof(XftFont *));
|
x->fonts = realloc(x->fonts, x->nfonts * sizeof(XftFont *));
|
||||||
|
|
||||||
if (x->fonts == NULL) OOM;
|
if (x->fonts == NULL) OOM;
|
||||||
|
|
||||||
x->fonts[x->nfonts-1] = XftFontOpenName(x->d, DefaultScreen(x->d), font);
|
x->fonts[x->nfonts-1] = XftFontOpenName(x->d, DefaultScreen(x->d), font);
|
||||||
|
|
||||||
if (x->fonts[x->nfonts-1] == NULL)
|
if (x->fonts[x->nfonts-1] == NULL)
|
||||||
ERR("failed allocating font '%s'\n", font);
|
ERR("failed allocating font '%s'\n", font);
|
||||||
|
|
||||||
return x->nfonts - 1;
|
return x->nfonts - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
x_connection *x_open(void)
|
x_connection *x_open(void) {
|
||||||
{
|
|
||||||
struct x_connection *ret;
|
struct x_connection *ret;
|
||||||
|
|
||||||
ret = calloc(1, sizeof(struct x_connection));
|
ret = calloc(1, sizeof(struct x_connection));
|
||||||
|
|
||||||
if (ret == NULL) OOM;
|
if (ret == NULL) OOM;
|
||||||
|
|
||||||
ret->d = XOpenDisplay(0);
|
ret->d = XOpenDisplay(0);
|
||||||
LOGD("XOpenDisplay display %p return x_connection %p\n", ret->d, ret);
|
LOGD("XOpenDisplay display %p return x_connection %p\n", ret->d, ret);
|
||||||
|
|
||||||
if (ret->d == NULL) ERR("error calling XOpenDisplay: no X? you root?\n");
|
if (ret->d == NULL) ERR("error calling XOpenDisplay: no X? you root?\n");
|
||||||
|
|
||||||
x_new_color(ret, "white"); /* background color */
|
x_new_color(ret, "white"); /* background color */
|
||||||
x_new_color(ret, "black"); /* foreground color */
|
x_new_color(ret, "black"); /* foreground color */
|
||||||
|
|
||||||
x_new_font(ret, "sans-8");
|
x_new_font(ret, "sans-8");
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
x_window *x_create_window(x_connection *_x, int width, int height,
|
x_window *x_create_window(x_connection *_x, int width, int height,
|
||||||
char *title)
|
char *title) {
|
||||||
{
|
|
||||||
struct x_connection *x = _x;
|
struct x_connection *x = _x;
|
||||||
struct x_window *ret;
|
struct x_window *ret;
|
||||||
|
|
||||||
ret = calloc(1, sizeof(struct x_window));
|
ret = calloc(1, sizeof(struct x_window));
|
||||||
|
|
||||||
if (ret == NULL) OOM;
|
if (ret == NULL) OOM;
|
||||||
|
|
||||||
ret->w = XCreateSimpleWindow(x->d, DefaultRootWindow(x->d), 0, 0,
|
ret->w = XCreateSimpleWindow(x->d, DefaultRootWindow(x->d), 0, 0,
|
||||||
@@ -94,17 +93,15 @@ x_window *x_create_window(x_connection *_x, int width, int height,
|
|||||||
WhitePixel(x->d, DefaultScreen(x->d)));
|
WhitePixel(x->d, DefaultScreen(x->d)));
|
||||||
ret->width = width;
|
ret->width = width;
|
||||||
ret->height = height;
|
ret->height = height;
|
||||||
|
|
||||||
XStoreName(x->d, ret->w, title);
|
XStoreName(x->d, ret->w, title);
|
||||||
|
|
||||||
ret->p = XCreatePixmap(x->d, ret->w, width, height,
|
ret->p = XCreatePixmap(x->d, ret->w, width, height,
|
||||||
DefaultDepth(x->d, DefaultScreen(x->d)));
|
DefaultDepth(x->d, DefaultScreen(x->d)));
|
||||||
XFillRectangle(x->d, ret->p, x->colors[BACKGROUND_COLOR],
|
XFillRectangle(x->d, ret->p, x->colors[BACKGROUND_COLOR],
|
||||||
0, 0, width, height);
|
0, 0, width, height);
|
||||||
|
|
||||||
ret->xft = XftDrawCreate(x->d, ret->p,
|
ret->xft = XftDrawCreate(x->d, ret->p,
|
||||||
DefaultVisual(x->d, DefaultScreen(x->d)),
|
DefaultVisual(x->d, DefaultScreen(x->d)),
|
||||||
DefaultColormap(x->d, DefaultScreen(x->d)));
|
DefaultColormap(x->d, DefaultScreen(x->d)));
|
||||||
|
|
||||||
if (ret->xft == NULL) ERR("XftDrawCreate failed\n");
|
if (ret->xft == NULL) ERR("XftDrawCreate failed\n");
|
||||||
|
|
||||||
/* enable backing store */
|
/* enable backing store */
|
||||||
@@ -113,7 +110,6 @@ x_window *x_create_window(x_connection *_x, int width, int height,
|
|||||||
att.backing_store = Always;
|
att.backing_store = Always;
|
||||||
XChangeWindowAttributes(x->d, ret->w, CWBackingStore, &att);
|
XChangeWindowAttributes(x->d, ret->w, CWBackingStore, &att);
|
||||||
}
|
}
|
||||||
|
|
||||||
XSelectInput(x->d, ret->w,
|
XSelectInput(x->d, ret->w,
|
||||||
KeyPressMask |
|
KeyPressMask |
|
||||||
ButtonPressMask |
|
ButtonPressMask |
|
||||||
@@ -121,15 +117,12 @@ x_window *x_create_window(x_connection *_x, int width, int height,
|
|||||||
PointerMotionMask |
|
PointerMotionMask |
|
||||||
ExposureMask |
|
ExposureMask |
|
||||||
StructureNotifyMask);
|
StructureNotifyMask);
|
||||||
|
|
||||||
XMapWindow(x->d, ret->w);
|
XMapWindow(x->d, ret->w);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
x_image *x_create_image(x_connection *_x, unsigned char *data,
|
x_image *x_create_image(x_connection *_x, unsigned char *data,
|
||||||
int width, int height)
|
int width, int height) {
|
||||||
{
|
|
||||||
struct x_connection *x = _x;
|
struct x_connection *x = _x;
|
||||||
struct x_image *ret;
|
struct x_image *ret;
|
||||||
XImage *ximage;
|
XImage *ximage;
|
||||||
@@ -137,8 +130,9 @@ x_image *x_create_image(x_connection *_x, unsigned char *data,
|
|||||||
XVisualInfo template;
|
XVisualInfo template;
|
||||||
int nvs;
|
int nvs;
|
||||||
Visual *v;
|
Visual *v;
|
||||||
|
ret = calloc(1, sizeof(struct x_image));
|
||||||
|
|
||||||
ret = calloc(1, sizeof(struct x_image)); if (ret == NULL) OOM;
|
if (ret == NULL) OOM;
|
||||||
|
|
||||||
template.class = TrueColor;
|
template.class = TrueColor;
|
||||||
template.depth = 24;
|
template.depth = 24;
|
||||||
@@ -146,7 +140,6 @@ x_image *x_create_image(x_connection *_x, unsigned char *data,
|
|||||||
template.green_mask = 0x00ff00;
|
template.green_mask = 0x00ff00;
|
||||||
template.blue_mask = 0x0000ff;
|
template.blue_mask = 0x0000ff;
|
||||||
template.bits_per_rgb = 8;
|
template.bits_per_rgb = 8;
|
||||||
|
|
||||||
vs = XGetVisualInfo(x->d, VisualDepthMask | VisualClassMask |
|
vs = XGetVisualInfo(x->d, VisualDepthMask | VisualClassMask |
|
||||||
VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask |
|
VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask |
|
||||||
VisualBitsPerRGBMask, &template, &nvs);
|
VisualBitsPerRGBMask, &template, &nvs);
|
||||||
@@ -163,51 +156,49 @@ x_image *x_create_image(x_connection *_x, unsigned char *data,
|
|||||||
|
|
||||||
v = vs[0].visual;
|
v = vs[0].visual;
|
||||||
XFree(vs);
|
XFree(vs);
|
||||||
|
|
||||||
ximage = XCreateImage(x->d, v, 24, ZPixmap, 0,
|
ximage = XCreateImage(x->d, v, 24, ZPixmap, 0,
|
||||||
(char*)data, width, height, 32, 0);
|
(char *)data, width, height, 32, 0);
|
||||||
|
|
||||||
if (ximage == NULL) ERR("image creation failed\n");
|
if (ximage == NULL) ERR("image creation failed\n");
|
||||||
|
|
||||||
ret->p = XCreatePixmap(x->d, DefaultRootWindow(x->d), width, height, 24);
|
ret->p = XCreatePixmap(x->d, DefaultRootWindow(x->d), width, height, 24);
|
||||||
|
|
||||||
XPutImage(x->d, ret->p, DefaultGC(x->d, DefaultScreen(x->d)),
|
XPutImage(x->d, ret->p, DefaultGC(x->d, DefaultScreen(x->d)),
|
||||||
ximage, 0, 0, 0, 0, width, height);
|
ximage, 0, 0, 0, 0, width, height);
|
||||||
|
|
||||||
/* TODO: be sure it's fine to set data to NULL */
|
/* TODO: be sure it's fine to set data to NULL */
|
||||||
ximage->data = NULL;
|
ximage->data = NULL;
|
||||||
XDestroyImage(ximage);
|
XDestroyImage(ximage);
|
||||||
|
|
||||||
ret->width = width;
|
ret->width = width;
|
||||||
ret->height = height;
|
ret->height = height;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct toplevel_window_widget *find_x_window(struct gui *g, Window id)
|
static struct toplevel_window_widget *find_x_window(struct gui *g, Window id) {
|
||||||
{
|
|
||||||
struct widget_list *cur;
|
struct widget_list *cur;
|
||||||
struct toplevel_window_widget *w;
|
struct toplevel_window_widget *w;
|
||||||
struct x_window *xw;
|
struct x_window *xw;
|
||||||
cur = g->toplevel;
|
cur = g->toplevel;
|
||||||
|
|
||||||
while (cur) {
|
while (cur) {
|
||||||
w = (struct toplevel_window_widget *)cur->item;
|
w = (struct toplevel_window_widget *)cur->item;
|
||||||
xw = w->x;
|
xw = w->x;
|
||||||
|
|
||||||
if (xw->w == id) return w;
|
if (xw->w == id) return w;
|
||||||
|
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_events(gui *_gui)
|
void x_events(gui *_gui) {
|
||||||
{
|
|
||||||
struct gui *g = _gui;
|
struct gui *g = _gui;
|
||||||
struct widget_list *cur;
|
struct widget_list *cur;
|
||||||
struct x_connection *x = g->x;
|
struct x_connection *x = g->x;
|
||||||
struct toplevel_window_widget *w;
|
struct toplevel_window_widget *w;
|
||||||
|
|
||||||
LOGD("x_events START\n");
|
LOGD("x_events START\n");
|
||||||
/* preprocessing (to "compress" events) */
|
/* preprocessing (to "compress" events) */
|
||||||
cur = g->toplevel;
|
cur = g->toplevel;
|
||||||
|
|
||||||
while (cur) {
|
while (cur) {
|
||||||
struct x_window *xw;
|
struct x_window *xw;
|
||||||
w = (struct toplevel_window_widget *)cur->item;
|
w = (struct toplevel_window_widget *)cur->item;
|
||||||
@@ -222,6 +213,7 @@ void x_events(gui *_gui)
|
|||||||
XEvent ev;
|
XEvent ev;
|
||||||
XNextEvent(x->d, &ev);
|
XNextEvent(x->d, &ev);
|
||||||
LOGD("XEV %d\n", ev.type);
|
LOGD("XEV %d\n", ev.type);
|
||||||
|
|
||||||
switch (ev.type) {
|
switch (ev.type) {
|
||||||
case MapNotify:
|
case MapNotify:
|
||||||
case Expose:
|
case Expose:
|
||||||
@@ -229,51 +221,76 @@ void x_events(gui *_gui)
|
|||||||
struct x_window *xw = w->x;
|
struct x_window *xw = w->x;
|
||||||
xw->redraw = 1;
|
xw->redraw = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
if ((w = find_x_window(g, ev.xconfigure.window)) != NULL) {
|
if ((w = find_x_window(g, ev.xconfigure.window)) != NULL) {
|
||||||
struct x_window *xw = w->x;
|
struct x_window *xw = w->x;
|
||||||
xw->resize = 1;
|
xw->resize = 1;
|
||||||
xw->new_width = ev.xconfigure.width;
|
xw->new_width = ev.xconfigure.width;
|
||||||
xw->new_height = ev.xconfigure.height;
|
xw->new_height = ev.xconfigure.height;
|
||||||
|
|
||||||
if (xw->new_width < 10) xw->new_width = 10;
|
if (xw->new_width < 10) xw->new_width = 10;
|
||||||
|
|
||||||
if (xw->new_height < 10) xw->new_height = 10;
|
if (xw->new_height < 10) xw->new_height = 10;
|
||||||
|
|
||||||
LOGD("ConfigureNotify %d %d\n", ev.xconfigure.width, ev.xconfigure.height);
|
LOGD("ConfigureNotify %d %d\n", ev.xconfigure.width, ev.xconfigure.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
if ((w = find_x_window(g, ev.xbutton.window)) != NULL) {
|
if ((w = find_x_window(g, ev.xbutton.window)) != NULL) {
|
||||||
int key_modifiers = 0;
|
int key_modifiers = 0;
|
||||||
|
|
||||||
if (ev.xbutton.state & ShiftMask) key_modifiers |= KEY_SHIFT;
|
if (ev.xbutton.state & ShiftMask) key_modifiers |= KEY_SHIFT;
|
||||||
|
|
||||||
if (ev.xbutton.state & Mod1Mask) key_modifiers |= KEY_ALT;
|
if (ev.xbutton.state & Mod1Mask) key_modifiers |= KEY_ALT;
|
||||||
|
|
||||||
if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL;
|
if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL;
|
||||||
|
|
||||||
w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers,
|
w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers,
|
||||||
ev.xbutton.button, 0);
|
ev.xbutton.button, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
if ((w = find_x_window(g, ev.xbutton.window)) != NULL) {
|
if ((w = find_x_window(g, ev.xbutton.window)) != NULL) {
|
||||||
int key_modifiers = 0;
|
int key_modifiers = 0;
|
||||||
|
|
||||||
if (ev.xbutton.state & ShiftMask) key_modifiers |= KEY_SHIFT;
|
if (ev.xbutton.state & ShiftMask) key_modifiers |= KEY_SHIFT;
|
||||||
|
|
||||||
if (ev.xbutton.state & Mod1Mask) key_modifiers |= KEY_ALT;
|
if (ev.xbutton.state & Mod1Mask) key_modifiers |= KEY_ALT;
|
||||||
|
|
||||||
if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL;
|
if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL;
|
||||||
|
|
||||||
w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers,
|
w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers,
|
||||||
ev.xbutton.button, 1);
|
ev.xbutton.button, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (gui_logd) WARN("TODO: X event type %d\n", ev.type);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default: if (gui_logd) WARN("TODO: X event type %d\n", ev.type); break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* postprocessing */
|
/* postprocessing */
|
||||||
LOGD("post processing\n");
|
LOGD("post processing\n");
|
||||||
cur = g->toplevel;
|
cur = g->toplevel;
|
||||||
|
|
||||||
while (cur) {
|
while (cur) {
|
||||||
struct toplevel_window_widget *w =
|
struct toplevel_window_widget *w =
|
||||||
(struct toplevel_window_widget *)cur->item;
|
(struct toplevel_window_widget *)cur->item;
|
||||||
struct x_window *xw = w->x;
|
struct x_window *xw = w->x;
|
||||||
|
|
||||||
if (xw->resize) {
|
if (xw->resize) {
|
||||||
LOGD("resize old %d %d new %d %d\n", xw->width, xw->height, xw->new_width, xw->new_height);
|
LOGD("resize old %d %d new %d %d\n", xw->width, xw->height, xw->new_width, xw->new_height);
|
||||||
|
|
||||||
if (xw->width != xw->new_width || xw->height != xw->new_height) {
|
if (xw->width != xw->new_width || xw->height != xw->new_height) {
|
||||||
w->common.allocate(g, w, 0, 0, xw->new_width, xw->new_height);
|
w->common.allocate(g, w, 0, 0, xw->new_width, xw->new_height);
|
||||||
xw->width = xw->new_width;
|
xw->width = xw->new_width;
|
||||||
@@ -287,40 +304,41 @@ void x_events(gui *_gui)
|
|||||||
xw->xft = XftDrawCreate(x->d, xw->p,
|
xw->xft = XftDrawCreate(x->d, xw->p,
|
||||||
DefaultVisual(x->d, DefaultScreen(x->d)),
|
DefaultVisual(x->d, DefaultScreen(x->d)),
|
||||||
DefaultColormap(x->d, DefaultScreen(x->d)));
|
DefaultColormap(x->d, DefaultScreen(x->d)));
|
||||||
|
|
||||||
if (xw->xft == NULL) ERR("XftDrawCreate failed\n");
|
if (xw->xft == NULL) ERR("XftDrawCreate failed\n");
|
||||||
|
|
||||||
//xw->repaint = 1;
|
//xw->repaint = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xw->repaint) {
|
if (xw->repaint) {
|
||||||
w->common.paint(g, w);
|
w->common.paint(g, w);
|
||||||
xw->redraw = 1;
|
xw->redraw = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xw->redraw) {
|
if (xw->redraw) {
|
||||||
struct x_connection *x = g->x;
|
struct x_connection *x = g->x;
|
||||||
LOGD("XCopyArea w h %d %d\n", xw->width, xw->height);
|
LOGD("XCopyArea w h %d %d\n", xw->width, xw->height);
|
||||||
XCopyArea(x->d, xw->p, xw->w, x->colors[1],
|
XCopyArea(x->d, xw->p, xw->w, x->colors[1],
|
||||||
0, 0, xw->width, xw->height, 0, 0);
|
0, 0, xw->width, xw->height, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGD("x_events DONE\n");
|
LOGD("x_events DONE\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_flush(x_connection *_x)
|
void x_flush(x_connection *_x) {
|
||||||
{
|
|
||||||
struct x_connection *x = _x;
|
struct x_connection *x = _x;
|
||||||
XFlush(x->d);
|
XFlush(x->d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_text_get_dimensions(x_connection *_c, int font, const char *t,
|
void x_text_get_dimensions(x_connection *_c, int font, const char *t,
|
||||||
int *width, int *height, int *baseline)
|
int *width, int *height, int *baseline) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
XGlyphInfo ext;
|
XGlyphInfo ext;
|
||||||
|
|
||||||
XftTextExtentsUtf8(c->d, c->fonts[font], (FcChar8 *)t, strlen(t), &ext);
|
XftTextExtentsUtf8(c->d, c->fonts[font], (FcChar8 *)t, strlen(t), &ext);
|
||||||
|
|
||||||
*width = ext.width;
|
*width = ext.width;
|
||||||
*height = c->fonts[font]->height;
|
*height = c->fonts[font]->height;
|
||||||
*baseline = c->fonts[font]->ascent;
|
*baseline = c->fonts[font]->ascent;
|
||||||
@@ -331,32 +349,28 @@ void x_text_get_dimensions(x_connection *_c, int font, const char *t,
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
void x_draw_line(x_connection *_c, x_window *_w, int color,
|
void x_draw_line(x_connection *_c, x_window *_w, int color,
|
||||||
int x1, int y1, int x2, int y2)
|
int x1, int y1, int x2, int y2) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
XDrawLine(c->d, w->p, c->colors[color], x1, y1, x2, y2);
|
XDrawLine(c->d, w->p, c->colors[color], x1, y1, x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_draw_rectangle(x_connection *_c, x_window *_w, int color,
|
void x_draw_rectangle(x_connection *_c, x_window *_w, int color,
|
||||||
int x, int y, int width, int height)
|
int x, int y, int width, int height) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
XDrawRectangle(c->d, w->p, c->colors[color], x, y, width, height);
|
XDrawRectangle(c->d, w->p, c->colors[color], x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_fill_rectangle(x_connection *_c, x_window *_w, int color,
|
void x_fill_rectangle(x_connection *_c, x_window *_w, int color,
|
||||||
int x, int y, int width, int height)
|
int x, int y, int width, int height) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
XFillRectangle(c->d, w->p, c->colors[color], x, y, width, height);
|
XFillRectangle(c->d, w->p, c->colors[color], x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_draw_string(x_connection *_c, x_window *_w, int font, int color,
|
void x_draw_string(x_connection *_c, x_window *_w, int font, int color,
|
||||||
int x, int y, const char *t)
|
int x, int y, const char *t) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
int tlen = strlen(t);
|
int tlen = strlen(t);
|
||||||
@@ -366,28 +380,26 @@ void x_draw_string(x_connection *_c, x_window *_w, int font, int color,
|
|||||||
|
|
||||||
void x_draw_clipped_string(x_connection *_c, x_window *_w, int font,
|
void x_draw_clipped_string(x_connection *_c, x_window *_w, int font,
|
||||||
int color, int x, int y, const char *t,
|
int color, int x, int y, const char *t,
|
||||||
int clipx, int clipy, int clipwidth, int clipheight)
|
int clipx, int clipy, int clipwidth, int clipheight) {
|
||||||
{
|
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
|
|
||||||
XRectangle clip = { clipx, clipy, clipwidth, clipheight };
|
XRectangle clip = { clipx, clipy, clipwidth, clipheight };
|
||||||
|
|
||||||
if (XftDrawSetClipRectangles(w->xft, 0, 0, &clip, 1) == False) abort();
|
if (XftDrawSetClipRectangles(w->xft, 0, 0, &clip, 1) == False) abort();
|
||||||
|
|
||||||
x_draw_string(_c, _w, font, color, x, y, t);
|
x_draw_string(_c, _w, font, color, x, y, t);
|
||||||
|
|
||||||
if (XftDrawSetClip(w->xft, NULL) == False) abort();
|
if (XftDrawSetClip(w->xft, NULL) == False) abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_draw_image(x_connection *_c, x_window *_w, x_image *_img, int x, int y)
|
void x_draw_image(x_connection *_c, x_window *_w, x_image *_img, int x, int y) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
struct x_image *img = _img;
|
struct x_image *img = _img;
|
||||||
|
|
||||||
XCopyArea(c->d, img->p, w->p, DefaultGC(c->d, DefaultScreen(c->d)),
|
XCopyArea(c->d, img->p, w->p, DefaultGC(c->d, DefaultScreen(c->d)),
|
||||||
0, 0, img->width, img->height, x, y);
|
0, 0, img->width, img->height, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_draw(x_connection *_c, x_window *_w)
|
void x_draw(x_connection *_c, x_window *_w) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
LOGD("x_draw XCopyArea w h %d %d display %p window %d pixmap %d\n", w->width, w->height, c->d, (int)w->w, (int)w->p);
|
LOGD("x_draw XCopyArea w h %d %d display %p window %d pixmap %d\n", w->width, w->height, c->d, (int)w->w, (int)w->p);
|
||||||
@@ -397,13 +409,13 @@ void x_draw(x_connection *_c, x_window *_w)
|
|||||||
/* those two special functions are to plot many points
|
/* those two special functions are to plot many points
|
||||||
* first call x_add_point many times then x_plot_points once
|
* first call x_add_point many times then x_plot_points once
|
||||||
*/
|
*/
|
||||||
void x_add_point(x_connection *_c, int x, int y)
|
void x_add_point(x_connection *_c, int x, int y) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
|
|
||||||
if (c->pts_size == c->pts_maxsize) {
|
if (c->pts_size == c->pts_maxsize) {
|
||||||
c->pts_maxsize += 65536;
|
c->pts_maxsize += 65536;
|
||||||
c->pts = realloc(c->pts, c->pts_maxsize * sizeof(XPoint));
|
c->pts = realloc(c->pts, c->pts_maxsize * sizeof(XPoint));
|
||||||
|
|
||||||
if (c->pts == NULL) OOM;
|
if (c->pts == NULL) OOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,8 +424,7 @@ void x_add_point(x_connection *_c, int x, int y)
|
|||||||
c->pts_size++;
|
c->pts_size++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void x_plot_points(x_connection *_c, x_window *_w, int color)
|
void x_plot_points(x_connection *_c, x_window *_w, int color) {
|
||||||
{
|
|
||||||
struct x_connection *c = _c;
|
struct x_connection *c = _c;
|
||||||
LOGD("x_plot_points %d points\n", c->pts_size);
|
LOGD("x_plot_points %d points\n", c->pts_size);
|
||||||
struct x_window *w = _w;
|
struct x_window *w = _w;
|
||||||
|
|||||||
@@ -59,14 +59,11 @@ void generate_qpsk_table(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_7_5KHz(void);
|
|
||||||
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
|
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
|
||||||
ccodelte_init();
|
ccodelte_init();
|
||||||
ccodelte_init_inv();
|
ccodelte_init_inv();
|
||||||
init_dfts();
|
|
||||||
phy_generate_viterbi_tables_lte();
|
phy_generate_viterbi_tables_lte();
|
||||||
load_codinglib();
|
load_codinglib();
|
||||||
lte_sync_time_init(frame_parms);
|
|
||||||
generate_ul_ref_sigs();
|
generate_ul_ref_sigs();
|
||||||
generate_ul_ref_sigs_rx();
|
generate_ul_ref_sigs_rx();
|
||||||
generate_64qam_table();
|
generate_64qam_table();
|
||||||
@@ -76,13 +73,11 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
|
|||||||
init_unscrambling_lut();
|
init_unscrambling_lut();
|
||||||
init_scrambling_lut();
|
init_scrambling_lut();
|
||||||
//set_taus_seed(1328);
|
//set_taus_seed(1328);
|
||||||
// init_7_5KHz();
|
|
||||||
init_sss();
|
init_sss();
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_lte_top(void) {
|
void free_lte_top(void) {
|
||||||
free_codinglib();
|
free_codinglib();
|
||||||
lte_sync_time_free();
|
|
||||||
/* free_ul_ref_sigs() is called in phy_free_lte_eNB() */
|
/* free_ul_ref_sigs() is called in phy_free_lte_eNB() */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ int phy_init_RU(RU_t *ru) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
|
if (ru->function != NGFI_RRU_IF5) { // we need to do RX/TX RU processing
|
||||||
|
init_dfts();
|
||||||
init_7_5KHz();
|
init_7_5KHz();
|
||||||
LOG_I(PHY,"nb_tx %d\n",ru->nb_tx);
|
LOG_I(PHY,"nb_tx %d\n",ru->nb_tx);
|
||||||
ru->common.rxdata_7_5kHz = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
|
ru->common.rxdata_7_5kHz = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||||
@@ -661,8 +662,9 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
init_dfts();
|
||||||
init_frame_parms(&ue->frame_parms,1);
|
init_frame_parms(&ue->frame_parms,1);
|
||||||
|
lte_sync_time_init(&ue->frame_parms);
|
||||||
init_lte_top(&ue->frame_parms);
|
init_lte_top(&ue->frame_parms);
|
||||||
init_7_5KHz();
|
init_7_5KHz();
|
||||||
init_ul_hopping(&ue->frame_parms);
|
init_ul_hopping(&ue->frame_parms);
|
||||||
|
|||||||
+10
-10
@@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
#include "common/ran_context.h"
|
#include "common/ran_context.h"
|
||||||
|
|
||||||
char* namepointer_chMag ;
|
char *namepointer_chMag ;
|
||||||
char fmageren_name2[512];
|
char fmageren_name2[512];
|
||||||
char* namepointer_log2;
|
char *namepointer_log2;
|
||||||
|
|
||||||
|
|
||||||
#include "PHY/LTE_REFSIG/primary_synch.h"
|
#include "PHY/LTE_REFSIG/primary_synch.h"
|
||||||
@@ -45,7 +45,7 @@ int16_t *primary_synch2_time;
|
|||||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||||
LTE_DL_FRAME_PARMS *lte_frame_parms_g;
|
LTE_DL_FRAME_PARMS *lte_frame_parms_g;
|
||||||
#else
|
#else
|
||||||
PHY_VARS_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]={NULL};
|
PHY_VARS_UE *PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]= {NULL};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -62,10 +62,10 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
|
|||||||
|
|
||||||
|
|
||||||
#ifndef OPENAIR2
|
#ifndef OPENAIR2
|
||||||
unsigned char NB_eNB_INST=0;
|
unsigned char NB_eNB_INST=0;
|
||||||
unsigned char NB_UE_INST=0;
|
unsigned char NB_UE_INST=0;
|
||||||
unsigned char NB_RN_INST=0;
|
unsigned char NB_RN_INST=0;
|
||||||
unsigned char NB_INST=0;
|
unsigned char NB_INST=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int ULSCH_max_consecutive_errors = 20;
|
unsigned int ULSCH_max_consecutive_errors = 20;
|
||||||
@@ -134,9 +134,9 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682
|
|||||||
#ifdef OCP_FRAMEWORK
|
#ifdef OCP_FRAMEWORK
|
||||||
#include <enums.h>
|
#include <enums.h>
|
||||||
#else
|
#else
|
||||||
char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",};
|
char eNB_functions[6][20]= {"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RAU_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",};
|
||||||
char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"};
|
char eNB_timing[2][20]= {"synch_to_ext_device","synch_to_other"};
|
||||||
char ru_if_types[MAX_RU_IF_TYPES][20]={"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"};
|
char ru_if_types[MAX_RU_IF_TYPES][20]= {"local RF","IF5 RRU","IF5 Mobipass","IF4p5 RRU","IF1pp RRU"};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// lookup table for unscrambling in RX
|
/// lookup table for unscrambling in RX
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@
|
|||||||
# define __PLATFORM_TYPES_H__
|
# define __PLATFORM_TYPES_H__
|
||||||
|
|
||||||
#if !defined(NAS_NETLINK)
|
#if !defined(NAS_NETLINK)
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -42,19 +42,19 @@
|
|||||||
* let's protect potential redefinition
|
* let's protect potential redefinition
|
||||||
*/
|
*/
|
||||||
#ifndef _BOOLEAN_T_DEFINED_
|
#ifndef _BOOLEAN_T_DEFINED_
|
||||||
#define _BOOLEAN_T_DEFINED_
|
#define _BOOLEAN_T_DEFINED_
|
||||||
|
|
||||||
typedef signed char boolean_t;
|
typedef signed char boolean_t;
|
||||||
|
|
||||||
#if !defined(TRUE)
|
#if !defined(TRUE)
|
||||||
#define TRUE (boolean_t)0x01
|
#define TRUE (boolean_t)0x01
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(FALSE)
|
#if !defined(FALSE)
|
||||||
#define FALSE (boolean_t)0x00
|
#define FALSE (boolean_t)0x00
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BOOL_NOT(b) (b^TRUE)
|
#define BOOL_NOT(b) (b^TRUE)
|
||||||
|
|
||||||
#endif /* _BOOLEAN_T_DEFINED_ */
|
#endif /* _BOOLEAN_T_DEFINED_ */
|
||||||
|
|
||||||
@@ -188,19 +188,19 @@ typedef uint32_t m_tmsi_t;
|
|||||||
|
|
||||||
//Random UE identity length = 40 bits
|
//Random UE identity length = 40 bits
|
||||||
#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
|
#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
|
||||||
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
|
#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
|
||||||
#endif
|
#endif
|
||||||
#if ! defined(NOT_A_RNTI)
|
#if ! defined(NOT_A_RNTI)
|
||||||
#define NOT_A_RNTI (rnti_t)0
|
#define NOT_A_RNTI (rnti_t)0
|
||||||
#endif
|
#endif
|
||||||
#if ! defined(M_RNTI)
|
#if ! defined(M_RNTI)
|
||||||
#define M_RNTI (rnti_t)0xFFFD
|
#define M_RNTI (rnti_t)0xFFFD
|
||||||
#endif
|
#endif
|
||||||
#if ! defined(P_RNTI)
|
#if ! defined(P_RNTI)
|
||||||
#define P_RNTI (rnti_t)0xFFFE
|
#define P_RNTI (rnti_t)0xFFFE
|
||||||
#endif
|
#endif
|
||||||
#if ! defined(SI_RNTI)
|
#if ! defined(SI_RNTI)
|
||||||
#define SI_RNTI (rnti_t)0xFFFF
|
#define SI_RNTI (rnti_t)0xFFFF
|
||||||
#endif
|
#endif
|
||||||
typedef enum config_action_e {
|
typedef enum config_action_e {
|
||||||
CONFIG_ACTION_NULL = 0,
|
CONFIG_ACTION_NULL = 0,
|
||||||
@@ -225,7 +225,7 @@ typedef uint8_t ebi_t; // eps bearer id
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// may be ITTI not enabled, but type instance is useful also for OTG,
|
// may be ITTI not enabled, but type instance is useful also for OTG,
|
||||||
#if !defined(instance_t)
|
#if !defined(instance_t)
|
||||||
typedef uint16_t instance_t;
|
typedef uint16_t instance_t;
|
||||||
#endif
|
#endif
|
||||||
typedef struct protocol_ctxt_s {
|
typedef struct protocol_ctxt_s {
|
||||||
module_id_t module_id; /*!< \brief Virtualized module identifier */
|
module_id_t module_id; /*!< \brief Virtualized module identifier */
|
||||||
@@ -293,5 +293,5 @@ typedef struct protocol_ctxt_s {
|
|||||||
#define CHECK_CTXT_ARGS(CTXT_Pp)
|
#define CHECK_CTXT_ARGS(CTXT_Pp)
|
||||||
|
|
||||||
#define exit_fun(msg) exit_function(__FILE__,__FUNCTION__,__LINE__,msg)
|
#define exit_fun(msg) exit_function(__FILE__,__FUNCTION__,__LINE__,msg)
|
||||||
void exit_function(const char* file, const char* function, const int line, const char* s);
|
void exit_function(const char *file, const char *function, const int line, const char *s);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
#include "rrc_types.h"
|
#include "rrc_types.h"
|
||||||
#include "s1ap_messages_types.h"
|
#include "s1ap_messages_types.h"
|
||||||
#ifdef CMAKER
|
#ifdef CMAKER
|
||||||
#include "LTE_SystemInformationBlockType2.h"
|
#include "LTE_SystemInformationBlockType2.h"
|
||||||
#else
|
#else
|
||||||
#include "RRC/LTE/MESSAGES/LTE_SystemInformationBlockType2.h"
|
#include "RRC/LTE/MESSAGES/LTE_SystemInformationBlockType2.h"
|
||||||
#endif
|
#endif
|
||||||
#include "LTE_SL-OffsetIndicator-r12.h"
|
#include "LTE_SL-OffsetIndicator-r12.h"
|
||||||
#include "LTE_SubframeBitmapSL-r12.h"
|
#include "LTE_SubframeBitmapSL-r12.h"
|
||||||
@@ -47,19 +47,19 @@
|
|||||||
//-------------------------------------------------------------------------------------------//
|
//-------------------------------------------------------------------------------------------//
|
||||||
// Messages for RRC logging
|
// Messages for RRC logging
|
||||||
#if defined(DISABLE_ITTI_XER_PRINT)
|
#if defined(DISABLE_ITTI_XER_PRINT)
|
||||||
#include "LTE_BCCH-DL-SCH-Message.h"
|
#include "LTE_BCCH-DL-SCH-Message.h"
|
||||||
#include "LTE_DL-CCCH-Message.h"
|
#include "LTE_DL-CCCH-Message.h"
|
||||||
#include "LTE_DL-DCCH-Message.h"
|
#include "LTE_DL-DCCH-Message.h"
|
||||||
#include "LTE_UE-EUTRA-Capability.h"
|
#include "LTE_UE-EUTRA-Capability.h"
|
||||||
#include "LTE_UL-CCCH-Message.h"
|
#include "LTE_UL-CCCH-Message.h"
|
||||||
#include "LTE_UL-DCCH-Message.h"
|
#include "LTE_UL-DCCH-Message.h"
|
||||||
|
|
||||||
typedef BCCH_DL_SCH_Message_t RrcDlBcchMessage;
|
typedef BCCH_DL_SCH_Message_t RrcDlBcchMessage;
|
||||||
typedef DL_CCCH_Message_t RrcDlCcchMessage;
|
typedef DL_CCCH_Message_t RrcDlCcchMessage;
|
||||||
typedef DL_DCCH_Message_t RrcDlDcchMessage;
|
typedef DL_DCCH_Message_t RrcDlDcchMessage;
|
||||||
typedef UE_EUTRA_Capability_t RrcUeEutraCapability;
|
typedef UE_EUTRA_Capability_t RrcUeEutraCapability;
|
||||||
typedef UL_CCCH_Message_t RrcUlCcchMessage;
|
typedef UL_CCCH_Message_t RrcUlCcchMessage;
|
||||||
typedef UL_DCCH_Message_t RrcUlDcchMessage;
|
typedef UL_DCCH_Message_t RrcUlDcchMessage;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------//
|
//-------------------------------------------------------------------------------------------//
|
||||||
@@ -102,6 +102,7 @@ typedef struct RrcConfigurationReq_s {
|
|||||||
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
|
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
|
||||||
uint8_t num_plmn;
|
uint8_t num_plmn;
|
||||||
|
|
||||||
|
uint32_t rrc_inactivity_timer_thres; // for testing, maybe change later
|
||||||
|
|
||||||
paging_drx_t default_drx;
|
paging_drx_t default_drx;
|
||||||
int16_t nb_cc;
|
int16_t nb_cc;
|
||||||
@@ -124,9 +125,9 @@ typedef struct RrcConfigurationReq_s {
|
|||||||
long pucch_delta_shift[MAX_NUM_CCs];
|
long pucch_delta_shift[MAX_NUM_CCs];
|
||||||
long pucch_nRB_CQI[MAX_NUM_CCs];
|
long pucch_nRB_CQI[MAX_NUM_CCs];
|
||||||
long pucch_nCS_AN[MAX_NUM_CCs];
|
long pucch_nCS_AN[MAX_NUM_CCs];
|
||||||
//#if (LTE_RRC_VERSION < MAKE_VERSION(10, 0, 0))
|
//#if (LTE_RRC_VERSION < MAKE_VERSION(10, 0, 0))
|
||||||
long pucch_n1_AN[MAX_NUM_CCs];
|
long pucch_n1_AN[MAX_NUM_CCs];
|
||||||
//#endif
|
//#endif
|
||||||
long pdsch_referenceSignalPower[MAX_NUM_CCs];
|
long pdsch_referenceSignalPower[MAX_NUM_CCs];
|
||||||
long pdsch_p_b[MAX_NUM_CCs];
|
long pdsch_p_b[MAX_NUM_CCs];
|
||||||
long pusch_n_SB[MAX_NUM_CCs];
|
long pusch_n_SB[MAX_NUM_CCs];
|
||||||
@@ -188,7 +189,7 @@ typedef struct RrcConfigurationReq_s {
|
|||||||
LTE_SL_OffsetIndicator_r12_PR rxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
|
LTE_SL_OffsetIndicator_r12_PR rxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
|
||||||
long rxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
|
long rxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
|
||||||
LTE_SubframeBitmapSL_r12_PR rxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
|
LTE_SubframeBitmapSL_r12_PR rxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
|
||||||
char* rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
char *rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
||||||
long rxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
long rxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
||||||
long rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
long rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
||||||
|
|
||||||
@@ -204,7 +205,7 @@ typedef struct RrcConfigurationReq_s {
|
|||||||
LTE_SL_OffsetIndicator_r12_PR discRxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
|
LTE_SL_OffsetIndicator_r12_PR discRxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
|
||||||
long discRxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
|
long discRxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
|
||||||
LTE_SubframeBitmapSL_r12_PR discRxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
|
LTE_SubframeBitmapSL_r12_PR discRxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
|
||||||
char* discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
char *discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
||||||
long discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
long discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
||||||
long discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
long discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
||||||
//for discRxPoolPS
|
//for discRxPoolPS
|
||||||
@@ -218,7 +219,7 @@ typedef struct RrcConfigurationReq_s {
|
|||||||
LTE_SL_OffsetIndicator_r12_PR discRxPoolPS_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
|
LTE_SL_OffsetIndicator_r12_PR discRxPoolPS_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
|
||||||
long discRxPoolPS_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
|
long discRxPoolPS_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
|
||||||
LTE_SubframeBitmapSL_r12_PR discRxPoolPS_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
|
LTE_SubframeBitmapSL_r12_PR discRxPoolPS_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
|
||||||
char* discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
char *discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
||||||
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
||||||
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
||||||
} RrcConfigurationReq;
|
} RrcConfigurationReq;
|
||||||
|
|||||||
+214
-36
@@ -36,13 +36,13 @@
|
|||||||
#include "UTIL/OTG/otg.h"
|
#include "UTIL/OTG/otg.h"
|
||||||
#include "UTIL/OTG/otg_externs.h"
|
#include "UTIL/OTG/otg_externs.h"
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
#include "intertask_interface.h"
|
#include "intertask_interface.h"
|
||||||
#if defined(ENABLE_USE_MME)
|
#if defined(ENABLE_USE_MME)
|
||||||
#include "s1ap_eNB.h"
|
#include "s1ap_eNB.h"
|
||||||
#include "sctp_eNB_task.h"
|
#include "sctp_eNB_task.h"
|
||||||
#else
|
#else
|
||||||
#define EPC_MODE_ENABLED 0
|
#define EPC_MODE_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include "sctp_default_values.h"
|
#include "sctp_default_values.h"
|
||||||
#include "LTE_SystemInformationBlockType2.h"
|
#include "LTE_SystemInformationBlockType2.h"
|
||||||
@@ -60,6 +60,8 @@
|
|||||||
#include "RRC_config_tools.h"
|
#include "RRC_config_tools.h"
|
||||||
#include "enb_paramdef.h"
|
#include "enb_paramdef.h"
|
||||||
|
|
||||||
|
#define RRC_INACTIVITY_THRESH 0
|
||||||
|
|
||||||
extern uint16_t sf_ahead;
|
extern uint16_t sf_ahead;
|
||||||
extern void set_parallel_conf(char *parallel_conf);
|
extern void set_parallel_conf(char *parallel_conf);
|
||||||
extern void set_worker_conf(char *worker_conf);
|
extern void set_worker_conf(char *worker_conf);
|
||||||
@@ -581,8 +583,9 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
|
|||||||
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
|
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
|
||||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||||
|
|
||||||
|
RRC_CONFIGURATION_REQ (msg_p).rrc_inactivity_timer_thres = RRC_INACTIVITY_THRESH; // set to 0 to deactivate
|
||||||
RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id;
|
RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id;
|
||||||
RRC_CONFIGURATION_REQ(msg_p).tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
|
RRC_CONFIGURATION_REQ (msg_p).tac = *ENBParamList.paramarray[i][ENB_TRACKING_AREA_CODE_IDX].uptr;
|
||||||
AssertFatal(!ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
|
AssertFatal(!ENBParamList.paramarray[i][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
|
||||||
&& !ENBParamList.paramarray[i][ENB_MOBILE_NETWORK_CODE_IDX_OLD].strptr,
|
&& !ENBParamList.paramarray[i][ENB_MOBILE_NETWORK_CODE_IDX_OLD].strptr,
|
||||||
"It seems that you use an old configuration file. Please change the existing\n"
|
"It seems that you use an old configuration file. Please change the existing\n"
|
||||||
@@ -2043,37 +2046,162 @@ int RCconfig_gtpu(void ) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
/*
|
||||||
int j,k = 0;
|
* Configure the s1ap_register_enb_req in itti message for future
|
||||||
int enb_id;
|
* communications between eNB(s) and MME.
|
||||||
int32_t my_int;
|
*/
|
||||||
|
int RCconfig_S1(
|
||||||
|
MessageDef *msg_p,
|
||||||
|
uint32_t i)
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
int enb_id = 0;
|
||||||
|
int32_t my_int = 0;
|
||||||
const char *active_enb[MAX_ENB];
|
const char *active_enb[MAX_ENB];
|
||||||
char *address = NULL;
|
char *address = NULL;
|
||||||
char *cidr = NULL;
|
char *cidr = NULL;
|
||||||
|
/*------------------------------------------------------------------------------*/
|
||||||
|
/*
|
||||||
|
* the only reason for all these variables is, that they are "hard-encoded" into
|
||||||
|
* the CCPARAMS_DESC macro and we need it for the default_DRX value ...
|
||||||
|
*/
|
||||||
|
char *frame_type = NULL;
|
||||||
|
int32_t tdd_config = 0;
|
||||||
|
int32_t tdd_config_s = 0;
|
||||||
|
char *prefix_type = NULL;
|
||||||
|
char *pbch_repetition = NULL;
|
||||||
|
int32_t eutra_band = 0;
|
||||||
|
long long int downlink_frequency = 0;
|
||||||
|
int32_t uplink_frequency_offset = 0;
|
||||||
|
int32_t Nid_cell = 0;
|
||||||
|
int32_t Nid_cell_mbsfn = 0;
|
||||||
|
int32_t N_RB_DL = 0;
|
||||||
|
int32_t nb_antenna_ports = 0;
|
||||||
|
int32_t prach_root = 0;
|
||||||
|
int32_t prach_config_index = 0;
|
||||||
|
char *prach_high_speed = NULL;
|
||||||
|
int32_t prach_zero_correlation = 0;
|
||||||
|
int32_t prach_freq_offset = 0;
|
||||||
|
int32_t pucch_delta_shift = 0;
|
||||||
|
int32_t pucch_nRB_CQI = 0;
|
||||||
|
int32_t pucch_nCS_AN = 0;
|
||||||
|
int32_t pucch_n1_AN = 0;
|
||||||
|
int32_t pdsch_referenceSignalPower = 0;
|
||||||
|
int32_t pdsch_p_b = 0;
|
||||||
|
int32_t pusch_n_SB = 0;
|
||||||
|
char *pusch_hoppingMode = NULL;
|
||||||
|
int32_t pusch_hoppingOffset = 0;
|
||||||
|
char *pusch_enable64QAM = NULL;
|
||||||
|
char *pusch_groupHoppingEnabled = NULL;
|
||||||
|
int32_t pusch_groupAssignment = 0;
|
||||||
|
char *pusch_sequenceHoppingEnabled = NULL;
|
||||||
|
int32_t pusch_nDMRS1 = 0;
|
||||||
|
char *phich_duration = NULL;
|
||||||
|
char *phich_resource = NULL;
|
||||||
|
char *srs_enable = NULL;
|
||||||
|
int32_t srs_BandwidthConfig = 0;
|
||||||
|
int32_t srs_SubframeConfig = 0;
|
||||||
|
char *srs_ackNackST = NULL;
|
||||||
|
char *srs_MaxUpPts = NULL;
|
||||||
|
int32_t pusch_p0_Nominal = 0;
|
||||||
|
char *pusch_alpha = NULL;
|
||||||
|
int32_t pucch_p0_Nominal = 0;
|
||||||
|
int32_t msg3_delta_Preamble = 0;
|
||||||
|
char *pucch_deltaF_Format1 = NULL;
|
||||||
|
char *pucch_deltaF_Format1b = NULL;
|
||||||
|
char *pucch_deltaF_Format2 = NULL;
|
||||||
|
char *pucch_deltaF_Format2a = NULL;
|
||||||
|
char *pucch_deltaF_Format2b = NULL;
|
||||||
|
int32_t rach_numberOfRA_Preambles = 0;
|
||||||
|
char *rach_preamblesGroupAConfig = NULL;
|
||||||
|
int32_t rach_sizeOfRA_PreamblesGroupA = 0;
|
||||||
|
int32_t rach_messageSizeGroupA = 0;
|
||||||
|
char *rach_messagePowerOffsetGroupB = NULL;
|
||||||
|
int32_t rach_powerRampingStep = 0;
|
||||||
|
int32_t rach_preambleInitialReceivedTargetPower = 0;
|
||||||
|
int32_t rach_preambleTransMax = 0;
|
||||||
|
int32_t rach_raResponseWindowSize = 10;
|
||||||
|
int32_t rach_macContentionResolutionTimer = 0;
|
||||||
|
int32_t rach_maxHARQ_Msg3Tx = 0;
|
||||||
|
int32_t pcch_defaultPagingCycle = 0;
|
||||||
|
char *pcch_nB = NULL;
|
||||||
|
int32_t bcch_modificationPeriodCoeff = 0;
|
||||||
|
int32_t ue_TimersAndConstants_t300 = 0;
|
||||||
|
int32_t ue_TimersAndConstants_t301 = 0;
|
||||||
|
int32_t ue_TimersAndConstants_t310 = 0;
|
||||||
|
int32_t ue_TimersAndConstants_t311 = 0;
|
||||||
|
int32_t ue_TimersAndConstants_n310 = 0;
|
||||||
|
int32_t ue_TimersAndConstants_n311 = 0;
|
||||||
|
int32_t ue_TransmissionMode = 0;
|
||||||
|
int32_t ue_multiple_max = 0;
|
||||||
|
//TTN - for D2D
|
||||||
|
//SIB18
|
||||||
|
const char *rxPool_sc_CP_Len = NULL;
|
||||||
|
const char *rxPool_sc_Period = NULL;
|
||||||
|
const char *rxPool_data_CP_Len = NULL;
|
||||||
|
libconfig_int rxPool_ResourceConfig_prb_Num = 0;
|
||||||
|
libconfig_int rxPool_ResourceConfig_prb_Start = 0;
|
||||||
|
libconfig_int rxPool_ResourceConfig_prb_End = 0;
|
||||||
|
const char *rxPool_ResourceConfig_offsetIndicator_present = NULL;
|
||||||
|
libconfig_int rxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||||
|
const char *rxPool_ResourceConfig_subframeBitmap_present = NULL;
|
||||||
|
char *rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = NULL;
|
||||||
|
libconfig_int rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 0;
|
||||||
|
libconfig_int rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||||
|
//SIB19
|
||||||
|
//For discRxPool
|
||||||
|
const char *discRxPool_cp_Len = NULL;
|
||||||
|
const char *discRxPool_discPeriod = NULL;
|
||||||
|
libconfig_int discRxPool_numRetx = 0;
|
||||||
|
libconfig_int discRxPool_numRepetition = 0;
|
||||||
|
libconfig_int discRxPool_ResourceConfig_prb_Num = 0;
|
||||||
|
libconfig_int discRxPool_ResourceConfig_prb_Start = 0;
|
||||||
|
libconfig_int discRxPool_ResourceConfig_prb_End = 0;
|
||||||
|
const char *discRxPool_ResourceConfig_offsetIndicator_present = NULL;
|
||||||
|
libconfig_int discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||||
|
const char *discRxPool_ResourceConfig_subframeBitmap_present = NULL;
|
||||||
|
char *discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = NULL;
|
||||||
|
libconfig_int discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 0;
|
||||||
|
libconfig_int discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||||
|
//For discRxPoolPS
|
||||||
|
const char *discRxPoolPS_cp_Len = NULL;
|
||||||
|
const char *discRxPoolPS_discPeriod = NULL;
|
||||||
|
libconfig_int discRxPoolPS_numRetx = 0;
|
||||||
|
libconfig_int discRxPoolPS_numRepetition = 0;
|
||||||
|
libconfig_int discRxPoolPS_ResourceConfig_prb_Num = 0;
|
||||||
|
libconfig_int discRxPoolPS_ResourceConfig_prb_Start = 0;
|
||||||
|
libconfig_int discRxPoolPS_ResourceConfig_prb_End = 0;
|
||||||
|
const char *discRxPoolPS_ResourceConfig_offsetIndicator_present = NULL;
|
||||||
|
libconfig_int discRxPoolPS_ResourceConfig_offsetIndicator_choice = 0;
|
||||||
|
const char *discRxPoolPS_ResourceConfig_subframeBitmap_present = NULL;
|
||||||
|
char *discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf = NULL;
|
||||||
|
libconfig_int discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size = 0;
|
||||||
|
libconfig_int discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||||
|
/*------------------------------------------------------------------------------*/
|
||||||
// for no gcc warnings
|
// for no gcc warnings
|
||||||
(void)my_int;
|
(void)my_int;
|
||||||
memset((char *)active_enb, 0, MAX_ENB * sizeof(char *));
|
memset((char *)active_enb, 0, MAX_ENB * sizeof(char *));
|
||||||
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
|
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
|
||||||
paramdef_t ENBParams[] = ENBPARAMS_DESC;
|
paramdef_t ENBParams[] = ENBPARAMS_DESC;
|
||||||
paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST,NULL,0};
|
paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST, NULL, 0};
|
||||||
/* get global parameters, defined outside any section in the config file */
|
/* get global parameters, defined outside any section in the config file */
|
||||||
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
|
config_get(ENBSParams, sizeof(ENBSParams)/sizeof(paramdef_t), NULL);
|
||||||
AssertFatal (i<ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt,
|
AssertFatal (i < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt,
|
||||||
"Failed to parse config file %s, %uth attribute %s \n",
|
"Failed to parse config file %s, %uth attribute %s \n",
|
||||||
RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
|
RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
|
||||||
|
|
||||||
if (ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt>0) {
|
if (ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt > 0) {
|
||||||
// Output a list of all eNBs.
|
// Output a list of all eNBs.
|
||||||
config_getlist( &ENBParamList,ENBParams,sizeof(ENBParams)/sizeof(paramdef_t),NULL);
|
config_getlist(&ENBParamList, ENBParams, sizeof(ENBParams)/sizeof(paramdef_t), NULL);
|
||||||
|
|
||||||
if (ENBParamList.numelt > 0) {
|
if (ENBParamList.numelt > 0) {
|
||||||
for (k = 0; k < ENBParamList.numelt; k++) {
|
for (int k = 0; k < ENBParamList.numelt; k++) {
|
||||||
if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) {
|
if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) {
|
||||||
// Calculate a default eNB ID
|
// Calculate a default eNB ID
|
||||||
if (EPC_MODE_ENABLED) {
|
if (EPC_MODE_ENABLED) {
|
||||||
uint32_t hash;
|
uint32_t hash = 0;
|
||||||
hash = s1ap_generate_eNB_id ();
|
hash = s1ap_generate_eNB_id();
|
||||||
enb_id = k + (hash & 0xFFFF8);
|
enb_id = k + (hash & 0xFFFF8);
|
||||||
} else {
|
} else {
|
||||||
enb_id = k;
|
enb_id = k;
|
||||||
@@ -2083,22 +2211,31 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// search if in active list
|
// search if in active list
|
||||||
for (j=0; j < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; j++) {
|
for (int j = 0; j < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; j++) {
|
||||||
if (strcmp(ENBSParams[ENB_ACTIVE_ENBS_IDX].strlistptr[j], *(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr)) == 0) {
|
if (strcmp(ENBSParams[ENB_ACTIVE_ENBS_IDX].strlistptr[j], *(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr)) == 0) {
|
||||||
paramdef_t PLMNParams[] = PLMNPARAMS_DESC;
|
paramdef_t PLMNParams[] = PLMNPARAMS_DESC;
|
||||||
paramlist_def_t PLMNParamList = {ENB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
paramlist_def_t PLMNParamList = {ENB_CONFIG_STRING_PLMN_LIST, NULL, 0};
|
||||||
|
paramdef_t CCsParams[] = CCPARAMS_DESC;
|
||||||
|
/* map parameter checking array instances to parameter definition array instances */
|
||||||
|
checkedparam_t config_check_CCparams[] = CCPARAMS_CHECK;
|
||||||
|
|
||||||
|
for (int I = 0; I < (sizeof(CCsParams) / sizeof(paramdef_t)); I++) {
|
||||||
|
CCsParams[I].chkPptr = &(config_check_CCparams[I]);
|
||||||
|
}
|
||||||
|
|
||||||
/* map parameter checking array instances to parameter definition array instances */
|
/* map parameter checking array instances to parameter definition array instances */
|
||||||
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
|
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
|
||||||
|
|
||||||
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
|
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I) {
|
||||||
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
|
||||||
|
}
|
||||||
|
|
||||||
paramdef_t S1Params[] = S1PARAMS_DESC;
|
paramdef_t S1Params[] = S1PARAMS_DESC;
|
||||||
paramlist_def_t S1ParamList = {ENB_CONFIG_STRING_MME_IP_ADDRESS,NULL,0};
|
paramlist_def_t S1ParamList = {ENB_CONFIG_STRING_MME_IP_ADDRESS, NULL, 0};
|
||||||
paramdef_t SCTPParams[] = SCTPPARAMS_DESC;
|
paramdef_t SCTPParams[] = SCTPPARAMS_DESC;
|
||||||
paramdef_t NETParams[] = NETPARAMS_DESC;
|
paramdef_t NETParams[] = NETPARAMS_DESC;
|
||||||
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
char aprefix[MAX_OPTNAME_SIZE*2 + 8];
|
||||||
sprintf(aprefix,"%s.[%i]",ENB_CONFIG_STRING_ENB_LIST,k);
|
sprintf(aprefix, "%s.[%i]", ENB_CONFIG_STRING_ENB_LIST, k);
|
||||||
S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = enb_id;
|
S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = enb_id;
|
||||||
|
|
||||||
if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_MACRO_ENB") == 0) {
|
if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_MACRO_ENB") == 0) {
|
||||||
@@ -2106,9 +2243,11 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
} else if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_HOME_ENB") == 0) {
|
} else if (strcmp(*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr), "CELL_HOME_ENB") == 0) {
|
||||||
S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB;
|
S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB;
|
||||||
} else {
|
} else {
|
||||||
AssertFatal (0,
|
AssertFatal(0,
|
||||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
|
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
|
||||||
RC.config_file_name, i, *(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr));
|
RC.config_file_name,
|
||||||
|
i,
|
||||||
|
*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(*(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr));
|
S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(*(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr));
|
||||||
@@ -2124,9 +2263,10 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
|
" plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } )\n");
|
||||||
config_getlist(&PLMNParamList, PLMNParams, sizeof(PLMNParams)/sizeof(paramdef_t), aprefix);
|
config_getlist(&PLMNParamList, PLMNParams, sizeof(PLMNParams)/sizeof(paramdef_t), aprefix);
|
||||||
|
|
||||||
if (PLMNParamList.numelt < 1 || PLMNParamList.numelt > 6)
|
if (PLMNParamList.numelt < 1 || PLMNParamList.numelt > 6) {
|
||||||
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
||||||
PLMNParamList.numelt);
|
PLMNParamList.numelt);
|
||||||
|
}
|
||||||
|
|
||||||
S1AP_REGISTER_ENB_REQ(msg_p).num_plmn = PLMNParamList.numelt;
|
S1AP_REGISTER_ENB_REQ(msg_p).num_plmn = PLMNParamList.numelt;
|
||||||
|
|
||||||
@@ -2140,8 +2280,48 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
S1AP_REGISTER_ENB_REQ(msg_p).mnc[l]);
|
S1AP_REGISTER_ENB_REQ(msg_p).mnc[l]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Default DRX param */
|
||||||
|
/*
|
||||||
|
* Here we get the config of the first CC, since the s1ap_register_enb_req_t doesn't support multiple CC.
|
||||||
|
* There is a unique value of defaultPagingCycle per eNB (same for multiple cells).
|
||||||
|
* Hence, it should be stated somewhere that the value should be the same for every CC, or put the value outside the CC
|
||||||
|
* in the conf file.
|
||||||
|
*/
|
||||||
|
sprintf(aprefix, "%s.[%i].%s.[%i]", ENB_CONFIG_STRING_ENB_LIST, k, ENB_CONFIG_STRING_COMPONENT_CARRIERS, 0);
|
||||||
|
config_get(CCsParams, sizeof(CCsParams)/sizeof(paramdef_t), aprefix);
|
||||||
|
|
||||||
|
switch (pcch_defaultPagingCycle) {
|
||||||
|
case 32: {
|
||||||
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 0;
|
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 0;
|
||||||
config_getlist( &S1ParamList,S1Params,sizeof(S1Params)/sizeof(paramdef_t),aprefix);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 64: {
|
||||||
|
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 128: {
|
||||||
|
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 256: {
|
||||||
|
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
LOG_E(S1AP, "Default I-DRX value in conf file is invalid (%i). Should be 32, 64, 128 or 256. \
|
||||||
|
Default DRX set to 32 in MME configuration\n",
|
||||||
|
pcch_defaultPagingCycle);
|
||||||
|
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* MME connection params */
|
||||||
|
sprintf(aprefix, "%s.[%i]", ENB_CONFIG_STRING_ENB_LIST, k);
|
||||||
|
config_getlist(&S1ParamList, S1Params, sizeof(S1Params)/sizeof(paramdef_t), aprefix);
|
||||||
S1AP_REGISTER_ENB_REQ (msg_p).nb_mme = 0;
|
S1AP_REGISTER_ENB_REQ (msg_p).nb_mme = 0;
|
||||||
|
|
||||||
for (int l = 0; l < S1ParamList.numelt; l++) {
|
for (int l = 0; l < S1ParamList.numelt; l++) {
|
||||||
@@ -2158,10 +2338,11 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[l].ipv6 = 1;
|
S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[l].ipv6 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (S1ParamList.paramarray[l][ENB_MME_BROADCAST_PLMN_INDEX].iptr)
|
if (S1ParamList.paramarray[l][ENB_MME_BROADCAST_PLMN_INDEX].iptr) {
|
||||||
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = S1ParamList.paramarray[l][ENB_MME_BROADCAST_PLMN_INDEX].numelt;
|
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = S1ParamList.paramarray[l][ENB_MME_BROADCAST_PLMN_INDEX].numelt;
|
||||||
else
|
} else {
|
||||||
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = 0;
|
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
AssertFatal(S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] <= S1AP_REGISTER_ENB_REQ(msg_p).num_plmn,
|
AssertFatal(S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] <= S1AP_REGISTER_ENB_REQ(msg_p).num_plmn,
|
||||||
"List of broadcast PLMN to be sent to MME can not be longer than actual "
|
"List of broadcast PLMN to be sent to MME can not be longer than actual "
|
||||||
@@ -2183,10 +2364,11 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
if (S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] == 0) {
|
if (S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] == 0) {
|
||||||
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = S1AP_REGISTER_ENB_REQ(msg_p).num_plmn;
|
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_num[l] = S1AP_REGISTER_ENB_REQ(msg_p).num_plmn;
|
||||||
|
|
||||||
for (int el = 0; el < S1AP_REGISTER_ENB_REQ(msg_p).num_plmn; ++el)
|
for (int el = 0; el < S1AP_REGISTER_ENB_REQ(msg_p).num_plmn; ++el) {
|
||||||
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_index[l][el] = el;
|
S1AP_REGISTER_ENB_REQ(msg_p).broadcast_plmn_index[l][el] = el;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// SCTP SETTING
|
// SCTP SETTING
|
||||||
S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
|
S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
|
||||||
@@ -2202,7 +2384,6 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) {
|
|||||||
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||||
// NETWORK_INTERFACES
|
// NETWORK_INTERFACES
|
||||||
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
|
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
|
||||||
// S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U);
|
|
||||||
cidr = *(NETParams[ENB_IPV4_ADDRESS_FOR_S1_MME_IDX].strptr);
|
cidr = *(NETParams[ENB_IPV4_ADDRESS_FOR_S1_MME_IDX].strptr);
|
||||||
address = strtok(cidr, "/");
|
address = strtok(cidr, "/");
|
||||||
S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0;
|
S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0;
|
||||||
@@ -2392,10 +2573,8 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
|||||||
|| X2AP_REGISTER_ENB_REQ(msg_p).mnc < 100,
|
|| X2AP_REGISTER_ENB_REQ(msg_p).mnc < 100,
|
||||||
"MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n",
|
"MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n",
|
||||||
X2AP_REGISTER_ENB_REQ(msg_p).mnc);
|
X2AP_REGISTER_ENB_REQ(msg_p).mnc);
|
||||||
|
|
||||||
/* CC params */
|
/* CC params */
|
||||||
config_getlist(&CCsParamList, NULL, 0, aprefix);
|
config_getlist(&CCsParamList, NULL, 0, aprefix);
|
||||||
|
|
||||||
X2AP_REGISTER_ENB_REQ (msg_p).num_cc = CCsParamList.numelt;
|
X2AP_REGISTER_ENB_REQ (msg_p).num_cc = CCsParamList.numelt;
|
||||||
|
|
||||||
if (CCsParamList.numelt > 0) {
|
if (CCsParamList.numelt > 0) {
|
||||||
@@ -2442,7 +2621,6 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
|||||||
AssertFatal(X2ParamList.numelt <= X2AP_MAX_NB_ENB_IP_ADDRESS,
|
AssertFatal(X2ParamList.numelt <= X2AP_MAX_NB_ENB_IP_ADDRESS,
|
||||||
"value of X2ParamList.numelt %d must be lower than X2AP_MAX_NB_ENB_IP_ADDRESS %d value: reconsider to increase X2AP_MAX_NB_ENB_IP_ADDRESS\n",
|
"value of X2ParamList.numelt %d must be lower than X2AP_MAX_NB_ENB_IP_ADDRESS %d value: reconsider to increase X2AP_MAX_NB_ENB_IP_ADDRESS\n",
|
||||||
X2ParamList.numelt,X2AP_MAX_NB_ENB_IP_ADDRESS);
|
X2ParamList.numelt,X2AP_MAX_NB_ENB_IP_ADDRESS);
|
||||||
|
|
||||||
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 = 0;
|
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 = 0;
|
||||||
|
|
||||||
for (l = 0; l < X2ParamList.numelt; l++) {
|
for (l = 0; l < X2ParamList.numelt; l++) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2272,8 +2272,7 @@ uint8_t get_tmode(module_id_t module_idP, int CC_idP, int UE_idP)
|
|||||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||||
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
|
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
|
||||||
|
|
||||||
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated =
|
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated = eNB->UE_list.physicalConfigDedicated[CC_idP][UE_idP];
|
||||||
eNB->UE_list.physicalConfigDedicated[CC_idP][UE_idP];
|
|
||||||
|
|
||||||
if (physicalConfigDedicated == NULL) { // RRCConnectionSetup not received by UE yet
|
if (physicalConfigDedicated == NULL) { // RRCConnectionSetup not received by UE yet
|
||||||
AssertFatal(cc->p_eNB <= 2, "p_eNB is %d, should be <2\n",
|
AssertFatal(cc->p_eNB <= 2, "p_eNB is %d, should be <2\n",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
* this work for additional information regarding copyright ownership.
|
* this work for additional information regarding copyright ownership.
|
||||||
@@ -1070,8 +1070,7 @@ typedef struct {
|
|||||||
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/
|
/*! \brief UE list used by eNB to order UEs/CC for scheduling*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/// Dedicated information for UEs
|
/// Dedicated information for UEs
|
||||||
struct PhysicalConfigDedicated
|
LTE_PhysicalConfigDedicated_t *physicalConfigDedicated[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
||||||
*physicalConfigDedicated[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
|
|
||||||
/// DLSCH pdu
|
/// DLSCH pdu
|
||||||
DLSCH_PDU DLSCH_pdu[NFAPI_CC_MAX][2][MAX_MOBILES_PER_ENB];
|
DLSCH_PDU DLSCH_pdu[NFAPI_CC_MAX][2][MAX_MOBILES_PER_ENB];
|
||||||
/// DCI template and MAC connection parameters for UEs
|
/// DCI template and MAC connection parameters for UEs
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#include "common/ran_context.h"
|
#include "common/ran_context.h"
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
# include "intertask_interface.h"
|
#include "intertask_interface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "flexran_agent_extern.h"
|
#include "flexran_agent_extern.h"
|
||||||
@@ -54,7 +54,7 @@ mac_rrc_data_req(
|
|||||||
const frame_t frameP,
|
const frame_t frameP,
|
||||||
const rb_id_t Srb_id,
|
const rb_id_t Srb_id,
|
||||||
const uint8_t Nb_tb,
|
const uint8_t Nb_tb,
|
||||||
uint8_t* const buffer_pP,
|
uint8_t *const buffer_pP,
|
||||||
const uint8_t mbsfn_sync_area
|
const uint8_t mbsfn_sync_area
|
||||||
)
|
)
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@@ -64,7 +64,6 @@ mac_rrc_data_req(
|
|||||||
uint8_t Sdu_size = 0;
|
uint8_t Sdu_size = 0;
|
||||||
uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
|
uint8_t sfn = (uint8_t)((frameP>>2)&0xff);
|
||||||
|
|
||||||
|
|
||||||
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
|
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
|
||||||
LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
|
LOG_D(RRC,"[eNB %d] mac_rrc_data_req to SRB ID=%d\n",Mod_idP,Srb_id);
|
||||||
}
|
}
|
||||||
@@ -72,8 +71,6 @@ mac_rrc_data_req(
|
|||||||
eNB_RRC_INST *rrc;
|
eNB_RRC_INST *rrc;
|
||||||
rrc_eNB_carrier_data_t *carrier;
|
rrc_eNB_carrier_data_t *carrier;
|
||||||
LTE_BCCH_BCH_Message_t *mib;
|
LTE_BCCH_BCH_Message_t *mib;
|
||||||
|
|
||||||
|
|
||||||
rrc = RC.rrc[Mod_idP];
|
rrc = RC.rrc[Mod_idP];
|
||||||
carrier = &rrc->carrier[0];
|
carrier = &rrc->carrier[0];
|
||||||
mib = &carrier->mib;
|
mib = &carrier->mib;
|
||||||
@@ -118,17 +115,18 @@ mac_rrc_data_req(
|
|||||||
|
|
||||||
LOG_T(RRC,"\n");
|
LOG_T(RRC,"\n");
|
||||||
} /* LOG_DEBUGFLAG(DEBUG_RRC) */
|
} /* LOG_DEBUGFLAG(DEBUG_RRC) */
|
||||||
|
|
||||||
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
|
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
|
||||||
} else {
|
} else {
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( (Srb_id & RAB_OFFSET ) == MIBCH) {
|
|
||||||
|
|
||||||
|
if( (Srb_id & RAB_OFFSET ) == MIBCH) {
|
||||||
mib->message.systemFrameNumber.buf = &sfn;
|
mib->message.systemFrameNumber.buf = &sfn;
|
||||||
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_BCH_Message,
|
enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_BCCH_BCH_Message,
|
||||||
NULL,
|
NULL,
|
||||||
(void*)mib,
|
(void *)mib,
|
||||||
carrier->MIB,
|
carrier->MIB,
|
||||||
24);
|
24);
|
||||||
LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded);
|
LOG_D(RRC,"Encoded MIB for frame %d (%p), bits %lu\n",sfn,carrier->MIB,enc_rval.encoded);
|
||||||
@@ -153,7 +151,6 @@ mac_rrc_data_req(
|
|||||||
// check if data is there for MAC
|
// check if data is there for MAC
|
||||||
if(Srb_info->Tx_buffer.payload_size>0) { //Fill buffer
|
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);
|
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);
|
||||||
|
|
||||||
memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size);
|
memcpy(buffer_pP,Srb_info->Tx_buffer.Payload,Srb_info->Tx_buffer.payload_size);
|
||||||
Sdu_size = Srb_info->Tx_buffer.payload_size;
|
Sdu_size = Srb_info->Tx_buffer.payload_size;
|
||||||
Srb_info->Tx_buffer.payload_size=0;
|
Srb_info->Tx_buffer.payload_size=0;
|
||||||
@@ -169,7 +166,6 @@ mac_rrc_data_req(
|
|||||||
if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer
|
if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] > 0) { //Fill buffer
|
||||||
LOG_D(RRC,"[eNB %d] PCCH (%p) has %d bytes\n",Mod_idP,&RC.rrc[Mod_idP]->carrier[CC_id].paging[mbsfn_sync_area],
|
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]);
|
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area]);
|
||||||
|
|
||||||
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]);
|
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];
|
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;
|
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_paging[mbsfn_sync_area] = 0;
|
||||||
@@ -203,16 +199,16 @@ mac_rrc_data_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
#endif // #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
|
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){
|
|
||||||
|
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR) {
|
||||||
memcpy(&buffer_pP[0],
|
memcpy(&buffer_pP[0],
|
||||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
|
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
|
||||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
|
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
|
||||||
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
|
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3
|
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR) { // First SI message with SIB2/3
|
||||||
memcpy(&buffer_pP[0],
|
memcpy(&buffer_pP[0],
|
||||||
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
|
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
|
||||||
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
|
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
|
||||||
@@ -220,8 +216,6 @@ mac_rrc_data_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,7 +228,7 @@ mac_rrc_data_ind(
|
|||||||
const sub_frame_t sub_frameP,
|
const sub_frame_t sub_frameP,
|
||||||
const rnti_t rntiP,
|
const rnti_t rntiP,
|
||||||
const rb_id_t srb_idP,
|
const rb_id_t srb_idP,
|
||||||
const uint8_t* sduP,
|
const uint8_t *sduP,
|
||||||
const sdu_size_t sdu_lenP,
|
const sdu_size_t sdu_lenP,
|
||||||
const uint8_t mbsfn_sync_areaP
|
const uint8_t mbsfn_sync_areaP
|
||||||
)
|
)
|
||||||
@@ -243,10 +237,8 @@ mac_rrc_data_ind(
|
|||||||
SRB_INFO *Srb_info;
|
SRB_INFO *Srb_info;
|
||||||
protocol_ctxt_t ctxt;
|
protocol_ctxt_t ctxt;
|
||||||
sdu_size_t sdu_size = 0;
|
sdu_size_t sdu_size = 0;
|
||||||
|
|
||||||
/* for no gcc warnings */
|
/* for no gcc warnings */
|
||||||
(void)sdu_size;
|
(void)sdu_size;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int si_window;
|
int si_window;
|
||||||
*/
|
*/
|
||||||
@@ -263,10 +255,12 @@ mac_rrc_data_ind(
|
|||||||
rrc_eNB_decode_ccch(&ctxt, Srb_info, CC_id);
|
rrc_eNB_decode_ccch(&ctxt, Srb_info, CC_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((srb_idP & RAB_OFFSET) == DCCH) {
|
if((srb_idP & RAB_OFFSET) == DCCH) {
|
||||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||||
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id],rntiP);
|
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id],rntiP);
|
||||||
if(ue_context_p){
|
|
||||||
|
if(ue_context_p) {
|
||||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(&ctxt,
|
rrc_eNB_generate_defaultRRCConnectionReconfiguration(&ctxt,
|
||||||
ue_context_p,
|
ue_context_p,
|
||||||
0);
|
0);
|
||||||
@@ -275,10 +269,12 @@ mac_rrc_data_ind(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
/*
|
||||||
|
* Get RRC status (Connected, Idle...) of UE from RNTI
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
mac_eNB_get_rrc_status(
|
mac_eNB_get_rrc_status(
|
||||||
const module_id_t Mod_idP,
|
const module_id_t Mod_idP,
|
||||||
@@ -286,10 +282,8 @@ mac_eNB_get_rrc_status(
|
|||||||
)
|
)
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||||
ue_context_p = rrc_eNB_get_ue_context(
|
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[Mod_idP], rntiP);
|
||||||
RC.rrc[Mod_idP],
|
|
||||||
rntiP);
|
|
||||||
|
|
||||||
if (ue_context_p != NULL) {
|
if (ue_context_p != NULL) {
|
||||||
return(ue_context_p->ue_context.Status);
|
return(ue_context_p->ue_context.Status);
|
||||||
@@ -302,26 +296,27 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
|||||||
const int CC_idP,
|
const int CC_idP,
|
||||||
const frame_t frameP,
|
const frame_t frameP,
|
||||||
const sub_frame_t subframeP,
|
const sub_frame_t subframeP,
|
||||||
const rnti_t rntiP)
|
const rnti_t rntiP) {
|
||||||
{
|
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
|
||||||
ue_context_p = rrc_eNB_get_ue_context(
|
ue_context_p = rrc_eNB_get_ue_context(
|
||||||
RC.rrc[Mod_instP],
|
RC.rrc[Mod_instP],
|
||||||
rntiP);
|
rntiP);
|
||||||
|
|
||||||
if (ue_context_p != NULL) {
|
if (ue_context_p != NULL) {
|
||||||
LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP);
|
LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP);
|
||||||
|
|
||||||
if(ue_context_p->ue_context.ul_failure_timer == 0)
|
if(ue_context_p->ue_context.ul_failure_timer == 0)
|
||||||
ue_context_p->ue_context.ul_failure_timer=1;
|
ue_context_p->ue_context.ul_failure_timer=1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rrc_agent_registered[Mod_instP]) {
|
if (rrc_agent_registered[Mod_instP]) {
|
||||||
agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP,
|
agent_rrc_xface[Mod_instP]->flexran_agent_notify_ue_state_change(Mod_instP,
|
||||||
rntiP,
|
rntiP,
|
||||||
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
|
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
rrc_mac_remove_ue(Mod_instP,rntiP);
|
rrc_mac_remove_ue(Mod_instP,rntiP);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,19 +324,18 @@ void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
|
|||||||
const int CC_idP,
|
const int CC_idP,
|
||||||
const frame_t frameP,
|
const frame_t frameP,
|
||||||
const sub_frame_t subframeP,
|
const sub_frame_t subframeP,
|
||||||
const rnti_t rntiP)
|
const rnti_t rntiP) {
|
||||||
{
|
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
|
||||||
ue_context_p = rrc_eNB_get_ue_context(
|
ue_context_p = rrc_eNB_get_ue_context(
|
||||||
RC.rrc[Mod_instP],
|
RC.rrc[Mod_instP],
|
||||||
rntiP);
|
rntiP);
|
||||||
|
|
||||||
if (ue_context_p != NULL) {
|
if (ue_context_p != NULL) {
|
||||||
LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP);
|
LOG_I(RRC,"Frame %d, Subframe %d: UE %x U-Plane failure, activating timer\n",frameP,subframeP,rntiP);
|
||||||
|
|
||||||
if(ue_context_p->ue_context.ul_failure_timer == 0)
|
if(ue_context_p->ue_context.ul_failure_timer == 0)
|
||||||
ue_context_p->ue_context.ul_failure_timer=19999;
|
ue_context_p->ue_context.ul_failure_timer=19999;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
LOG_W(RRC,"Frame %d, Subframe %d: U-Plane failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
LOG_W(RRC,"Frame %d, Subframe %d: U-Plane failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -350,9 +344,8 @@ void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
|||||||
const int CC_idP,
|
const int CC_idP,
|
||||||
const frame_t frameP,
|
const frame_t frameP,
|
||||||
const sub_frame_t subframeP,
|
const sub_frame_t subframeP,
|
||||||
const rnti_t rntiP)
|
const rnti_t rntiP) {
|
||||||
{
|
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
|
||||||
ue_context_p = rrc_eNB_get_ue_context(
|
ue_context_p = rrc_eNB_get_ue_context(
|
||||||
RC.rrc[Mod_instP],
|
RC.rrc[Mod_instP],
|
||||||
rntiP);
|
rntiP);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -57,7 +57,7 @@ uint16_t get_adjacent_cell_id(uint8_t Mod_id,uint8_t index);
|
|||||||
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
|
uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Generate configuration for SIB1 (eNB).
|
\brief Generate configuration for MIB (eNB).
|
||||||
@param carrier pointer to Carrier information
|
@param carrier pointer to Carrier information
|
||||||
@param N_RB_DL Number of downlink PRBs
|
@param N_RB_DL Number of downlink PRBs
|
||||||
@param phich_Resource PHICH resoure parameter
|
@param phich_Resource PHICH resoure parameter
|
||||||
@@ -115,16 +115,16 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, LTE_SL_Destina
|
|||||||
/** \brief Generate an RRCConnectionSetupComplete UL-DCCH-Message (UE)
|
/** \brief Generate an RRCConnectionSetupComplete UL-DCCH-Message (UE)
|
||||||
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
||||||
@returns Size of encoded bit stream in bytes*/
|
@returns Size of encoded bit stream in bytes*/
|
||||||
uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t* buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength,
|
uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength,
|
||||||
const char* dedicatedInfoNAS);
|
const char *dedicatedInfoNAS);
|
||||||
|
|
||||||
/** \brief Generate an RRCConnectionReconfigurationComplete UL-DCCH-Message (UE)
|
/** \brief Generate an RRCConnectionReconfigurationComplete UL-DCCH-Message (UE)
|
||||||
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
@param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU
|
||||||
@returns Size of encoded bit stream in bytes*/
|
@returns Size of encoded bit stream in bytes*/
|
||||||
uint8_t
|
uint8_t
|
||||||
do_RRCConnectionReconfigurationComplete(
|
do_RRCConnectionReconfigurationComplete(
|
||||||
const protocol_ctxt_t* const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
uint8_t* buffer,
|
uint8_t *buffer,
|
||||||
const uint8_t Transaction_id
|
const uint8_t Transaction_id
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -143,14 +143,14 @@ PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting
|
|||||||
@returns Size of encoded bit stream in bytes*/
|
@returns Size of encoded bit stream in bytes*/
|
||||||
uint8_t
|
uint8_t
|
||||||
do_RRCConnectionSetup(
|
do_RRCConnectionSetup(
|
||||||
const protocol_ctxt_t* const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||||
int CC_id,
|
int CC_id,
|
||||||
uint8_t* const buffer,
|
uint8_t *const buffer,
|
||||||
const uint8_t transmission_mode,
|
const uint8_t transmission_mode,
|
||||||
const uint8_t Transaction_id,
|
const uint8_t Transaction_id,
|
||||||
LTE_SRB_ToAddModList_t** SRB_configList,
|
LTE_SRB_ToAddModList_t **SRB_configList,
|
||||||
struct LTE_PhysicalConfigDedicated** physicalConfigDedicated
|
struct LTE_PhysicalConfigDedicated **physicalConfigDedicated
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,7 +177,7 @@ do_RRCConnectionSetup(
|
|||||||
|
|
||||||
uint16_t
|
uint16_t
|
||||||
do_RRCConnectionReconfiguration(
|
do_RRCConnectionReconfiguration(
|
||||||
const protocol_ctxt_t* const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint8_t Transaction_id,
|
uint8_t Transaction_id,
|
||||||
LTE_SRB_ToAddModList_t *SRB_list,
|
LTE_SRB_ToAddModList_t *SRB_list,
|
||||||
@@ -195,13 +195,13 @@ do_RRCConnectionReconfiguration(
|
|||||||
struct LTE_MeasConfig__speedStatePars *speedStatePars,
|
struct LTE_MeasConfig__speedStatePars *speedStatePars,
|
||||||
LTE_RSRP_Range_t *rsrp,
|
LTE_RSRP_Range_t *rsrp,
|
||||||
LTE_C_RNTI_t *cba_rnti,
|
LTE_C_RNTI_t *cba_rnti,
|
||||||
struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList* dedicatedInfoNASList,
|
struct LTE_RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList,
|
||||||
LTE_SL_CommConfig_r12_t *sl_CommConfig,
|
LTE_SL_CommConfig_r12_t *sl_CommConfig,
|
||||||
LTE_SL_DiscConfig_r12_t *sl_DiscConfig
|
LTE_SL_DiscConfig_r12_t *sl_DiscConfig
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
, LTE_SCellToAddMod_r10_t *SCell_config
|
, LTE_SCellToAddMod_r10_t *SCell_config
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
\brief Generate an RRCConnectionReestablishment DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB2) and
|
\brief Generate an RRCConnectionReestablishment DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB2) and
|
||||||
PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting (PUCCH format 2/2a/2b) or SRS.
|
PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting (PUCCH format 2/2a/2b) or SRS.
|
||||||
@@ -216,10 +216,10 @@ PhysicalConfigDedicated IEs. The latter does not enable periodic CQI reporting
|
|||||||
@returns Size of encoded bit stream in bytes*/
|
@returns Size of encoded bit stream in bytes*/
|
||||||
uint8_t
|
uint8_t
|
||||||
do_RRCConnectionReestablishment(
|
do_RRCConnectionReestablishment(
|
||||||
const protocol_ctxt_t* const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||||
int CC_id,
|
int CC_id,
|
||||||
uint8_t* const buffer,
|
uint8_t *const buffer,
|
||||||
const uint8_t transmission_mode,
|
const uint8_t transmission_mode,
|
||||||
const uint8_t Transaction_id,
|
const uint8_t Transaction_id,
|
||||||
LTE_SRB_ToAddModList_t **SRB_configList,
|
LTE_SRB_ToAddModList_t **SRB_configList,
|
||||||
@@ -233,7 +233,7 @@ do_RRCConnectionReestablishment(
|
|||||||
uint8_t
|
uint8_t
|
||||||
do_RRCConnectionReestablishmentReject(
|
do_RRCConnectionReestablishmentReject(
|
||||||
uint8_t Mod_id,
|
uint8_t Mod_id,
|
||||||
uint8_t* const buffer);
|
uint8_t *const buffer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Generate an RRCConnectionReject DL-CCCH-Message (eNB).
|
\brief Generate an RRCConnectionReject DL-CCCH-Message (eNB).
|
||||||
@@ -243,7 +243,7 @@ do_RRCConnectionReestablishmentReject(
|
|||||||
uint8_t
|
uint8_t
|
||||||
do_RRCConnectionReject(
|
do_RRCConnectionReject(
|
||||||
uint8_t Mod_id,
|
uint8_t Mod_id,
|
||||||
uint8_t* const buffer);
|
uint8_t *const buffer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This
|
\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This
|
||||||
@@ -286,14 +286,14 @@ OAI_UECapability_t *fill_ue_capability(char *LTE_UE_EUTRA_Capability_xer);
|
|||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
do_UECapabilityEnquiry(
|
do_UECapabilityEnquiry(
|
||||||
const protocol_ctxt_t* const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
uint8_t* const buffer,
|
uint8_t *const buffer,
|
||||||
const uint8_t Transaction_id
|
const uint8_t Transaction_id
|
||||||
);
|
);
|
||||||
|
|
||||||
uint8_t do_SecurityModeCommand(
|
uint8_t do_SecurityModeCommand(
|
||||||
const protocol_ctxt_t* const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
uint8_t* const buffer,
|
uint8_t *const buffer,
|
||||||
const uint8_t Transaction_id,
|
const uint8_t Transaction_id,
|
||||||
const uint8_t cipheringAlgorithm,
|
const uint8_t cipheringAlgorithm,
|
||||||
const uint8_t integrityProtAlgorithm);
|
const uint8_t integrityProtAlgorithm);
|
||||||
|
|||||||
@@ -735,7 +735,7 @@ Paging-v1130-IEs ::= SEQUENCE {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Paging-v1310-IEs ::= SEQUENCE {
|
Paging-v1310-IEs ::= SEQUENCE {
|
||||||
redistributionIndication-r13 ENUMERATED {true} OPTIONAL, --Need ON
|
redistributionIndication-r13 ENUMERATED {true} OPTIONAL, -- Need ON
|
||||||
systemInfoModification-eDRX-r13 ENUMERATED {true} OPTIONAL, -- Need ON
|
systemInfoModification-eDRX-r13 ENUMERATED {true} OPTIONAL, -- Need ON
|
||||||
nonCriticalExtension SEQUENCE {} OPTIONAL
|
nonCriticalExtension SEQUENCE {} OPTIONAL
|
||||||
}
|
}
|
||||||
|
|||||||
+89
-87
@@ -119,13 +119,13 @@ struct DirectCommunicationEstablishReq {
|
|||||||
uint32_t pppp;
|
uint32_t pppp;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PC5SEstablishReq{
|
struct PC5SEstablishReq {
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint32_t sourceL2Id;
|
uint32_t sourceL2Id;
|
||||||
uint32_t destinationL2Id;
|
uint32_t destinationL2Id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PC5SEstablishRsp{
|
struct PC5SEstablishRsp {
|
||||||
uint32_t slrbid_lcid28;
|
uint32_t slrbid_lcid28;
|
||||||
uint32_t slrbid_lcid29;
|
uint32_t slrbid_lcid29;
|
||||||
uint32_t slrbid_lcid30;
|
uint32_t slrbid_lcid30;
|
||||||
@@ -167,7 +167,7 @@ void *send_UE_status_notification(void *);
|
|||||||
|
|
||||||
//#include "COMMON/openair_defs.h"
|
//#include "COMMON/openair_defs.h"
|
||||||
#ifndef USER_MODE
|
#ifndef USER_MODE
|
||||||
//#include <rtai.h>
|
//#include <rtai.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "LTE_SystemInformationBlockType1.h"
|
#include "LTE_SystemInformationBlockType1.h"
|
||||||
@@ -182,18 +182,18 @@ void *send_UE_status_notification(void *);
|
|||||||
#include "LTE_SBCCH-SL-BCH-MessageType.h"
|
#include "LTE_SBCCH-SL-BCH-MessageType.h"
|
||||||
#include "LTE_BCCH-BCH-Message.h"
|
#include "LTE_BCCH-BCH-Message.h"
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||||
#include "LTE_MCCH-Message.h"
|
#include "LTE_MCCH-Message.h"
|
||||||
#include "LTE_MBSFNAreaConfiguration-r9.h"
|
#include "LTE_MBSFNAreaConfiguration-r9.h"
|
||||||
#endif
|
#endif
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
#include "LTE_SCellToAddMod-r10.h"
|
#include "LTE_SCellToAddMod-r10.h"
|
||||||
#endif
|
#endif
|
||||||
#include "LTE_AS-Config.h"
|
#include "LTE_AS-Config.h"
|
||||||
#include "LTE_AS-Context.h"
|
#include "LTE_AS-Context.h"
|
||||||
#include "LTE_UE-EUTRA-Capability.h"
|
#include "LTE_UE-EUTRA-Capability.h"
|
||||||
#include "LTE_MeasResults.h"
|
#include "LTE_MeasResults.h"
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(12, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(12, 0, 0))
|
||||||
#include "LTE_SidelinkUEInformation-r12.h"
|
#include "LTE_SidelinkUEInformation-r12.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* for ImsiMobileIdentity_t */
|
/* for ImsiMobileIdentity_t */
|
||||||
@@ -203,66 +203,66 @@ void *send_UE_status_notification(void *);
|
|||||||
* the code is in favor of Rel14, those defines do the translation
|
* the code is in favor of Rel14, those defines do the translation
|
||||||
*/
|
*/
|
||||||
#if (LTE_RRC_VERSION < MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION < MAKE_VERSION(14, 0, 0))
|
||||||
# define CipheringAlgorithm_r12_t e_SecurityAlgorithmConfig__cipheringAlgorithm
|
#define CipheringAlgorithm_r12_t e_SecurityAlgorithmConfig__cipheringAlgorithm
|
||||||
# define CipheringAlgorithm_r12_eea0 SecurityAlgorithmConfig__cipheringAlgorithm_eea0
|
#define CipheringAlgorithm_r12_eea0 SecurityAlgorithmConfig__cipheringAlgorithm_eea0
|
||||||
# define CipheringAlgorithm_r12_eea1 SecurityAlgorithmConfig__cipheringAlgorithm_eea1
|
#define CipheringAlgorithm_r12_eea1 SecurityAlgorithmConfig__cipheringAlgorithm_eea1
|
||||||
# define CipheringAlgorithm_r12_eea2 SecurityAlgorithmConfig__cipheringAlgorithm_eea2
|
#define CipheringAlgorithm_r12_eea2 SecurityAlgorithmConfig__cipheringAlgorithm_eea2
|
||||||
# define CipheringAlgorithm_r12_spare1 SecurityAlgorithmConfig__cipheringAlgorithm_spare1
|
#define CipheringAlgorithm_r12_spare1 SecurityAlgorithmConfig__cipheringAlgorithm_spare1
|
||||||
# define Alpha_r12_al0 UplinkPowerControlCommon__alpha_al0
|
#define Alpha_r12_al0 UplinkPowerControlCommon__alpha_al0
|
||||||
# define Alpha_r12_al04 UplinkPowerControlCommon__alpha_al04
|
#define Alpha_r12_al04 UplinkPowerControlCommon__alpha_al04
|
||||||
# define Alpha_r12_al05 UplinkPowerControlCommon__alpha_al05
|
#define Alpha_r12_al05 UplinkPowerControlCommon__alpha_al05
|
||||||
# define Alpha_r12_al06 UplinkPowerControlCommon__alpha_al06
|
#define Alpha_r12_al06 UplinkPowerControlCommon__alpha_al06
|
||||||
# define Alpha_r12_al07 UplinkPowerControlCommon__alpha_al07
|
#define Alpha_r12_al07 UplinkPowerControlCommon__alpha_al07
|
||||||
# define Alpha_r12_al08 UplinkPowerControlCommon__alpha_al08
|
#define Alpha_r12_al08 UplinkPowerControlCommon__alpha_al08
|
||||||
# define Alpha_r12_al09 UplinkPowerControlCommon__alpha_al09
|
#define Alpha_r12_al09 UplinkPowerControlCommon__alpha_al09
|
||||||
# define Alpha_r12_al1 UplinkPowerControlCommon__alpha_al1
|
#define Alpha_r12_al1 UplinkPowerControlCommon__alpha_al1
|
||||||
# define PreambleTransMax_n3 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3
|
#define PreambleTransMax_n3 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3
|
||||||
# define PreambleTransMax_n4 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4
|
#define PreambleTransMax_n4 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4
|
||||||
# define PreambleTransMax_n5 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5
|
#define PreambleTransMax_n5 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5
|
||||||
# define PreambleTransMax_n6 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6
|
#define PreambleTransMax_n6 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6
|
||||||
# define PreambleTransMax_n7 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7
|
#define PreambleTransMax_n7 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7
|
||||||
# define PreambleTransMax_n8 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8
|
#define PreambleTransMax_n8 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8
|
||||||
# define PreambleTransMax_n10 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10
|
#define PreambleTransMax_n10 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10
|
||||||
# define PreambleTransMax_n20 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20
|
#define PreambleTransMax_n20 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20
|
||||||
# define PreambleTransMax_n50 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50
|
#define PreambleTransMax_n50 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50
|
||||||
# define PreambleTransMax_n100 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100
|
#define PreambleTransMax_n100 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100
|
||||||
# define PreambleTransMax_n200 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200
|
#define PreambleTransMax_n200 RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200
|
||||||
# define PeriodicBSR_Timer_r12_sf5 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf5
|
#define PeriodicBSR_Timer_r12_sf5 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf5
|
||||||
# define PeriodicBSR_Timer_r12_sf10 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf10
|
#define PeriodicBSR_Timer_r12_sf10 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf10
|
||||||
# define PeriodicBSR_Timer_r12_sf16 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf16
|
#define PeriodicBSR_Timer_r12_sf16 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf16
|
||||||
# define PeriodicBSR_Timer_r12_sf20 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf20
|
#define PeriodicBSR_Timer_r12_sf20 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf20
|
||||||
# define PeriodicBSR_Timer_r12_sf32 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf32
|
#define PeriodicBSR_Timer_r12_sf32 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf32
|
||||||
# define PeriodicBSR_Timer_r12_sf40 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf40
|
#define PeriodicBSR_Timer_r12_sf40 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf40
|
||||||
# define PeriodicBSR_Timer_r12_sf64 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf64
|
#define PeriodicBSR_Timer_r12_sf64 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf64
|
||||||
# define PeriodicBSR_Timer_r12_sf80 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf80
|
#define PeriodicBSR_Timer_r12_sf80 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf80
|
||||||
# define PeriodicBSR_Timer_r12_sf128 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf128
|
#define PeriodicBSR_Timer_r12_sf128 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf128
|
||||||
# define PeriodicBSR_Timer_r12_sf160 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf160
|
#define PeriodicBSR_Timer_r12_sf160 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf160
|
||||||
# define PeriodicBSR_Timer_r12_sf320 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf320
|
#define PeriodicBSR_Timer_r12_sf320 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf320
|
||||||
# define PeriodicBSR_Timer_r12_sf640 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf640
|
#define PeriodicBSR_Timer_r12_sf640 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf640
|
||||||
# define PeriodicBSR_Timer_r12_sf1280 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf1280
|
#define PeriodicBSR_Timer_r12_sf1280 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf1280
|
||||||
# define PeriodicBSR_Timer_r12_sf2560 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf2560
|
#define PeriodicBSR_Timer_r12_sf2560 MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_sf2560
|
||||||
# define PeriodicBSR_Timer_r12_infinity MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity
|
#define PeriodicBSR_Timer_r12_infinity MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity
|
||||||
# define RetxBSR_Timer_r12_sf320 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf320
|
#define RetxBSR_Timer_r12_sf320 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf320
|
||||||
# define RetxBSR_Timer_r12_sf640 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf640
|
#define RetxBSR_Timer_r12_sf640 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf640
|
||||||
# define RetxBSR_Timer_r12_sf1280 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf1280
|
#define RetxBSR_Timer_r12_sf1280 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf1280
|
||||||
# define RetxBSR_Timer_r12_sf2560 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560
|
#define RetxBSR_Timer_r12_sf2560 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560
|
||||||
# define RetxBSR_Timer_r12_sf5120 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf5120
|
#define RetxBSR_Timer_r12_sf5120 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf5120
|
||||||
# define RetxBSR_Timer_r12_sf10240 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf10240
|
#define RetxBSR_Timer_r12_sf10240 MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf10240
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This corrects something generated by asn1c which is different between Rel8 and Rel10
|
// This corrects something generated by asn1c which is different between Rel8 and Rel10
|
||||||
#if (LTE_RRC_VERSION <= MAKE_VERSION(10, 0, 0))
|
#if (LTE_RRC_VERSION <= MAKE_VERSION(10, 0, 0))
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member SystemInformation_r8_IEs_sib_TypeAndInfo_Member
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member SystemInformation_r8_IEs_sib_TypeAndInfo_Member
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib2
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib2
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib3
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib3
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib4
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib4
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib5
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib5
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib6
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib6
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib7
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib7
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib8
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib8
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib9
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib9
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib10
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib10
|
||||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib11
|
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib11
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -279,13 +279,13 @@ void *send_UE_status_notification(void *);
|
|||||||
*/
|
*/
|
||||||
//#include "L3_rrc_defs.h"
|
//#include "L3_rrc_defs.h"
|
||||||
#ifndef NO_RRM
|
#ifndef NO_RRM
|
||||||
#include "L3_rrc_interface.h"
|
#include "L3_rrc_interface.h"
|
||||||
#include "rrc_rrm_msg.h"
|
#include "rrc_rrm_msg.h"
|
||||||
#include "rrc_rrm_interface.h"
|
#include "rrc_rrm_interface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
# include "intertask_interface.h"
|
#include "intertask_interface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO: be sure this include is correct.
|
/* TODO: be sure this include is correct.
|
||||||
@@ -293,11 +293,11 @@ void *send_UE_status_notification(void *);
|
|||||||
* issue #186.
|
* issue #186.
|
||||||
*/
|
*/
|
||||||
#if !defined(ENABLE_ITTI)
|
#if !defined(ENABLE_ITTI)
|
||||||
# include "as_message.h"
|
#include "as_message.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_USE_MME)
|
#if defined(ENABLE_USE_MME)
|
||||||
# include "commonDef.h"
|
#include "commonDef.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//--------
|
//--------
|
||||||
@@ -516,29 +516,29 @@ typedef struct eNB_RRC_UE_s {
|
|||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
LTE_SCellToAddMod_r10_t sCell_config[2];
|
LTE_SCellToAddMod_r10_t sCell_config[2];
|
||||||
#endif
|
#endif
|
||||||
LTE_SRB_ToAddModList_t* SRB_configList;
|
LTE_SRB_ToAddModList_t *SRB_configList;
|
||||||
LTE_SRB_ToAddModList_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
LTE_SRB_ToAddModList_t *SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||||
LTE_DRB_ToAddModList_t* DRB_configList;
|
LTE_DRB_ToAddModList_t *DRB_configList;
|
||||||
LTE_DRB_ToAddModList_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
LTE_DRB_ToAddModList_t *DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||||
LTE_DRB_ToReleaseList_t* DRB_Release_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
LTE_DRB_ToReleaseList_t *DRB_Release_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||||
uint8_t DRB_active[8];
|
uint8_t DRB_active[8];
|
||||||
struct LTE_PhysicalConfigDedicated* physicalConfigDedicated;
|
struct LTE_PhysicalConfigDedicated *physicalConfigDedicated;
|
||||||
struct LTE_SPS_Config* sps_Config;
|
struct LTE_SPS_Config *sps_Config;
|
||||||
LTE_MeasObjectToAddMod_t* MeasObj[MAX_MEAS_OBJ];
|
LTE_MeasObjectToAddMod_t *MeasObj[MAX_MEAS_OBJ];
|
||||||
struct LTE_ReportConfigToAddMod* ReportConfig[MAX_MEAS_CONFIG];
|
struct LTE_ReportConfigToAddMod *ReportConfig[MAX_MEAS_CONFIG];
|
||||||
struct LTE_QuantityConfig* QuantityConfig;
|
struct LTE_QuantityConfig *QuantityConfig;
|
||||||
struct LTE_MeasIdToAddMod* MeasId[MAX_MEAS_ID];
|
struct LTE_MeasIdToAddMod *MeasId[MAX_MEAS_ID];
|
||||||
LTE_MAC_MainConfig_t* mac_MainConfig;
|
LTE_MAC_MainConfig_t *mac_MainConfig;
|
||||||
LTE_MeasGapConfig_t* measGapConfig;
|
LTE_MeasGapConfig_t *measGapConfig;
|
||||||
SRB_INFO SI;
|
SRB_INFO SI;
|
||||||
SRB_INFO Srb0;
|
SRB_INFO Srb0;
|
||||||
SRB_INFO_TABLE_ENTRY Srb1;
|
SRB_INFO_TABLE_ENTRY Srb1;
|
||||||
SRB_INFO_TABLE_ENTRY Srb2;
|
SRB_INFO_TABLE_ENTRY Srb2;
|
||||||
LTE_MeasConfig_t* measConfig;
|
LTE_MeasConfig_t *measConfig;
|
||||||
HANDOVER_INFO* handover_info;
|
HANDOVER_INFO *handover_info;
|
||||||
LTE_MeasResults_t* measResults;
|
LTE_MeasResults_t *measResults;
|
||||||
|
|
||||||
LTE_UE_EUTRA_Capability_t* UE_Capability;
|
LTE_UE_EUTRA_Capability_t *UE_Capability;
|
||||||
ImsiMobileIdentity_t imsi;
|
ImsiMobileIdentity_t imsi;
|
||||||
|
|
||||||
#if defined(ENABLE_SECURITY)
|
#if defined(ENABLE_SECURITY)
|
||||||
@@ -552,7 +552,7 @@ typedef struct eNB_RRC_UE_s {
|
|||||||
LTE_CipheringAlgorithm_r12_t ciphering_algorithm;
|
LTE_CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||||
e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||||
|
|
||||||
uint8_t Status;
|
uint8_t Status; // RRC status, type enum UE_STATE_t
|
||||||
rnti_t rnti;
|
rnti_t rnti;
|
||||||
uint64_t random_ue_identity;
|
uint64_t random_ue_identity;
|
||||||
|
|
||||||
@@ -599,6 +599,8 @@ typedef struct eNB_RRC_UE_s {
|
|||||||
uint32_t ue_release_timer_thres_rrc;
|
uint32_t ue_release_timer_thres_rrc;
|
||||||
uint32_t ue_reestablishment_timer;
|
uint32_t ue_reestablishment_timer;
|
||||||
uint32_t ue_reestablishment_timer_thres;
|
uint32_t ue_reestablishment_timer_thres;
|
||||||
|
/* RRC inactivity timer: on timeout, should release RRC connection for inactivity on all E-RABs */
|
||||||
|
uint32_t ue_rrc_inactivity_timer;
|
||||||
uint8_t e_rab_release_command_flag;
|
uint8_t e_rab_release_command_flag;
|
||||||
int8_t reestablishment_xid;
|
int8_t reestablishment_xid;
|
||||||
} eNB_RRC_UE_t;
|
} eNB_RRC_UE_t;
|
||||||
|
|||||||
+874
-1329
File diff suppressed because it is too large
Load Diff
+316
-362
File diff suppressed because it is too large
Load Diff
+32
-73
@@ -61,7 +61,7 @@
|
|||||||
#include "assertions.h"
|
#include "assertions.h"
|
||||||
#include "conversions.h"
|
#include "conversions.h"
|
||||||
#if defined(TEST_S1C_MME)
|
#if defined(TEST_S1C_MME)
|
||||||
#include "oaisim_mme_test_s1c.h"
|
#include "oaisim_mme_test_s1c.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
s1ap_eNB_config_t s1ap_config;
|
s1ap_eNB_config_t s1ap_config;
|
||||||
@@ -74,22 +74,17 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
|
|||||||
|
|
||||||
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
|
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
|
||||||
|
|
||||||
uint32_t s1ap_generate_eNB_id(void)
|
uint32_t s1ap_generate_eNB_id(void) {
|
||||||
{
|
|
||||||
char *out;
|
char *out;
|
||||||
char hostname[50];
|
char hostname[50];
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t eNB_id;
|
uint32_t eNB_id;
|
||||||
|
|
||||||
/* Retrieve the host name */
|
/* Retrieve the host name */
|
||||||
ret = gethostname(hostname, sizeof(hostname));
|
ret = gethostname(hostname, sizeof(hostname));
|
||||||
DevAssert(ret == 0);
|
DevAssert(ret == 0);
|
||||||
|
|
||||||
out = crypt(hostname, "eurecom");
|
out = crypt(hostname, "eurecom");
|
||||||
DevAssert(out != NULL);
|
DevAssert(out != NULL);
|
||||||
|
|
||||||
eNB_id = ((out[0] << 24) | (out[1] << 16) | (out[2] << 8) | out[3]);
|
eNB_id = ((out[0] << 24) | (out[1] << 16) | (out[2] << 8) | out[3]);
|
||||||
|
|
||||||
return eNB_id;
|
return eNB_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,55 +94,42 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
|||||||
uint16_t in_streams,
|
uint16_t in_streams,
|
||||||
uint16_t out_streams,
|
uint16_t out_streams,
|
||||||
uint8_t broadcast_plmn_num,
|
uint8_t broadcast_plmn_num,
|
||||||
uint8_t broadcast_plmn_index[PLMN_LIST_MAX_SIZE])
|
uint8_t broadcast_plmn_index[PLMN_LIST_MAX_SIZE]) {
|
||||||
{
|
|
||||||
MessageDef *message_p = NULL;
|
MessageDef *message_p = NULL;
|
||||||
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
|
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
|
||||||
s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL;
|
s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL;
|
||||||
struct s1ap_eNB_mme_data_s *mme = NULL;
|
struct s1ap_eNB_mme_data_s *mme = NULL;
|
||||||
|
|
||||||
DevAssert(instance_p != NULL);
|
DevAssert(instance_p != NULL);
|
||||||
DevAssert(mme_ip_address != NULL);
|
DevAssert(mme_ip_address != NULL);
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
|
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
|
||||||
|
|
||||||
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
|
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
|
||||||
|
|
||||||
sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
|
sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
|
||||||
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
|
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
|
||||||
|
|
||||||
sctp_new_association_req_p->in_streams = in_streams;
|
sctp_new_association_req_p->in_streams = in_streams;
|
||||||
sctp_new_association_req_p->out_streams = out_streams;
|
sctp_new_association_req_p->out_streams = out_streams;
|
||||||
|
|
||||||
memcpy(&sctp_new_association_req_p->remote_address,
|
memcpy(&sctp_new_association_req_p->remote_address,
|
||||||
mme_ip_address,
|
mme_ip_address,
|
||||||
sizeof(*mme_ip_address));
|
sizeof(*mme_ip_address));
|
||||||
|
|
||||||
memcpy(&sctp_new_association_req_p->local_address,
|
memcpy(&sctp_new_association_req_p->local_address,
|
||||||
local_ip_addr,
|
local_ip_addr,
|
||||||
sizeof(*local_ip_addr));
|
sizeof(*local_ip_addr));
|
||||||
|
|
||||||
S1AP_INFO("[eNB %d] check the mme registration state\n",instance_p->instance);
|
S1AP_INFO("[eNB %d] check the mme registration state\n",instance_p->instance);
|
||||||
|
|
||||||
mme = NULL;
|
mme = NULL;
|
||||||
|
|
||||||
if ( mme == NULL ) {
|
if ( mme == NULL ) {
|
||||||
|
|
||||||
/* Create new MME descriptor */
|
/* Create new MME descriptor */
|
||||||
s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p));
|
s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p));
|
||||||
DevAssert(s1ap_mme_data_p != NULL);
|
DevAssert(s1ap_mme_data_p != NULL);
|
||||||
|
|
||||||
s1ap_mme_data_p->cnx_id = s1ap_eNB_fetch_add_global_cnx_id();
|
s1ap_mme_data_p->cnx_id = s1ap_eNB_fetch_add_global_cnx_id();
|
||||||
sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id;
|
sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id;
|
||||||
|
|
||||||
s1ap_mme_data_p->assoc_id = -1;
|
s1ap_mme_data_p->assoc_id = -1;
|
||||||
s1ap_mme_data_p->broadcast_plmn_num = broadcast_plmn_num;
|
s1ap_mme_data_p->broadcast_plmn_num = broadcast_plmn_num;
|
||||||
|
|
||||||
for (int i = 0; i < broadcast_plmn_num; ++i)
|
for (int i = 0; i < broadcast_plmn_num; ++i)
|
||||||
s1ap_mme_data_p->broadcast_plmn_index[i] = broadcast_plmn_index[i];
|
s1ap_mme_data_p->broadcast_plmn_index[i] = broadcast_plmn_index[i];
|
||||||
|
|
||||||
s1ap_mme_data_p->s1ap_eNB_instance = instance_p;
|
s1ap_mme_data_p->s1ap_eNB_instance = instance_p;
|
||||||
|
|
||||||
STAILQ_INIT(&s1ap_mme_data_p->served_gummei);
|
STAILQ_INIT(&s1ap_mme_data_p->served_gummei);
|
||||||
|
|
||||||
/* Insert the new descriptor in list of known MME
|
/* Insert the new descriptor in list of known MME
|
||||||
* but not yet associated.
|
* but not yet associated.
|
||||||
*/
|
*/
|
||||||
@@ -158,12 +140,10 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
|||||||
} else if (mme->state == S1AP_ENB_STATE_WAITING) {
|
} else if (mme->state == S1AP_ENB_STATE_WAITING) {
|
||||||
instance_p->s1ap_mme_pending_nb ++;
|
instance_p->s1ap_mme_pending_nb ++;
|
||||||
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
|
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
|
||||||
|
|
||||||
S1AP_INFO("[eNB %d] MME already registered, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
|
S1AP_INFO("[eNB %d] MME already registered, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
|
||||||
instance_p->instance,
|
instance_p->instance,
|
||||||
mme->state, mme->cnx_id,
|
mme->state, mme->cnx_id,
|
||||||
instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
|
instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
|
||||||
|
|
||||||
/*s1ap_mme_data_p->cnx_id = mme->cnx_id;
|
/*s1ap_mme_data_p->cnx_id = mme->cnx_id;
|
||||||
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
|
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
|
||||||
|
|
||||||
@@ -181,13 +161,10 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB)
|
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB) {
|
||||||
{
|
|
||||||
s1ap_eNB_instance_t *new_instance;
|
s1ap_eNB_instance_t *new_instance;
|
||||||
uint8_t index;
|
uint8_t index;
|
||||||
|
|
||||||
DevAssert(s1ap_register_eNB != NULL);
|
DevAssert(s1ap_register_eNB != NULL);
|
||||||
|
|
||||||
/* Look if the provided instance already exists */
|
/* Look if the provided instance already exists */
|
||||||
new_instance = s1ap_eNB_get_instance(instance);
|
new_instance = s1ap_eNB_get_instance(instance);
|
||||||
|
|
||||||
@@ -197,38 +174,36 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
|
|||||||
DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0);
|
DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0);
|
||||||
DevCheck(new_instance->num_plmn == s1ap_register_eNB->num_plmn, new_instance->num_plmn, s1ap_register_eNB->num_plmn, 0);
|
DevCheck(new_instance->num_plmn == s1ap_register_eNB->num_plmn, new_instance->num_plmn, s1ap_register_eNB->num_plmn, 0);
|
||||||
DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0);
|
DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0);
|
||||||
for (int i = 0; i < new_instance->num_plmn; i++)
|
|
||||||
{
|
for (int i = 0; i < new_instance->num_plmn; i++) {
|
||||||
DevCheck(new_instance->mcc[i] == s1ap_register_eNB->mcc[i], new_instance->mcc[i], s1ap_register_eNB->mcc[i], 0);
|
DevCheck(new_instance->mcc[i] == s1ap_register_eNB->mcc[i], new_instance->mcc[i], s1ap_register_eNB->mcc[i], 0);
|
||||||
DevCheck(new_instance->mnc[i] == s1ap_register_eNB->mnc[i], new_instance->mnc[i], s1ap_register_eNB->mnc[i], 0);
|
DevCheck(new_instance->mnc[i] == s1ap_register_eNB->mnc[i], new_instance->mnc[i], s1ap_register_eNB->mnc[i], 0);
|
||||||
DevCheck(new_instance->mnc_digit_length[i] == s1ap_register_eNB->mnc_digit_length[i], new_instance->mnc_digit_length[i], s1ap_register_eNB->mnc_digit_length[i], 0);
|
DevCheck(new_instance->mnc_digit_length[i] == s1ap_register_eNB->mnc_digit_length[i], new_instance->mnc_digit_length[i], s1ap_register_eNB->mnc_digit_length[i], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
DevCheck(new_instance->default_drx == s1ap_register_eNB->default_drx, new_instance->default_drx, s1ap_register_eNB->default_drx, 0);
|
DevCheck(new_instance->default_drx == s1ap_register_eNB->default_drx, new_instance->default_drx, s1ap_register_eNB->default_drx, 0);
|
||||||
} else {
|
} else {
|
||||||
new_instance = calloc(1, sizeof(s1ap_eNB_instance_t));
|
new_instance = calloc(1, sizeof(s1ap_eNB_instance_t));
|
||||||
DevAssert(new_instance != NULL);
|
DevAssert(new_instance != NULL);
|
||||||
|
|
||||||
RB_INIT(&new_instance->s1ap_ue_head);
|
RB_INIT(&new_instance->s1ap_ue_head);
|
||||||
RB_INIT(&new_instance->s1ap_mme_head);
|
RB_INIT(&new_instance->s1ap_mme_head);
|
||||||
|
|
||||||
/* Copy usefull parameters */
|
/* Copy usefull parameters */
|
||||||
new_instance->instance = instance;
|
new_instance->instance = instance;
|
||||||
new_instance->eNB_name = s1ap_register_eNB->eNB_name;
|
new_instance->eNB_name = s1ap_register_eNB->eNB_name;
|
||||||
new_instance->eNB_id = s1ap_register_eNB->eNB_id;
|
new_instance->eNB_id = s1ap_register_eNB->eNB_id;
|
||||||
new_instance->cell_type = s1ap_register_eNB->cell_type;
|
new_instance->cell_type = s1ap_register_eNB->cell_type;
|
||||||
new_instance->tac = s1ap_register_eNB->tac;
|
new_instance->tac = s1ap_register_eNB->tac;
|
||||||
for (int i = 0; i < s1ap_register_eNB->num_plmn; i++)
|
|
||||||
{
|
for (int i = 0; i < s1ap_register_eNB->num_plmn; i++) {
|
||||||
new_instance->mcc[i] = s1ap_register_eNB->mcc[i];
|
new_instance->mcc[i] = s1ap_register_eNB->mcc[i];
|
||||||
new_instance->mnc[i] = s1ap_register_eNB->mnc[i];
|
new_instance->mnc[i] = s1ap_register_eNB->mnc[i];
|
||||||
new_instance->mnc_digit_length[i] = s1ap_register_eNB->mnc_digit_length[i];
|
new_instance->mnc_digit_length[i] = s1ap_register_eNB->mnc_digit_length[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
new_instance->num_plmn = s1ap_register_eNB->num_plmn;
|
new_instance->num_plmn = s1ap_register_eNB->num_plmn;
|
||||||
new_instance->default_drx = s1ap_register_eNB->default_drx;
|
new_instance->default_drx = s1ap_register_eNB->default_drx;
|
||||||
|
|
||||||
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
|
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
|
||||||
s1ap_eNB_insert_new_instance(new_instance);
|
s1ap_eNB_insert_new_instance(new_instance);
|
||||||
|
|
||||||
S1AP_INFO("Registered new eNB[%d] and %s eNB id %u\n",
|
S1AP_INFO("Registered new eNB[%d] and %s eNB id %u\n",
|
||||||
instance,
|
instance,
|
||||||
s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home",
|
s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home",
|
||||||
@@ -250,16 +225,12 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
|
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
|
||||||
{
|
|
||||||
s1ap_eNB_instance_t *instance_p;
|
s1ap_eNB_instance_t *instance_p;
|
||||||
s1ap_eNB_mme_data_t *s1ap_mme_data_p;
|
s1ap_eNB_mme_data_t *s1ap_mme_data_p;
|
||||||
|
|
||||||
DevAssert(sctp_new_association_resp != NULL);
|
DevAssert(sctp_new_association_resp != NULL);
|
||||||
|
|
||||||
instance_p = s1ap_eNB_get_instance(instance);
|
instance_p = s1ap_eNB_get_instance(instance);
|
||||||
DevAssert(instance_p != NULL);
|
DevAssert(instance_p != NULL);
|
||||||
|
|
||||||
s1ap_mme_data_p = s1ap_eNB_get_MME(instance_p, -1,
|
s1ap_mme_data_p = s1ap_eNB_get_MME(instance_p, -1,
|
||||||
sctp_new_association_resp->ulp_cnx_id);
|
sctp_new_association_resp->ulp_cnx_id);
|
||||||
DevAssert(s1ap_mme_data_p != NULL);
|
DevAssert(s1ap_mme_data_p != NULL);
|
||||||
@@ -269,9 +240,7 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
|||||||
sctp_new_association_resp->sctp_state,
|
sctp_new_association_resp->sctp_state,
|
||||||
instance,
|
instance,
|
||||||
sctp_new_association_resp->ulp_cnx_id);
|
sctp_new_association_resp->ulp_cnx_id);
|
||||||
|
|
||||||
s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
|
s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,16 +248,13 @@ void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
|||||||
s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id;
|
s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id;
|
||||||
s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams;
|
s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams;
|
||||||
s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams;
|
s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams;
|
||||||
|
|
||||||
/* Prepare new S1 Setup Request */
|
/* Prepare new S1 Setup Request */
|
||||||
s1ap_eNB_generate_s1_setup_request(instance_p, s1ap_mme_data_p);
|
s1ap_eNB_generate_s1_setup_request(instance_p, s1ap_mme_data_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
|
void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
|
||||||
{
|
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
DevAssert(sctp_data_ind != NULL);
|
DevAssert(sctp_data_ind != NULL);
|
||||||
#if defined(TEST_S1C_MME)
|
#if defined(TEST_S1C_MME)
|
||||||
mme_test_s1_notify_sctp_data_ind(sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
mme_test_s1_notify_sctp_data_ind(sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||||
@@ -301,18 +267,14 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
|
|||||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void s1ap_eNB_init(void)
|
void s1ap_eNB_init(void) {
|
||||||
{
|
|
||||||
S1AP_DEBUG("Starting S1AP layer\n");
|
S1AP_DEBUG("Starting S1AP layer\n");
|
||||||
|
|
||||||
s1ap_eNB_prepare_internal_data();
|
s1ap_eNB_prepare_internal_data();
|
||||||
|
|
||||||
itti_mark_task_ready(TASK_S1AP);
|
itti_mark_task_ready(TASK_S1AP);
|
||||||
MSC_START_USE();
|
MSC_START_USE();
|
||||||
}
|
}
|
||||||
|
|
||||||
void *s1ap_eNB_process_itti_msg(void* notUsed)
|
void *s1ap_eNB_process_itti_msg(void *notUsed) {
|
||||||
{
|
|
||||||
MessageDef *received_msg = NULL;
|
MessageDef *received_msg = NULL;
|
||||||
int result;
|
int result;
|
||||||
itti_receive_msg(TASK_S1AP, &received_msg);
|
itti_receive_msg(TASK_S1AP, &received_msg);
|
||||||
@@ -396,11 +358,8 @@ void *s1ap_eNB_process_itti_msg(void* notUsed)
|
|||||||
case S1AP_UE_CONTEXT_RELEASE_REQ: {
|
case S1AP_UE_CONTEXT_RELEASE_REQ: {
|
||||||
s1ap_eNB_instance_t *s1ap_eNB_instance_p = NULL; // test
|
s1ap_eNB_instance_t *s1ap_eNB_instance_p = NULL; // test
|
||||||
struct s1ap_eNB_ue_context_s *ue_context_p = NULL; // test
|
struct s1ap_eNB_ue_context_s *ue_context_p = NULL; // test
|
||||||
|
|
||||||
s1ap_ue_context_release_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
s1ap_ue_context_release_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||||
&S1AP_UE_CONTEXT_RELEASE_REQ(received_msg));
|
&S1AP_UE_CONTEXT_RELEASE_REQ(received_msg));
|
||||||
|
|
||||||
|
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(ITTI_MESSAGE_GET_INSTANCE(received_msg)); // test
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(ITTI_MESSAGE_GET_INSTANCE(received_msg)); // test
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL); // test
|
DevAssert(s1ap_eNB_instance_p != NULL); // test
|
||||||
|
|
||||||
@@ -427,14 +386,12 @@ void *s1ap_eNB_process_itti_msg(void* notUsed)
|
|||||||
|
|
||||||
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
|
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
|
||||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||||
|
|
||||||
received_msg = NULL;
|
received_msg = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *s1ap_eNB_task(void *arg)
|
void *s1ap_eNB_task(void *arg) {
|
||||||
{
|
|
||||||
s1ap_eNB_init();
|
s1ap_eNB_init();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -444,23 +401,26 @@ void *s1ap_eNB_task(void *arg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
/*
|
||||||
|
* eNB generate a S1 setup request towards MME
|
||||||
|
*/
|
||||||
static int s1ap_eNB_generate_s1_setup_request(
|
static int s1ap_eNB_generate_s1_setup_request(
|
||||||
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p)
|
s1ap_eNB_instance_t *instance_p,
|
||||||
|
s1ap_eNB_mme_data_t *s1ap_mme_data_p)
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
S1AP_S1AP_PDU_t pdu;
|
S1AP_S1AP_PDU_t pdu;
|
||||||
S1AP_S1SetupRequest_t *out;
|
S1AP_S1SetupRequest_t *out = NULL;
|
||||||
S1AP_S1SetupRequestIEs_t *ie;
|
S1AP_S1SetupRequestIEs_t *ie = NULL;
|
||||||
S1AP_SupportedTAs_Item_t *ta;
|
S1AP_SupportedTAs_Item_t *ta = NULL;
|
||||||
S1AP_PLMNidentity_t *plmn;
|
S1AP_PLMNidentity_t *plmn = NULL;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t len;
|
uint32_t len = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
DevAssert(instance_p != NULL);
|
DevAssert(instance_p != NULL);
|
||||||
DevAssert(s1ap_mme_data_p != NULL);
|
DevAssert(s1ap_mme_data_p != NULL);
|
||||||
|
|
||||||
s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
|
s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
|
||||||
|
|
||||||
/* Prepare the S1AP message to encode */
|
/* Prepare the S1AP message to encode */
|
||||||
memset(&pdu, 0, sizeof(pdu));
|
memset(&pdu, 0, sizeof(pdu));
|
||||||
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
|
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
|
||||||
@@ -468,7 +428,6 @@ static int s1ap_eNB_generate_s1_setup_request(
|
|||||||
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_reject;
|
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_reject;
|
||||||
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_S1SetupRequest;
|
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_S1SetupRequest;
|
||||||
out = &pdu.choice.initiatingMessage.value.choice.S1SetupRequest;
|
out = &pdu.choice.initiatingMessage.value.choice.S1SetupRequest;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_Global_ENB_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_Global_ENB_ID;
|
||||||
@@ -519,7 +478,6 @@ static int s1ap_eNB_generate_s1_setup_request(
|
|||||||
ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAs.list, ta);
|
ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAs.list, ta);
|
||||||
}
|
}
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX;
|
ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX;
|
||||||
@@ -540,6 +498,7 @@ static int s1ap_eNB_generate_s1_setup_request(
|
|||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_UE_RetentionInformation;
|
ie->id = S1AP_ProtocolIE_ID_id_UE_RetentionInformation;
|
||||||
@@ -558,6 +517,7 @@ static int s1ap_eNB_generate_s1_setup_request(
|
|||||||
// ie->value.choice.NB_IoT_DefaultPagingDRX = ;
|
// ie->value.choice.NB_IoT_DefaultPagingDRX = ;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
||||||
|
|
||||||
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||||
@@ -567,6 +527,5 @@ static int s1ap_eNB_generate_s1_setup_request(
|
|||||||
|
|
||||||
/* Non UE-Associated signalling -> stream = 0 */
|
/* Non UE-Associated signalling -> stream = 0 */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, s1ap_mme_data_p->assoc_id, buffer, len, 0);
|
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, s1ap_mme_data_p->assoc_id, buffer, len, 0);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,16 +148,15 @@ s1ap_message_decoded_callback messages_callback[][3] = {
|
|||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0)) */
|
||||||
};
|
};
|
||||||
char *s1ap_direction2String(int s1ap_dir) {
|
char *s1ap_direction2String(int s1ap_dir) {
|
||||||
static char *s1ap_direction_String[] = {
|
static char *s1ap_direction_String[] = {
|
||||||
"", /* Nothing */
|
"", /* Nothing */
|
||||||
"Originating message", /* originating message */
|
"Originating message", /* originating message */
|
||||||
"Successfull outcome", /* successfull outcome */
|
"Successfull outcome", /* successfull outcome */
|
||||||
"UnSuccessfull outcome", /* successfull outcome */
|
"UnSuccessfull outcome", /* successfull outcome */
|
||||||
};
|
};
|
||||||
return(s1ap_direction_String[s1ap_dir]);
|
return(s1ap_direction_String[s1ap_dir]);
|
||||||
}
|
}
|
||||||
void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown)
|
void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown) {
|
||||||
{
|
|
||||||
if (sctp_shutdown) {
|
if (sctp_shutdown) {
|
||||||
/* A previously connected MME has been shutdown */
|
/* A previously connected MME has been shutdown */
|
||||||
|
|
||||||
@@ -173,7 +172,6 @@ void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shut
|
|||||||
/* If there are no more associated MME, inform eNB app */
|
/* If there are no more associated MME, inform eNB app */
|
||||||
if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) {
|
if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) {
|
||||||
MessageDef *message_p;
|
MessageDef *message_p;
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND);
|
||||||
S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0;
|
S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0;
|
||||||
itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
|
||||||
@@ -192,7 +190,6 @@ void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shut
|
|||||||
/* If there are no more pending messages, inform eNB app */
|
/* If there are no more pending messages, inform eNB app */
|
||||||
if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) {
|
if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) {
|
||||||
MessageDef *message_p;
|
MessageDef *message_p;
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF);
|
||||||
S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb;
|
S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb;
|
||||||
itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
|
||||||
@@ -201,13 +198,10 @@ void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shut
|
|||||||
}
|
}
|
||||||
|
|
||||||
int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
|
int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
|
||||||
const uint8_t *const data, const uint32_t data_length)
|
const uint8_t *const data, const uint32_t data_length) {
|
||||||
{
|
|
||||||
S1AP_S1AP_PDU_t pdu;
|
S1AP_S1AP_PDU_t pdu;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
DevAssert(data != NULL);
|
DevAssert(data != NULL);
|
||||||
|
|
||||||
memset(&pdu, 0, sizeof(pdu));
|
memset(&pdu, 0, sizeof(pdu));
|
||||||
|
|
||||||
if (s1ap_eNB_decode_pdu(&pdu, data, data_length) < 0) {
|
if (s1ap_eNB_decode_pdu(&pdu, data, data_length) < 0) {
|
||||||
@@ -246,14 +240,11 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
|
|||||||
static
|
static
|
||||||
int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
|
int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
S1AP_S1SetupFailure_t *container;
|
S1AP_S1SetupFailure_t *container;
|
||||||
S1AP_S1SetupFailureIEs_t *ie;
|
S1AP_S1SetupFailureIEs_t *ie;
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p;
|
s1ap_eNB_mme_data_t *mme_desc_p;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.unsuccessfulOutcome.value.choice.S1SetupFailure;
|
container = &pdu->choice.unsuccessfulOutcome.value.choice.S1SetupFailure;
|
||||||
|
|
||||||
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
|
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
|
||||||
@@ -280,22 +271,18 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
|
|||||||
|
|
||||||
mme_desc_p->state = S1AP_ENB_STATE_WAITING;
|
mme_desc_p->state = S1AP_ENB_STATE_WAITING;
|
||||||
s1ap_handle_s1_setup_message(mme_desc_p, 0);
|
s1ap_handle_s1_setup_message(mme_desc_p, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
S1AP_S1SetupResponse_t *container;
|
S1AP_S1SetupResponse_t *container;
|
||||||
S1AP_S1SetupResponseIEs_t *ie;
|
S1AP_S1SetupResponseIEs_t *ie;
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p;
|
s1ap_eNB_mme_data_t *mme_desc_p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.successfulOutcome.value.choice.S1SetupResponse;
|
container = &pdu->choice.successfulOutcome.value.choice.S1SetupResponse;
|
||||||
|
|
||||||
/* S1 Setup Response == Non UE-related procedure -> stream 0 */
|
/* S1 Setup Response == Non UE-related procedure -> stream 0 */
|
||||||
@@ -324,20 +311,16 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
|||||||
S1AP_ServedGUMMEIsItem_t *gummei_item_p;
|
S1AP_ServedGUMMEIsItem_t *gummei_item_p;
|
||||||
struct served_gummei_s *new_gummei_p;
|
struct served_gummei_s *new_gummei_p;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
gummei_item_p = ie->value.choice.ServedGUMMEIs.list.array[i];
|
gummei_item_p = ie->value.choice.ServedGUMMEIs.list.array[i];
|
||||||
new_gummei_p = calloc(1, sizeof(struct served_gummei_s));
|
new_gummei_p = calloc(1, sizeof(struct served_gummei_s));
|
||||||
|
|
||||||
STAILQ_INIT(&new_gummei_p->served_plmns);
|
STAILQ_INIT(&new_gummei_p->served_plmns);
|
||||||
STAILQ_INIT(&new_gummei_p->served_group_ids);
|
STAILQ_INIT(&new_gummei_p->served_group_ids);
|
||||||
STAILQ_INIT(&new_gummei_p->mme_codes);
|
STAILQ_INIT(&new_gummei_p->mme_codes);
|
||||||
|
|
||||||
S1AP_DEBUG("servedPLMNs.list.count %d\n", gummei_item_p->servedPLMNs.list.count);
|
S1AP_DEBUG("servedPLMNs.list.count %d\n", gummei_item_p->servedPLMNs.list.count);
|
||||||
|
|
||||||
for (j = 0; j < gummei_item_p->servedPLMNs.list.count; j++) {
|
for (j = 0; j < gummei_item_p->servedPLMNs.list.count; j++) {
|
||||||
S1AP_PLMNidentity_t *plmn_identity_p;
|
S1AP_PLMNidentity_t *plmn_identity_p;
|
||||||
struct plmn_identity_s *new_plmn_identity_p;
|
struct plmn_identity_s *new_plmn_identity_p;
|
||||||
|
|
||||||
plmn_identity_p = gummei_item_p->servedPLMNs.list.array[j];
|
plmn_identity_p = gummei_item_p->servedPLMNs.list.array[j];
|
||||||
new_plmn_identity_p = calloc(1, sizeof(struct plmn_identity_s));
|
new_plmn_identity_p = calloc(1, sizeof(struct plmn_identity_s));
|
||||||
TBCD_TO_MCC_MNC(plmn_identity_p, new_plmn_identity_p->mcc,
|
TBCD_TO_MCC_MNC(plmn_identity_p, new_plmn_identity_p->mcc,
|
||||||
@@ -349,7 +332,6 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
|||||||
for (j = 0; j < gummei_item_p->servedGroupIDs.list.count; j++) {
|
for (j = 0; j < gummei_item_p->servedGroupIDs.list.count; j++) {
|
||||||
S1AP_MME_Group_ID_t *mme_group_id_p;
|
S1AP_MME_Group_ID_t *mme_group_id_p;
|
||||||
struct served_group_id_s *new_group_id_p;
|
struct served_group_id_s *new_group_id_p;
|
||||||
|
|
||||||
mme_group_id_p = gummei_item_p->servedGroupIDs.list.array[j];
|
mme_group_id_p = gummei_item_p->servedGroupIDs.list.array[j];
|
||||||
new_group_id_p = calloc(1, sizeof(struct served_group_id_s));
|
new_group_id_p = calloc(1, sizeof(struct served_group_id_s));
|
||||||
OCTET_STRING_TO_INT16(mme_group_id_p, new_group_id_p->mme_group_id);
|
OCTET_STRING_TO_INT16(mme_group_id_p, new_group_id_p->mme_group_id);
|
||||||
@@ -360,10 +342,8 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
|||||||
for (j = 0; j < gummei_item_p->servedMMECs.list.count; j++) {
|
for (j = 0; j < gummei_item_p->servedMMECs.list.count; j++) {
|
||||||
S1AP_MME_Code_t *mme_code_p;
|
S1AP_MME_Code_t *mme_code_p;
|
||||||
struct mme_code_s *new_mme_code_p;
|
struct mme_code_s *new_mme_code_p;
|
||||||
|
|
||||||
mme_code_p = gummei_item_p->servedMMECs.list.array[j];
|
mme_code_p = gummei_item_p->servedMMECs.list.array[j];
|
||||||
new_mme_code_p = calloc(1, sizeof(struct mme_code_s));
|
new_mme_code_p = calloc(1, sizeof(struct mme_code_s));
|
||||||
|
|
||||||
OCTET_STRING_TO_INT8(mme_code_p, new_mme_code_p->mme_code);
|
OCTET_STRING_TO_INT8(mme_code_p, new_mme_code_p->mme_code);
|
||||||
STAILQ_INSERT_TAIL(&new_gummei_p->mme_codes, new_mme_code_p, next);
|
STAILQ_INSERT_TAIL(&new_gummei_p->mme_codes, new_mme_code_p, next);
|
||||||
new_gummei_p->nb_mme_code++;
|
new_gummei_p->nb_mme_code++;
|
||||||
@@ -376,10 +356,10 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
|||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_RelativeMMECapacity, true);
|
S1AP_ProtocolIE_ID_id_RelativeMMECapacity, true);
|
||||||
mme_desc_p->relative_mme_capacity = ie->value.choice.RelativeMMECapacity;
|
mme_desc_p->relative_mme_capacity = ie->value.choice.RelativeMMECapacity;
|
||||||
|
|
||||||
/* Optionaly set the mme name */
|
/* Optionaly set the mme name */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_MMEname, false);
|
S1AP_ProtocolIE_ID_id_MMEname, false);
|
||||||
|
|
||||||
if (ie) {
|
if (ie) {
|
||||||
mme_desc_p->mme_name = calloc(ie->value.choice.MMEname.size + 1, sizeof(char));
|
mme_desc_p->mme_name = calloc(ie->value.choice.MMEname.size + 1, sizeof(char));
|
||||||
memcpy(mme_desc_p->mme_name, ie->value.choice.MMEname.buf,
|
memcpy(mme_desc_p->mme_name, ie->value.choice.MMEname.buf,
|
||||||
@@ -394,7 +374,6 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
|||||||
mme_desc_p->state = S1AP_ENB_STATE_CONNECTED;
|
mme_desc_p->state = S1AP_ENB_STATE_CONNECTED;
|
||||||
mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb ++;
|
mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb ++;
|
||||||
s1ap_handle_s1_setup_message(mme_desc_p, 0);
|
s1ap_handle_s1_setup_message(mme_desc_p, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,14 +381,11 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
|
|||||||
static
|
static
|
||||||
int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
S1AP_ErrorIndication_t *container;
|
S1AP_ErrorIndication_t *container;
|
||||||
S1AP_ErrorIndicationIEs_t *ie;
|
S1AP_ErrorIndicationIEs_t *ie;
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p;
|
s1ap_eNB_mme_data_t *mme_desc_p;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.ErrorIndication;
|
container = &pdu->choice.initiatingMessage.value.choice.ErrorIndication;
|
||||||
|
|
||||||
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
|
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
|
||||||
@@ -455,118 +431,156 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
case S1AP_CauseRadioNetwork_unspecified:
|
case S1AP_CauseRadioNetwork_unspecified:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unspecified\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unspecified\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_tx2relocoverall_expiry:
|
case S1AP_CauseRadioNetwork_tx2relocoverall_expiry:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_tx2relocoverall_expiry\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_tx2relocoverall_expiry\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_successful_handover:
|
case S1AP_CauseRadioNetwork_successful_handover:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_successful_handover\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_successful_handover\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_release_due_to_eutran_generated_reason:
|
case S1AP_CauseRadioNetwork_release_due_to_eutran_generated_reason:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_release_due_to_eutran_generated_reason\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_release_due_to_eutran_generated_reason\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_handover_cancelled:
|
case S1AP_CauseRadioNetwork_handover_cancelled:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_handover_cancelled\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_handover_cancelled\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_partial_handover:
|
case S1AP_CauseRadioNetwork_partial_handover:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_partial_handover\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_partial_handover\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system:
|
case S1AP_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_ho_target_not_allowed:
|
case S1AP_CauseRadioNetwork_ho_target_not_allowed:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_ho_target_not_allowed\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_ho_target_not_allowed\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_tS1relocoverall_expiry:
|
case S1AP_CauseRadioNetwork_tS1relocoverall_expiry:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_tS1relocoverall_expiry\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_tS1relocoverall_expiry\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_tS1relocprep_expiry:
|
case S1AP_CauseRadioNetwork_tS1relocprep_expiry:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_tS1relocprep_expiry\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_tS1relocprep_expiry\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_cell_not_available:
|
case S1AP_CauseRadioNetwork_cell_not_available:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_cell_not_available\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_cell_not_available\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_unknown_targetID:
|
case S1AP_CauseRadioNetwork_unknown_targetID:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_targetID\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_targetID\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_no_radio_resources_available_in_target_cell:
|
case S1AP_CauseRadioNetwork_no_radio_resources_available_in_target_cell:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_no_radio_resources_available_in_target_cell\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_no_radio_resources_available_in_target_cell\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id:
|
case S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_unknown_enb_ue_s1ap_id:
|
case S1AP_CauseRadioNetwork_unknown_enb_ue_s1ap_id:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_enb_ue_s1ap_id\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_enb_ue_s1ap_id\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_unknown_pair_ue_s1ap_id:
|
case S1AP_CauseRadioNetwork_unknown_pair_ue_s1ap_id:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_pair_ue_s1ap_id\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_pair_ue_s1ap_id\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_handover_desirable_for_radio_reason:
|
case S1AP_CauseRadioNetwork_handover_desirable_for_radio_reason:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_handover_desirable_for_radio_reason\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_handover_desirable_for_radio_reason\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_time_critical_handover:
|
case S1AP_CauseRadioNetwork_time_critical_handover:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_time_critical_handover\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_time_critical_handover\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_resource_optimisation_handover:
|
case S1AP_CauseRadioNetwork_resource_optimisation_handover:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_resource_optimisation_handover\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_resource_optimisation_handover\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_reduce_load_in_serving_cell:
|
case S1AP_CauseRadioNetwork_reduce_load_in_serving_cell:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_reduce_load_in_serving_cell\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_reduce_load_in_serving_cell\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_user_inactivity:
|
case S1AP_CauseRadioNetwork_user_inactivity:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_user_inactivity\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_user_inactivity\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_radio_connection_with_ue_lost:
|
case S1AP_CauseRadioNetwork_radio_connection_with_ue_lost:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_radio_connection_with_ue_lost\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_radio_connection_with_ue_lost\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_load_balancing_tau_required:
|
case S1AP_CauseRadioNetwork_load_balancing_tau_required:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_load_balancing_tau_required\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_load_balancing_tau_required\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_cs_fallback_triggered:
|
case S1AP_CauseRadioNetwork_cs_fallback_triggered:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_cs_fallback_triggered\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_cs_fallback_triggered\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_ue_not_available_for_ps_service:
|
case S1AP_CauseRadioNetwork_ue_not_available_for_ps_service:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_ue_not_available_for_ps_service\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_ue_not_available_for_ps_service\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_radio_resources_not_available:
|
case S1AP_CauseRadioNetwork_radio_resources_not_available:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_radio_resources_not_available\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_radio_resources_not_available\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_failure_in_radio_interface_procedure:
|
case S1AP_CauseRadioNetwork_failure_in_radio_interface_procedure:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_failure_in_radio_interface_procedure\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_failure_in_radio_interface_procedure\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_invalid_qos_combination:
|
case S1AP_CauseRadioNetwork_invalid_qos_combination:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_invals1ap_id_qos_combination\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_invals1ap_id_qos_combination\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_interrat_redirection:
|
case S1AP_CauseRadioNetwork_interrat_redirection:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_interrat_redirection\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_interrat_redirection\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_interaction_with_other_procedure:
|
case S1AP_CauseRadioNetwork_interaction_with_other_procedure:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_interaction_with_other_procedure\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_interaction_with_other_procedure\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_unknown_E_RAB_ID:
|
case S1AP_CauseRadioNetwork_unknown_E_RAB_ID:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_E_RAB_ID\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_unknown_E_RAB_ID\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_multiple_E_RAB_ID_instances:
|
case S1AP_CauseRadioNetwork_multiple_E_RAB_ID_instances:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_multiple_E_RAB_ID_instances\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_multiple_E_RAB_ID_instances\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported:
|
case S1AP_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_s1_intra_system_handover_triggered:
|
case S1AP_CauseRadioNetwork_s1_intra_system_handover_triggered:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_s1_intra_system_handover_triggered\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_s1_intra_system_handover_triggered\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_s1_inter_system_handover_triggered:
|
case S1AP_CauseRadioNetwork_s1_inter_system_handover_triggered:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_s1_inter_system_handover_triggered\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_s1_inter_system_handover_triggered\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_x2_handover_triggered:
|
case S1AP_CauseRadioNetwork_x2_handover_triggered:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_x2_handover_triggered\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_x2_handover_triggered\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_redirection_towards_1xRTT:
|
case S1AP_CauseRadioNetwork_redirection_towards_1xRTT:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_redirection_towards_1xRTT\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_redirection_towards_1xRTT\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_not_supported_QCI_value:
|
case S1AP_CauseRadioNetwork_not_supported_QCI_value:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_not_supported_QCI_value\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_not_supported_QCI_value\n");
|
||||||
break;
|
break;
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||||
|
|
||||||
case S1AP_CauseRadioNetwork_invalid_CSG_Id:
|
case S1AP_CauseRadioNetwork_invalid_CSG_Id:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_invals1ap_id_CSG_Id\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseRadioNetwork_invals1ap_id_CSG_Id\n");
|
||||||
break;
|
break;
|
||||||
@@ -575,6 +589,7 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
default:
|
default:
|
||||||
S1AP_WARN("Received S1 Error indication cause radio network case not handled\n");
|
S1AP_WARN("Received S1 Error indication cause radio network case not handled\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_transport:
|
case S1AP_Cause_PR_transport:
|
||||||
@@ -582,12 +597,15 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
case S1AP_CauseTransport_transport_resource_unavailable:
|
case S1AP_CauseTransport_transport_resource_unavailable:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseTransport_transport_resource_unavailable\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseTransport_transport_resource_unavailable\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseTransport_unspecified:
|
case S1AP_CauseTransport_unspecified:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseTransport_unspecified\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseTransport_unspecified\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
S1AP_WARN("Received S1 Error indication cause transport case not handled\n");
|
S1AP_WARN("Received S1 Error indication cause transport case not handled\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_nas:
|
case S1AP_Cause_PR_nas:
|
||||||
@@ -595,20 +613,25 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
case S1AP_CauseNas_normal_release:
|
case S1AP_CauseNas_normal_release:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_normal_release\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_normal_release\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseNas_authentication_failure:
|
case S1AP_CauseNas_authentication_failure:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_authentication_failure\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_authentication_failure\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseNas_detach:
|
case S1AP_CauseNas_detach:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_detach\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_detach\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseNas_unspecified:
|
case S1AP_CauseNas_unspecified:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_unspecified\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_unspecified\n");
|
||||||
break;
|
break;
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||||
|
|
||||||
case S1AP_CauseNas_csg_subscription_expiry:
|
case S1AP_CauseNas_csg_subscription_expiry:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_csg_subscription_expiry\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseNas_csg_subscription_expiry\n");
|
||||||
break;
|
break;
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0)) */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
S1AP_WARN("Received S1 Error indication cause nas case not handled\n");
|
S1AP_WARN("Received S1 Error indication cause nas case not handled\n");
|
||||||
}
|
}
|
||||||
@@ -620,27 +643,35 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
case S1AP_CauseProtocol_transfer_syntax_error:
|
case S1AP_CauseProtocol_transfer_syntax_error:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_transfer_syntax_error\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_transfer_syntax_error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseProtocol_abstract_syntax_error_reject:
|
case S1AP_CauseProtocol_abstract_syntax_error_reject:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_abstract_syntax_error_reject\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_abstract_syntax_error_reject\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseProtocol_abstract_syntax_error_ignore_and_notify:
|
case S1AP_CauseProtocol_abstract_syntax_error_ignore_and_notify:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_abstract_syntax_error_ignore_and_notify\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_abstract_syntax_error_ignore_and_notify\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseProtocol_message_not_compatible_with_receiver_state:
|
case S1AP_CauseProtocol_message_not_compatible_with_receiver_state:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_message_not_compatible_with_receiver_state\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_message_not_compatible_with_receiver_state\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseProtocol_semantic_error:
|
case S1AP_CauseProtocol_semantic_error:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_semantic_error\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_semantic_error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message:
|
case S1AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_abstract_syntax_error_falsely_constructed_message\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseProtocol_unspecified:
|
case S1AP_CauseProtocol_unspecified:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_unspecified\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseProtocol_unspecified\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
S1AP_WARN("Received S1 Error indication cause protocol case not handled\n");
|
S1AP_WARN("Received S1 Error indication cause protocol case not handled\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_misc:
|
case S1AP_Cause_PR_misc:
|
||||||
@@ -648,24 +679,31 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
case S1AP_CauseMisc_control_processing_overload:
|
case S1AP_CauseMisc_control_processing_overload:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_control_processing_overload\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_control_processing_overload\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseMisc_not_enough_user_plane_processing_resources:
|
case S1AP_CauseMisc_not_enough_user_plane_processing_resources:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_not_enough_user_plane_processing_resources\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_not_enough_user_plane_processing_resources\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseMisc_hardware_failure:
|
case S1AP_CauseMisc_hardware_failure:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_hardware_failure\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_hardware_failure\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseMisc_om_intervention:
|
case S1AP_CauseMisc_om_intervention:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_om_intervention\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_om_intervention\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseMisc_unspecified:
|
case S1AP_CauseMisc_unspecified:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_unspecified\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_unspecified\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_CauseMisc_unknown_PLMN:
|
case S1AP_CauseMisc_unknown_PLMN:
|
||||||
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_unknown_PLMN\n");
|
S1AP_WARN("Received S1 Error indication S1AP_CauseMisc_unknown_PLMN\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
S1AP_WARN("Received S1 Error indication cause misc case not handled\n");
|
S1AP_WARN("Received S1 Error indication cause misc case not handled\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -676,8 +714,8 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
if (ie) {
|
if (ie) {
|
||||||
// TODO continue
|
// TODO continue
|
||||||
}
|
}
|
||||||
// TODO continue
|
|
||||||
|
|
||||||
|
// TODO continue
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,8 +723,7 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
|
|||||||
static
|
static
|
||||||
int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
||||||
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
||||||
@@ -695,9 +732,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
S1AP_InitialContextSetupRequestIEs_t *ie;
|
S1AP_InitialContextSetupRequestIEs_t *ie;
|
||||||
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
||||||
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.InitialContextSetupRequest;
|
container = &pdu->choice.initiatingMessage.value.choice.InitialContextSetupRequest;
|
||||||
|
|
||||||
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
||||||
@@ -710,7 +745,6 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
||||||
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
||||||
|
|
||||||
/* id-eNB-UE-S1AP-ID */
|
/* id-eNB-UE-S1AP-ID */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
||||||
@@ -732,16 +766,11 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ue_desc_p->rx_stream = stream;
|
ue_desc_p->rx_stream = stream;
|
||||||
|
|
||||||
ue_desc_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
|
ue_desc_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_INITIAL_CONTEXT_SETUP_REQ);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_INITIAL_CONTEXT_SETUP_REQ);
|
||||||
|
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||||
ue_desc_p->ue_initial_id = 0;
|
ue_desc_p->ue_initial_id = 0;
|
||||||
|
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).eNB_ue_s1ap_id = ue_desc_p->eNB_ue_s1ap_id;
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).eNB_ue_s1ap_id = ue_desc_p->eNB_ue_s1ap_id;
|
||||||
|
|
||||||
/* id-uEaggregateMaximumBitrate */
|
/* id-uEaggregateMaximumBitrate */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate, true);
|
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate, true);
|
||||||
@@ -749,11 +778,9 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
&(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_ul));
|
&(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_ul));
|
||||||
asn_INTEGER2ulong(&(ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateDL),
|
asn_INTEGER2ulong(&(ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateDL),
|
||||||
&(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_dl));
|
&(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_dl));
|
||||||
|
|
||||||
/* id-E-RABToBeSetupListCtxtSUReq */
|
/* id-E-RABToBeSetupListCtxtSUReq */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_E_RABToBeSetupListCtxtSUReq, true);
|
S1AP_ProtocolIE_ID_id_E_RABToBeSetupListCtxtSUReq, true);
|
||||||
|
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).nb_of_e_rabs =
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).nb_of_e_rabs =
|
||||||
ie->value.choice.E_RABToBeSetupListCtxtSUReq.list.count;
|
ie->value.choice.E_RABToBeSetupListCtxtSUReq.list.count;
|
||||||
|
|
||||||
@@ -765,10 +792,8 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
if (item_p->nAS_PDU != NULL) {
|
if (item_p->nAS_PDU != NULL) {
|
||||||
/* Only copy NAS pdu if present */
|
/* Only copy NAS pdu if present */
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.length = item_p->nAS_PDU->size;
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.length = item_p->nAS_PDU->size;
|
||||||
|
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer =
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer =
|
||||||
malloc(sizeof(uint8_t) * item_p->nAS_PDU->size);
|
malloc(sizeof(uint8_t) * item_p->nAS_PDU->size);
|
||||||
|
|
||||||
memcpy(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer,
|
memcpy(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].nas_pdu.buffer,
|
||||||
item_p->nAS_PDU->buf, item_p->nAS_PDU->size);
|
item_p->nAS_PDU->buf, item_p->nAS_PDU->size);
|
||||||
S1AP_DEBUG("Received NAS message with the E_RAB setup procedure\n");
|
S1AP_DEBUG("Received NAS message with the E_RAB setup procedure\n");
|
||||||
@@ -782,13 +807,10 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
item_p->transportLayerAddress.buf, item_p->transportLayerAddress.size);
|
item_p->transportLayerAddress.buf, item_p->transportLayerAddress.size);
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].sgw_addr.length =
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].sgw_addr.length =
|
||||||
item_p->transportLayerAddress.size * 8 - item_p->transportLayerAddress.bits_unused;
|
item_p->transportLayerAddress.size * 8 - item_p->transportLayerAddress.bits_unused;
|
||||||
|
|
||||||
/* GTP tunnel endpoint ID */
|
/* GTP tunnel endpoint ID */
|
||||||
OCTET_STRING_TO_INT32(&item_p->gTP_TEID, S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].gtp_teid);
|
OCTET_STRING_TO_INT32(&item_p->gTP_TEID, S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].gtp_teid);
|
||||||
|
|
||||||
/* Set the QOS informations */
|
/* Set the QOS informations */
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.qci = item_p->e_RABlevelQoSParameters.qCI;
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.qci = item_p->e_RABlevelQoSParameters.qCI;
|
||||||
|
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.priority_level =
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.priority_level =
|
||||||
item_p->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel;
|
item_p->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel;
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.pre_emp_capability =
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).e_rab_param[i].qos.allocation_retention_priority.pre_emp_capability =
|
||||||
@@ -804,15 +826,12 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.encryptionAlgorithms);
|
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.encryptionAlgorithms);
|
||||||
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.integrity_algorithms =
|
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.integrity_algorithms =
|
||||||
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.integrityProtectionAlgorithms);
|
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.integrityProtectionAlgorithms);
|
||||||
|
|
||||||
/* id-SecurityKey : Copy the security key */
|
/* id-SecurityKey : Copy the security key */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_SecurityKey, true);
|
S1AP_ProtocolIE_ID_id_SecurityKey, true);
|
||||||
memcpy(&S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_key,
|
memcpy(&S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_key,
|
||||||
ie->value.choice.SecurityKey.buf, ie->value.choice.SecurityKey.size);
|
ie->value.choice.SecurityKey.buf, ie->value.choice.SecurityKey.size);
|
||||||
|
|
||||||
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -820,8 +839,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
|
|||||||
static
|
static
|
||||||
int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
||||||
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
||||||
MessageDef *message_p = NULL;
|
MessageDef *message_p = NULL;
|
||||||
@@ -829,9 +847,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
|||||||
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
||||||
S1AP_UEContextReleaseCommand_t *container;
|
S1AP_UEContextReleaseCommand_t *container;
|
||||||
S1AP_UEContextReleaseCommand_IEs_t *ie;
|
S1AP_UEContextReleaseCommand_IEs_t *ie;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.UEContextReleaseCommand;
|
container = &pdu->choice.initiatingMessage.value.choice.UEContextReleaseCommand;
|
||||||
|
|
||||||
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
||||||
@@ -847,7 +863,6 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
|||||||
case S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair:
|
case S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair:
|
||||||
enb_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.eNB_UE_S1AP_ID;
|
enb_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.eNB_UE_S1AP_ID;
|
||||||
mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
|
mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
|
||||||
|
|
||||||
MSC_LOG_RX_MESSAGE(
|
MSC_LOG_RX_MESSAGE(
|
||||||
MSC_S1AP_ENB,
|
MSC_S1AP_ENB,
|
||||||
MSC_S1AP_MME,
|
MSC_S1AP_MME,
|
||||||
@@ -863,11 +878,6 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
|||||||
"existing UE context 0x%06lx\n",
|
"existing UE context 0x%06lx\n",
|
||||||
assoc_id,
|
assoc_id,
|
||||||
enb_ue_s1ap_id);
|
enb_ue_s1ap_id);
|
||||||
/*MessageDef *msg_complete_p;
|
|
||||||
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, ue_desc_p->eNB_instance->instance <=> 0, msg_complete_p);
|
|
||||||
*/
|
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
MSC_LOG_TX_MESSAGE(
|
MSC_LOG_TX_MESSAGE(
|
||||||
@@ -877,6 +887,11 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
|||||||
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ",
|
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ",
|
||||||
enb_ue_s1ap_id);
|
enb_ue_s1ap_id);
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
|
||||||
|
|
||||||
|
if (ue_desc_p->mme_ue_s1ap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode
|
||||||
|
ue_desc_p->mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||||
|
}
|
||||||
|
|
||||||
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||||
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -905,8 +920,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
|
|||||||
static
|
static
|
||||||
int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
||||||
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
||||||
@@ -915,9 +929,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
MessageDef *message_p = NULL;
|
MessageDef *message_p = NULL;
|
||||||
S1AP_E_RABSetupRequest_t *container;
|
S1AP_E_RABSetupRequest_t *container;
|
||||||
S1AP_E_RABSetupRequestIEs_t *ie;
|
S1AP_E_RABSetupRequestIEs_t *ie;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.E_RABSetupRequest;
|
container = &pdu->choice.initiatingMessage.value.choice.E_RABSetupRequest;
|
||||||
|
|
||||||
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
||||||
@@ -930,7 +942,6 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
||||||
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
||||||
|
|
||||||
/* id-eNB-UE-S1AP-ID */
|
/* id-eNB-UE-S1AP-ID */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
||||||
@@ -959,11 +970,9 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_SETUP_REQ);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_SETUP_REQ);
|
||||||
|
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
S1AP_E_RAB_SETUP_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
S1AP_E_RAB_SETUP_REQ(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
S1AP_E_RAB_SETUP_REQ(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||||
|
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABSetupRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABSetupRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_E_RABToBeSetupListBearerSUReq, true);
|
S1AP_ProtocolIE_ID_id_E_RABToBeSetupListBearerSUReq, true);
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).nb_e_rabs_tosetup =
|
S1AP_E_RAB_SETUP_REQ(message_p).nb_e_rabs_tosetup =
|
||||||
@@ -971,24 +980,19 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
|
|
||||||
for (i = 0; i < ie->value.choice.E_RABToBeSetupListBearerSUReq.list.count; i++) {
|
for (i = 0; i < ie->value.choice.E_RABToBeSetupListBearerSUReq.list.count; i++) {
|
||||||
S1AP_E_RABToBeSetupItemBearerSUReq_t *item_p;
|
S1AP_E_RABToBeSetupItemBearerSUReq_t *item_p;
|
||||||
|
|
||||||
item_p = &(((S1AP_E_RABToBeSetupItemBearerSUReqIEs_t *)ie->value.choice.E_RABToBeSetupListBearerSUReq.list.array[i])->value.choice.E_RABToBeSetupItemBearerSUReq);
|
item_p = &(((S1AP_E_RABToBeSetupItemBearerSUReqIEs_t *)ie->value.choice.E_RABToBeSetupListBearerSUReq.list.array[i])->value.choice.E_RABToBeSetupItemBearerSUReq);
|
||||||
|
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].e_rab_id = item_p->e_RAB_ID;
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].e_rab_id = item_p->e_RAB_ID;
|
||||||
|
|
||||||
// check for the NAS PDU
|
// check for the NAS PDU
|
||||||
if (item_p->nAS_PDU.size > 0 ) {
|
if (item_p->nAS_PDU.size > 0 ) {
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length = item_p->nAS_PDU.size;
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length = item_p->nAS_PDU.size;
|
||||||
|
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer = malloc(sizeof(uint8_t) * item_p->nAS_PDU.size);
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer = malloc(sizeof(uint8_t) * item_p->nAS_PDU.size);
|
||||||
|
|
||||||
memcpy(S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer,
|
memcpy(S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer,
|
||||||
item_p->nAS_PDU.buf, item_p->nAS_PDU.size);
|
item_p->nAS_PDU.buf, item_p->nAS_PDU.size);
|
||||||
// S1AP_INFO("received a NAS PDU with size %d (%02x.%02x)\n",S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length, item_p->nAS_PDU.buf[0], item_p->nAS_PDU.buf[1]);
|
// S1AP_INFO("received a NAS PDU with size %d (%02x.%02x)\n",S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length, item_p->nAS_PDU.buf[0], item_p->nAS_PDU.buf[1]);
|
||||||
} else {
|
} else {
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length = 0;
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.length = 0;
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer = NULL;
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].nas_pdu.buffer = NULL;
|
||||||
|
|
||||||
S1AP_WARN("NAS PDU is not provided, generate a E_RAB_SETUP Failure (TBD) back to MME \n");
|
S1AP_WARN("NAS PDU is not provided, generate a E_RAB_SETUP Failure (TBD) back to MME \n");
|
||||||
// return -1;
|
// return -1;
|
||||||
}
|
}
|
||||||
@@ -998,7 +1002,6 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
item_p->transportLayerAddress.buf, item_p->transportLayerAddress.size);
|
item_p->transportLayerAddress.buf, item_p->transportLayerAddress.size);
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length =
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length =
|
||||||
item_p->transportLayerAddress.size * 8 - item_p->transportLayerAddress.bits_unused;
|
item_p->transportLayerAddress.size * 8 - item_p->transportLayerAddress.bits_unused;
|
||||||
|
|
||||||
/* S1AP_INFO("sgw addr %s len: %d (size %d, index %d)\n",
|
/* S1AP_INFO("sgw addr %s len: %d (size %d, index %d)\n",
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.buffer,
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.buffer,
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length,
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].sgw_addr.length,
|
||||||
@@ -1006,10 +1009,8 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
*/
|
*/
|
||||||
/* GTP tunnel endpoint ID */
|
/* GTP tunnel endpoint ID */
|
||||||
OCTET_STRING_TO_INT32(&item_p->gTP_TEID, S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].gtp_teid);
|
OCTET_STRING_TO_INT32(&item_p->gTP_TEID, S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].gtp_teid);
|
||||||
|
|
||||||
/* Set the QOS informations */
|
/* Set the QOS informations */
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.qci = item_p->e_RABlevelQoSParameters.qCI;
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.qci = item_p->e_RABlevelQoSParameters.qCI;
|
||||||
|
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.priority_level =
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.priority_level =
|
||||||
item_p->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel;
|
item_p->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel;
|
||||||
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.pre_emp_capability =
|
S1AP_E_RAB_SETUP_REQ(message_p).e_rab_setup_params[i].qos.allocation_retention_priority.pre_emp_capability =
|
||||||
@@ -1019,25 +1020,20 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
||||||
s1ap_eNB_instance_t *s1ap_eNB_instance = NULL;
|
s1ap_eNB_instance_t *s1ap_eNB_instance = NULL;
|
||||||
MessageDef *message_p = NULL;
|
MessageDef *message_p = NULL;
|
||||||
S1AP_Paging_t *container;
|
S1AP_Paging_t *container;
|
||||||
S1AP_PagingIEs_t *ie;
|
S1AP_PagingIEs_t *ie;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.Paging;
|
container = &pdu->choice.initiatingMessage.value.choice.Paging;
|
||||||
|
|
||||||
// received Paging Message from MME
|
// received Paging Message from MME
|
||||||
S1AP_DEBUG("[SCTP %d] Received Paging Message From MME\n",assoc_id);
|
S1AP_DEBUG("[SCTP %d] Received Paging Message From MME\n",assoc_id);
|
||||||
|
|
||||||
@@ -1055,6 +1051,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
s1ap_eNB_instance = mme_desc_p->s1ap_eNB_instance;
|
s1ap_eNB_instance = mme_desc_p->s1ap_eNB_instance;
|
||||||
|
|
||||||
if (s1ap_eNB_instance == NULL) {
|
if (s1ap_eNB_instance == NULL) {
|
||||||
S1AP_ERROR("[SCTP %d] Received Paging for non existing MME context : s1ap_eNB_instance is NULL\n",
|
S1AP_ERROR("[SCTP %d] Received Paging for non existing MME context : s1ap_eNB_instance is NULL\n",
|
||||||
assoc_id);
|
assoc_id);
|
||||||
@@ -1062,7 +1059,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_PAGING_IND);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_PAGING_IND);
|
||||||
|
|
||||||
/* convert S1AP_PagingIEs_t to s1ap_paging_ind_t */
|
/* convert S1AP_PagingIEs_t to s1ap_paging_ind_t */
|
||||||
/* id-UEIdentityIndexValue : convert UE Identity Index value */
|
/* id-UEIdentityIndexValue : convert UE Identity Index value */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
||||||
@@ -1070,13 +1066,12 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
S1AP_PAGING_IND(message_p).ue_index_value = BIT_STRING_to_uint32(&ie->value.choice.UEIdentityIndexValue);
|
S1AP_PAGING_IND(message_p).ue_index_value = BIT_STRING_to_uint32(&ie->value.choice.UEIdentityIndexValue);
|
||||||
S1AP_DEBUG("[SCTP %d] Received Paging ue_index_value (%d)\n",
|
S1AP_DEBUG("[SCTP %d] Received Paging ue_index_value (%d)\n",
|
||||||
assoc_id,(uint32_t)S1AP_PAGING_IND(message_p).ue_index_value);
|
assoc_id,(uint32_t)S1AP_PAGING_IND(message_p).ue_index_value);
|
||||||
|
|
||||||
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.mme_code = 0;
|
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.mme_code = 0;
|
||||||
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.m_tmsi = 0;
|
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.m_tmsi = 0;
|
||||||
|
|
||||||
/* id-UEPagingID */
|
/* id-UEPagingID */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_UEPagingID, true);
|
S1AP_ProtocolIE_ID_id_UEPagingID, true);
|
||||||
|
|
||||||
/* convert UE Paging Identity */
|
/* convert UE Paging Identity */
|
||||||
if (ie->value.choice.UEPagingID.present == S1AP_UEPagingID_PR_s_TMSI) {
|
if (ie->value.choice.UEPagingID.present == S1AP_UEPagingID_PR_s_TMSI) {
|
||||||
S1AP_PAGING_IND(message_p).ue_paging_identity.presenceMask = UE_PAGING_IDENTITY_s_tmsi;
|
S1AP_PAGING_IND(message_p).ue_paging_identity.presenceMask = UE_PAGING_IDENTITY_s_tmsi;
|
||||||
@@ -1115,7 +1110,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256;
|
S1AP_PAGING_IND(message_p).paging_drx = PAGING_DRX_256;
|
||||||
|
|
||||||
/* id-pagingDRX */
|
/* id-pagingDRX */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_pagingDRX, false);
|
S1AP_ProtocolIE_ID_id_pagingDRX, false);
|
||||||
@@ -1145,7 +1139,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
memset (&S1AP_PAGING_IND(message_p).plmn_identity[0], 0, sizeof(plmn_identity_t)*256);
|
memset (&S1AP_PAGING_IND(message_p).plmn_identity[0], 0, sizeof(plmn_identity_t)*256);
|
||||||
memset (&S1AP_PAGING_IND(message_p).tac[0], 0, sizeof(int16_t)*256);
|
memset (&S1AP_PAGING_IND(message_p).tac[0], 0, sizeof(int16_t)*256);
|
||||||
S1AP_PAGING_IND(message_p).tai_size = 0;
|
S1AP_PAGING_IND(message_p).tai_size = 0;
|
||||||
|
|
||||||
/* id-TAIList */
|
/* id-TAIList */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_PagingIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_TAIList, true);
|
S1AP_ProtocolIE_ID_id_TAIList, true);
|
||||||
@@ -1165,7 +1158,6 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
S1AP_PAGING_IND(message_p).tac[i]);
|
S1AP_PAGING_IND(message_p).tac[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//paging parameter values
|
//paging parameter values
|
||||||
S1AP_DEBUG("[SCTP %d] Received Paging parameters: ue_index_value %d cn_domain %d paging_drx %d paging_priority %d\n",assoc_id,
|
S1AP_DEBUG("[SCTP %d] Received Paging parameters: ue_index_value %d cn_domain %d paging_drx %d paging_priority %d\n",assoc_id,
|
||||||
S1AP_PAGING_IND(message_p).ue_index_value, S1AP_PAGING_IND(message_p).cn_domain,
|
S1AP_PAGING_IND(message_p).ue_index_value, S1AP_PAGING_IND(message_p).cn_domain,
|
||||||
@@ -1176,18 +1168,15 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
|
|||||||
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[0], S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[1],
|
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[0], S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[1],
|
||||||
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2], S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[3],
|
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[2], S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[3],
|
||||||
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[4], S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[5]);
|
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[4], S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[5]);
|
||||||
|
|
||||||
/* send message to RRC */
|
/* send message to RRC */
|
||||||
itti_send_msg_to_task(TASK_RRC_ENB, s1ap_eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, s1ap_eNB_instance->instance, message_p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
int i, nb_of_e_rabs_failed;
|
int i, nb_of_e_rabs_failed;
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
||||||
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
||||||
@@ -1196,9 +1185,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
|||||||
S1AP_E_RABModifyRequestIEs_t *ie;
|
S1AP_E_RABModifyRequestIEs_t *ie;
|
||||||
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
||||||
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.E_RABModifyRequest;
|
container = &pdu->choice.initiatingMessage.value.choice.E_RABModifyRequest;
|
||||||
|
|
||||||
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
||||||
@@ -1211,7 +1198,6 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
|||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
||||||
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
||||||
|
|
||||||
/* id-eNB-UE-S1AP-ID */
|
/* id-eNB-UE-S1AP-ID */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
||||||
@@ -1238,9 +1224,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
|||||||
S1AP_WARN("UE context mme_ue_s1ap_id is different form that of the message (%d != %ld)",
|
S1AP_WARN("UE context mme_ue_s1ap_id is different form that of the message (%d != %ld)",
|
||||||
ue_desc_p->mme_ue_s1ap_id, mme_ue_s1ap_id);
|
ue_desc_p->mme_ue_s1ap_id, mme_ue_s1ap_id);
|
||||||
message_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFY_RESP);
|
message_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_MODIFY_RESP);
|
||||||
|
|
||||||
S1AP_E_RAB_MODIFY_RESP (message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
S1AP_E_RAB_MODIFY_RESP (message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||||
|
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq, true);
|
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq, true);
|
||||||
|
|
||||||
@@ -1252,22 +1236,18 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
|||||||
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause = S1AP_Cause_PR_radioNetwork;
|
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause = S1AP_Cause_PR_radioNetwork;
|
||||||
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id;
|
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id;
|
||||||
}
|
}
|
||||||
S1AP_E_RAB_MODIFY_RESP(message_p).nb_of_e_rabs_failed = nb_of_e_rabs_failed;
|
|
||||||
|
|
||||||
|
S1AP_E_RAB_MODIFY_RESP(message_p).nb_of_e_rabs_failed = nb_of_e_rabs_failed;
|
||||||
s1ap_eNB_e_rab_modify_resp(mme_desc_p->s1ap_eNB_instance->instance,
|
s1ap_eNB_e_rab_modify_resp(mme_desc_p->s1ap_eNB_instance->instance,
|
||||||
&S1AP_E_RAB_MODIFY_RESP(message_p));
|
&S1AP_E_RAB_MODIFY_RESP(message_p));
|
||||||
|
|
||||||
message_p = NULL;
|
message_p = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_MODIFY_REQ);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_MODIFY_REQ);
|
||||||
|
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
S1AP_E_RAB_MODIFY_REQ(message_p).ue_initial_id = ue_desc_p->ue_initial_id;
|
||||||
|
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
S1AP_E_RAB_MODIFY_REQ(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
S1AP_E_RAB_MODIFY_REQ(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||||
|
|
||||||
/* id-E-RABToBeModifiedListBearerModReq */
|
/* id-E-RABToBeModifiedListBearerModReq */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABModifyRequestIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq, true);
|
S1AP_ProtocolIE_ID_id_E_RABToBeModifiedListBearerModReq, true);
|
||||||
@@ -1282,9 +1262,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
|||||||
// check for the NAS PDU
|
// check for the NAS PDU
|
||||||
if (item_p->nAS_PDU.size > 0 ) {
|
if (item_p->nAS_PDU.size > 0 ) {
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.length = item_p->nAS_PDU.size;
|
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.length = item_p->nAS_PDU.size;
|
||||||
|
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer = malloc(sizeof(uint8_t) * item_p->nAS_PDU.size);
|
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer = malloc(sizeof(uint8_t) * item_p->nAS_PDU.size);
|
||||||
|
|
||||||
memcpy(S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer,
|
memcpy(S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].nas_pdu.buffer,
|
||||||
item_p->nAS_PDU.buf, item_p->nAS_PDU.size);
|
item_p->nAS_PDU.buf, item_p->nAS_PDU.size);
|
||||||
} else {
|
} else {
|
||||||
@@ -1295,26 +1273,22 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
|
|||||||
|
|
||||||
/* Set the QOS informations */
|
/* Set the QOS informations */
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.qci = item_p->e_RABLevelQoSParameters.qCI;
|
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.qci = item_p->e_RABLevelQoSParameters.qCI;
|
||||||
|
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.priority_level =
|
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.priority_level =
|
||||||
item_p->e_RABLevelQoSParameters.allocationRetentionPriority.priorityLevel;
|
item_p->e_RABLevelQoSParameters.allocationRetentionPriority.priorityLevel;
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.pre_emp_capability =
|
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.pre_emp_capability =
|
||||||
item_p->e_RABLevelQoSParameters.allocationRetentionPriority.pre_emptionCapability;
|
item_p->e_RABLevelQoSParameters.allocationRetentionPriority.pre_emptionCapability;
|
||||||
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.pre_emp_vulnerability =
|
S1AP_E_RAB_MODIFY_REQ(message_p).e_rab_modify_params[i].qos.allocation_retention_priority.pre_emp_vulnerability =
|
||||||
item_p->e_RABLevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability;
|
item_p->e_RABLevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// handle e-rab release command and send it to rrc_end
|
// handle e-rab release command and send it to rrc_end
|
||||||
static
|
static
|
||||||
int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
S1AP_S1AP_PDU_t *pdu)
|
S1AP_S1AP_PDU_t *pdu) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
|
||||||
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
s1ap_eNB_ue_context_t *ue_desc_p = NULL;
|
||||||
@@ -1323,9 +1297,7 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
|||||||
S1AP_E_RABReleaseCommandIEs_t *ie;
|
S1AP_E_RABReleaseCommandIEs_t *ie;
|
||||||
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
S1AP_ENB_UE_S1AP_ID_t enb_ue_s1ap_id;
|
||||||
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
S1AP_MME_UE_S1AP_ID_t mme_ue_s1ap_id;
|
||||||
|
|
||||||
DevAssert(pdu != NULL);
|
DevAssert(pdu != NULL);
|
||||||
|
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.E_RABReleaseCommand;
|
container = &pdu->choice.initiatingMessage.value.choice.E_RABReleaseCommand;
|
||||||
|
|
||||||
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
|
||||||
@@ -1337,7 +1309,6 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
|||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
||||||
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
||||||
|
|
||||||
/* id-eNB-UE-S1AP-ID */
|
/* id-eNB-UE-S1AP-ID */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
||||||
@@ -1366,14 +1337,13 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
|||||||
|
|
||||||
S1AP_DEBUG("[SCTP %d] Received E-RAB release command for eNB_UE_S1AP_ID %ld mme_ue_s1ap_id %ld\n",
|
S1AP_DEBUG("[SCTP %d] Received E-RAB release command for eNB_UE_S1AP_ID %ld mme_ue_s1ap_id %ld\n",
|
||||||
assoc_id, enb_ue_s1ap_id, mme_ue_s1ap_id);
|
assoc_id, enb_ue_s1ap_id, mme_ue_s1ap_id);
|
||||||
|
|
||||||
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_RELEASE_COMMAND);
|
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_RELEASE_COMMAND);
|
||||||
S1AP_E_RAB_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
S1AP_E_RAB_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
|
||||||
S1AP_E_RAB_RELEASE_COMMAND(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
S1AP_E_RAB_RELEASE_COMMAND(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
|
||||||
|
|
||||||
/* id-NAS-PDU */
|
/* id-NAS-PDU */
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_NAS_PDU, false);
|
S1AP_ProtocolIE_ID_id_NAS_PDU, false);
|
||||||
|
|
||||||
if(ie && ie->value.choice.NAS_PDU.size > 0) {
|
if(ie && ie->value.choice.NAS_PDU.size > 0) {
|
||||||
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = ie->value.choice.NAS_PDU.size;
|
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = ie->value.choice.NAS_PDU.size;
|
||||||
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer =
|
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer =
|
||||||
@@ -1399,6 +1369,5 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,13 +61,10 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
S1AP_InitialUEMessage_IEs_t *ie;
|
S1AP_InitialUEMessage_IEs_t *ie;
|
||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t length = 0;
|
uint32_t length = 0;
|
||||||
|
|
||||||
DevAssert(s1ap_nas_first_req_p != NULL);
|
DevAssert(s1ap_nas_first_req_p != NULL);
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
instance_p = s1ap_eNB_get_instance(instance);
|
instance_p = s1ap_eNB_get_instance(instance);
|
||||||
DevAssert(instance_p != NULL);
|
DevAssert(instance_p != NULL);
|
||||||
|
|
||||||
memset(&pdu, 0, sizeof(pdu));
|
memset(&pdu, 0, sizeof(pdu));
|
||||||
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
|
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
|
||||||
pdu.choice.initiatingMessage.procedureCode = S1AP_ProcedureCode_id_initialUEMessage;
|
pdu.choice.initiatingMessage.procedureCode = S1AP_ProcedureCode_id_initialUEMessage;
|
||||||
@@ -81,6 +78,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
instance_p,
|
instance_p,
|
||||||
s1ap_nas_first_req_p->establishment_cause,
|
s1ap_nas_first_req_p->establishment_cause,
|
||||||
s1ap_nas_first_req_p->ue_identity.gummei);
|
s1ap_nas_first_req_p->ue_identity.gummei);
|
||||||
|
|
||||||
if (mme_desc_p) {
|
if (mme_desc_p) {
|
||||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through GUMMEI MCC %d MNC %d MMEGI %d MMEC %d\n",
|
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through GUMMEI MCC %d MNC %d MMEGI %d MMEC %d\n",
|
||||||
instance,
|
instance,
|
||||||
@@ -101,6 +99,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
s1ap_nas_first_req_p->establishment_cause,
|
s1ap_nas_first_req_p->establishment_cause,
|
||||||
s1ap_nas_first_req_p->selected_plmn_identity,
|
s1ap_nas_first_req_p->selected_plmn_identity,
|
||||||
s1ap_nas_first_req_p->ue_identity.s_tmsi.mme_code);
|
s1ap_nas_first_req_p->ue_identity.s_tmsi.mme_code);
|
||||||
|
|
||||||
if (mme_desc_p) {
|
if (mme_desc_p) {
|
||||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through S-TMSI MMEC %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through S-TMSI MMEC %d and selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||||
instance,
|
instance,
|
||||||
@@ -121,6 +120,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
instance_p,
|
instance_p,
|
||||||
s1ap_nas_first_req_p->establishment_cause,
|
s1ap_nas_first_req_p->establishment_cause,
|
||||||
s1ap_nas_first_req_p->selected_plmn_identity);
|
s1ap_nas_first_req_p->selected_plmn_identity);
|
||||||
|
|
||||||
if (mme_desc_p) {
|
if (mme_desc_p) {
|
||||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
|
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through selected PLMN Identity index %d MCC %d MNC %d\n",
|
||||||
instance,
|
instance,
|
||||||
@@ -140,6 +140,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
mme_desc_p = s1ap_eNB_nnsf_select_mme(
|
mme_desc_p = s1ap_eNB_nnsf_select_mme(
|
||||||
instance_p,
|
instance_p,
|
||||||
s1ap_nas_first_req_p->establishment_cause);
|
s1ap_nas_first_req_p->establishment_cause);
|
||||||
|
|
||||||
if (mme_desc_p) {
|
if (mme_desc_p) {
|
||||||
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through highest relative capacity\n",
|
S1AP_INFO("[eNB %d] Chose MME '%s' (assoc_id %d) through highest relative capacity\n",
|
||||||
instance,
|
instance,
|
||||||
@@ -153,7 +154,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
* In case eNB has no MME associated, the eNB should inform RRC and discard
|
* In case eNB has no MME associated, the eNB should inform RRC and discard
|
||||||
* this request.
|
* this request.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
S1AP_WARN("No MME is associated to the eNB\n");
|
S1AP_WARN("No MME is associated to the eNB\n");
|
||||||
// TODO: Inform RRC
|
// TODO: Inform RRC
|
||||||
return -1;
|
return -1;
|
||||||
@@ -164,7 +164,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
*/
|
*/
|
||||||
ue_desc_p = s1ap_eNB_allocate_new_UE_context();
|
ue_desc_p = s1ap_eNB_allocate_new_UE_context();
|
||||||
DevAssert(ue_desc_p != NULL);
|
DevAssert(ue_desc_p != NULL);
|
||||||
|
|
||||||
/* Keep a reference to the selected MME */
|
/* Keep a reference to the selected MME */
|
||||||
ue_desc_p->mme_ref = mme_desc_p;
|
ue_desc_p->mme_ref = mme_desc_p;
|
||||||
ue_desc_p->ue_initial_id = s1ap_nas_first_req_p->ue_initial_id;
|
ue_desc_p->ue_initial_id = s1ap_nas_first_req_p->ue_initial_id;
|
||||||
@@ -173,7 +172,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
struct s1ap_eNB_ue_context_s *collision_p;
|
struct s1ap_eNB_ue_context_s *collision_p;
|
||||||
|
|
||||||
/* Peek a random value for the eNB_ue_s1ap_id */
|
/* Peek a random value for the eNB_ue_s1ap_id */
|
||||||
ue_desc_p->eNB_ue_s1ap_id = (random() + random()) & 0x00ffffff;
|
ue_desc_p->eNB_ue_s1ap_id = (random() + random()) & 0x00ffffff;
|
||||||
|
|
||||||
@@ -194,7 +192,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
ie->value.present = S1AP_InitialUEMessage_IEs__value_PR_ENB_UE_S1AP_ID;
|
ie->value.present = S1AP_InitialUEMessage_IEs__value_PR_ENB_UE_S1AP_ID;
|
||||||
ie->value.choice.ENB_UE_S1AP_ID = ue_desc_p->eNB_ue_s1ap_id;
|
ie->value.choice.ENB_UE_S1AP_ID = ue_desc_p->eNB_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
|
ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
|
||||||
@@ -210,7 +207,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
#endif
|
#endif
|
||||||
ie->value.choice.NAS_PDU.size = s1ap_nas_first_req_p->nas_pdu.length;
|
ie->value.choice.NAS_PDU.size = s1ap_nas_first_req_p->nas_pdu.length;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_TAI;
|
ie->id = S1AP_ProtocolIE_ID_id_TAI;
|
||||||
@@ -223,7 +219,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
|
instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
|
||||||
&ie->value.choice.TAI.pLMNidentity);
|
&ie->value.choice.TAI.pLMNidentity);
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI;
|
ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI;
|
||||||
@@ -242,11 +237,9 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
|
instance_p->mnc_digit_length[ue_desc_p->selected_plmn_identity],
|
||||||
&ie->value.choice.EUTRAN_CGI.pLMNidentity);
|
&ie->value.choice.EUTRAN_CGI.pLMNidentity);
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* Set the establishment cause according to those provided by RRC */
|
/* Set the establishment cause according to those provided by RRC */
|
||||||
DevCheck(s1ap_nas_first_req_p->establishment_cause < RRC_CAUSE_LAST,
|
DevCheck(s1ap_nas_first_req_p->establishment_cause < RRC_CAUSE_LAST,
|
||||||
s1ap_nas_first_req_p->establishment_cause, RRC_CAUSE_LAST, 0);
|
s1ap_nas_first_req_p->establishment_cause, RRC_CAUSE_LAST, 0);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_RRC_Establishment_Cause;
|
ie->id = S1AP_ProtocolIE_ID_id_RRC_Establishment_Cause;
|
||||||
@@ -300,6 +293,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_CellAccessMode;
|
ie->id = S1AP_ProtocolIE_ID_id_CellAccessMode;
|
||||||
@@ -311,6 +305,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(10, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_GW_TransportLayerAddress;
|
ie->id = S1AP_ProtocolIE_ID_id_GW_TransportLayerAddress;
|
||||||
@@ -331,6 +326,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(11, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(11, 0, 0))
|
||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
@@ -372,6 +368,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0))
|
||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
@@ -403,6 +400,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
ie = (S1AP_InitialUEMessage_IEs_t *)calloc(1, sizeof(S1AP_InitialUEMessage_IEs_t));
|
||||||
@@ -422,6 +420,7 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
// ie->value.choice.Coverage_Level = ue_release_req_p->eNB_ue_s1ap_id;
|
// ie->value.choice.Coverage_Level = ue_release_req_p->eNB_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0)) */
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(11, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(11, 0, 0)) */
|
||||||
@@ -435,7 +434,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
|
|
||||||
/* Update the current S1AP UE state */
|
/* Update the current S1AP UE state */
|
||||||
ue_desc_p->ue_state = S1AP_UE_WAITING_CSR;
|
ue_desc_p->ue_state = S1AP_UE_WAITING_CSR;
|
||||||
|
|
||||||
/* Assign a stream for this UE :
|
/* Assign a stream for this UE :
|
||||||
* From 3GPP 36.412 7)Transport layers:
|
* From 3GPP 36.412 7)Transport layers:
|
||||||
* Within the SCTP association established between one MME and eNB pair:
|
* Within the SCTP association established between one MME and eNB pair:
|
||||||
@@ -455,7 +453,6 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ue_desc_p->tx_stream = mme_desc_p->nextstream;
|
ue_desc_p->tx_stream = mme_desc_p->nextstream;
|
||||||
|
|
||||||
MSC_LOG_TX_MESSAGE(
|
MSC_LOG_TX_MESSAGE(
|
||||||
MSC_S1AP_ENB,
|
MSC_S1AP_ENB,
|
||||||
MSC_S1AP_MME,
|
MSC_S1AP_MME,
|
||||||
@@ -464,11 +461,9 @@ int s1ap_eNB_handle_nas_first_req(
|
|||||||
MSC_AS_TIME_FMT" initialUEMessage initiatingMessage eNB_ue_s1ap_id %u",
|
MSC_AS_TIME_FMT" initialUEMessage initiatingMessage eNB_ue_s1ap_id %u",
|
||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
ue_desc_p->eNB_ue_s1ap_id);
|
ue_desc_p->eNB_ue_s1ap_id);
|
||||||
|
|
||||||
/* Send encoded message over sctp */
|
/* Send encoded message over sctp */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, mme_desc_p->assoc_id,
|
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, mme_desc_p->assoc_id,
|
||||||
buffer, length, ue_desc_p->tx_stream);
|
buffer, length, ue_desc_p->tx_stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,14 +497,11 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
s1ap_eNB_instance = mme_desc_p->s1ap_eNB_instance;
|
s1ap_eNB_instance = mme_desc_p->s1ap_eNB_instance;
|
||||||
|
|
||||||
/* Prepare the S1AP message to encode */
|
/* Prepare the S1AP message to encode */
|
||||||
container = &pdu->choice.initiatingMessage.value.choice.DownlinkNASTransport;
|
container = &pdu->choice.initiatingMessage.value.choice.DownlinkNASTransport;
|
||||||
|
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
|
||||||
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
|
||||||
|
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
|
||||||
enb_ue_s1ap_id = ie->value.choice.ENB_UE_S1AP_ID;
|
enb_ue_s1ap_id = ie->value.choice.ENB_UE_S1AP_ID;
|
||||||
@@ -563,7 +555,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
|
|||||||
MSC_AS_TIME_FMT" downlinkNASTransport eNB_ue_s1ap_id %u mme_ue_s1ap_id %u",
|
MSC_AS_TIME_FMT" downlinkNASTransport eNB_ue_s1ap_id %u mme_ue_s1ap_id %u",
|
||||||
assoc_id,
|
assoc_id,
|
||||||
mme_ue_s1ap_id);
|
mme_ue_s1ap_id);
|
||||||
|
|
||||||
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
|
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
|
||||||
S1AP_ProtocolIE_ID_id_NAS_PDU, true);
|
S1AP_ProtocolIE_ID_id_NAS_PDU, true);
|
||||||
/* Forward the NAS PDU to RRC */
|
/* Forward the NAS PDU to RRC */
|
||||||
@@ -572,10 +563,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
|
|||||||
ue_desc_p->eNB_ue_s1ap_id,
|
ue_desc_p->eNB_ue_s1ap_id,
|
||||||
ie->value.choice.NAS_PDU.buf,
|
ie->value.choice.NAS_PDU.buf,
|
||||||
ie->value.choice.NAS_PDU.size);
|
ie->value.choice.NAS_PDU.size);
|
||||||
|
|
||||||
// LG: Why set to 0 ??
|
|
||||||
//ue_desc_p->ue_initial_id = 0;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,9 +577,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
S1AP_UplinkNASTransport_IEs_t *ie;
|
S1AP_UplinkNASTransport_IEs_t *ie;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
|
|
||||||
DevAssert(s1ap_uplink_nas_p != NULL);
|
DevAssert(s1ap_uplink_nas_p != NULL);
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL);
|
DevAssert(s1ap_eNB_instance_p != NULL);
|
||||||
@@ -622,7 +607,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_ignore;
|
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_ignore;
|
||||||
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_UplinkNASTransport;
|
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_UplinkNASTransport;
|
||||||
out = &pdu.choice.initiatingMessage.value.choice.UplinkNASTransport;
|
out = &pdu.choice.initiatingMessage.value.choice.UplinkNASTransport;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -630,7 +614,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -638,7 +621,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_ENB_UE_S1AP_ID;
|
ie->value.present = S1AP_UplinkNASTransport_IEs__value_PR_ENB_UE_S1AP_ID;
|
||||||
ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id;
|
ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
|
ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
|
||||||
@@ -647,7 +629,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
ie->value.choice.NAS_PDU.buf = s1ap_uplink_nas_p->nas_pdu.buffer;
|
ie->value.choice.NAS_PDU.buf = s1ap_uplink_nas_p->nas_pdu.buffer;
|
||||||
ie->value.choice.NAS_PDU.size = s1ap_uplink_nas_p->nas_pdu.length;
|
ie->value.choice.NAS_PDU.size = s1ap_uplink_nas_p->nas_pdu.length;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI;
|
ie->id = S1AP_ProtocolIE_ID_id_EUTRAN_CGI;
|
||||||
@@ -663,7 +644,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
0,
|
0,
|
||||||
&ie->value.choice.EUTRAN_CGI.cell_ID);
|
&ie->value.choice.EUTRAN_CGI.cell_ID);
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_TAI;
|
ie->id = S1AP_ProtocolIE_ID_id_TAI;
|
||||||
@@ -676,9 +656,9 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
&ie->value.choice.TAI.pLMNidentity);
|
&ie->value.choice.TAI.pLMNidentity);
|
||||||
TAC_TO_ASN1(s1ap_eNB_instance_p->tac, &ie->value.choice.TAI.tAC);
|
TAC_TO_ASN1(s1ap_eNB_instance_p->tac, &ie->value.choice.TAI.tAC);
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(10, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_GW_TransportLayerAddress;
|
ie->id = S1AP_ProtocolIE_ID_id_GW_TransportLayerAddress;
|
||||||
@@ -690,6 +670,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
ie = (S1AP_UplinkNASTransport_IEs_t *)calloc(1, sizeof(S1AP_UplinkNASTransport_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_SIPTO_L_GW_TransportLayerAddress;
|
ie->id = S1AP_ProtocolIE_ID_id_SIPTO_L_GW_TransportLayerAddress;
|
||||||
@@ -708,6 +689,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
// ie->value.choice.LHN_ID =;
|
// ie->value.choice.LHN_ID =;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(10, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(10, 0, 0)) */
|
||||||
|
|
||||||
@@ -726,12 +708,10 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
ue_context_p->eNB_ue_s1ap_id,
|
ue_context_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
length, ue_context_p->tx_stream);
|
length, ue_context_p->tx_stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -748,9 +728,7 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
|
|||||||
S1AP_NASNonDeliveryIndication_IEs_t *ie;
|
S1AP_NASNonDeliveryIndication_IEs_t *ie;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
|
|
||||||
DevAssert(s1ap_nas_non_delivery_ind != NULL);
|
DevAssert(s1ap_nas_non_delivery_ind != NULL);
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL);
|
DevAssert(s1ap_eNB_instance_p != NULL);
|
||||||
@@ -773,7 +751,6 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
|
|||||||
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_ignore;
|
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_ignore;
|
||||||
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_NASNonDeliveryIndication;
|
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_NASNonDeliveryIndication;
|
||||||
out = &pdu.choice.initiatingMessage.value.choice.NASNonDeliveryIndication;
|
out = &pdu.choice.initiatingMessage.value.choice.NASNonDeliveryIndication;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -781,7 +758,6 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
|
|||||||
ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -789,7 +765,6 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
|
|||||||
ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_ENB_UE_S1AP_ID;
|
ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_ENB_UE_S1AP_ID;
|
||||||
ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id;
|
ie->value.choice.ENB_UE_S1AP_ID = ue_context_p->eNB_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
|
ie->id = S1AP_ProtocolIE_ID_id_NAS_PDU;
|
||||||
@@ -797,9 +772,7 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
|
|||||||
ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_NAS_PDU;
|
ie->value.present = S1AP_NASNonDeliveryIndication_IEs__value_PR_NAS_PDU;
|
||||||
ie->value.choice.NAS_PDU.buf = s1ap_nas_non_delivery_ind->nas_pdu.buffer;
|
ie->value.choice.NAS_PDU.buf = s1ap_nas_non_delivery_ind->nas_pdu.buffer;
|
||||||
ie->value.choice.NAS_PDU.size = s1ap_nas_non_delivery_ind->nas_pdu.length;
|
ie->value.choice.NAS_PDU.size = s1ap_nas_non_delivery_ind->nas_pdu.length;
|
||||||
|
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
ie = (S1AP_NASNonDeliveryIndication_IEs_t *)calloc(1, sizeof(S1AP_NASNonDeliveryIndication_IEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_Cause;
|
ie->id = S1AP_ProtocolIE_ID_id_Cause;
|
||||||
@@ -828,7 +801,6 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance,
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
ue_context_p->eNB_ue_s1ap_id,
|
ue_context_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
@@ -849,10 +821,8 @@ int s1ap_eNB_initial_ctxt_resp(
|
|||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
|
|
||||||
DevAssert(initial_ctxt_resp_p != NULL);
|
DevAssert(initial_ctxt_resp_p != NULL);
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL);
|
DevAssert(s1ap_eNB_instance_p != NULL);
|
||||||
|
|
||||||
@@ -882,7 +852,6 @@ int s1ap_eNB_initial_ctxt_resp(
|
|||||||
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
||||||
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_InitialContextSetupResponse;
|
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_InitialContextSetupResponse;
|
||||||
out = &pdu.choice.successfulOutcome.value.choice.InitialContextSetupResponse;
|
out = &pdu.choice.successfulOutcome.value.choice.InitialContextSetupResponse;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -890,7 +859,6 @@ int s1ap_eNB_initial_ctxt_resp(
|
|||||||
ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -898,7 +866,6 @@ int s1ap_eNB_initial_ctxt_resp(
|
|||||||
ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_ENB_UE_S1AP_ID;
|
ie->value.present = S1AP_InitialContextSetupResponseIEs__value_PR_ENB_UE_S1AP_ID;
|
||||||
ie->value.choice.ENB_UE_S1AP_ID = initial_ctxt_resp_p->eNB_ue_s1ap_id;
|
ie->value.choice.ENB_UE_S1AP_ID = initial_ctxt_resp_p->eNB_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
ie = (S1AP_InitialContextSetupResponseIEs_t *)calloc(1, sizeof(S1AP_InitialContextSetupResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_E_RABSetupListCtxtSURes;
|
ie->id = S1AP_ProtocolIE_ID_id_E_RABSetupListCtxtSURes;
|
||||||
@@ -949,23 +916,27 @@ int s1ap_eNB_initial_ctxt_resp(
|
|||||||
item->value.choice.E_RABItem.e_RAB_ID = initial_ctxt_resp_p->e_rabs_failed[i].e_rab_id;
|
item->value.choice.E_RABItem.e_RAB_ID = initial_ctxt_resp_p->e_rabs_failed[i].e_rab_id;
|
||||||
item->value.choice.E_RABItem.cause.present = initial_ctxt_resp_p->e_rabs_failed[i].cause;
|
item->value.choice.E_RABItem.cause.present = initial_ctxt_resp_p->e_rabs_failed[i].cause;
|
||||||
|
|
||||||
switch(item->value.choice.E_RABItem.cause.present)
|
switch(item->value.choice.E_RABItem.cause.present) {
|
||||||
{
|
|
||||||
case S1AP_Cause_PR_radioNetwork:
|
case S1AP_Cause_PR_radioNetwork:
|
||||||
item->value.choice.E_RABItem.cause.choice.radioNetwork = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.radioNetwork = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_transport:
|
case S1AP_Cause_PR_transport:
|
||||||
item->value.choice.E_RABItem.cause.choice.transport = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.transport = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_nas:
|
case S1AP_Cause_PR_nas:
|
||||||
item->value.choice.E_RABItem.cause.choice.nas = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.nas = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_protocol:
|
case S1AP_Cause_PR_protocol:
|
||||||
item->value.choice.E_RABItem.cause.choice.protocol = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.protocol = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_misc:
|
case S1AP_Cause_PR_misc:
|
||||||
item->value.choice.E_RABItem.cause.choice.misc = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.misc = initial_ctxt_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_NOTHING:
|
case S1AP_Cause_PR_NOTHING:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1003,12 +974,10 @@ int s1ap_eNB_initial_ctxt_resp(
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
initial_ctxt_resp_p->eNB_ue_s1ap_id,
|
initial_ctxt_resp_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
length, ue_context_p->tx_stream);
|
length, ue_context_p->tx_stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1024,10 +993,8 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
S1AP_UECapabilityInfoIndicationIEs_t *ie;
|
S1AP_UECapabilityInfoIndicationIEs_t *ie;
|
||||||
uint8_t *buffer;
|
uint8_t *buffer;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
|
|
||||||
DevAssert(ue_cap_info_ind_p != NULL);
|
DevAssert(ue_cap_info_ind_p != NULL);
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL);
|
DevAssert(s1ap_eNB_instance_p != NULL);
|
||||||
|
|
||||||
@@ -1057,7 +1024,6 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_ignore;
|
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_ignore;
|
||||||
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_UECapabilityInfoIndication;
|
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_UECapabilityInfoIndication;
|
||||||
out = &pdu.choice.initiatingMessage.value.choice.UECapabilityInfoIndication;
|
out = &pdu.choice.initiatingMessage.value.choice.UECapabilityInfoIndication;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -1065,7 +1031,6 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -1073,7 +1038,6 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_ENB_UE_S1AP_ID;
|
ie->value.present = S1AP_UECapabilityInfoIndicationIEs__value_PR_ENB_UE_S1AP_ID;
|
||||||
ie->value.choice.ENB_UE_S1AP_ID = ue_cap_info_ind_p->eNB_ue_s1ap_id;
|
ie->value.choice.ENB_UE_S1AP_ID = ue_cap_info_ind_p->eNB_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_UERadioCapability;
|
ie->id = S1AP_ProtocolIE_ID_id_UERadioCapability;
|
||||||
@@ -1082,9 +1046,9 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
ie->value.choice.UERadioCapability.buf = ue_cap_info_ind_p->ue_radio_cap.buffer;
|
ie->value.choice.UERadioCapability.buf = ue_cap_info_ind_p->ue_radio_cap.buffer;
|
||||||
ie->value.choice.UERadioCapability.size = ue_cap_info_ind_p->ue_radio_cap.length;
|
ie->value.choice.UERadioCapability.size = ue_cap_info_ind_p->ue_radio_cap.length;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(12, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(12, 0, 0))
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
ie = (S1AP_UECapabilityInfoIndicationIEs_t *)calloc(1, sizeof(S1AP_UECapabilityInfoIndicationIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_UERadioCapabilityForPaging;
|
ie->id = S1AP_ProtocolIE_ID_id_UERadioCapabilityForPaging;
|
||||||
@@ -1093,6 +1057,7 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
// ie->value.choice.UERadioCapabilityForPaging = ;
|
// ie->value.choice.UERadioCapabilityForPaging = ;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
||||||
|
|
||||||
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
||||||
@@ -1110,12 +1075,10 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
ue_cap_info_ind_p->eNB_ue_s1ap_id,
|
ue_cap_info_ind_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
length, ue_context_p->tx_stream);
|
length, ue_context_p->tx_stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1132,10 +1095,8 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
|
|||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
|
|
||||||
DevAssert(e_rab_setup_resp_p != NULL);
|
DevAssert(e_rab_setup_resp_p != NULL);
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL);
|
DevAssert(s1ap_eNB_instance_p != NULL);
|
||||||
|
|
||||||
@@ -1165,7 +1126,6 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
|
|||||||
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
||||||
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_E_RABSetupResponse;
|
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_E_RABSetupResponse;
|
||||||
out = &pdu.choice.successfulOutcome.value.choice.E_RABSetupResponse;
|
out = &pdu.choice.successfulOutcome.value.choice.E_RABSetupResponse;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -1173,7 +1133,6 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
|
|||||||
ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_E_RABSetupResponseIEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
ie = (S1AP_E_RABSetupResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABSetupResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -1234,23 +1193,27 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
|
|||||||
item->value.choice.E_RABItem.e_RAB_ID = e_rab_setup_resp_p->e_rabs_failed[i].e_rab_id;
|
item->value.choice.E_RABItem.e_RAB_ID = e_rab_setup_resp_p->e_rabs_failed[i].e_rab_id;
|
||||||
item->value.choice.E_RABItem.cause.present = e_rab_setup_resp_p->e_rabs_failed[i].cause;
|
item->value.choice.E_RABItem.cause.present = e_rab_setup_resp_p->e_rabs_failed[i].cause;
|
||||||
|
|
||||||
switch(item->value.choice.E_RABItem.cause.present)
|
switch(item->value.choice.E_RABItem.cause.present) {
|
||||||
{
|
|
||||||
case S1AP_Cause_PR_radioNetwork:
|
case S1AP_Cause_PR_radioNetwork:
|
||||||
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_transport:
|
case S1AP_Cause_PR_transport:
|
||||||
item->value.choice.E_RABItem.cause.choice.transport = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.transport = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_nas:
|
case S1AP_Cause_PR_nas:
|
||||||
item->value.choice.E_RABItem.cause.choice.nas = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.nas = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_protocol:
|
case S1AP_Cause_PR_protocol:
|
||||||
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_misc:
|
case S1AP_Cause_PR_misc:
|
||||||
item->value.choice.E_RABItem.cause.choice.misc = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.misc = e_rab_setup_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_NOTHING:
|
case S1AP_Cause_PR_NOTHING:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1280,6 +1243,7 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
|
|||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_E_RABSetupListBearerSURes, &e_RABSetupListBearerSURes);
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_E_RABSetupListBearerSURes, &e_RABSetupListBearerSURes);
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, "start encode\n");
|
fprintf(stderr, "start encode\n");
|
||||||
|
|
||||||
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
||||||
S1AP_ERROR("Failed to encode uplink transport\n");
|
S1AP_ERROR("Failed to encode uplink transport\n");
|
||||||
/* Encode procedure has failed... */
|
/* Encode procedure has failed... */
|
||||||
@@ -1295,12 +1259,10 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance,
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
e_rab_setup_resp_p->eNB_ue_s1ap_id,
|
e_rab_setup_resp_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
length, ue_context_p->tx_stream);
|
length, ue_context_p->tx_stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1314,14 +1276,11 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
|
|||||||
S1AP_S1AP_PDU_t pdu;
|
S1AP_S1AP_PDU_t pdu;
|
||||||
S1AP_E_RABModifyResponse_t *out;
|
S1AP_E_RABModifyResponse_t *out;
|
||||||
S1AP_E_RABModifyResponseIEs_t *ie;
|
S1AP_E_RABModifyResponseIEs_t *ie;
|
||||||
|
|
||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
|
|
||||||
DevAssert(e_rab_modify_resp_p != NULL);
|
DevAssert(e_rab_modify_resp_p != NULL);
|
||||||
DevAssert(s1ap_eNB_instance_p != NULL);
|
DevAssert(s1ap_eNB_instance_p != NULL);
|
||||||
|
|
||||||
@@ -1351,7 +1310,6 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
|
|||||||
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
||||||
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_E_RABModifyResponse;
|
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_E_RABModifyResponse;
|
||||||
out = &pdu.choice.successfulOutcome.value.choice.E_RABModifyResponse;
|
out = &pdu.choice.successfulOutcome.value.choice.E_RABModifyResponse;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t));
|
ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -1359,7 +1317,6 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
|
|||||||
ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_E_RABModifyResponseIEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t));
|
ie = (S1AP_E_RABModifyResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABModifyResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -1405,23 +1362,27 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
|
|||||||
item->value.choice.E_RABItem.e_RAB_ID = e_rab_modify_resp_p->e_rabs_failed[i].e_rab_id;
|
item->value.choice.E_RABItem.e_RAB_ID = e_rab_modify_resp_p->e_rabs_failed[i].e_rab_id;
|
||||||
item->value.choice.E_RABItem.cause.present = e_rab_modify_resp_p->e_rabs_failed[i].cause;
|
item->value.choice.E_RABItem.cause.present = e_rab_modify_resp_p->e_rabs_failed[i].cause;
|
||||||
|
|
||||||
switch(item->value.choice.E_RABItem.cause.present)
|
switch(item->value.choice.E_RABItem.cause.present) {
|
||||||
{
|
|
||||||
case S1AP_Cause_PR_radioNetwork:
|
case S1AP_Cause_PR_radioNetwork:
|
||||||
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_transport:
|
case S1AP_Cause_PR_transport:
|
||||||
item->value.choice.E_RABItem.cause.choice.transport = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.transport = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_nas:
|
case S1AP_Cause_PR_nas:
|
||||||
item->value.choice.E_RABItem.cause.choice.nas = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.nas = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_protocol:
|
case S1AP_Cause_PR_protocol:
|
||||||
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_misc:
|
case S1AP_Cause_PR_misc:
|
||||||
item->value.choice.E_RABItem.cause.choice.misc = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.misc = e_rab_modify_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_NOTHING:
|
case S1AP_Cause_PR_NOTHING:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1445,6 +1406,7 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "start encode\n");
|
fprintf(stderr, "start encode\n");
|
||||||
|
|
||||||
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
||||||
S1AP_ERROR("Failed to encode uplink transport\n");
|
S1AP_ERROR("Failed to encode uplink transport\n");
|
||||||
/* Encode procedure has failed... */
|
/* Encode procedure has failed... */
|
||||||
@@ -1460,7 +1422,6 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance,
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
e_rab_modify_resp_p->eNB_ue_s1ap_id,
|
e_rab_modify_resp_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
@@ -1480,7 +1441,6 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
/* Retrieve the S1AP eNB instance associated with Mod_id */
|
||||||
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
|
||||||
DevAssert(e_rab_release_resp_p != NULL);
|
DevAssert(e_rab_release_resp_p != NULL);
|
||||||
@@ -1501,7 +1461,6 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
pdu.choice.successfulOutcome.criticality = S1AP_Criticality_reject;
|
||||||
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_E_RABReleaseResponse;
|
pdu.choice.successfulOutcome.value.present = S1AP_SuccessfulOutcome__value_PR_E_RABReleaseResponse;
|
||||||
out = &pdu.choice.successfulOutcome.value.choice.E_RABReleaseResponse;
|
out = &pdu.choice.successfulOutcome.value.choice.E_RABReleaseResponse;
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t));
|
ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID;
|
||||||
@@ -1509,7 +1468,6 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
ie->value.present = S1AP_E_RABReleaseResponseIEs__value_PR_MME_UE_S1AP_ID;
|
ie->value.present = S1AP_E_RABReleaseResponseIEs__value_PR_MME_UE_S1AP_ID;
|
||||||
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
ie->value.choice.MME_UE_S1AP_ID = ue_context_p->mme_ue_s1ap_id;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
/* mandatory */
|
/* mandatory */
|
||||||
ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t));
|
ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
ie->id = S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID;
|
||||||
@@ -1555,23 +1513,27 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
item->value.choice.E_RABItem.e_RAB_ID = e_rab_release_resp_p->e_rabs_failed[i].e_rab_id;
|
item->value.choice.E_RABItem.e_RAB_ID = e_rab_release_resp_p->e_rabs_failed[i].e_rab_id;
|
||||||
item->value.choice.E_RABItem.cause.present = e_rab_release_resp_p->e_rabs_failed[i].cause;
|
item->value.choice.E_RABItem.cause.present = e_rab_release_resp_p->e_rabs_failed[i].cause;
|
||||||
|
|
||||||
switch(item->value.choice.E_RABItem.cause.present)
|
switch(item->value.choice.E_RABItem.cause.present) {
|
||||||
{
|
|
||||||
case S1AP_Cause_PR_radioNetwork:
|
case S1AP_Cause_PR_radioNetwork:
|
||||||
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.radioNetwork = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_transport:
|
case S1AP_Cause_PR_transport:
|
||||||
item->value.choice.E_RABItem.cause.choice.transport = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.transport = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_nas:
|
case S1AP_Cause_PR_nas:
|
||||||
item->value.choice.E_RABItem.cause.choice.nas = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.nas = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_protocol:
|
case S1AP_Cause_PR_protocol:
|
||||||
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.protocol = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_misc:
|
case S1AP_Cause_PR_misc:
|
||||||
item->value.choice.E_RABItem.cause.choice.misc = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
item->value.choice.E_RABItem.cause.choice.misc = e_rab_release_resp_p->e_rabs_failed[i].cause_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S1AP_Cause_PR_NOTHING:
|
case S1AP_Cause_PR_NOTHING:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1595,6 +1557,7 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
|
|
||||||
/* optional */
|
/* optional */
|
||||||
#if (S1AP_VERSION >= MAKE_VERSION(12, 0, 0))
|
#if (S1AP_VERSION >= MAKE_VERSION(12, 0, 0))
|
||||||
|
|
||||||
if(0) {
|
if(0) {
|
||||||
ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t));
|
ie = (S1AP_E_RABReleaseResponseIEs_t *)calloc(1, sizeof(S1AP_E_RABReleaseResponseIEs_t));
|
||||||
ie->id = S1AP_ProtocolIE_ID_id_UserLocationInformation;
|
ie->id = S1AP_ProtocolIE_ID_id_UserLocationInformation;
|
||||||
@@ -1603,9 +1566,10 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
// ie->value.choice.UserLocationInformation = ;
|
// ie->value.choice.UserLocationInformation = ;
|
||||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
}
|
}
|
||||||
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
|
||||||
|
|
||||||
|
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
|
||||||
fprintf(stderr, "start encode\n");
|
fprintf(stderr, "start encode\n");
|
||||||
|
|
||||||
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) {
|
||||||
S1AP_ERROR("Failed to encode release response\n");
|
S1AP_ERROR("Failed to encode release response\n");
|
||||||
/* Encode procedure has failed... */
|
/* Encode procedure has failed... */
|
||||||
@@ -1621,14 +1585,11 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance,
|
|||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
e_rab_release_resp_p->eNB_ue_s1ap_id,
|
e_rab_release_resp_p->eNB_ue_s1ap_id,
|
||||||
ue_context_p->mme_ue_s1ap_id);
|
ue_context_p->mme_ue_s1ap_id);
|
||||||
|
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance,
|
||||||
ue_context_p->mme_ref->assoc_id, buffer,
|
ue_context_p->mme_ref->assoc_id, buffer,
|
||||||
length, ue_context_p->tx_stream);
|
length, ue_context_p->tx_stream);
|
||||||
|
|
||||||
S1AP_INFO("e_rab_release_response sended eNB_UE_S1AP_ID %d mme_ue_s1ap_id %d nb_of_e_rabs_released %d nb_of_e_rabs_failed %d\n",
|
S1AP_INFO("e_rab_release_response sended eNB_UE_S1AP_ID %d mme_ue_s1ap_id %d nb_of_e_rabs_released %d nb_of_e_rabs_failed %d\n",
|
||||||
e_rab_release_resp_p->eNB_ue_s1ap_id, ue_context_p->mme_ue_s1ap_id,e_rab_release_resp_p->nb_of_e_rabs_released,e_rab_release_resp_p->nb_of_e_rabs_failed);
|
e_rab_release_resp_p->eNB_ue_s1ap_id, ue_context_p->mme_ue_s1ap_id,e_rab_release_resp_p->nb_of_e_rabs_released,e_rab_release_resp_p->nb_of_e_rabs_failed);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ log_config = {
|
|||||||
global_log_verbosity ="medium";
|
global_log_verbosity ="medium";
|
||||||
hw_log_level ="info";
|
hw_log_level ="info";
|
||||||
hw_log_verbosity ="medium";
|
hw_log_verbosity ="medium";
|
||||||
phy_log_level ="debug";
|
phy_log_level ="info";
|
||||||
phy_log_verbosity ="medium";
|
phy_log_verbosity ="medium";
|
||||||
mac_log_level ="debug";
|
mac_log_level ="info";
|
||||||
mac_log_verbosity ="high";
|
mac_log_verbosity ="high";
|
||||||
rlc_log_level ="info";
|
rlc_log_level ="info";
|
||||||
rlc_log_verbosity ="medium";
|
rlc_log_verbosity ="medium";
|
||||||
|
|||||||
+98
-173
@@ -77,16 +77,16 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef OPENAIR2
|
#ifndef OPENAIR2
|
||||||
#include "UTIL/OTG/otg_extern.h"
|
#include "UTIL/OTG/otg_extern.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
# if defined(ENABLE_USE_MME)
|
#if defined(ENABLE_USE_MME)
|
||||||
# include "s1ap_eNB.h"
|
#include "s1ap_eNB.h"
|
||||||
#ifdef PDCP_USE_NETLINK
|
#ifdef PDCP_USE_NETLINK
|
||||||
# include "SIMULATION/ETH_TRANSPORT/proto.h"
|
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||||
#endif
|
#endif
|
||||||
# endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "T.h"
|
#include "T.h"
|
||||||
@@ -106,8 +106,8 @@ struct timing_info_t {
|
|||||||
|
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
extern volatile int start_eNB;
|
extern volatile int start_eNB;
|
||||||
extern volatile int start_UE;
|
extern volatile int start_UE;
|
||||||
#endif
|
#endif
|
||||||
extern volatile int oai_exit;
|
extern volatile int oai_exit;
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ int wakeup_tx(PHY_VARS_eNB *eNB);
|
|||||||
int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB);
|
int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB);
|
||||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern uint8_t nfapi_mode;
|
extern uint8_t nfapi_mode;
|
||||||
@@ -165,13 +165,10 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
|||||||
// *******************************************************************
|
// *******************************************************************
|
||||||
|
|
||||||
if (nfapi_mode == 1) {
|
if (nfapi_mode == 1) {
|
||||||
|
|
||||||
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
||||||
uint16_t frame = proc->frame_rx;
|
uint16_t frame = proc->frame_rx;
|
||||||
uint16_t subframe = proc->subframe_rx;
|
uint16_t subframe = proc->subframe_rx;
|
||||||
|
|
||||||
//add_subframe(&frame, &subframe, 4);
|
//add_subframe(&frame, &subframe, 4);
|
||||||
|
|
||||||
//oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
|
//oai_subframe_ind(proc->frame_tx, proc->subframe_tx);
|
||||||
//LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
|
//LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe);
|
||||||
start_meas(&nfapi_meas);
|
start_meas(&nfapi_meas);
|
||||||
@@ -202,7 +199,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
|||||||
|
|
||||||
// ****************************************
|
// ****************************************
|
||||||
// Common RX procedures subframe n
|
// Common RX procedures subframe n
|
||||||
|
|
||||||
T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
|
T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
|
||||||
|
|
||||||
// if this is IF5 or 3GPP_eNB
|
// if this is IF5 or 3GPP_eNB
|
||||||
@@ -219,35 +215,34 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
|||||||
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
if (nfapi_mode == 0 || nfapi_mode == 1) {
|
||||||
phy_procedures_eNB_uespec_RX(eNB, proc);
|
phy_procedures_eNB_uespec_RX(eNB, proc);
|
||||||
}
|
}
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 );
|
|
||||||
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 1 );
|
||||||
|
|
||||||
|
|
||||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||||
|
|
||||||
eNB->UL_INFO.frame = proc->frame_rx;
|
eNB->UL_INFO.frame = proc->frame_rx;
|
||||||
eNB->UL_INFO.subframe = proc->subframe_rx;
|
eNB->UL_INFO.subframe = proc->subframe_rx;
|
||||||
eNB->UL_INFO.module_id = eNB->Mod_id;
|
eNB->UL_INFO.module_id = eNB->Mod_id;
|
||||||
eNB->UL_INFO.CC_id = eNB->CC_id;
|
eNB->UL_INFO.CC_id = eNB->CC_id;
|
||||||
|
|
||||||
eNB->if_inst->UL_indication(&eNB->UL_INFO);
|
eNB->if_inst->UL_indication(&eNB->UL_INFO);
|
||||||
|
|
||||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||||
/* this conflict resolution may be totally wrong, to be tested */
|
/* this conflict resolution may be totally wrong, to be tested */
|
||||||
/* CONFLICT RESOLUTION: BEGIN */
|
/* CONFLICT RESOLUTION: BEGIN */
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 0 );
|
||||||
|
|
||||||
if(oai_exit) return(-1);
|
if(oai_exit) return(-1);
|
||||||
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD){
|
|
||||||
|
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) {
|
||||||
#ifndef PHY_TX_THREAD
|
#ifndef PHY_TX_THREAD
|
||||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CONFLICT RESOLUTION: what about this release_thread call, has it to be done? if yes, where? */
|
/* CONFLICT RESOLUTION: what about this release_thread call, has it to be done? if yes, where? */
|
||||||
//if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
|
//if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
|
||||||
/* CONFLICT RESOLUTION: END */
|
/* CONFLICT RESOLUTION: END */
|
||||||
|
|
||||||
stop_meas( &softmodem_stats_rxtx_sf );
|
stop_meas( &softmodem_stats_rxtx_sf );
|
||||||
|
|
||||||
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
|
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);
|
||||||
|
|
||||||
LOG_D(PHY, "rxtx:%lld nfapi:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
|
LOG_D(PHY, "rxtx:%lld nfapi:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
|
||||||
softmodem_stats_rxtx_sf.p_time, nfapi_meas.p_time,
|
softmodem_stats_rxtx_sf.p_time, nfapi_meas.p_time,
|
||||||
TICK_TO_US(eNB->phy_proc_tx),
|
TICK_TO_US(eNB->phy_proc_tx),
|
||||||
@@ -264,14 +259,12 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
|||||||
TICK_TO_US(eNB->dlsch_turbo_encoding_stats),
|
TICK_TO_US(eNB->dlsch_turbo_encoding_stats),
|
||||||
TICK_TO_US(eNB->dlsch_interleaving_stats),
|
TICK_TO_US(eNB->dlsch_interleaving_stats),
|
||||||
TICK_TO_US(eNB->rx_dft_stats));
|
TICK_TO_US(eNB->rx_dft_stats));
|
||||||
|
|
||||||
LOG_D(PHY," ulsch[ch:%lld freq:%lld dec:%lld demod:%lld ru:%lld ",
|
LOG_D(PHY," ulsch[ch:%lld freq:%lld dec:%lld demod:%lld ru:%lld ",
|
||||||
TICK_TO_US(eNB->ulsch_channel_estimation_stats),
|
TICK_TO_US(eNB->ulsch_channel_estimation_stats),
|
||||||
TICK_TO_US(eNB->ulsch_freq_offset_estimation_stats),
|
TICK_TO_US(eNB->ulsch_freq_offset_estimation_stats),
|
||||||
TICK_TO_US(eNB->ulsch_decoding_stats),
|
TICK_TO_US(eNB->ulsch_decoding_stats),
|
||||||
TICK_TO_US(eNB->ulsch_demodulation_stats),
|
TICK_TO_US(eNB->ulsch_demodulation_stats),
|
||||||
TICK_TO_US(eNB->ulsch_rate_unmatching_stats));
|
TICK_TO_US(eNB->ulsch_rate_unmatching_stats));
|
||||||
|
|
||||||
LOG_D(PHY, "td:%lld dei:%lld dem:%lld llr:%lld tci:%lld ",
|
LOG_D(PHY, "td:%lld dei:%lld dem:%lld llr:%lld tci:%lld ",
|
||||||
TICK_TO_US(eNB->ulsch_turbo_decoding_stats),
|
TICK_TO_US(eNB->ulsch_turbo_decoding_stats),
|
||||||
TICK_TO_US(eNB->ulsch_deinterleaving_stats),
|
TICK_TO_US(eNB->ulsch_deinterleaving_stats),
|
||||||
@@ -286,7 +279,6 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
|||||||
TICK_TO_US(eNB->ulsch_tc_intl1_stats),
|
TICK_TO_US(eNB->ulsch_tc_intl1_stats),
|
||||||
TICK_TO_US(eNB->ulsch_tc_intl2_stats)
|
TICK_TO_US(eNB->ulsch_tc_intl2_stats)
|
||||||
);
|
);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,7 +288,6 @@ static void* L1_thread_tx(void* param) {
|
|||||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||||
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
||||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||||
|
|
||||||
char thread_name[100];
|
char thread_name[100];
|
||||||
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
sprintf(thread_name,"TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||||
thread_top_init(thread_name,1,470000,500000,500000);
|
thread_top_init(thread_name,1,470000,500000,500000);
|
||||||
@@ -304,10 +295,9 @@ static void* L1_thread_tx(void* param) {
|
|||||||
//wait_sync("tx_thread");
|
//wait_sync("tx_thread");
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
|
|
||||||
if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break;
|
if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break;
|
||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
// *****************************************
|
// *****************************************
|
||||||
// TX processing for subframe n+4
|
// TX processing for subframe n+4
|
||||||
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
||||||
@@ -317,11 +307,12 @@ static void* L1_thread_tx(void* param) {
|
|||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_ENB,proc->subframe_rx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_ENB,proc->subframe_rx);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
|
||||||
|
|
||||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||||
|
|
||||||
|
|
||||||
pthread_mutex_lock( &proc->mutex );
|
pthread_mutex_lock( &proc->mutex );
|
||||||
proc->instance_cnt = -1;
|
proc->instance_cnt = -1;
|
||||||
|
|
||||||
// the thread can now be woken up
|
// the thread can now be woken up
|
||||||
if (pthread_cond_signal(&proc->cond) != 0) {
|
if (pthread_cond_signal(&proc->cond) != 0) {
|
||||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||||
@@ -355,28 +346,20 @@ static void* L1_thread( void* param ) {
|
|||||||
proc = &eNB_proc->L1_proc;
|
proc = &eNB_proc->L1_proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||||
|
|
||||||
char thread_name[100];
|
char thread_name[100];
|
||||||
|
|
||||||
cpu_set_t cpuset;
|
cpu_set_t cpuset;
|
||||||
CPU_ZERO(&cpuset);
|
CPU_ZERO(&cpuset);
|
||||||
|
|
||||||
// set default return value
|
// set default return value
|
||||||
eNB_thread_rxtx_status = 0;
|
eNB_thread_rxtx_status = 0;
|
||||||
|
|
||||||
|
|
||||||
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||||
thread_top_init(thread_name,1,470000,500000,500000);
|
thread_top_init(thread_name,1,470000,500000,500000);
|
||||||
pthread_setname_np( pthread_self(),"rxtx processing");
|
pthread_setname_np( pthread_self(),"rxtx processing");
|
||||||
LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid));
|
LOG_I(PHY,"thread rxtx created id=%ld\n", syscall(__NR_gettid));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||||
|
|
||||||
@@ -384,17 +367,14 @@ static void* L1_thread( void* param ) {
|
|||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,sched_getcpu());
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB,proc->subframe_tx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_ENB,proc->subframe_tx);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB,proc->subframe_rx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_ENB,proc->subframe_rx);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB,proc->frame_tx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_ENB,proc->frame_tx);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB,proc->frame_rx);
|
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_ENB,proc->frame_rx);
|
||||||
|
|
||||||
|
|
||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
if (eNB->CC_id==0)
|
if (eNB->CC_id==0) {
|
||||||
{
|
|
||||||
if (rxtx(eNB,proc,thread_name) < 0) break;
|
if (rxtx(eNB,proc,thread_name) < 0) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,13 +384,10 @@ static void* L1_thread( void* param ) {
|
|||||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
|
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
|
||||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB);
|
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // while !oai_exit
|
} // while !oai_exit
|
||||||
|
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
|
||||||
|
|
||||||
LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
|
LOG_D(PHY, " *** Exiting eNB thread RXn_TXnp4\n");
|
||||||
|
|
||||||
eNB_thread_rxtx_status = 0;
|
eNB_thread_rxtx_status = 0;
|
||||||
return &eNB_thread_rxtx_status;
|
return &eNB_thread_rxtx_status;
|
||||||
}
|
}
|
||||||
@@ -421,7 +398,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
|||||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||||
RU_proc_t *ru_proc=&ru->proc;
|
RU_proc_t *ru_proc=&ru->proc;
|
||||||
|
|
||||||
proc->frame_rx = frame_rx;
|
proc->frame_rx = frame_rx;
|
||||||
proc->subframe_rx = subframe_rx;
|
proc->subframe_rx = subframe_rx;
|
||||||
|
|
||||||
@@ -532,7 +508,6 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock( &L1_proc_tx->mutex);
|
pthread_mutex_unlock( &L1_proc_tx->mutex);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,34 +518,30 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
|||||||
|
|
||||||
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
||||||
|
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
struct timespec wait;
|
struct timespec wait;
|
||||||
|
|
||||||
pthread_mutex_lock(&proc->mutex_RU);
|
pthread_mutex_lock(&proc->mutex_RU);
|
||||||
for (i=0;i<eNB->num_RU;i++) {
|
|
||||||
|
for (i=0; i<eNB->num_RU; i++) {
|
||||||
if (ru == eNB->RU_list[i]) {
|
if (ru == eNB->RU_list[i]) {
|
||||||
if ((proc->RU_mask&(1<<i)) > 0)
|
if ((proc->RU_mask&(1<<i)) > 0)
|
||||||
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n",
|
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information from RU %d (num_RU %d,mask %x) has not been served yet!\n",
|
||||||
eNB->Mod_id,proc->frame_rx,proc->subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask);
|
eNB->Mod_id,proc->frame_rx,proc->subframe_rx,ru->idx,eNB->num_RU,proc->RU_mask);
|
||||||
|
|
||||||
proc->RU_mask |= (1<<i);
|
proc->RU_mask |= (1<<i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proc->RU_mask != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
if (proc->RU_mask != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||||
LOG_E(PHY,"Not all RUs have provided their info\n");
|
LOG_E(PHY,"Not all RUs have provided their info\n");
|
||||||
pthread_mutex_unlock(&proc->mutex_RU);
|
pthread_mutex_unlock(&proc->mutex_RU);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
} else { // all RUs have provided their information so continue on and wakeup eNB processing
|
||||||
else { // all RUs have provided their information so continue on and wakeup eNB processing
|
|
||||||
proc->RU_mask = 0;
|
proc->RU_mask = 0;
|
||||||
pthread_mutex_unlock(&proc->mutex_RU);
|
pthread_mutex_unlock(&proc->mutex_RU);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wait.tv_sec=0;
|
wait.tv_sec=0;
|
||||||
wait.tv_nsec=5000000L;
|
wait.tv_nsec=5000000L;
|
||||||
|
|
||||||
@@ -588,7 +559,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
++L1_proc->instance_cnt;
|
++L1_proc->instance_cnt;
|
||||||
|
|
||||||
// We have just received and processed the common part of a subframe, say n.
|
// We have just received and processed the common part of a subframe, say n.
|
||||||
@@ -611,7 +581,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_unlock( &L1_proc->mutex);
|
pthread_mutex_unlock( &L1_proc->mutex);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -623,20 +592,23 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
|
|
||||||
if (ru!=NULL) {
|
if (ru!=NULL) {
|
||||||
pthread_mutex_lock(&proc->mutex_RU_PRACH);
|
pthread_mutex_lock(&proc->mutex_RU_PRACH);
|
||||||
for (i=0;i<eNB->num_RU;i++) {
|
|
||||||
|
for (i=0; i<eNB->num_RU; i++) {
|
||||||
if (ru == eNB->RU_list[i]) {
|
if (ru == eNB->RU_list[i]) {
|
||||||
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU);
|
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach,eNB->num_RU);
|
||||||
|
|
||||||
if ((proc->RU_mask_prach&(1<<i)) > 0)
|
if ((proc->RU_mask_prach&(1<<i)) > 0)
|
||||||
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH) from RU %d (num_RU %d, mask %x) has not been served yet!\n",
|
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH) from RU %d (num_RU %d, mask %x) has not been served yet!\n",
|
||||||
eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach);
|
eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach);
|
||||||
|
|
||||||
proc->RU_mask_prach |= (1<<i);
|
proc->RU_mask_prach |= (1<<i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proc->RU_mask_prach != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
if (proc->RU_mask_prach != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||||
pthread_mutex_unlock(&proc->mutex_RU_PRACH);
|
pthread_mutex_unlock(&proc->mutex_RU_PRACH);
|
||||||
return;
|
return;
|
||||||
}
|
} else { // all RUs have provided their information so continue on and wakeup eNB processing
|
||||||
else { // all RUs have provided their information so continue on and wakeup eNB processing
|
|
||||||
proc->RU_mask_prach = 0;
|
proc->RU_mask_prach = 0;
|
||||||
pthread_mutex_unlock(&proc->mutex_RU_PRACH);
|
pthread_mutex_unlock(&proc->mutex_RU_PRACH);
|
||||||
}
|
}
|
||||||
@@ -645,6 +617,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
// check if we have to detect PRACH first
|
// check if we have to detect PRACH first
|
||||||
if (is_prach_subframe(fp,frame,subframe)>0) {
|
if (is_prach_subframe(fp,frame,subframe)>0) {
|
||||||
LOG_D(PHY,"Triggering prach processing, frame %d, subframe %d\n",frame,subframe);
|
LOG_D(PHY,"Triggering prach processing, frame %d, subframe %d\n",frame,subframe);
|
||||||
|
|
||||||
if (proc->instance_cnt_prach == 0) {
|
if (proc->instance_cnt_prach == 0) {
|
||||||
LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH\n", frame,subframe);
|
LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH\n", frame,subframe);
|
||||||
return;
|
return;
|
||||||
@@ -671,7 +644,6 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
|
|
||||||
pthread_mutex_unlock( &proc->mutex_prach );
|
pthread_mutex_unlock( &proc->mutex_prach );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
@@ -683,20 +655,23 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
|
|
||||||
if (ru!=NULL) {
|
if (ru!=NULL) {
|
||||||
pthread_mutex_lock(&proc->mutex_RU_PRACH_br);
|
pthread_mutex_lock(&proc->mutex_RU_PRACH_br);
|
||||||
for (i=0;i<eNB->num_RU;i++) {
|
|
||||||
|
for (i=0; i<eNB->num_RU; i++) {
|
||||||
if (ru == eNB->RU_list[i]) {
|
if (ru == eNB->RU_list[i]) {
|
||||||
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH BR (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach_br,eNB->num_RU);
|
LOG_D(PHY,"frame %d, subframe %d: RU %d for eNB %d signals PRACH BR (mask %x, num_RU %d)\n",frame,subframe,i,eNB->Mod_id,proc->RU_mask_prach_br,eNB->num_RU);
|
||||||
|
|
||||||
if ((proc->RU_mask_prach_br&(1<<i)) > 0)
|
if ((proc->RU_mask_prach_br&(1<<i)) > 0)
|
||||||
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH BR) from RU %d (num_RU %d, mask %x) has not been served yet!\n",
|
LOG_E(PHY,"eNB %d frame %d, subframe %d : previous information (PRACH BR) from RU %d (num_RU %d, mask %x) has not been served yet!\n",
|
||||||
eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach_br);
|
eNB->Mod_id,frame,subframe,ru->idx,eNB->num_RU,proc->RU_mask_prach_br);
|
||||||
|
|
||||||
proc->RU_mask_prach_br |= (1<<i);
|
proc->RU_mask_prach_br |= (1<<i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proc->RU_mask_prach_br != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
if (proc->RU_mask_prach_br != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||||
pthread_mutex_unlock(&proc->mutex_RU_PRACH_br);
|
pthread_mutex_unlock(&proc->mutex_RU_PRACH_br);
|
||||||
return;
|
return;
|
||||||
}
|
} else { // all RUs have provided their information so continue on and wakeup eNB processing
|
||||||
else { // all RUs have provided their information so continue on and wakeup eNB processing
|
|
||||||
proc->RU_mask_prach_br = 0;
|
proc->RU_mask_prach_br = 0;
|
||||||
pthread_mutex_unlock(&proc->mutex_RU_PRACH_br);
|
pthread_mutex_unlock(&proc->mutex_RU_PRACH_br);
|
||||||
}
|
}
|
||||||
@@ -705,6 +680,7 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
// check if we have to detect PRACH first
|
// check if we have to detect PRACH first
|
||||||
if (is_prach_subframe(fp,frame,subframe)>0) {
|
if (is_prach_subframe(fp,frame,subframe)>0) {
|
||||||
LOG_D(PHY,"Triggering prach br processing, frame %d, subframe %d\n",frame,subframe);
|
LOG_D(PHY,"Triggering prach br processing, frame %d, subframe %d\n",frame,subframe);
|
||||||
|
|
||||||
if (proc->instance_cnt_prach_br == 0) {
|
if (proc->instance_cnt_prach_br == 0) {
|
||||||
LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH BR\n", frame,subframe);
|
LOG_W(PHY,"[eNB] Frame %d Subframe %d, dropping PRACH BR\n", frame,subframe);
|
||||||
return;
|
return;
|
||||||
@@ -731,7 +707,6 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
|
|
||||||
pthread_mutex_unlock( &proc->mutex_prach_br );
|
pthread_mutex_unlock( &proc->mutex_prach_br );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -741,25 +716,20 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
|||||||
* \param param is a \ref L1_proc_t structure which contains the info what to process.
|
* \param param is a \ref L1_proc_t structure which contains the info what to process.
|
||||||
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
||||||
*/
|
*/
|
||||||
static void* eNB_thread_prach( void* param ) {
|
static void *eNB_thread_prach( void *param ) {
|
||||||
static int eNB_thread_prach_status;
|
static int eNB_thread_prach_status;
|
||||||
|
|
||||||
|
|
||||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||||
L1_proc_t *proc = &eNB->proc;
|
L1_proc_t *proc = &eNB->proc;
|
||||||
|
|
||||||
// set default return value
|
// set default return value
|
||||||
eNB_thread_prach_status = 0;
|
eNB_thread_prach_status = 0;
|
||||||
|
|
||||||
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
|
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
|
||||||
|
|
||||||
//wait_sync("eNB_thread_prach");
|
//wait_sync("eNB_thread_prach");
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"eNB_prach_thread") < 0) break;
|
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"eNB_prach_thread") < 0) break;
|
||||||
|
|
||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
LOG_D(PHY,"Running eNB prach procedures\n");
|
LOG_D(PHY,"Running eNB prach procedures\n");
|
||||||
@@ -773,7 +743,6 @@ static void* eNB_thread_prach( void* param ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(PHY, "Exiting eNB thread PRACH\n");
|
LOG_I(PHY, "Exiting eNB thread PRACH\n");
|
||||||
|
|
||||||
eNB_thread_prach_status = 0;
|
eNB_thread_prach_status = 0;
|
||||||
return &eNB_thread_prach_status;
|
return &eNB_thread_prach_status;
|
||||||
}
|
}
|
||||||
@@ -784,23 +753,18 @@ static void* eNB_thread_prach( void* param ) {
|
|||||||
* \param param is a \ref L1_proc_t structure which contains the info what to process.
|
* \param param is a \ref L1_proc_t structure which contains the info what to process.
|
||||||
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
||||||
*/
|
*/
|
||||||
static void* eNB_thread_prach_br( void* param ) {
|
static void *eNB_thread_prach_br( void *param ) {
|
||||||
static int eNB_thread_prach_status;
|
static int eNB_thread_prach_status;
|
||||||
|
|
||||||
|
|
||||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||||
L1_proc_t *proc = &eNB->proc;
|
L1_proc_t *proc = &eNB->proc;
|
||||||
|
|
||||||
// set default return value
|
// set default return value
|
||||||
eNB_thread_prach_status = 0;
|
eNB_thread_prach_status = 0;
|
||||||
|
|
||||||
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
|
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
|
if (wait_on_condition(&proc->mutex_prach_br,&proc->cond_prach_br,&proc->instance_cnt_prach_br,"eNB_prach_thread_br") < 0) break;
|
||||||
|
|
||||||
if (oai_exit) break;
|
if (oai_exit) break;
|
||||||
|
|
||||||
LOG_D(PHY,"Running eNB prach procedures for BL/CE UEs\n");
|
LOG_D(PHY,"Running eNB prach procedures for BL/CE UEs\n");
|
||||||
@@ -810,7 +774,6 @@ static void* eNB_thread_prach_br( void* param ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(PHY, "Exiting eNB thread PRACH BR\n");
|
LOG_I(PHY, "Exiting eNB thread PRACH BR\n");
|
||||||
|
|
||||||
eNB_thread_prach_status = 0;
|
eNB_thread_prach_status = 0;
|
||||||
return &eNB_thread_prach_status;
|
return &eNB_thread_prach_status;
|
||||||
}
|
}
|
||||||
@@ -824,17 +787,17 @@ extern void init_te_thread(PHY_VARS_eNB *);
|
|||||||
extern void kill_td_thread(PHY_VARS_eNB *);
|
extern void kill_td_thread(PHY_VARS_eNB *);
|
||||||
extern void kill_te_thread(PHY_VARS_eNB *);
|
extern void kill_te_thread(PHY_VARS_eNB *);
|
||||||
|
|
||||||
static void* process_stats_thread(void* param) {
|
static void *process_stats_thread(void *param) {
|
||||||
|
PHY_VARS_eNB *eNB = (PHY_VARS_eNB *)param;
|
||||||
PHY_VARS_eNB *eNB = (PHY_VARS_eNB*)param;
|
|
||||||
|
|
||||||
wait_sync("process_stats_thread");
|
wait_sync("process_stats_thread");
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
if (opp_enabled == 1) {
|
if (opp_enabled == 1) {
|
||||||
if ( eNB->ulsch_decoding_stats.trials>0)
|
if ( eNB->ulsch_decoding_stats.trials>0)
|
||||||
print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
|
print_meas(&eNB->ulsch_decoding_stats,"ulsch_decoding",NULL,NULL);
|
||||||
|
|
||||||
if (eNB->dlsch_encoding_stats.trials >0) {
|
if (eNB->dlsch_encoding_stats.trials >0) {
|
||||||
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_crc",NULL,NULL);
|
print_meas(&eNB->dlsch_turbo_encoding_preperation_stats,"dlsch_coding_crc",NULL,NULL);
|
||||||
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats,"dlsch_segmentation",NULL,NULL);
|
print_meas(&eNB->dlsch_turbo_encoding_segmentation_stats,"dlsch_segmentation",NULL,NULL);
|
||||||
@@ -848,15 +811,16 @@ static void* process_stats_thread(void* param) {
|
|||||||
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL);
|
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats0,"coding_worker_0",NULL,NULL);
|
||||||
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL);
|
print_meas(&eNB->dlsch_turbo_encoding_wakeup_stats1,"coding_worker_1",NULL,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
|
print_meas(&eNB->dlsch_modulation_stats,"dlsch_modulation",NULL,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_eNB_proc(int inst) {
|
void init_eNB_proc(int inst) {
|
||||||
|
|
||||||
/*int i=0;*/
|
/*int i=0;*/
|
||||||
int CC_id;
|
int CC_id;
|
||||||
PHY_VARS_eNB *eNB;
|
PHY_VARS_eNB *eNB;
|
||||||
@@ -866,7 +830,6 @@ void init_eNB_proc(int inst) {
|
|||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
pthread_attr_t *attr_prach_br=NULL;
|
pthread_attr_t *attr_prach_br=NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]);
|
LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]);
|
||||||
|
|
||||||
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
||||||
@@ -908,10 +871,8 @@ void init_eNB_proc(int inst) {
|
|||||||
pthread_mutex_init( &proc->mutex_RU,NULL);
|
pthread_mutex_init( &proc->mutex_RU,NULL);
|
||||||
pthread_mutex_init( &proc->mutex_RU_tx,NULL);
|
pthread_mutex_init( &proc->mutex_RU_tx,NULL);
|
||||||
pthread_mutex_init( &proc->mutex_RU_PRACH,NULL);
|
pthread_mutex_init( &proc->mutex_RU_PRACH,NULL);
|
||||||
|
|
||||||
pthread_cond_init( &proc->cond_prach, NULL);
|
pthread_cond_init( &proc->cond_prach, NULL);
|
||||||
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
|
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
|
||||||
|
|
||||||
pthread_attr_init( &proc->attr_prach);
|
pthread_attr_init( &proc->attr_prach);
|
||||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||||
pthread_attr_init( &L1_proc->attr);
|
pthread_attr_init( &L1_proc->attr);
|
||||||
@@ -931,24 +892,22 @@ void init_eNB_proc(int inst) {
|
|||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
attr_prach_br = &proc->attr_prach_br;
|
attr_prach_br = &proc->attr_prach_br;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// attr_td = &proc->attr_td;
|
// attr_td = &proc->attr_td;
|
||||||
// attr_te = &proc->attr_te;
|
// attr_te = &proc->attr_te;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(get_thread_worker_conf() == WORKER_ENABLE)
|
if(get_thread_worker_conf() == WORKER_ENABLE) {
|
||||||
{
|
|
||||||
init_te_thread(eNB);
|
init_te_thread(eNB);
|
||||||
init_td_thread(eNB);
|
init_td_thread(eNB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
|
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
|
||||||
|
|
||||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
||||||
pthread_create( &L1_proc->pthread, attr0, L1_thread, proc );
|
pthread_create( &L1_proc->pthread, attr0, L1_thread, proc );
|
||||||
pthread_create( &L1_proc_tx->pthread, attr1, L1_thread_tx, proc);
|
pthread_create( &L1_proc_tx->pthread, attr1, L1_thread_tx, proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
|
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||||
@@ -956,10 +915,7 @@ void init_eNB_proc(int inst) {
|
|||||||
|
|
||||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||||
|
|
||||||
|
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void*)eNB);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//for multiple CCs: setup master and slaves
|
//for multiple CCs: setup master and slaves
|
||||||
@@ -978,13 +934,10 @@ void init_eNB_proc(int inst) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* setup PHY proc TX sync mechanism */
|
/* setup PHY proc TX sync mechanism */
|
||||||
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
||||||
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
|
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
|
||||||
sync_phy_proc.phy_proc_CC_id = 0;
|
sync_phy_proc.phy_proc_CC_id = 0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -993,7 +946,6 @@ void init_eNB_proc(int inst) {
|
|||||||
* \brief Terminate eNB TX and RX threads.
|
* \brief Terminate eNB TX and RX threads.
|
||||||
*/
|
*/
|
||||||
void kill_eNB_proc(int inst) {
|
void kill_eNB_proc(int inst) {
|
||||||
|
|
||||||
int *status;
|
int *status;
|
||||||
PHY_VARS_eNB *eNB;
|
PHY_VARS_eNB *eNB;
|
||||||
L1_proc_t *proc;
|
L1_proc_t *proc;
|
||||||
@@ -1010,6 +962,7 @@ void kill_eNB_proc(int inst) {
|
|||||||
kill_td_thread(eNB);
|
kill_td_thread(eNB);
|
||||||
kill_te_thread(eNB);
|
kill_te_thread(eNB);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst );
|
LOG_I(PHY, "Killing TX CC_id %d inst %d\n", CC_id, inst );
|
||||||
|
|
||||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
||||||
@@ -1028,20 +981,17 @@ void kill_eNB_proc(int inst) {
|
|||||||
proc->instance_cnt_prach = 0;
|
proc->instance_cnt_prach = 0;
|
||||||
pthread_cond_signal( &proc->cond_prach );
|
pthread_cond_signal( &proc->cond_prach );
|
||||||
pthread_mutex_unlock(&proc->mutex_prach);
|
pthread_mutex_unlock(&proc->mutex_prach);
|
||||||
|
|
||||||
pthread_cond_signal( &proc->cond_asynch_rxtx );
|
pthread_cond_signal( &proc->cond_asynch_rxtx );
|
||||||
pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx);
|
pthread_cond_broadcast(&sync_phy_proc.cond_phy_proc_tx);
|
||||||
|
|
||||||
LOG_D(PHY, "joining pthread_prach\n");
|
LOG_D(PHY, "joining pthread_prach\n");
|
||||||
pthread_join( proc->pthread_prach, (void**)&status );
|
pthread_join( proc->pthread_prach, (void **)&status );
|
||||||
|
|
||||||
LOG_I(PHY, "Destroying prach mutex/cond\n");
|
LOG_I(PHY, "Destroying prach mutex/cond\n");
|
||||||
pthread_mutex_destroy( &proc->mutex_prach );
|
pthread_mutex_destroy( &proc->mutex_prach );
|
||||||
pthread_cond_destroy( &proc->cond_prach );
|
pthread_cond_destroy( &proc->cond_prach );
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
proc->instance_cnt_prach_br = 0;
|
proc->instance_cnt_prach_br = 0;
|
||||||
pthread_cond_signal( &proc->cond_prach_br );
|
pthread_cond_signal( &proc->cond_prach_br );
|
||||||
pthread_join( proc->pthread_prach_br, (void**)&status );
|
pthread_join( proc->pthread_prach_br, (void **)&status );
|
||||||
pthread_mutex_destroy( &proc->mutex_prach_br );
|
pthread_mutex_destroy( &proc->mutex_prach_br );
|
||||||
pthread_cond_destroy( &proc->cond_prach_br );
|
pthread_cond_destroy( &proc->cond_prach_br );
|
||||||
#endif
|
#endif
|
||||||
@@ -1073,7 +1023,6 @@ void kill_eNB_proc(int inst) {
|
|||||||
pthread_mutex_destroy(&proc->mutex_RU_PRACH_br);
|
pthread_mutex_destroy(&proc->mutex_RU_PRACH_br);
|
||||||
pthread_attr_destroy(&proc->attr_prach_br);
|
pthread_attr_destroy(&proc->attr_prach_br);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1081,7 +1030,6 @@ void kill_eNB_proc(int inst) {
|
|||||||
|
|
||||||
|
|
||||||
void reset_opp_meas(void) {
|
void reset_opp_meas(void) {
|
||||||
|
|
||||||
int sfn;
|
int sfn;
|
||||||
reset_meas(&softmodem_stats_mt);
|
reset_meas(&softmodem_stats_mt);
|
||||||
reset_meas(&softmodem_stats_hw);
|
reset_meas(&softmodem_stats_hw);
|
||||||
@@ -1094,7 +1042,6 @@ void reset_opp_meas(void) {
|
|||||||
|
|
||||||
|
|
||||||
void print_opp_meas(void) {
|
void print_opp_meas(void) {
|
||||||
|
|
||||||
int sfn=0;
|
int sfn=0;
|
||||||
print_meas(&softmodem_stats_mt, "Main ENB Thread", NULL, NULL);
|
print_meas(&softmodem_stats_mt, "Main ENB Thread", NULL, NULL);
|
||||||
print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL);
|
print_meas(&softmodem_stats_hw, "HW Acquisation", NULL, NULL);
|
||||||
@@ -1105,33 +1052,34 @@ void print_opp_meas(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_transport(PHY_VARS_eNB *eNB)
|
void free_transport(PHY_VARS_eNB *eNB) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||||
LOG_D(PHY, "Freeing Transport Channel Buffers for DLSCH, UE %d\n",i);
|
LOG_D(PHY, "Freeing Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||||
|
|
||||||
for (j=0; j<2; j++) free_eNB_dlsch(eNB->dlsch[i][j]);
|
for (j=0; j<2; j++) free_eNB_dlsch(eNB->dlsch[i][j]);
|
||||||
|
|
||||||
LOG_D(PHY, "Freeing Transport Channel Buffer for ULSCH, UE %d\n",i);
|
LOG_D(PHY, "Freeing Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||||
free_eNB_ulsch(eNB->ulsch[1+i]);
|
free_eNB_ulsch(eNB->ulsch[1+i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
free_eNB_ulsch(eNB->ulsch[0]);
|
free_eNB_ulsch(eNB->ulsch[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_transport(PHY_VARS_eNB *eNB) {
|
void init_transport(PHY_VARS_eNB *eNB) {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||||
|
|
||||||
LOG_I(PHY, "Initialise transport\n");
|
LOG_I(PHY, "Initialise transport\n");
|
||||||
|
|
||||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||||
LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
|
LOG_D(PHY,"Allocating Transport Channel Buffers for DLSCH, UE %d\n",i);
|
||||||
|
|
||||||
for (j=0; j<2; j++) {
|
for (j=0; j<2; j++) {
|
||||||
eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL,0,fp);
|
eNB->dlsch[i][j] = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL,0,fp);
|
||||||
|
|
||||||
if (!eNB->dlsch[i][j]) {
|
if (!eNB->dlsch[i][j]) {
|
||||||
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
|
LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@@ -1153,6 +1101,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
|||||||
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
|
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
|
||||||
eNB->transmission_mode[i] = fp->nb_antenna_ports_eNB==1 ? 1 : 2;
|
eNB->transmission_mode[i] = fp->nb_antenna_ports_eNB==1 ? 1 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ULSCH for RA
|
// ULSCH for RA
|
||||||
eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, fp->N_RB_UL, 0);
|
eNB->ulsch[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, fp->N_RB_UL, 0);
|
||||||
|
|
||||||
@@ -1160,128 +1109,107 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
|||||||
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
LOG_E(PHY,"Can't get eNB ulsch structures\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
eNB->dlsch_SI = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
eNB->dlsch_SI = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
||||||
LOG_D(PHY,"eNB %d.%d : SI %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_SI);
|
LOG_D(PHY,"eNB %d.%d : SI %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_SI);
|
||||||
eNB->dlsch_ra = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
eNB->dlsch_ra = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
||||||
LOG_D(PHY,"eNB %d.%d : RA %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_ra);
|
LOG_D(PHY,"eNB %d.%d : RA %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_ra);
|
||||||
eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
eNB->dlsch_MCH = new_eNB_dlsch(1,8,NSOFT,fp->N_RB_DL, 0, fp);
|
||||||
LOG_D(PHY,"eNB %d.%d : MCH %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_MCH);
|
LOG_D(PHY,"eNB %d.%d : MCH %p\n",eNB->Mod_id,eNB->CC_id,eNB->dlsch_MCH);
|
||||||
|
|
||||||
|
|
||||||
eNB->rx_total_gain_dB=130;
|
eNB->rx_total_gain_dB=130;
|
||||||
|
|
||||||
for(i=0; i<NUMBER_OF_UE_MAX; i++)
|
for(i=0; i<NUMBER_OF_UE_MAX; i++)
|
||||||
eNB->mu_mimo_mode[i].dl_pow_off = 2;
|
eNB->mu_mimo_mode[i].dl_pow_off = 2;
|
||||||
|
|
||||||
eNB->check_for_total_transmissions = 0;
|
eNB->check_for_total_transmissions = 0;
|
||||||
|
|
||||||
eNB->check_for_MUMIMO_transmissions = 0;
|
eNB->check_for_MUMIMO_transmissions = 0;
|
||||||
|
|
||||||
eNB->FULL_MUMIMO_transmissions = 0;
|
eNB->FULL_MUMIMO_transmissions = 0;
|
||||||
|
|
||||||
eNB->check_for_SUMIMO_transmissions = 0;
|
eNB->check_for_SUMIMO_transmissions = 0;
|
||||||
|
|
||||||
fp->pucch_config_common.deltaPUCCH_Shift = 1;
|
fp->pucch_config_common.deltaPUCCH_Shift = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_eNB_afterRU(void) {
|
void init_eNB_afterRU(void) {
|
||||||
|
|
||||||
int inst,CC_id,ru_id,i,aa;
|
int inst,CC_id,ru_id,i,aa;
|
||||||
PHY_VARS_eNB *eNB;
|
PHY_VARS_eNB *eNB;
|
||||||
|
|
||||||
LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst);
|
LOG_I(PHY,"%s() RC.nb_inst:%d\n", __FUNCTION__, RC.nb_inst);
|
||||||
|
|
||||||
for (inst=0;inst<RC.nb_inst;inst++) {
|
for (inst=0; inst<RC.nb_inst; inst++) {
|
||||||
LOG_I(PHY,"RC.nb_CC[inst]:%d\n", RC.nb_CC[inst]);
|
LOG_I(PHY,"RC.nb_CC[inst]:%d\n", RC.nb_CC[inst]);
|
||||||
for (CC_id=0;CC_id<RC.nb_CC[inst];CC_id++) {
|
|
||||||
|
|
||||||
|
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
|
||||||
LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.eNB[inst][CC_id]);
|
LOG_I(PHY,"RC.nb_CC[inst:%d][CC_id:%d]:%p\n", inst, CC_id, RC.eNB[inst][CC_id]);
|
||||||
|
|
||||||
eNB = RC.eNB[inst][CC_id];
|
eNB = RC.eNB[inst][CC_id];
|
||||||
phy_init_lte_eNB(eNB,0,0);
|
phy_init_lte_eNB(eNB,0,0);
|
||||||
|
|
||||||
// map antennas and PRACH signals to eNB RX
|
// map antennas and PRACH signals to eNB RX
|
||||||
if (0) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
if (0) AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
||||||
|
|
||||||
LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
|
LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
|
||||||
eNB->frame_parms.nb_antennas_rx = 0;
|
eNB->frame_parms.nb_antennas_rx = 0;
|
||||||
|
|
||||||
LOG_I(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
|
LOG_I(PHY,"Overwriting eNB->prach_vars.rxsigF[0]:%p\n", eNB->prach_vars.rxsigF[0]);
|
||||||
|
eNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||||
eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*));
|
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
for (int ce_level=0;ce_level<4;ce_level++) {
|
|
||||||
LOG_I(PHY,"Overwriting eNB->prach_vars_br.rxsigF.rxsigF[0]:%p\n", eNB->prach_vars_br.rxsigF[ce_level]);
|
|
||||||
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
for (int ce_level=0; ce_level<4; ce_level++) {
|
||||||
|
LOG_I(PHY,"Overwriting eNB->prach_vars_br.rxsigF.rxsigF[0]:%p\n", eNB->prach_vars_br.rxsigF[ce_level]);
|
||||||
|
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t **)malloc16(64*sizeof(int16_t *));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
|
LOG_I(PHY,"eNB->num_RU:%d\n", eNB->num_RU);
|
||||||
|
|
||||||
for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) {
|
for (ru_id=0,aa=0; ru_id<eNB->num_RU; ru_id++) {
|
||||||
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
||||||
|
|
||||||
AssertFatal(eNB->RU_list[ru_id]->common.rxdataF!=NULL,
|
AssertFatal(eNB->RU_list[ru_id]->common.rxdataF!=NULL,
|
||||||
"RU %d : common.rxdataF is NULL\n",
|
"RU %d : common.rxdataF is NULL\n",
|
||||||
eNB->RU_list[ru_id]->idx);
|
eNB->RU_list[ru_id]->idx);
|
||||||
|
|
||||||
AssertFatal(eNB->RU_list[ru_id]->prach_rxsigF!=NULL,
|
AssertFatal(eNB->RU_list[ru_id]->prach_rxsigF!=NULL,
|
||||||
"RU %d : prach_rxsigF is NULL\n",
|
"RU %d : prach_rxsigF is NULL\n",
|
||||||
eNB->RU_list[ru_id]->idx);
|
eNB->RU_list[ru_id]->idx);
|
||||||
|
|
||||||
for (i=0;i<eNB->RU_list[ru_id]->nb_rx;aa++,i++) {
|
for (i=0; i<eNB->RU_list[ru_id]->nb_rx; aa++,i++) {
|
||||||
LOG_I(PHY,"Attaching RU %d antenna %d to eNB antenna %d\n",eNB->RU_list[ru_id]->idx,i,aa);
|
LOG_I(PHY,"Attaching RU %d antenna %d to eNB antenna %d\n",eNB->RU_list[ru_id]->idx,i,aa);
|
||||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[i];
|
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[i];
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
for (int ce_level=0;ce_level<4;ce_level++)
|
|
||||||
|
for (int ce_level=0; ce_level<4; ce_level++)
|
||||||
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
|
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
|
eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* TODO: review this code, there is something wrong.
|
/* TODO: review this code, there is something wrong.
|
||||||
* In monolithic mode, we come here with nb_antennas_rx == 0
|
* In monolithic mode, we come here with nb_antennas_rx == 0
|
||||||
* (not tested in other modes).
|
* (not tested in other modes).
|
||||||
*/
|
*/
|
||||||
if (eNB->frame_parms.nb_antennas_rx < 1)
|
if (eNB->frame_parms.nb_antennas_rx < 1) {
|
||||||
{
|
|
||||||
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_rx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_rx);
|
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_rx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_rx);
|
||||||
eNB->frame_parms.nb_antennas_rx = 1;
|
eNB->frame_parms.nb_antennas_rx = 1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//LOG_I(PHY," Delete code\n");
|
//LOG_I(PHY," Delete code\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eNB->frame_parms.nb_antennas_tx < 1)
|
if (eNB->frame_parms.nb_antennas_tx < 1) {
|
||||||
{
|
|
||||||
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_tx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_tx);
|
LOG_I(PHY, "%s() ************* DJP ***** eNB->frame_parms.nb_antennas_tx:%d - GOING TO HARD CODE TO 1", __FUNCTION__, eNB->frame_parms.nb_antennas_tx);
|
||||||
eNB->frame_parms.nb_antennas_tx = 1;
|
eNB->frame_parms.nb_antennas_tx = 1;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//LOG_I(PHY," Delete code\n");
|
//LOG_I(PHY," Delete code\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AssertFatal(eNB->frame_parms.nb_antennas_rx >0,
|
AssertFatal(eNB->frame_parms.nb_antennas_rx >0,
|
||||||
"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
|
"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
|
||||||
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
|
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
|
||||||
|
|
||||||
init_transport(eNB);
|
init_transport(eNB);
|
||||||
//init_precoding_weights(RC.eNB[inst][CC_id]);
|
//init_precoding_weights(RC.eNB[inst][CC_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
init_eNB_proc(inst);
|
init_eNB_proc(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||||
|
|
||||||
AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id);
|
AssertFatal(RC.ru[ru_id]!=NULL,"ru_id %d is null\n",ru_id);
|
||||||
|
|
||||||
RC.ru[ru_id]->wakeup_rxtx = wakeup_rxtx;
|
RC.ru[ru_id]->wakeup_rxtx = wakeup_rxtx;
|
||||||
RC.ru[ru_id]->wakeup_prach_eNB = wakeup_prach_eNB;
|
RC.ru[ru_id]->wakeup_prach_eNB = wakeup_prach_eNB;
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
@@ -1292,35 +1220,34 @@ void init_eNB_afterRU(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_eNB(int single_thread_flag,int wait_for_sync) {
|
void init_eNB(int single_thread_flag,int wait_for_sync) {
|
||||||
|
|
||||||
int CC_id;
|
int CC_id;
|
||||||
int inst;
|
int inst;
|
||||||
PHY_VARS_eNB *eNB;
|
PHY_VARS_eNB *eNB;
|
||||||
|
|
||||||
LOG_I(PHY,"[lte-softmodem.c] eNB structure about to allocated RC.nb_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_L1_CC[0]);
|
LOG_I(PHY,"[lte-softmodem.c] eNB structure about to allocated RC.nb_L1_inst:%d RC.nb_L1_CC[0]:%d\n",RC.nb_L1_inst,RC.nb_L1_CC[0]);
|
||||||
|
|
||||||
if (RC.eNB == NULL) RC.eNB = (PHY_VARS_eNB***) malloc(RC.nb_L1_inst*sizeof(PHY_VARS_eNB **));
|
if (RC.eNB == NULL) RC.eNB = (PHY_VARS_eNB ** *) malloc(RC.nb_L1_inst*sizeof(PHY_VARS_eNB **));
|
||||||
|
|
||||||
LOG_I(PHY,"[lte-softmodem.c] eNB structure RC.eNB allocated\n");
|
LOG_I(PHY,"[lte-softmodem.c] eNB structure RC.eNB allocated\n");
|
||||||
for (inst=0;inst<RC.nb_L1_inst;inst++) {
|
|
||||||
if (RC.eNB[inst] == NULL) RC.eNB[inst] = (PHY_VARS_eNB**) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_eNB *));
|
for (inst=0; inst<RC.nb_L1_inst; inst++) {
|
||||||
for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) {
|
if (RC.eNB[inst] == NULL) RC.eNB[inst] = (PHY_VARS_eNB **) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_eNB *));
|
||||||
if (RC.eNB[inst][CC_id] == NULL) RC.eNB[inst][CC_id] = (PHY_VARS_eNB*) malloc(sizeof(PHY_VARS_eNB));
|
|
||||||
|
for (CC_id=0; CC_id<RC.nb_L1_CC[inst]; CC_id++) {
|
||||||
|
if (RC.eNB[inst][CC_id] == NULL) RC.eNB[inst][CC_id] = (PHY_VARS_eNB *) malloc(sizeof(PHY_VARS_eNB));
|
||||||
|
|
||||||
eNB = RC.eNB[inst][CC_id];
|
eNB = RC.eNB[inst][CC_id];
|
||||||
eNB->abstraction_flag = 0;
|
eNB->abstraction_flag = 0;
|
||||||
eNB->single_thread_flag = single_thread_flag;
|
eNB->single_thread_flag = single_thread_flag;
|
||||||
|
|
||||||
|
|
||||||
LOG_I(PHY,"Initializing eNB %d CC_id %d single_thread_flag:%d\n",inst,CC_id,single_thread_flag);
|
LOG_I(PHY,"Initializing eNB %d CC_id %d single_thread_flag:%d\n",inst,CC_id,single_thread_flag);
|
||||||
#ifndef OCP_FRAMEWORK
|
#ifndef OCP_FRAMEWORK
|
||||||
LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id);
|
LOG_I(PHY,"Initializing eNB %d CC_id %d\n",inst,CC_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOG_I(PHY,"Registering with MAC interface module\n");
|
LOG_I(PHY,"Registering with MAC interface module\n");
|
||||||
AssertFatal((eNB->if_inst = IF_Module_init(inst))!=NULL,"Cannot register interface");
|
AssertFatal((eNB->if_inst = IF_Module_init(inst))!=NULL,"Cannot register interface");
|
||||||
eNB->if_inst->schedule_response = schedule_response;
|
eNB->if_inst->schedule_response = schedule_response;
|
||||||
eNB->if_inst->PHY_config_req = phy_config_request;
|
eNB->if_inst->PHY_config_req = phy_config_request;
|
||||||
memset((void*)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
|
memset((void *)&eNB->UL_INFO,0,sizeof(eNB->UL_INFO));
|
||||||
memset((void*)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO));
|
memset((void *)&eNB->Sched_INFO,0,sizeof(eNB->Sched_INFO));
|
||||||
LOG_I(PHY,"Setting indication lists\n");
|
LOG_I(PHY,"Setting indication lists\n");
|
||||||
eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = eNB->rx_pdu_list;
|
eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = eNB->rx_pdu_list;
|
||||||
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
|
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
|
||||||
@@ -1330,7 +1257,6 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
|
|||||||
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
||||||
eNB->prach_energy_counter = 0;
|
eNB->prach_energy_counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n");
|
LOG_I(PHY,"[lte-softmodem.c] eNB structure allocated\n");
|
||||||
@@ -1338,8 +1264,7 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
|
|||||||
|
|
||||||
|
|
||||||
void stop_eNB(int nb_inst) {
|
void stop_eNB(int nb_inst) {
|
||||||
|
for (int inst=0; inst<nb_inst; inst++) {
|
||||||
for (int inst=0;inst<nb_inst;inst++) {
|
|
||||||
LOG_I(PHY,"Killing eNB %d processing threads\n",inst);
|
LOG_I(PHY,"Killing eNB %d processing threads\n",inst);
|
||||||
kill_eNB_proc(inst);
|
kill_eNB_proc(inst);
|
||||||
}
|
}
|
||||||
|
|||||||
+90
-153
@@ -79,11 +79,11 @@ unsigned short config_frames[4] = {2,9,11,13};
|
|||||||
//#include "PHY/TOOLS/time_meas.h"
|
//#include "PHY/TOOLS/time_meas.h"
|
||||||
|
|
||||||
#ifndef OPENAIR2
|
#ifndef OPENAIR2
|
||||||
#include "UTIL/OTG/otg_vars.h"
|
#include "UTIL/OTG/otg_vars.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
#include "create_tasks.h"
|
#include "create_tasks.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "PHY/INIT/phy_init.h"
|
#include "PHY/INIT/phy_init.h"
|
||||||
@@ -91,24 +91,24 @@ unsigned short config_frames[4] = {2,9,11,13};
|
|||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#endif
|
#endif
|
||||||
#include "lte-softmodem.h"
|
#include "lte-softmodem.h"
|
||||||
#include "NB_IoT_interface.h"
|
#include "NB_IoT_interface.h"
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||||
// at eNB 0, an UL scope for every UE
|
// at eNB 0, an UL scope for every UE
|
||||||
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
|
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
|
||||||
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||||
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||||
char title[255];
|
char title[255];
|
||||||
unsigned char scope_enb_num_ue = 2;
|
unsigned char scope_enb_num_ue = 2;
|
||||||
static pthread_t forms_thread; //xforms
|
static pthread_t forms_thread; //xforms
|
||||||
#endif //XFORMS
|
#endif //XFORMS
|
||||||
|
|
||||||
#ifndef ENABLE_USE_MME
|
#ifndef ENABLE_USE_MME
|
||||||
#define EPC_MODE_ENABLED 0
|
#define EPC_MODE_ENABLED 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pthread_cond_t nfapi_sync_cond;
|
pthread_cond_t nfapi_sync_cond;
|
||||||
@@ -128,8 +128,8 @@ uint16_t runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75,
|
|||||||
uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
|
uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
volatile int start_eNB = 0;
|
volatile int start_eNB = 0;
|
||||||
volatile int start_UE = 0;
|
volatile int start_UE = 0;
|
||||||
#endif
|
#endif
|
||||||
volatile int oai_exit = 0;
|
volatile int oai_exit = 0;
|
||||||
|
|
||||||
@@ -171,9 +171,9 @@ char channels[128] = "0";
|
|||||||
int rx_input_level_dBm;
|
int rx_input_level_dBm;
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
extern int otg_enabled;
|
extern int otg_enabled;
|
||||||
#else
|
#else
|
||||||
int otg_enabled;
|
int otg_enabled;
|
||||||
#endif
|
#endif
|
||||||
//int number_of_cards = 1;
|
//int number_of_cards = 1;
|
||||||
|
|
||||||
@@ -210,6 +210,7 @@ struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
|||||||
|
|
||||||
struct timespec clock_difftime(struct timespec start, struct timespec end) {
|
struct timespec clock_difftime(struct timespec start, struct timespec end) {
|
||||||
struct timespec temp;
|
struct timespec temp;
|
||||||
|
|
||||||
if ((end.tv_nsec-start.tv_nsec)<0) {
|
if ((end.tv_nsec-start.tv_nsec)<0) {
|
||||||
temp.tv_sec = end.tv_sec-start.tv_sec-1;
|
temp.tv_sec = end.tv_sec-start.tv_sec-1;
|
||||||
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
|
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
|
||||||
@@ -217,6 +218,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
|
|||||||
temp.tv_sec = end.tv_sec-start.tv_sec;
|
temp.tv_sec = end.tv_sec-start.tv_sec;
|
||||||
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
|
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
|
||||||
}
|
}
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,16 +234,21 @@ void update_difftimes(struct timespec start, struct timespec end) {
|
|||||||
struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
diff_time = clock_difftime(start, end);
|
diff_time = clock_difftime(start, end);
|
||||||
|
|
||||||
if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) {
|
if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) {
|
||||||
min_diff_time.tv_nsec = diff_time.tv_nsec;
|
min_diff_time.tv_nsec = diff_time.tv_nsec;
|
||||||
changed = 1;
|
changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) {
|
if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) {
|
||||||
max_diff_time.tv_nsec = diff_time.tv_nsec;
|
max_diff_time.tv_nsec = diff_time.tv_nsec;
|
||||||
changed = 1;
|
changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
|
||||||
if (changed) print_difftimes();
|
if (changed) print_difftimes();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +269,6 @@ void signal_handler(int sig) {
|
|||||||
if (sig==SIGSEGV) {
|
if (sig==SIGSEGV) {
|
||||||
// get void*'s for all entries on the stack
|
// get void*'s for all entries on the stack
|
||||||
size = backtrace(array, 10);
|
size = backtrace(array, 10);
|
||||||
|
|
||||||
// print out all the frames to stderr
|
// print out all the frames to stderr
|
||||||
fprintf(stderr, "Error: signal %d:\n", sig);
|
fprintf(stderr, "Error: signal %d:\n", sig);
|
||||||
backtrace_symbols_fd(array, size, 2);
|
backtrace_symbols_fd(array, size, 2);
|
||||||
@@ -270,15 +276,11 @@ void signal_handler(int sig) {
|
|||||||
} else {
|
} else {
|
||||||
printf("Linux signal %s...\n",strsignal(sig));
|
printf("Linux signal %s...\n",strsignal(sig));
|
||||||
exit_function(__FILE__, __FUNCTION__, __LINE__,"softmodem starting exit procedure\n");
|
exit_function(__FILE__, __FUNCTION__, __LINE__,"softmodem starting exit procedure\n");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void exit_function(const char* file, const char* function, const int line, const char* s)
|
void exit_function(const char *file, const char *function, const int line, const char *s) {
|
||||||
{
|
|
||||||
|
|
||||||
int ru_id;
|
int ru_id;
|
||||||
|
|
||||||
if (s != NULL) {
|
if (s != NULL) {
|
||||||
@@ -287,34 +289,32 @@ void exit_function(const char* file, const char* function, const int line, const
|
|||||||
|
|
||||||
oai_exit = 1;
|
oai_exit = 1;
|
||||||
|
|
||||||
|
|
||||||
if (RC.ru == NULL)
|
if (RC.ru == NULL)
|
||||||
exit(-1); // likely init not completed, prevent crash or hang, exit now...
|
exit(-1); // likely init not completed, prevent crash or hang, exit now...
|
||||||
for (ru_id=0; ru_id<RC.nb_RU;ru_id++) {
|
|
||||||
|
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||||
if (RC.ru[ru_id] && RC.ru[ru_id]->rfdevice.trx_end_func) {
|
if (RC.ru[ru_id] && RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RC.ru[ru_id] && RC.ru[ru_id]->ifdevice.trx_end_func) {
|
if (RC.ru[ru_id] && RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sleep(1); //allow lte-softmodem threads to exit first
|
sleep(1); //allow lte-softmodem threads to exit first
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
itti_terminate_tasks (TASK_UNKNOWN);
|
itti_terminate_tasks (TASK_UNKNOWN);
|
||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
|
|
||||||
|
|
||||||
void reset_stats(FL_OBJECT *button, long arg)
|
void reset_stats(FL_OBJECT *button, long arg) {
|
||||||
{
|
|
||||||
int i,j,k;
|
int i,j,k;
|
||||||
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
|
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
|
||||||
|
|
||||||
@@ -329,8 +329,6 @@ void reset_stats(FL_OBJECT *button, long arg)
|
|||||||
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
||||||
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
||||||
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
||||||
|
|
||||||
|
|
||||||
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
||||||
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
||||||
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
||||||
@@ -339,28 +337,22 @@ void reset_stats(FL_OBJECT *button, long arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *scope_thread(void *arg) {
|
static void *scope_thread(void *arg) {
|
||||||
|
|
||||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||||
FILE *eNB_stats;
|
FILE *eNB_stats;
|
||||||
# endif
|
# endif
|
||||||
struct sched_param sched_param;
|
struct sched_param sched_param;
|
||||||
int UE_id, CC_id;
|
int UE_id, CC_id;
|
||||||
int ue_cnt=0;
|
int ue_cnt=0;
|
||||||
|
|
||||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
|
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
|
||||||
sched_setscheduler(0, SCHED_FIFO,&sched_param);
|
sched_setscheduler(0, SCHED_FIFO,&sched_param);
|
||||||
|
|
||||||
printf("Scope thread has priority %d\n",sched_param.sched_priority);
|
printf("Scope thread has priority %d\n",sched_param.sched_priority);
|
||||||
|
|
||||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||||
|
|
||||||
eNB_stats = fopen("eNB_stats.txt", "w");
|
eNB_stats = fopen("eNB_stats.txt", "w");
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
|
|
||||||
ue_cnt=0;
|
ue_cnt=0;
|
||||||
|
|
||||||
for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
|
||||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
if ((ue_cnt<scope_enb_num_ue)) {
|
if ((ue_cnt<scope_enb_num_ue)) {
|
||||||
@@ -371,11 +363,11 @@ static void *scope_thread(void *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("%s",stats_buffer);
|
// printf("%s",stats_buffer);
|
||||||
|
|
||||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||||
|
|
||||||
if (eNB_stats) {
|
if (eNB_stats) {
|
||||||
@@ -385,8 +377,7 @@ static void *scope_thread(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
pthread_exit((void *)arg);
|
||||||
pthread_exit((void*)arg);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -397,12 +388,11 @@ static void *scope_thread(void *arg) {
|
|||||||
void *l2l1_task(void *arg) {
|
void *l2l1_task(void *arg) {
|
||||||
MessageDef *message_p = NULL;
|
MessageDef *message_p = NULL;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
itti_set_task_real_time(TASK_L2L1);
|
itti_set_task_real_time(TASK_L2L1);
|
||||||
itti_mark_task_ready(TASK_L2L1);
|
itti_mark_task_ready(TASK_L2L1);
|
||||||
|
|
||||||
/* Wait for the initialize message */
|
/* Wait for the initialize message */
|
||||||
printf("Wait for the ITTI initialize message\n");
|
printf("Wait for the ITTI initialize message\n");
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
itti_receive_msg (TASK_L2L1, &message_p);
|
itti_receive_msg (TASK_L2L1, &message_p);
|
||||||
|
|
||||||
@@ -448,18 +438,17 @@ void *l2l1_task(void *arg) {
|
|||||||
|
|
||||||
|
|
||||||
static void get_options(void) {
|
static void get_options(void) {
|
||||||
|
|
||||||
|
|
||||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||||
get_common_options();
|
get_common_options();
|
||||||
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
|
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
|
||||||
|
|
||||||
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) {
|
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) {
|
||||||
memset((void*)&RC,0,sizeof(RC));
|
memset((void *)&RC,0,sizeof(RC));
|
||||||
/* Read RC configuration file */
|
/* Read RC configuration file */
|
||||||
RCConfig();
|
RCConfig();
|
||||||
NB_eNB_INST = RC.nb_inst;
|
NB_eNB_INST = RC.nb_inst;
|
||||||
printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_eNB_INST,RC.nb_L1_inst,RC.nb_RU);
|
printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_eNB_INST,RC.nb_L1_inst,RC.nb_RU);
|
||||||
|
|
||||||
if (!SOFTMODEM_NONBIOT) {
|
if (!SOFTMODEM_NONBIOT) {
|
||||||
load_NB_IoT();
|
load_NB_IoT();
|
||||||
printf(" nb_nbiot_rrc_inst %d, nb_nbiot_L1_inst %d, nb_nbiot_macrlc_inst %d\n",
|
printf(" nb_nbiot_rrc_inst %d, nb_nbiot_L1_inst %d, nb_nbiot_macrlc_inst %d\n",
|
||||||
@@ -469,7 +458,6 @@ static void get_options(void) {
|
|||||||
RC.nb_nb_iot_rrc_inst=RC.nb_nb_iot_L1_inst=RC.nb_nb_iot_macrlc_inst=0;
|
RC.nb_nb_iot_rrc_inst=RC.nb_nb_iot_L1_inst=RC.nb_nb_iot_macrlc_inst=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -477,11 +465,10 @@ static void get_options(void) {
|
|||||||
|
|
||||||
|
|
||||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||||
|
|
||||||
int CC_id;
|
int CC_id;
|
||||||
|
|
||||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
frame_parms[CC_id] = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
frame_parms[CC_id] = (LTE_DL_FRAME_PARMS *) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
||||||
/* Set some default values that may be overwritten while reading options */
|
/* Set some default values that may be overwritten while reading options */
|
||||||
frame_parms[CC_id]->frame_type = FDD;
|
frame_parms[CC_id]->frame_type = FDD;
|
||||||
frame_parms[CC_id]->tdd_config = 3;
|
frame_parms[CC_id]->tdd_config = 3;
|
||||||
@@ -495,9 +482,7 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
|||||||
frame_parms[CC_id]->nb_antenna_ports_eNB = 1;
|
frame_parms[CC_id]->nb_antenna_ports_eNB = 1;
|
||||||
frame_parms[CC_id]->nb_antennas_tx = 1;
|
frame_parms[CC_id]->nb_antennas_tx = 1;
|
||||||
frame_parms[CC_id]->nb_antennas_rx = 1;
|
frame_parms[CC_id]->nb_antennas_rx = 1;
|
||||||
|
|
||||||
frame_parms[CC_id]->nushift = 0;
|
frame_parms[CC_id]->nushift = 0;
|
||||||
|
|
||||||
frame_parms[CC_id]->phich_config_common.phich_resource = oneSixth;
|
frame_parms[CC_id]->phich_config_common.phich_resource = oneSixth;
|
||||||
frame_parms[CC_id]->phich_config_common.phich_duration = normal;
|
frame_parms[CC_id]->phich_config_common.phich_duration = normal;
|
||||||
// UL RS Config
|
// UL RS Config
|
||||||
@@ -505,54 +490,47 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
|||||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0;
|
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0;
|
||||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
|
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
|
||||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
|
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
|
||||||
|
|
||||||
frame_parms[CC_id]->prach_config_common.rootSequenceIndex=22;
|
frame_parms[CC_id]->prach_config_common.rootSequenceIndex=22;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=1;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=1;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
||||||
|
// downlink_frequency[CC_id][0] = 2680000000; // Use float to avoid issue with frequency over 2^31.
|
||||||
// downlink_frequency[CC_id][0] = 2680000000; // Use float to avoid issue with frequency over 2^31.
|
// downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
|
||||||
// downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
|
// downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
|
||||||
// downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
|
// downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0];
|
||||||
// downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0];
|
|
||||||
//printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]);
|
//printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]);
|
||||||
frame_parms[CC_id]->dl_CarrierFreq=downlink_frequency[CC_id][0];
|
frame_parms[CC_id]->dl_CarrierFreq=downlink_frequency[CC_id][0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait_RUs(void) {
|
void wait_RUs(void) {
|
||||||
|
|
||||||
LOG_I(PHY,"Waiting for RUs to be configured ... RC.ru_mask:%02lx\n", RC.ru_mask);
|
LOG_I(PHY,"Waiting for RUs to be configured ... RC.ru_mask:%02lx\n", RC.ru_mask);
|
||||||
|
|
||||||
// wait for all RUs to be configured over fronthaul
|
// wait for all RUs to be configured over fronthaul
|
||||||
pthread_mutex_lock(&RC.ru_mutex);
|
pthread_mutex_lock(&RC.ru_mutex);
|
||||||
|
|
||||||
while (RC.ru_mask>0) {
|
while (RC.ru_mask>0) {
|
||||||
pthread_cond_wait(&RC.ru_cond,&RC.ru_mutex);
|
pthread_cond_wait(&RC.ru_cond,&RC.ru_mutex);
|
||||||
printf("RC.ru_mask:%02lx\n", RC.ru_mask);
|
printf("RC.ru_mask:%02lx\n", RC.ru_mask);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&RC.ru_mutex);
|
|
||||||
|
|
||||||
|
pthread_mutex_unlock(&RC.ru_mutex);
|
||||||
LOG_I(PHY,"RUs configured\n");
|
LOG_I(PHY,"RUs configured\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait_eNBs(void) {
|
void wait_eNBs(void) {
|
||||||
|
|
||||||
int i,j;
|
int i,j;
|
||||||
int waiting=1;
|
int waiting=1;
|
||||||
|
|
||||||
|
|
||||||
while (waiting==1) {
|
while (waiting==1) {
|
||||||
printf("Waiting for eNB L1 instances to all get configured ... sleeping 50ms (nb_L1_inst %d)\n",RC.nb_L1_inst);
|
printf("Waiting for eNB L1 instances to all get configured ... sleeping 50ms (nb_L1_inst %d)\n",RC.nb_L1_inst);
|
||||||
usleep(50*1000);
|
usleep(50*1000);
|
||||||
waiting=0;
|
waiting=0;
|
||||||
for (i=0;i<RC.nb_L1_inst;i++) {
|
|
||||||
|
|
||||||
|
for (i=0; i<RC.nb_L1_inst; i++) {
|
||||||
printf("RC.nb_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]);
|
printf("RC.nb_L1_CC[%d]:%d\n", i, RC.nb_L1_CC[i]);
|
||||||
|
|
||||||
for (j=0;j<RC.nb_L1_CC[i];j++) {
|
for (j=0; j<RC.nb_L1_CC[i]; j++) {
|
||||||
if (RC.eNB[i][j]->configured==0) {
|
if (RC.eNB[i][j]->configured==0) {
|
||||||
waiting=1;
|
waiting=1;
|
||||||
break;
|
break;
|
||||||
@@ -560,6 +538,7 @@ void wait_eNBs(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("eNB L1 are configured\n");
|
printf("eNB L1 are configured\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,8 +546,7 @@ void wait_eNBs(void) {
|
|||||||
/*
|
/*
|
||||||
* helper function to terminate a certain ITTI task
|
* helper function to terminate a certain ITTI task
|
||||||
*/
|
*/
|
||||||
void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to)
|
void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to) {
|
||||||
{
|
|
||||||
LOG_I(ENB_APP, "sending TERMINATE_MESSAGE from task %s (%d) to task %s (%d)\n",
|
LOG_I(ENB_APP, "sending TERMINATE_MESSAGE from task %s (%d) to task %s (%d)\n",
|
||||||
itti_get_task_name(from), from, itti_get_task_name(to), to);
|
itti_get_task_name(from), from, itti_get_task_name(to), to);
|
||||||
MessageDef *msg;
|
MessageDef *msg;
|
||||||
@@ -577,10 +555,9 @@ void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to)
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern void free_transport(PHY_VARS_eNB *);
|
extern void free_transport(PHY_VARS_eNB *);
|
||||||
extern void phy_free_RU(RU_t*);
|
extern void phy_free_RU(RU_t *);
|
||||||
|
|
||||||
int stop_L1L2(module_id_t enb_id)
|
int stop_L1L2(module_id_t enb_id) {
|
||||||
{
|
|
||||||
LOG_W(ENB_APP, "stopping lte-softmodem\n");
|
LOG_W(ENB_APP, "stopping lte-softmodem\n");
|
||||||
|
|
||||||
if (!RC.ru) {
|
if (!RC.ru) {
|
||||||
@@ -597,10 +574,12 @@ int stop_L1L2(module_id_t enb_id)
|
|||||||
LOG_I(ENB_APP, "calling kill_eNB_proc() for instance %d\n", enb_id);
|
LOG_I(ENB_APP, "calling kill_eNB_proc() for instance %d\n", enb_id);
|
||||||
kill_eNB_proc(enb_id);
|
kill_eNB_proc(enb_id);
|
||||||
oai_exit = 0;
|
oai_exit = 0;
|
||||||
|
|
||||||
for (int cc_id = 0; cc_id < RC.nb_CC[enb_id]; cc_id++) {
|
for (int cc_id = 0; cc_id < RC.nb_CC[enb_id]; cc_id++) {
|
||||||
free_transport(RC.eNB[enb_id][cc_id]);
|
free_transport(RC.eNB[enb_id][cc_id]);
|
||||||
phy_free_lte_eNB(RC.eNB[enb_id][cc_id]);
|
phy_free_lte_eNB(RC.eNB[enb_id][cc_id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
phy_free_RU(RC.ru[enb_id]);
|
phy_free_RU(RC.ru[enb_id]);
|
||||||
free_lte_top();
|
free_lte_top();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -609,14 +588,11 @@ int stop_L1L2(module_id_t enb_id)
|
|||||||
/*
|
/*
|
||||||
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
|
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
|
||||||
*/
|
*/
|
||||||
int restart_L1L2(module_id_t enb_id)
|
int restart_L1L2(module_id_t enb_id) {
|
||||||
{
|
|
||||||
RU_t *ru = RC.ru[enb_id];
|
RU_t *ru = RC.ru[enb_id];
|
||||||
int cc_id;
|
int cc_id;
|
||||||
MessageDef *msg_p = NULL;
|
MessageDef *msg_p = NULL;
|
||||||
|
|
||||||
LOG_W(ENB_APP, "restarting lte-softmodem\n");
|
LOG_W(ENB_APP, "restarting lte-softmodem\n");
|
||||||
|
|
||||||
/* block threads */
|
/* block threads */
|
||||||
pthread_mutex_lock(&sync_mutex);
|
pthread_mutex_lock(&sync_mutex);
|
||||||
sync_var = -1;
|
sync_var = -1;
|
||||||
@@ -634,14 +610,15 @@ int restart_L1L2(module_id_t enb_id)
|
|||||||
/* reset the list of connected UEs in the MAC, since in this process with
|
/* reset the list of connected UEs in the MAC, since in this process with
|
||||||
* loose all UEs (have to reconnect) */
|
* loose all UEs (have to reconnect) */
|
||||||
init_UE_list(&RC.mac[enb_id]->UE_list);
|
init_UE_list(&RC.mac[enb_id]->UE_list);
|
||||||
|
|
||||||
LOG_I(ENB_APP, "attempting to create ITTI tasks\n");
|
LOG_I(ENB_APP, "attempting to create ITTI tasks\n");
|
||||||
|
|
||||||
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
|
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
|
||||||
LOG_E(RRC, "Create task for RRC eNB failed\n");
|
LOG_E(RRC, "Create task for RRC eNB failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
LOG_I(RRC, "Re-created task for RRC eNB successfully\n");
|
LOG_I(RRC, "Re-created task for RRC eNB successfully\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
|
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
|
||||||
LOG_E(PDCP, "Create task for L2L1 failed\n");
|
LOG_E(PDCP, "Create task for L2L1 failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -656,26 +633,22 @@ int restart_L1L2(module_id_t enb_id)
|
|||||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||||
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
||||||
* broken, so we cannot test it */
|
* broken, so we cannot test it */
|
||||||
|
|
||||||
wait_eNBs();
|
wait_eNBs();
|
||||||
init_RU_proc(ru);
|
init_RU_proc(ru);
|
||||||
ru->rf_map.card = 0;
|
ru->rf_map.card = 0;
|
||||||
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||||
wait_RUs();
|
wait_RUs();
|
||||||
init_eNB_afterRU();
|
init_eNB_afterRU();
|
||||||
|
|
||||||
printf("Sending sync to all threads\n");
|
printf("Sending sync to all threads\n");
|
||||||
pthread_mutex_lock(&sync_mutex);
|
pthread_mutex_lock(&sync_mutex);
|
||||||
sync_var=0;
|
sync_var=0;
|
||||||
pthread_cond_broadcast(&sync_cond);
|
pthread_cond_broadcast(&sync_cond);
|
||||||
pthread_mutex_unlock(&sync_mutex);
|
pthread_mutex_unlock(&sync_mutex);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void wait_nfapi_init(char *thread_name) {
|
static void wait_nfapi_init(char *thread_name) {
|
||||||
|
|
||||||
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
|
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
|
||||||
pthread_mutex_lock( &nfapi_sync_mutex );
|
pthread_mutex_lock( &nfapi_sync_mutex );
|
||||||
|
|
||||||
@@ -683,74 +656,65 @@ static void wait_nfapi_init(char *thread_name) {
|
|||||||
pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
|
pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
|
||||||
|
|
||||||
pthread_mutex_unlock(&nfapi_sync_mutex);
|
pthread_mutex_unlock(&nfapi_sync_mutex);
|
||||||
|
|
||||||
printf( "NFAPI: got sync (%s)\n", thread_name);
|
printf( "NFAPI: got sync (%s)\n", thread_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv ) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
#if defined (XFORMS)
|
#if defined (XFORMS)
|
||||||
void *status;
|
void *status;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int CC_id;
|
int CC_id;
|
||||||
int ru_id;
|
int ru_id;
|
||||||
#if defined (XFORMS)
|
#if defined (XFORMS)
|
||||||
int ret;
|
int ret;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( load_configmodule(argc,argv,0) == NULL) {
|
if ( load_configmodule(argc,argv,0) == NULL) {
|
||||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mode = normal_txrx;
|
mode = normal_txrx;
|
||||||
|
|
||||||
set_latency_target();
|
set_latency_target();
|
||||||
|
|
||||||
logInit();
|
logInit();
|
||||||
|
|
||||||
printf("Reading in command-line options\n");
|
printf("Reading in command-line options\n");
|
||||||
|
|
||||||
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||||
get_options ();
|
get_options ();
|
||||||
|
|
||||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||||
fprintf(stderr,"Getting configuration failed\n");
|
fprintf(stderr,"Getting configuration failed\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if T_TRACER
|
#if T_TRACER
|
||||||
|
|
||||||
T_Config_Init();
|
T_Config_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret=config_check_cmdlineopt(NULL);
|
ret=config_check_cmdlineopt(NULL);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
LOG_E(ENB_APP, "%i unknown options in command line\n",ret);
|
LOG_E(ENB_APP, "%i unknown options in command line\n",ret);
|
||||||
exit_fun("");
|
exit_fun("");
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_CLEARRTFLAG(CONFIG_NOCHECKUNKOPT);
|
CONFIG_CLEARRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||||
//randominit (0);
|
//randominit (0);
|
||||||
set_taus_seed (0);
|
set_taus_seed (0);
|
||||||
|
|
||||||
printf("configuring for RAU/RRU\n");
|
printf("configuring for RAU/RRU\n");
|
||||||
|
|
||||||
if (opp_enabled ==1) {
|
if (opp_enabled ==1) {
|
||||||
reset_opp_meas();
|
reset_opp_meas();
|
||||||
}
|
}
|
||||||
|
|
||||||
cpuf=get_cpu_freq_GHz();
|
cpuf=get_cpu_freq_GHz();
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
|
|
||||||
printf("ITTI init, useMME: %i\n" ,EPC_MODE_ENABLED);
|
printf("ITTI init, useMME: %i\n" ,EPC_MODE_ENABLED);
|
||||||
|
|
||||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||||
|
|
||||||
// initialize mscgen log after ITTI
|
// initialize mscgen log after ITTI
|
||||||
if (get_softmodem_params()->start_msc) {
|
if (get_softmodem_params()->start_msc) {
|
||||||
load_module_shlib("msc",NULL,0,&msc_interface);
|
load_module_shlib("msc",NULL,0,&msc_interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -766,56 +730,50 @@ int main( int argc, char **argv )
|
|||||||
pdcp_netlink_init();
|
pdcp_netlink_init();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// to make a graceful exit when ctrl-c is pressed
|
// to make a graceful exit when ctrl-c is pressed
|
||||||
signal(SIGSEGV, signal_handler);
|
signal(SIGSEGV, signal_handler);
|
||||||
signal(SIGINT, signal_handler);
|
signal(SIGINT, signal_handler);
|
||||||
signal(SIGTERM, signal_handler);
|
signal(SIGTERM, signal_handler);
|
||||||
signal(SIGABRT, signal_handler);
|
signal(SIGABRT, signal_handler);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
check_clock();
|
check_clock();
|
||||||
|
|
||||||
#ifndef PACKAGE_VERSION
|
#ifndef PACKAGE_VERSION
|
||||||
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||||
|
|
||||||
printf("Runtime table\n");
|
printf("Runtime table\n");
|
||||||
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
|
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
|
||||||
|
|
||||||
|
|
||||||
#ifndef DEADLINE_SCHEDULER
|
#ifndef DEADLINE_SCHEDULER
|
||||||
|
|
||||||
printf("NO deadline scheduler\n");
|
printf("NO deadline scheduler\n");
|
||||||
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
|
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
|
||||||
|
|
||||||
cpu_set_t cpuset;
|
cpu_set_t cpuset;
|
||||||
int s;
|
int s;
|
||||||
char cpu_affinity[1024];
|
char cpu_affinity[1024];
|
||||||
CPU_ZERO(&cpuset);
|
CPU_ZERO(&cpuset);
|
||||||
#ifdef CPU_AFFINITY
|
#ifdef CPU_AFFINITY
|
||||||
|
|
||||||
if (get_nprocs() > 2) {
|
if (get_nprocs() > 2) {
|
||||||
CPU_SET(0, &cpuset);
|
CPU_SET(0, &cpuset);
|
||||||
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||||
|
|
||||||
if (s != 0) {
|
if (s != 0) {
|
||||||
perror( "pthread_setaffinity_np");
|
perror( "pthread_setaffinity_np");
|
||||||
exit_fun("Error setting processor affinity");
|
exit_fun("Error setting processor affinity");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
|
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#endif
|
||||||
/* Check the actual affinity mask assigned to the thread */
|
/* Check the actual affinity mask assigned to the thread */
|
||||||
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||||
|
|
||||||
if (s != 0) {
|
if (s != 0) {
|
||||||
perror( "pthread_getaffinity_np");
|
perror( "pthread_getaffinity_np");
|
||||||
exit_fun("Error getting processor affinity ");
|
exit_fun("Error getting processor affinity ");
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||||
|
|
||||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||||
if (CPU_ISSET(j, &cpuset)) {
|
if (CPU_ISSET(j, &cpuset)) {
|
||||||
char temp[1024];
|
char temp[1024];
|
||||||
@@ -823,30 +781,28 @@ int main( int argc, char **argv )
|
|||||||
strcat(cpu_affinity, temp);
|
strcat(cpu_affinity, temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
if (RC.nb_inst > 0) {
|
|
||||||
|
|
||||||
|
if (RC.nb_inst > 0) {
|
||||||
// don't create if node doesn't connect to RRC/S1/GTP
|
// don't create if node doesn't connect to RRC/S1/GTP
|
||||||
if (create_tasks(1) < 0) {
|
if (create_tasks(1) < 0) {
|
||||||
printf("cannot create ITTI tasks\n");
|
printf("cannot create ITTI tasks\n");
|
||||||
exit(-1); // need a softer mode
|
exit(-1); // need a softer mode
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("ITTI tasks created\n");
|
printf("ITTI tasks created\n");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
printf("No ITTI, Initializing L1\n");
|
printf("No ITTI, Initializing L1\n");
|
||||||
RCconfig_L1();
|
RCconfig_L1();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#endif
|
||||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||||
RCconfig_flexran();
|
RCconfig_flexran();
|
||||||
|
|
||||||
for (i = 0; i < RC.nb_L1_inst; i++) {
|
for (i = 0; i < RC.nb_L1_inst; i++) {
|
||||||
flexran_agent_start(i);
|
flexran_agent_start(i);
|
||||||
}
|
}
|
||||||
@@ -854,20 +810,15 @@ int main( int argc, char **argv )
|
|||||||
// init UE_PF_PO and mutex lock
|
// init UE_PF_PO and mutex lock
|
||||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||||
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
|
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
|
||||||
|
|
||||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||||
|
|
||||||
pthread_cond_init(&sync_cond,NULL);
|
pthread_cond_init(&sync_cond,NULL);
|
||||||
pthread_mutex_init(&sync_mutex, NULL);
|
pthread_mutex_init(&sync_mutex, NULL);
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
int UE_id;
|
int UE_id;
|
||||||
|
|
||||||
printf("XFORMS\n");
|
printf("XFORMS\n");
|
||||||
|
|
||||||
if (get_softmodem_params()->do_forms==1) {
|
if (get_softmodem_params()->do_forms==1) {
|
||||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||||
|
|
||||||
form_stats_l2 = create_form_stats_form();
|
form_stats_l2 = create_form_stats_form();
|
||||||
fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats");
|
fl_show_form (form_stats_l2->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "l2 stats");
|
||||||
form_stats = create_form_stats_form();
|
form_stats = create_form_stats_form();
|
||||||
@@ -898,11 +849,9 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rt_sleep_ns(10*100000000ULL);
|
rt_sleep_ns(10*100000000ULL);
|
||||||
|
|
||||||
if (nfapi_mode)
|
if (nfapi_mode) {
|
||||||
{
|
|
||||||
printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
|
printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
|
||||||
pthread_cond_init(&sync_cond,NULL);
|
pthread_cond_init(&sync_cond,NULL);
|
||||||
pthread_mutex_init(&sync_mutex, NULL);
|
pthread_mutex_init(&sync_mutex, NULL);
|
||||||
@@ -914,27 +863,30 @@ int main( int argc, char **argv )
|
|||||||
case 0:
|
case 0:
|
||||||
nfapi_mode_str = "MONOLITHIC";
|
nfapi_mode_str = "MONOLITHIC";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
nfapi_mode_str = "PNF";
|
nfapi_mode_str = "PNF";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
nfapi_mode_str = "VNF";
|
nfapi_mode_str = "VNF";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
|
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||||
|
|
||||||
if (nfapi_mode==2) // VNF
|
if (nfapi_mode==2) // VNF
|
||||||
wait_nfapi_init("main?");
|
wait_nfapi_init("main?");
|
||||||
|
|
||||||
printf("START MAIN THREADS\n");
|
printf("START MAIN THREADS\n");
|
||||||
|
|
||||||
// start the main threads
|
// start the main threads
|
||||||
|
|
||||||
number_of_cards = 1;
|
number_of_cards = 1;
|
||||||
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
|
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
|
||||||
|
|
||||||
if (RC.nb_L1_inst > 0) {
|
if (RC.nb_L1_inst > 0) {
|
||||||
printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
|
printf("Initializing eNB threads single_thread_flag:%d wait_for_sync:%d\n", get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
|
||||||
init_eNB(get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
|
init_eNB(get_softmodem_params()->single_thread_flag,get_softmodem_params()->wait_for_sync);
|
||||||
@@ -944,12 +896,13 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
printf("wait_eNBs()\n");
|
printf("wait_eNBs()\n");
|
||||||
wait_eNBs();
|
wait_eNBs();
|
||||||
|
|
||||||
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
|
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
|
||||||
|
|
||||||
if (RC.nb_RU >0) {
|
if (RC.nb_RU >0) {
|
||||||
printf("Initializing RU threads\n");
|
printf("Initializing RU threads\n");
|
||||||
init_RU(get_softmodem_params()->rf_config_file);
|
init_RU(get_softmodem_params()->rf_config_file);
|
||||||
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
|
||||||
|
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||||
RC.ru[ru_id]->rf_map.card=0;
|
RC.ru[ru_id]->rf_map.card=0;
|
||||||
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||||
}
|
}
|
||||||
@@ -970,31 +923,23 @@ int main( int argc, char **argv )
|
|||||||
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
|
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
|
||||||
printf("ALL RUs ready - init eNBs\n");
|
printf("ALL RUs ready - init eNBs\n");
|
||||||
|
|
||||||
if (nfapi_mode != 1 && nfapi_mode != 2)
|
if (nfapi_mode != 1 && nfapi_mode != 2) {
|
||||||
{
|
|
||||||
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
|
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||||
init_eNB_afterRU();
|
init_eNB_afterRU();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
|
printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("ALL RUs ready - ALL eNBs ready\n");
|
printf("ALL RUs ready - ALL eNBs ready\n");
|
||||||
|
|
||||||
|
|
||||||
// connect the TX/RX buffers
|
// connect the TX/RX buffers
|
||||||
|
|
||||||
sleep(1); /* wait for thread activation */
|
sleep(1); /* wait for thread activation */
|
||||||
|
|
||||||
printf("Sending sync to all threads\n");
|
printf("Sending sync to all threads\n");
|
||||||
|
|
||||||
pthread_mutex_lock(&sync_mutex);
|
pthread_mutex_lock(&sync_mutex);
|
||||||
sync_var=0;
|
sync_var=0;
|
||||||
pthread_cond_broadcast(&sync_cond);
|
pthread_cond_broadcast(&sync_cond);
|
||||||
pthread_mutex_unlock(&sync_mutex);
|
pthread_mutex_unlock(&sync_mutex);
|
||||||
|
|
||||||
ret=config_check_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
ret=config_check_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
LOG_E(ENB_APP, "%i unknown options in command line (invalid section name)\n",ret);
|
LOG_E(ENB_APP, "%i unknown options in command line (invalid section name)\n",ret);
|
||||||
exit_fun("");
|
exit_fun("");
|
||||||
@@ -1003,7 +948,6 @@ int main( int argc, char **argv )
|
|||||||
// wait for end of program
|
// wait for end of program
|
||||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||||
//getchar();
|
//getchar();
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
printf("Entering ITTI signals handler\n");
|
printf("Entering ITTI signals handler\n");
|
||||||
itti_wait_tasks_end();
|
itti_wait_tasks_end();
|
||||||
@@ -1014,10 +958,9 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
while (oai_exit==0)
|
while (oai_exit==0)
|
||||||
rt_sleep_ns(100000000ULL);
|
rt_sleep_ns(100000000ULL);
|
||||||
|
|
||||||
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// stop threads
|
// stop threads
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
printf("waiting for XFORMS thread\n");
|
printf("waiting for XFORMS thread\n");
|
||||||
@@ -1026,7 +969,6 @@ int main( int argc, char **argv )
|
|||||||
pthread_join(forms_thread,&status);
|
pthread_join(forms_thread,&status);
|
||||||
fl_hide_form(form_stats->stats_form);
|
fl_hide_form(form_stats->stats_form);
|
||||||
fl_free_form(form_stats->stats_form);
|
fl_free_form(form_stats->stats_form);
|
||||||
|
|
||||||
fl_hide_form(form_stats_l2->stats_form);
|
fl_hide_form(form_stats_l2->stats_form);
|
||||||
fl_free_form(form_stats_l2->stats_form);
|
fl_free_form(form_stats_l2->stats_form);
|
||||||
|
|
||||||
@@ -1039,11 +981,10 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("stopping MODEM threads\n");
|
printf("stopping MODEM threads\n");
|
||||||
|
|
||||||
stop_eNB(NB_eNB_INST);
|
stop_eNB(NB_eNB_INST);
|
||||||
stop_RU(RC.nb_RU);
|
stop_RU(RC.nb_RU);
|
||||||
|
|
||||||
/* release memory used by the RU/eNB threads (incomplete), after all
|
/* release memory used by the RU/eNB threads (incomplete), after all
|
||||||
* threads have been stopped (they partially use the same memory) */
|
* threads have been stopped (they partially use the same memory) */
|
||||||
for (int inst = 0; inst < NB_eNB_INST; inst++) {
|
for (int inst = 0; inst < NB_eNB_INST; inst++) {
|
||||||
@@ -1052,29 +993,27 @@ int main( int argc, char **argv )
|
|||||||
phy_free_lte_eNB(RC.eNB[inst][cc_id]);
|
phy_free_lte_eNB(RC.eNB[inst][cc_id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int inst = 0; inst < RC.nb_RU; inst++) {
|
for (int inst = 0; inst < RC.nb_RU; inst++) {
|
||||||
phy_free_RU(RC.ru[inst]);
|
phy_free_RU(RC.ru[inst]);
|
||||||
}
|
}
|
||||||
free_lte_top();
|
|
||||||
|
|
||||||
|
free_lte_top();
|
||||||
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||||
end_configmodule();
|
end_configmodule();
|
||||||
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||||
|
|
||||||
pthread_cond_destroy(&sync_cond);
|
pthread_cond_destroy(&sync_cond);
|
||||||
pthread_mutex_destroy(&sync_mutex);
|
pthread_mutex_destroy(&sync_mutex);
|
||||||
|
|
||||||
pthread_cond_destroy(&nfapi_sync_cond);
|
pthread_cond_destroy(&nfapi_sync_cond);
|
||||||
pthread_mutex_destroy(&nfapi_sync_mutex);
|
pthread_mutex_destroy(&nfapi_sync_mutex);
|
||||||
|
|
||||||
pthread_mutex_destroy(&ue_pf_po_mutex);
|
pthread_mutex_destroy(&ue_pf_po_mutex);
|
||||||
|
|
||||||
|
|
||||||
for(ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
for(ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||||
if (RC.ru[ru_id]->rfdevice.trx_end_func) {
|
if (RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RC.ru[ru_id]->ifdevice.trx_end_func) {
|
if (RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||||
@@ -1085,8 +1024,6 @@ int main( int argc, char **argv )
|
|||||||
terminate_opt();
|
terminate_opt();
|
||||||
|
|
||||||
logClean();
|
logClean();
|
||||||
|
|
||||||
printf("Bye.\n");
|
printf("Bye.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,18 +75,18 @@
|
|||||||
#include "UTIL/OPT/opt.h"
|
#include "UTIL/OPT/opt.h"
|
||||||
|
|
||||||
#ifndef OPENAIR2
|
#ifndef OPENAIR2
|
||||||
#include "UTIL/OTG/otg_vars.h"
|
#include "UTIL/OTG/otg_vars.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
#include "create_tasks.h"
|
#include "create_tasks.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#endif
|
#endif
|
||||||
#include "lte-softmodem.h"
|
#include "lte-softmodem.h"
|
||||||
|
|
||||||
@@ -95,14 +95,14 @@
|
|||||||
/* temporary compilation wokaround (UE/eNB split */
|
/* temporary compilation wokaround (UE/eNB split */
|
||||||
uint16_t sf_ahead;
|
uint16_t sf_ahead;
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||||
// at eNB 0, an UL scope for every UE
|
// at eNB 0, an UL scope for every UE
|
||||||
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
|
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
|
||||||
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||||
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||||
char title[255];
|
char title[255];
|
||||||
unsigned char scope_enb_num_ue = 2;
|
unsigned char scope_enb_num_ue = 2;
|
||||||
static pthread_t forms_thread; //xforms
|
static pthread_t forms_thread; //xforms
|
||||||
#endif //XFORMS
|
#endif //XFORMS
|
||||||
|
|
||||||
pthread_cond_t nfapi_sync_cond;
|
pthread_cond_t nfapi_sync_cond;
|
||||||
@@ -125,8 +125,8 @@ uint16_t runtime_phy_rx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75,
|
|||||||
uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
|
uint16_t runtime_phy_tx[29][6]; // SISO [MCS 0-28][RBs 0-5 : 6, 15, 25, 50, 75, 100]
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
volatile int start_eNB = 0;
|
volatile int start_eNB = 0;
|
||||||
volatile int start_UE = 0;
|
volatile int start_UE = 0;
|
||||||
#endif
|
#endif
|
||||||
volatile int oai_exit = 0;
|
volatile int oai_exit = 0;
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ char channels[128] = "0";
|
|||||||
int rx_input_level_dBm;
|
int rx_input_level_dBm;
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
extern int otg_enabled;
|
extern int otg_enabled;
|
||||||
#endif
|
#endif
|
||||||
//int number_of_cards = 1;
|
//int number_of_cards = 1;
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ uint64_t num_missed_slots=0; // counter for the number of missed slots
|
|||||||
file */
|
file */
|
||||||
extern void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_iface);
|
extern void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_iface);
|
||||||
|
|
||||||
extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
extern PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||||
uint8_t UE_id,
|
uint8_t UE_id,
|
||||||
uint8_t abstraction_flag);
|
uint8_t abstraction_flag);
|
||||||
|
|
||||||
@@ -205,8 +205,8 @@ int transmission_mode=1;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
char* usrp_args=NULL;
|
char *usrp_args=NULL;
|
||||||
char* usrp_clksrc=NULL;
|
char *usrp_clksrc=NULL;
|
||||||
|
|
||||||
THREAD_STRUCT thread_struct;
|
THREAD_STRUCT thread_struct;
|
||||||
/* struct for ethernet specific parameters given in eNB conf file */
|
/* struct for ethernet specific parameters given in eNB conf file */
|
||||||
@@ -237,6 +237,7 @@ struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
|||||||
|
|
||||||
struct timespec clock_difftime(struct timespec start, struct timespec end) {
|
struct timespec clock_difftime(struct timespec start, struct timespec end) {
|
||||||
struct timespec temp;
|
struct timespec temp;
|
||||||
|
|
||||||
if ((end.tv_nsec-start.tv_nsec)<0) {
|
if ((end.tv_nsec-start.tv_nsec)<0) {
|
||||||
temp.tv_sec = end.tv_sec-start.tv_sec-1;
|
temp.tv_sec = end.tv_sec-start.tv_sec-1;
|
||||||
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
|
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
|
||||||
@@ -244,6 +245,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
|
|||||||
temp.tv_sec = end.tv_sec-start.tv_sec;
|
temp.tv_sec = end.tv_sec-start.tv_sec;
|
||||||
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
|
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
|
||||||
}
|
}
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,16 +261,21 @@ void update_difftimes(struct timespec start, struct timespec end) {
|
|||||||
struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 };
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
diff_time = clock_difftime(start, end);
|
diff_time = clock_difftime(start, end);
|
||||||
|
|
||||||
if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) {
|
if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) {
|
||||||
min_diff_time.tv_nsec = diff_time.tv_nsec;
|
min_diff_time.tv_nsec = diff_time.tv_nsec;
|
||||||
changed = 1;
|
changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) {
|
if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) {
|
||||||
max_diff_time.tv_nsec = diff_time.tv_nsec;
|
max_diff_time.tv_nsec = diff_time.tv_nsec;
|
||||||
changed = 1;
|
changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
|
||||||
if (changed) print_difftimes();
|
if (changed) print_difftimes();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +297,6 @@ void signal_handler(int sig) {
|
|||||||
if (sig==SIGSEGV) {
|
if (sig==SIGSEGV) {
|
||||||
// get void*'s for all entries on the stack
|
// get void*'s for all entries on the stack
|
||||||
size = backtrace(array, 10);
|
size = backtrace(array, 10);
|
||||||
|
|
||||||
// print out all the frames to stderr
|
// print out all the frames to stderr
|
||||||
fprintf(stderr, "Error: signal %d:\n", sig);
|
fprintf(stderr, "Error: signal %d:\n", sig);
|
||||||
backtrace_symbols_fd(array, size, 2);
|
backtrace_symbols_fd(array, size, 2);
|
||||||
@@ -299,20 +305,14 @@ void signal_handler(int sig) {
|
|||||||
char msg[64];
|
char msg[64];
|
||||||
sprintf(msg,"Received linux signal %s...\n",strsignal(sig));
|
sprintf(msg,"Received linux signal %s...\n",strsignal(sig));
|
||||||
exit_function(__FILE__, __FUNCTION__, __LINE__,msg);
|
exit_function(__FILE__, __FUNCTION__, __LINE__,msg);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void exit_function(const char* file, const char* function, const int line, const char* s)
|
void exit_function(const char *file, const char *function, const int line, const char *s) {
|
||||||
{
|
|
||||||
int CC_id;
|
int CC_id;
|
||||||
|
|
||||||
logClean();
|
logClean();
|
||||||
printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, ((s==NULL)?"":s));
|
printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, ((s==NULL)?"":s));
|
||||||
|
|
||||||
|
|
||||||
oai_exit = 1;
|
oai_exit = 1;
|
||||||
|
|
||||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
@@ -325,8 +325,10 @@ void exit_function(const char* file, const char* function, const int line, const
|
|||||||
|
|
||||||
sleep(1); //allow lte-softmodem threads to exit first
|
sleep(1); //allow lte-softmodem threads to exit first
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
|
|
||||||
if(PHY_vars_UE_g != NULL )
|
if(PHY_vars_UE_g != NULL )
|
||||||
itti_terminate_tasks (TASK_UNKNOWN);
|
itti_terminate_tasks (TASK_UNKNOWN);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -334,8 +336,7 @@ void exit_function(const char* file, const char* function, const int line, const
|
|||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
|
|
||||||
|
|
||||||
void reset_stats(FL_OBJECT *button, long arg)
|
void reset_stats(FL_OBJECT *button, long arg) {
|
||||||
{
|
|
||||||
int i,j,k;
|
int i,j,k;
|
||||||
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
|
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
|
||||||
|
|
||||||
@@ -350,8 +351,6 @@ void reset_stats(FL_OBJECT *button, long arg)
|
|||||||
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
||||||
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
||||||
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
||||||
|
|
||||||
|
|
||||||
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
||||||
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
||||||
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
||||||
@@ -365,17 +364,11 @@ static void *scope_thread(void *arg) {
|
|||||||
FILE *UE_stats, *eNB_stats;
|
FILE *UE_stats, *eNB_stats;
|
||||||
# endif
|
# endif
|
||||||
struct sched_param sched_param;
|
struct sched_param sched_param;
|
||||||
|
|
||||||
|
|
||||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
|
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
|
||||||
sched_setscheduler(0, SCHED_FIFO,&sched_param);
|
sched_setscheduler(0, SCHED_FIFO,&sched_param);
|
||||||
|
|
||||||
printf("Scope thread has priority %d\n",sched_param.sched_priority);
|
printf("Scope thread has priority %d\n",sched_param.sched_priority);
|
||||||
|
|
||||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||||
|
|
||||||
UE_stats = fopen("UE_stats.txt", "w");
|
UE_stats = fopen("UE_stats.txt", "w");
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (!oai_exit) {
|
while (!oai_exit) {
|
||||||
@@ -383,14 +376,13 @@ static void *scope_thread(void *arg) {
|
|||||||
//fl_set_object_label(form_stats->stats_text, stats_buffer);
|
//fl_set_object_label(form_stats->stats_text, stats_buffer);
|
||||||
fl_clear_browser(form_stats->stats_text);
|
fl_clear_browser(form_stats->stats_text);
|
||||||
fl_add_browser_line(form_stats->stats_text, stats_buffer);
|
fl_add_browser_line(form_stats->stats_text, stats_buffer);
|
||||||
|
|
||||||
phy_scope_UE(form_ue[0],
|
phy_scope_UE(form_ue[0],
|
||||||
PHY_vars_UE_g[0][0],
|
PHY_vars_UE_g[0][0],
|
||||||
0,
|
0,
|
||||||
0,7);
|
0,7);
|
||||||
|
|
||||||
// printf("%s",stats_buffer);
|
// printf("%s",stats_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef ENABLE_XFORMS_WRITE_STATS
|
# ifdef ENABLE_XFORMS_WRITE_STATS
|
||||||
|
|
||||||
if (UE_stats) {
|
if (UE_stats) {
|
||||||
@@ -400,8 +392,7 @@ static void *scope_thread(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
pthread_exit((void *)arg);
|
||||||
pthread_exit((void*)arg);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -411,11 +402,9 @@ static void *scope_thread(void *arg) {
|
|||||||
void *l2l1_task(void *arg) {
|
void *l2l1_task(void *arg) {
|
||||||
MessageDef *message_p = NULL;
|
MessageDef *message_p = NULL;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
itti_set_task_real_time(TASK_L2L1);
|
itti_set_task_real_time(TASK_L2L1);
|
||||||
itti_mark_task_ready(TASK_L2L1);
|
itti_mark_task_ready(TASK_L2L1);
|
||||||
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
// Wait for a message
|
// Wait for a message
|
||||||
itti_receive_msg (TASK_L2L1, &message_p);
|
itti_receive_msg (TASK_L2L1, &message_p);
|
||||||
@@ -459,43 +448,48 @@ static void get_options(void) {
|
|||||||
char *loopfile=NULL;
|
char *loopfile=NULL;
|
||||||
int dumpframe;
|
int dumpframe;
|
||||||
int timingadv;
|
int timingadv;
|
||||||
|
|
||||||
set_default_frame_parms(frame_parms);
|
set_default_frame_parms(frame_parms);
|
||||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||||
/* unknown parameters on command line will be checked in main
|
/* unknown parameters on command line will be checked in main
|
||||||
after all init have been performed */
|
after all init have been performed */
|
||||||
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||||
get_common_options();
|
get_common_options();
|
||||||
get_uethreads_params();
|
get_uethreads_params();
|
||||||
|
|
||||||
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
|
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
|
||||||
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
|
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
|
||||||
|
|
||||||
|
|
||||||
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
|
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
|
||||||
|
|
||||||
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
|
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
|
||||||
|
|
||||||
if (loopfile != NULL) {
|
if (loopfile != NULL) {
|
||||||
printf("Input file for hardware emulation: %s",loopfile);
|
printf("Input file for hardware emulation: %s",loopfile);
|
||||||
mode=loop_through_memory;
|
mode=loop_through_memory;
|
||||||
input_fd = fopen(loopfile,"r");
|
input_fd = fopen(loopfile,"r");
|
||||||
AssertFatal(input_fd != NULL,"Please provide a valid input file\n");
|
AssertFatal(input_fd != NULL,"Please provide a valid input file\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
get_softmodem_params()->hw_timing_advance = timingadv;
|
get_softmodem_params()->hw_timing_advance = timingadv;
|
||||||
|
|
||||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
|
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
|
||||||
|
|
||||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
|
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
|
||||||
|
|
||||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
|
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
|
||||||
|
|
||||||
if (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr)
|
if (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr)
|
||||||
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach;
|
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach;
|
||||||
|
|
||||||
if (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr)
|
if (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr)
|
||||||
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect;
|
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect;
|
||||||
|
|
||||||
if (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr)
|
if (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr)
|
||||||
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
||||||
|
|
||||||
if (dumpframe > 0) mode = rx_dump_frame;
|
if (dumpframe > 0) mode = rx_dump_frame;
|
||||||
|
|
||||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_scan=0;
|
UE_scan=0;
|
||||||
|
|
||||||
if (tddflag > 0) {
|
if (tddflag > 0) {
|
||||||
@@ -508,28 +502,32 @@ static void get_options(void) {
|
|||||||
frame_parms[0]->N_RB_DL = 6;
|
frame_parms[0]->N_RB_DL = 6;
|
||||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||||
frame_parms[0]->N_RB_DL = 100;
|
frame_parms[0]->N_RB_DL = 100;
|
||||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||||
frame_parms[0]->N_RB_DL = 50;
|
frame_parms[0]->N_RB_DL = 50;
|
||||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||||
frame_parms[0]->N_RB_DL = 25;
|
frame_parms[0]->N_RB_DL = 25;
|
||||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_scan = 0;
|
UE_scan = 0;
|
||||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||||
|
|
||||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
||||||
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) {
|
|
||||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||||
}
|
}
|
||||||
@@ -547,11 +545,10 @@ static void get_options(void) {
|
|||||||
|
|
||||||
|
|
||||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||||
|
|
||||||
int CC_id;
|
int CC_id;
|
||||||
|
|
||||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
frame_parms[CC_id] = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
frame_parms[CC_id] = (LTE_DL_FRAME_PARMS *) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
||||||
/* Set some default values that may be overwritten while reading options */
|
/* Set some default values that may be overwritten while reading options */
|
||||||
frame_parms[CC_id]->frame_type = FDD;
|
frame_parms[CC_id]->frame_type = FDD;
|
||||||
frame_parms[CC_id]->tdd_config = 3;
|
frame_parms[CC_id]->tdd_config = 3;
|
||||||
@@ -565,9 +562,7 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
|||||||
frame_parms[CC_id]->nb_antenna_ports_eNB = 1;
|
frame_parms[CC_id]->nb_antenna_ports_eNB = 1;
|
||||||
frame_parms[CC_id]->nb_antennas_tx = 1;
|
frame_parms[CC_id]->nb_antennas_tx = 1;
|
||||||
frame_parms[CC_id]->nb_antennas_rx = 1;
|
frame_parms[CC_id]->nb_antennas_rx = 1;
|
||||||
|
|
||||||
frame_parms[CC_id]->nushift = 0;
|
frame_parms[CC_id]->nushift = 0;
|
||||||
|
|
||||||
frame_parms[CC_id]->phich_config_common.phich_resource = oneSixth;
|
frame_parms[CC_id]->phich_config_common.phich_resource = oneSixth;
|
||||||
frame_parms[CC_id]->phich_config_common.phich_duration = normal;
|
frame_parms[CC_id]->phich_config_common.phich_duration = normal;
|
||||||
// UL RS Config
|
// UL RS Config
|
||||||
@@ -575,31 +570,24 @@ void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
|||||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0;
|
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0;
|
||||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
|
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
|
||||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
|
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
|
||||||
|
|
||||||
frame_parms[CC_id]->prach_config_common.rootSequenceIndex=22;
|
frame_parms[CC_id]->prach_config_common.rootSequenceIndex=22;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=1;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=1;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
|
||||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
|
||||||
|
|
||||||
downlink_frequency[CC_id][0] = DEFAULT_DLF; // Use float to avoid issue with frequency over 2^31.
|
downlink_frequency[CC_id][0] = DEFAULT_DLF; // Use float to avoid issue with frequency over 2^31.
|
||||||
downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
|
downlink_frequency[CC_id][1] = downlink_frequency[CC_id][0];
|
||||||
downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
|
downlink_frequency[CC_id][2] = downlink_frequency[CC_id][0];
|
||||||
downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0];
|
downlink_frequency[CC_id][3] = downlink_frequency[CC_id][0];
|
||||||
|
|
||||||
frame_parms[CC_id]->dl_CarrierFreq=downlink_frequency[CC_id][0];
|
frame_parms[CC_id]->dl_CarrierFreq=downlink_frequency[CC_id][0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
|
void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
|
||||||
|
|
||||||
int card;
|
int card;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (card=0; card<MAX_CARDS; card++) {
|
for (card=0; card<MAX_CARDS; card++) {
|
||||||
|
|
||||||
openair0_cfg[card].mmapped_dma=mmapped_dma;
|
openair0_cfg[card].mmapped_dma=mmapped_dma;
|
||||||
openair0_cfg[card].configFilename = NULL;
|
openair0_cfg[card].configFilename = NULL;
|
||||||
|
|
||||||
@@ -632,26 +620,18 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
|
|||||||
openair0_cfg[card].rx_bw = 1.5e6;
|
openair0_cfg[card].rx_bw = 1.5e6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (frame_parms->frame_type==TDD)
|
if (frame_parms->frame_type==TDD)
|
||||||
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
|
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
|
||||||
else //FDD
|
else //FDD
|
||||||
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
||||||
|
|
||||||
openair0_cfg[card].Mod_id = 0;
|
openair0_cfg[card].Mod_id = 0;
|
||||||
|
|
||||||
openair0_cfg[card].num_rb_dl=frame_parms->N_RB_DL;
|
openair0_cfg[card].num_rb_dl=frame_parms->N_RB_DL;
|
||||||
|
|
||||||
openair0_cfg[card].clock_source = clock_source;
|
openair0_cfg[card].clock_source = clock_source;
|
||||||
|
|
||||||
|
|
||||||
openair0_cfg[card].tx_num_channels=min(2,frame_parms->nb_antennas_tx);
|
openair0_cfg[card].tx_num_channels=min(2,frame_parms->nb_antennas_tx);
|
||||||
openair0_cfg[card].rx_num_channels=min(2,frame_parms->nb_antennas_rx);
|
openair0_cfg[card].rx_num_channels=min(2,frame_parms->nb_antennas_rx);
|
||||||
|
|
||||||
for (i=0; i<4; i++) {
|
for (i=0; i<4; i++) {
|
||||||
|
|
||||||
if (i<openair0_cfg[card].tx_num_channels)
|
if (i<openair0_cfg[card].tx_num_channels)
|
||||||
openair0_cfg[card].tx_freq[i] = downlink_frequency[0][i]+uplink_frequency_offset[0][i];
|
openair0_cfg[card].tx_freq[i] = downlink_frequency[0][i]+uplink_frequency_offset[0][i];
|
||||||
else
|
else
|
||||||
@@ -665,8 +645,6 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
|
|||||||
openair0_cfg[card].autocal[i] = 1;
|
openair0_cfg[card].autocal[i] = 1;
|
||||||
openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
|
openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
|
||||||
openair0_cfg[card].rx_gain[i] = rxgain - rx_gain_off;
|
openair0_cfg[card].rx_gain[i] = rxgain - rx_gain_off;
|
||||||
|
|
||||||
|
|
||||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||||
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
|
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
|
||||||
card,i, openair0_cfg[card].tx_gain[i],
|
card,i, openair0_cfg[card].tx_gain[i],
|
||||||
@@ -676,6 +654,7 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
|
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
|
||||||
|
|
||||||
if (usrp_clksrc) {
|
if (usrp_clksrc) {
|
||||||
if (strcmp(usrp_clksrc, "internal") == 0) {
|
if (strcmp(usrp_clksrc, "internal") == 0) {
|
||||||
openair0_cfg[card].clock_source = internal;
|
openair0_cfg[card].clock_source = internal;
|
||||||
@@ -704,8 +683,7 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
|
|||||||
/*
|
/*
|
||||||
* helper function to terminate a certain ITTI task
|
* helper function to terminate a certain ITTI task
|
||||||
*/
|
*/
|
||||||
void terminate_task(task_id_t task_id, module_id_t mod_id)
|
void terminate_task(task_id_t task_id, module_id_t mod_id) {
|
||||||
{
|
|
||||||
LOG_I(ENB_APP, "sending TERMINATE_MESSAGE to task %s (%d)\n", itti_get_task_name(task_id), task_id);
|
LOG_I(ENB_APP, "sending TERMINATE_MESSAGE to task %s (%d)\n", itti_get_task_name(task_id), task_id);
|
||||||
MessageDef *msg;
|
MessageDef *msg;
|
||||||
msg = itti_alloc_new_message (ENB_APP, TERMINATE_MESSAGE);
|
msg = itti_alloc_new_message (ENB_APP, TERMINATE_MESSAGE);
|
||||||
@@ -719,7 +697,6 @@ void terminate_task(task_id_t task_id, module_id_t mod_id)
|
|||||||
|
|
||||||
|
|
||||||
static inline void wait_nfapi_init(char *thread_name) {
|
static inline void wait_nfapi_init(char *thread_name) {
|
||||||
|
|
||||||
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
|
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
|
||||||
pthread_mutex_lock( &nfapi_sync_mutex );
|
pthread_mutex_lock( &nfapi_sync_mutex );
|
||||||
|
|
||||||
@@ -727,91 +704,64 @@ static inline void wait_nfapi_init(char *thread_name) {
|
|||||||
pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
|
pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex );
|
||||||
|
|
||||||
pthread_mutex_unlock(&nfapi_sync_mutex);
|
pthread_mutex_unlock(&nfapi_sync_mutex);
|
||||||
|
|
||||||
printf( "NFAPI: got sync (%s)\n", thread_name);
|
printf( "NFAPI: got sync (%s)\n", thread_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int stop_L1L2(module_id_t enb_id)
|
int stop_L1L2(module_id_t enb_id) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int restart_L1L2(module_id_t enb_id)
|
int restart_L1L2(module_id_t enb_id) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv ) {
|
||||||
{
|
|
||||||
#if defined (XFORMS)
|
#if defined (XFORMS)
|
||||||
void *status;
|
void *status;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int CC_id;
|
int CC_id;
|
||||||
uint8_t abstraction_flag=0;
|
uint8_t abstraction_flag=0;
|
||||||
|
|
||||||
// Default value for the number of UEs. It will hold,
|
// Default value for the number of UEs. It will hold,
|
||||||
// if not changed from the command line option --num-ues
|
// if not changed from the command line option --num-ues
|
||||||
NB_UE_INST=1;
|
NB_UE_INST=1;
|
||||||
|
|
||||||
#if defined (XFORMS)
|
#if defined (XFORMS)
|
||||||
int ret;
|
int ret;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
start_background_system();
|
start_background_system();
|
||||||
|
|
||||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
|
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == NULL) {
|
||||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mode = normal_txrx;
|
mode = normal_txrx;
|
||||||
memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS);
|
memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS);
|
||||||
|
|
||||||
|
|
||||||
set_latency_target();
|
set_latency_target();
|
||||||
|
|
||||||
logInit();
|
logInit();
|
||||||
|
|
||||||
printf("Reading in command-line options\n");
|
printf("Reading in command-line options\n");
|
||||||
|
|
||||||
for (int i=0;i<MAX_NUM_CCs;i++) tx_max_power[i]=23;
|
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
|
||||||
|
|
||||||
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
CONFIG_SETRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||||
get_options ();
|
get_options ();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||||
|
|
||||||
if (NB_UE_INST > 1 && simL1flag != 1) {
|
if (NB_UE_INST > 1 && simL1flag != 1) {
|
||||||
printf("Running with more than 1 UE instance and simL1 is not active, this will result in undefined behaviour for now, exiting.\n");
|
printf("Running with more than 1 UE instance and simL1 is not active, this will result in undefined behaviour for now, exiting.\n");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("NFAPI_MODE value: %d \n", nfapi_mode);
|
printf("NFAPI_MODE value: %d \n", nfapi_mode);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if T_TRACER
|
#if T_TRACER
|
||||||
T_Config_Init();
|
T_Config_Init();
|
||||||
#endif
|
#endif
|
||||||
CONFIG_CLEARRTFLAG(CONFIG_NOCHECKUNKOPT);
|
CONFIG_CLEARRTFLAG(CONFIG_NOCHECKUNKOPT);
|
||||||
|
|
||||||
|
|
||||||
//randominit (0);
|
//randominit (0);
|
||||||
set_taus_seed (0);
|
set_taus_seed (0);
|
||||||
|
|
||||||
cpuf=get_cpu_freq_GHz();
|
cpuf=get_cpu_freq_GHz();
|
||||||
|
|
||||||
pthread_cond_init(&sync_cond,NULL);
|
pthread_cond_init(&sync_cond,NULL);
|
||||||
pthread_mutex_init(&sync_mutex, NULL);
|
pthread_mutex_init(&sync_mutex, NULL);
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
printf("ITTI init\n");
|
printf("ITTI init\n");
|
||||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||||
|
|
||||||
@@ -819,6 +769,7 @@ int main( int argc, char **argv )
|
|||||||
if (get_softmodem_params()->start_msc) {
|
if (get_softmodem_params()->start_msc) {
|
||||||
load_module_shlib("msc",NULL,0,&msc_interface);
|
load_module_shlib("msc",NULL,0,&msc_interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -834,27 +785,22 @@ int main( int argc, char **argv )
|
|||||||
pdcp_netlink_init();
|
pdcp_netlink_init();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
//TTN for D2D
|
||||||
//TTN for D2D
|
|
||||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||||
printf ("RRC control socket\n");
|
printf ("RRC control socket\n");
|
||||||
rrc_control_socket_init();
|
rrc_control_socket_init();
|
||||||
printf ("PDCP PC5S socket\n");
|
printf ("PDCP PC5S socket\n");
|
||||||
pdcp_pc5_socket_init();
|
pdcp_pc5_socket_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// to make a graceful exit when ctrl-c is pressed
|
// to make a graceful exit when ctrl-c is pressed
|
||||||
signal(SIGSEGV, signal_handler);
|
signal(SIGSEGV, signal_handler);
|
||||||
signal(SIGINT, signal_handler);
|
signal(SIGINT, signal_handler);
|
||||||
signal(SIGTERM, signal_handler);
|
signal(SIGTERM, signal_handler);
|
||||||
signal(SIGABRT, signal_handler);
|
signal(SIGABRT, signal_handler);
|
||||||
|
|
||||||
check_clock();
|
check_clock();
|
||||||
|
|
||||||
#ifndef PACKAGE_VERSION
|
#ifndef PACKAGE_VERSION
|
||||||
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||||
|
|
||||||
// init the parameters
|
// init the parameters
|
||||||
@@ -864,98 +810,92 @@ int main( int argc, char **argv )
|
|||||||
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later
|
frame_parms[CC_id]->nb_antenna_ports_eNB = 1; //initial value overwritten by initial sync later
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NB_INST=1;
|
NB_INST=1;
|
||||||
if(nfapi_mode == 3){
|
|
||||||
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE**)*NB_UE_INST);
|
if(nfapi_mode == 3) {
|
||||||
|
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE **)*NB_UE_INST);
|
||||||
|
|
||||||
for (int i=0; i<NB_UE_INST; i++) {
|
for (int i=0; i<NB_UE_INST; i++) {
|
||||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
PHY_vars_UE_g[i] = malloc(sizeof(PHY_VARS_UE*)*MAX_NUM_CCs);
|
PHY_vars_UE_g[i] = malloc(sizeof(PHY_VARS_UE *)*MAX_NUM_CCs);
|
||||||
PHY_vars_UE_g[i][CC_id] = init_ue_vars(frame_parms[CC_id], i,abstraction_flag);
|
PHY_vars_UE_g[i][CC_id] = init_ue_vars(frame_parms[CC_id], i,abstraction_flag);
|
||||||
|
|
||||||
|
|
||||||
if (get_softmodem_params()->phy_test==1)
|
if (get_softmodem_params()->phy_test==1)
|
||||||
PHY_vars_UE_g[i][CC_id]->mac_enabled = 0;
|
PHY_vars_UE_g[i][CC_id]->mac_enabled = 0;
|
||||||
else
|
else
|
||||||
PHY_vars_UE_g[i][CC_id]->mac_enabled = 1;
|
PHY_vars_UE_g[i][CC_id]->mac_enabled = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else init_openair0(frame_parms[0],(int)rx_gain[0][0]);
|
||||||
else init_openair0(frame_parms[0],(int)rx_gain[0][0]);
|
|
||||||
|
|
||||||
|
|
||||||
if (simL1flag==1) {
|
if (simL1flag==1) {
|
||||||
AssertFatal(NULL!=load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY),
|
AssertFatal(NULL!=load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY),
|
||||||
"[SOFTMODEM] Error, configuration module init failed\n");
|
"[SOFTMODEM] Error, configuration module init failed\n");
|
||||||
|
|
||||||
RCConfig_sim();
|
RCConfig_sim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the main UE threads
|
// start the main UE threads
|
||||||
int eMBMS_active = 0;
|
int eMBMS_active = 0;
|
||||||
|
|
||||||
if (nfapi_mode==3) // UE-STUB-PNF
|
if (nfapi_mode==3) { // UE-STUB-PNF
|
||||||
{
|
|
||||||
config_sync_var=0;
|
config_sync_var=0;
|
||||||
wait_nfapi_init("main?");
|
wait_nfapi_init("main?");
|
||||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||||
frame_parms[0]);
|
frame_parms[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (get_softmodem_params()->phy_test==0) {
|
if (get_softmodem_params()->phy_test==0) {
|
||||||
printf("Filling UE band info\n");
|
printf("Filling UE band info\n");
|
||||||
fill_ue_band_info();
|
fill_ue_band_info();
|
||||||
dl_phy_sync_success (0, 0, 0, 1);
|
dl_phy_sync_success (0, 0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nfapi_mode!=3){
|
if (nfapi_mode!=3) {
|
||||||
number_of_cards = 1;
|
number_of_cards = 1;
|
||||||
|
|
||||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cpuf=get_cpu_freq_GHz();
|
cpuf=get_cpu_freq_GHz();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef DEADLINE_SCHEDULER
|
#ifndef DEADLINE_SCHEDULER
|
||||||
|
|
||||||
printf("NO deadline scheduler\n");
|
printf("NO deadline scheduler\n");
|
||||||
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
|
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
|
||||||
|
|
||||||
cpu_set_t cpuset;
|
cpu_set_t cpuset;
|
||||||
int s;
|
int s;
|
||||||
char cpu_affinity[1024];
|
char cpu_affinity[1024];
|
||||||
CPU_ZERO(&cpuset);
|
CPU_ZERO(&cpuset);
|
||||||
#ifdef CPU_AFFINITY
|
#ifdef CPU_AFFINITY
|
||||||
|
|
||||||
if (get_nprocs() > 2) {
|
if (get_nprocs() > 2) {
|
||||||
CPU_SET(0, &cpuset);
|
CPU_SET(0, &cpuset);
|
||||||
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||||
|
|
||||||
if (s != 0) {
|
if (s != 0) {
|
||||||
perror( "pthread_setaffinity_np");
|
perror( "pthread_setaffinity_np");
|
||||||
exit_fun("Error setting processor affinity");
|
exit_fun("Error setting processor affinity");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
|
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
#endif
|
||||||
/* Check the actual affinity mask assigned to the thread */
|
/* Check the actual affinity mask assigned to the thread */
|
||||||
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||||
|
|
||||||
if (s != 0) {
|
if (s != 0) {
|
||||||
perror( "pthread_getaffinity_np");
|
perror( "pthread_getaffinity_np");
|
||||||
exit_fun("Error getting processor affinity ");
|
exit_fun("Error getting processor affinity ");
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||||
|
|
||||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||||
if (CPU_ISSET(j, &cpuset)) {
|
if (CPU_ISSET(j, &cpuset)) {
|
||||||
char temp[1024];
|
char temp[1024];
|
||||||
@@ -963,58 +903,56 @@ int main( int argc, char **argv )
|
|||||||
strcat(cpu_affinity, temp);
|
strcat(cpu_affinity, temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
|
|
||||||
if (create_tasks_ue(1) < 0) {
|
if (create_tasks_ue(1) < 0) {
|
||||||
printf("cannot create ITTI tasks\n");
|
printf("cannot create ITTI tasks\n");
|
||||||
exit(-1); // need a softer mode
|
exit(-1); // need a softer mode
|
||||||
}
|
}
|
||||||
if(nfapi_mode==3){ // Here we should add another nfapi_mode for the case of Supervised LTE-D2D
|
|
||||||
|
if(nfapi_mode==3) { // Here we should add another nfapi_mode for the case of Supervised LTE-D2D
|
||||||
UE_config_stub_pnf();
|
UE_config_stub_pnf();
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("ITTI tasks created\n");
|
printf("ITTI tasks created\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
mlockall(MCL_CURRENT | MCL_FUTURE);
|
mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||||
|
|
||||||
|
|
||||||
rt_sleep_ns(10*100000000ULL);
|
rt_sleep_ns(10*100000000ULL);
|
||||||
|
|
||||||
const char *nfapi_mode_str = "<UNKNOWN>";
|
const char *nfapi_mode_str = "<UNKNOWN>";
|
||||||
|
|
||||||
switch(nfapi_mode)
|
switch(nfapi_mode) {
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
nfapi_mode_str = "MONOLITHIC";
|
nfapi_mode_str = "MONOLITHIC";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
nfapi_mode_str = "PNF";
|
nfapi_mode_str = "PNF";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
nfapi_mode_str = "VNF";
|
nfapi_mode_str = "VNF";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
nfapi_mode_str = "UE_STUB_PNF";
|
nfapi_mode_str = "UE_STUB_PNF";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
nfapi_mode_str = "UE_STUB_OFFNET";
|
nfapi_mode_str = "UE_STUB_OFFNET";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
|
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||||
|
|
||||||
|
|
||||||
// connect the TX/RX buffers
|
// connect the TX/RX buffers
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(nfapi_mode!=3) {
|
if(nfapi_mode!=3) {
|
||||||
if (setup_ue_buffers(PHY_vars_UE_g[0],&openair0_cfg[0])!=0) {
|
if (setup_ue_buffers(PHY_vars_UE_g[0],&openair0_cfg[0])!=0) {
|
||||||
@@ -1024,41 +962,35 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (input_fd) {
|
if (input_fd) {
|
||||||
printf("Reading in from file to antenna buffer %d\n",0);
|
printf("Reading in from file to antenna buffer %d\n",0);
|
||||||
|
|
||||||
if (fread(PHY_vars_UE_g[0][0]->common_vars.rxdata[0],
|
if (fread(PHY_vars_UE_g[0][0]->common_vars.rxdata[0],
|
||||||
sizeof(int32_t),
|
sizeof(int32_t),
|
||||||
frame_parms[0]->samples_per_tti*10,
|
frame_parms[0]->samples_per_tti*10,
|
||||||
input_fd) != frame_parms[0]->samples_per_tti*10)
|
input_fd) != frame_parms[0]->samples_per_tti*10)
|
||||||
printf("error reading from file\n");
|
printf("error reading from file\n");
|
||||||
}
|
}
|
||||||
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
|
|
||||||
|
|
||||||
|
//p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
|
||||||
|
|
||||||
if (simL1flag==1) {
|
if (simL1flag==1) {
|
||||||
init_ocm((double)snr_dB,0);
|
init_ocm((double)snr_dB,0);
|
||||||
PHY_vars_UE_g[0][0]->no_timing_correction = 1;
|
PHY_vars_UE_g[0][0]->no_timing_correction = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
int UE_id;
|
int UE_id;
|
||||||
|
|
||||||
printf("XFORMS\n");
|
printf("XFORMS\n");
|
||||||
|
|
||||||
if (get_softmodem_params()->do_forms==1) {
|
if (get_softmodem_params()->do_forms==1) {
|
||||||
fl_initialize (&argc, argv, NULL, 0, 0);
|
fl_initialize (&argc, argv, NULL, 0, 0);
|
||||||
|
|
||||||
form_stats = create_form_stats_form();
|
form_stats = create_form_stats_form();
|
||||||
fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats");
|
fl_show_form (form_stats->stats_form, FL_PLACE_HOTSPOT, FL_FULLBORDER, "stats");
|
||||||
UE_id = 0;
|
UE_id = 0;
|
||||||
form_ue[UE_id] = create_lte_phy_scope_ue();
|
form_ue[UE_id] = create_lte_phy_scope_ue();
|
||||||
sprintf (title, "LTE DL SCOPE UE");
|
sprintf (title, "LTE DL SCOPE UE");
|
||||||
fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
fl_show_form (form_ue[UE_id]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (openair_daq_vars.use_ia_receiver) {
|
if (openair_daq_vars.use_ia_receiver) {
|
||||||
fl_set_button(form_ue[UE_id]->button_0,1);
|
fl_set_button(form_ue[UE_id]->button_0,1);
|
||||||
@@ -1079,30 +1011,26 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
ret=config_check_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
ret=config_check_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
LOG_E(ENB_APP, "%i unknown options in command line (invalid section name)\n",ret);
|
LOG_E(ENB_APP, "%i unknown options in command line (invalid section name)\n",ret);
|
||||||
exit_fun("");
|
exit_fun("");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Sending sync to all threads (%p,%p,%p)\n",&sync_var,&sync_cond,&sync_mutex);
|
printf("Sending sync to all threads (%p,%p,%p)\n",&sync_var,&sync_cond,&sync_mutex);
|
||||||
|
|
||||||
|
|
||||||
pthread_mutex_lock(&sync_mutex);
|
pthread_mutex_lock(&sync_mutex);
|
||||||
sync_var=0;
|
sync_var=0;
|
||||||
pthread_cond_broadcast(&sync_cond);
|
pthread_cond_broadcast(&sync_cond);
|
||||||
pthread_mutex_unlock(&sync_mutex);
|
pthread_mutex_unlock(&sync_mutex);
|
||||||
|
|
||||||
printf("sync sent\n");
|
printf("sync sent\n");
|
||||||
/*
|
/*
|
||||||
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
printf("About to call end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||||
end_configmodule();
|
end_configmodule();
|
||||||
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
printf("Called end_configmodule() from %s() %s:%d\n", __FUNCTION__, __FILE__, __LINE__);
|
||||||
*/
|
*/
|
||||||
// wait for end of program
|
// wait for end of program
|
||||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||||
//getchar();
|
//getchar();
|
||||||
|
|
||||||
|
|
||||||
#if defined(ENABLE_ITTI)
|
#if defined(ENABLE_ITTI)
|
||||||
printf("Entering ITTI signals handler\n");
|
printf("Entering ITTI signals handler\n");
|
||||||
itti_wait_tasks_end();
|
itti_wait_tasks_end();
|
||||||
@@ -1113,10 +1041,9 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
while (oai_exit==0)
|
while (oai_exit==0)
|
||||||
rt_sleep_ns(100000000ULL);
|
rt_sleep_ns(100000000ULL);
|
||||||
|
|
||||||
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// stop threads
|
// stop threads
|
||||||
#ifdef XFORMS
|
#ifdef XFORMS
|
||||||
printf("waiting for XFORMS thread\n");
|
printf("waiting for XFORMS thread\n");
|
||||||
@@ -1130,9 +1057,7 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("stopping MODEM threads\n");
|
printf("stopping MODEM threads\n");
|
||||||
|
|
||||||
pthread_cond_destroy(&sync_cond);
|
pthread_cond_destroy(&sync_cond);
|
||||||
pthread_mutex_destroy(&sync_mutex);
|
pthread_mutex_destroy(&sync_mutex);
|
||||||
|
|
||||||
@@ -1146,8 +1071,6 @@ int main( int argc, char **argv )
|
|||||||
terminate_opt();
|
terminate_opt();
|
||||||
|
|
||||||
logClean();
|
logClean();
|
||||||
|
|
||||||
printf("Bye.\n");
|
printf("Bye.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user