Commit fb465455 authored by frtabu's avatar frtabu

Fix corrupted LOGs in L1L2simulator, introducing two new components NFAPI_VNF...

Fix corrupted LOGs in L1L2simulator, introducing two new components NFAPI_VNF and NFAPI_pnf. Integrate Fujitsu fix for up to 50 UEs. Apply astyle to all modified files in the branch
parent f3dc8d44
...@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) { ...@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) {
logparams_dump[i].numelt = 0; logparams_dump[i].numelt = 0;
} }
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX); config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX); config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX); config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
/* set the debug mask according to the debug parameters values */ /* set the debug mask according to the debug parameters values */
...@@ -385,7 +385,6 @@ int logInit (void) { ...@@ -385,7 +385,6 @@ int logInit (void) {
register_log_component("OCG","",OCG); register_log_component("OCG","",OCG);
register_log_component("PERF","",PERF); register_log_component("PERF","",PERF);
register_log_component("OIP","",OIP); register_log_component("OIP","",OIP);
register_log_component("CLI","",CLI);
register_log_component("MSC","log",MSC); register_log_component("MSC","log",MSC);
register_log_component("OCM","log",OCM); register_log_component("OCM","log",OCM);
register_log_component("HW","",HW); register_log_component("HW","",HW);
...@@ -408,6 +407,8 @@ int logInit (void) { ...@@ -408,6 +407,8 @@ int logInit (void) {
register_log_component("X2AP","",X2AP); register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER); register_log_component("LOADER","log",LOADER);
register_log_component("ASN","log",ASN); register_log_component("ASN","log",ASN);
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
register_log_component("NFAPI_VNF","log",NFAPI_VNF);
for (int i=0 ; log_level_names[i].name != NULL ; i++) for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
...@@ -438,7 +439,7 @@ char *log_getthreadname(char *threadname, int bufsize) { ...@@ -438,7 +439,7 @@ char *log_getthreadname(char *threadname, int bufsize) {
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) { static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
char threadname[PR_SET_NAME]; char threadname[PR_SET_NAME];
return snprintf(log_buffer, buffsize , "%s%s[%s]%c %s %s%s", return snprintf(log_buffer, buffsize, "%s%s[%s]%c %s %s%s",
log_level_highlight_end[level], log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]), ( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name, g_log->log_component[comp].name,
...@@ -452,11 +453,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le ...@@ -452,11 +453,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
char log_buffer[MAX_LOG_TOTAL]; char log_buffer[MAX_LOG_TOTAL];
va_list args; va_list args;
va_start(args, format); va_start(args, format);
log_header(log_buffer,MAX_LOG_TOTAL ,comp, level,format); log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args); g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
va_end(args); va_end(args);
} }
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ) {
char log_buffer[MAX_LOG_TOTAL];
log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
}
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) { void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) {
va_list args; va_list args;
char *wbuf; char *wbuf;
...@@ -474,7 +481,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char ...@@ -474,7 +481,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
if (wbuf != NULL) { if (wbuf != NULL) {
va_start(args, format); va_start(args, format);
int pos=log_header(wbuf,MAX_LOG_TOTAL ,component, OAILOG_INFO,""); int pos=log_header(wbuf,MAX_LOG_TOTAL,component, OAILOG_INFO,"");
int pos2=vsprintf(wbuf+pos,format, args); int pos2=vsprintf(wbuf+pos,format, args);
pos=pos+pos2; pos=pos+pos2;
va_end(args); va_end(args);
......
...@@ -198,7 +198,6 @@ typedef enum { ...@@ -198,7 +198,6 @@ typedef enum {
NAS, NAS,
PERF, PERF,
OIP, OIP,
CLI,
MSC, MSC,
OCM, OCM,
UDP_, UDP_,
...@@ -218,6 +217,8 @@ typedef enum { ...@@ -218,6 +217,8 @@ typedef enum {
X2AP, X2AP,
LOADER, LOADER,
ASN, ASN,
NFAPI_VNF,
NFAPI_PNF,
MAX_LOG_PREDEF_COMPONENTS, MAX_LOG_PREDEF_COMPONENTS,
} }
comp_name_t; comp_name_t;
...@@ -286,6 +287,7 @@ extern "C" { ...@@ -286,6 +287,7 @@ extern "C" {
int logInit (void); int logInit (void);
int isLogInitDone (void); int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ); void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
int set_log(int component, int level); int set_log(int component, int level);
void set_glog(int level); void set_glog(int level);
...@@ -365,9 +367,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -365,9 +367,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) # define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) # define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) # define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
# define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
/* bitmask dependant macros, to isolate debugging code */ /* bitmask dependant macros, to isolate debugging code */
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D) # define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
......
...@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE ...@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_NFAPI_VNF_INFO
DESC = NFAPI_VNF legacy logs - info level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_ERROR
DESC = NFAPI_VNF legacy logs - error level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_WARNING
DESC = NFAPI_VNF legacy logs - warning level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_DEBUG
DESC = NFAPI_VNF legacy logs - debug level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_VNF_TRACE
DESC = NFAPI_VNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_INFO
DESC = NFAPI_PNF legacy logs - info level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_ERROR
DESC = NFAPI_PNF legacy logs - error level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_WARNING
DESC = NFAPI_PNF legacy logs - warning level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_DEBUG
DESC = NFAPI_PNF legacy logs - debug level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NFAPI_PNF_TRACE
DESC = NFAPI_PNF legacy logs - trace level
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
# this is a bad hack but I won't fix (function util_print_hex_octets # this is a bad hack but I won't fix (function util_print_hex_octets
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c # in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
# does funky things with the LOG_x macros but we work on the C pre-processor # does funky things with the LOG_x macros but we work on the C pre-processor
...@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE ...@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE
GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
#needed?
ID = LEGACY_CLI_INFO
DESC = CLI legacy logs - info level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_ERROR
DESC = CLI legacy logs - error level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_WARNING
DESC = CLI legacy logs - warning level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_DEBUG
DESC = CLI legacy logs - debug level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_CLI_TRACE
DESC = CLI legacy logs - trace level
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
################# #################
#### UE LOGS #### #### UE LOGS ####
......
This diff is collapsed.
...@@ -606,7 +606,7 @@ void vnf_deallocate(void *ptr) { ...@@ -606,7 +606,7 @@ void vnf_deallocate(void *ptr) {
void vnf_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) { void vnf_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) {
va_list args; va_list args;
va_start(args, message); va_start(args, message);
nfapi_log("FILE>", "FUNC", 999, PHY, nfapitooai_level(nfapi_level), message, args); VLOG( NFAPI_VNF, nfapitooai_level(nfapi_level), message, args);
va_end(args); va_end(args);
} }
......
...@@ -147,6 +147,7 @@ int netlink_init_tun(void) { ...@@ -147,6 +147,7 @@ int netlink_init_tun(void) {
nas_msg_rx.msg_iov = &nas_iov_rx; nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1; nas_msg_rx.msg_iovlen = 1;
} /* for */ } /* for */
return 1; return 1;
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define EMU_PROTO_H_ #define EMU_PROTO_H_
void init_bypass (void); void init_bypass (void);
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char*, unsigned int*, unsigned int*),unsigned int (*rx_handlerP) (unsigned char,char*,unsigned int)); void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char *, unsigned int *, unsigned int *),unsigned int (*rx_handlerP) (unsigned char,char *,unsigned int));
int bypass_rx_data(unsigned int frame, unsigned int last_slot, int bypass_rx_data(unsigned int frame, unsigned int last_slot,
unsigned int next_slot, uint8_t is_master); unsigned int next_slot, uint8_t is_master);
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot, void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
...@@ -43,7 +43,7 @@ void bypass_tx_data (emu_transport_info_t Type, unsigned int frame, unsigned int ...@@ -43,7 +43,7 @@ void bypass_tx_data (emu_transport_info_t Type, unsigned int frame, unsigned int
void emulation_tx_rx(void); void emulation_tx_rx(void);
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int* Nbytes,unsigned int *Nb_flows); unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int *Nbytes,unsigned int *Nb_flows);
unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes); unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes);
unsigned int emul_rx_data(void); unsigned int emul_rx_data(void);
......
...@@ -80,8 +80,7 @@ int config_check_band_frequencies( int ind, ...@@ -80,8 +80,7 @@ int config_check_band_frequencies( int ind,
int16_t band, int16_t band,
uint32_t downlink_frequency, uint32_t downlink_frequency,
int32_t uplink_frequency_offset, int32_t uplink_frequency_offset,
uint32_t frame_type) uint32_t frame_type) {
{
int errors = 0; int errors = 0;
if (band > 0) { if (band > 0) {
...@@ -90,21 +89,18 @@ int config_check_band_frequencies( int ind, ...@@ -90,21 +89,18 @@ int config_check_band_frequencies( int ind,
for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) { for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) {
if (band == eutra_bands[band_index].band) { if (band == eutra_bands[band_index].band) {
uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset; uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset;
AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++, AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++,
"enb %d downlink frequency %u too low (%u) for band %d!", "enb %d downlink frequency %u too low (%u) for band %d!",
ind, downlink_frequency, eutra_bands[band_index].dl_min, band); ind, downlink_frequency, eutra_bands[band_index].dl_min, band);
AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++, AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++,
"enb %d downlink frequency %u too high (%u) for band %d!", "enb %d downlink frequency %u too high (%u) for band %d!",
ind, downlink_frequency, eutra_bands[band_index].dl_max, band); ind, downlink_frequency, eutra_bands[band_index].dl_max, band);
AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++, AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++,
"enb %d uplink frequency %u too low (%u) for band %d!", "enb %d uplink frequency %u too low (%u) for band %d!",
ind, uplink_frequency, eutra_bands[band_index].ul_min, band); ind, uplink_frequency, eutra_bands[band_index].ul_min, band);
AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++, AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++,
"enb %d uplink frequency %u too high (%u) for band %d!", "enb %d uplink frequency %u too high (%u) for band %d!",
ind, uplink_frequency, eutra_bands[band_index].ul_max, band); ind, uplink_frequency, eutra_bands[band_index].ul_max, band);
AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++, AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++,
"enb %d invalid frame type (%d/%d) for band %d!", "enb %d invalid frame type (%d/%d) for band %d!",
ind, eutra_bands[band_index].frame_type, frame_type, band); ind, eutra_bands[band_index].frame_type, frame_type, band);
...@@ -112,7 +108,6 @@ int config_check_band_frequencies( int ind, ...@@ -112,7 +108,6 @@ int config_check_band_frequencies( int ind,
} }
} }
return errors; return errors;
} }
...@@ -87,28 +87,21 @@ static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_ ...@@ -87,28 +87,21 @@ static void configure_phy(module_id_t enb_id, const Enb_properties_array_t* enb_
*/ */
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
static void configure_rrc(uint32_t enb_id) static void configure_rrc(uint32_t enb_id) {
{
MessageDef *msg_p = NULL; MessageDef *msg_p = NULL;
// int CC_id; // int CC_id;
msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ); msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
if (RC.rrc[enb_id]) { if (RC.rrc[enb_id]) {
RCconfig_RRC(msg_p,enb_id, RC.rrc[enb_id]); RCconfig_RRC(msg_p,enb_id, RC.rrc[enb_id]);
LOG_I(ENB_APP,"Sending configuration message to RRC task\n"); LOG_I(ENB_APP,"Sending configuration message to RRC task\n");
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);
} else AssertFatal(0,"RRC context for eNB %d not allocated\n",enb_id);
}
else AssertFatal(0,"RRC context for eNB %d not allocated\n",enb_id);
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, const Enb_properties_array_t *enb_properties) static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end) { //, const Enb_properties_array_t *enb_properties)
{
uint32_t enb_id; uint32_t enb_id;
MessageDef *msg_p; MessageDef *msg_p;
uint32_t register_enb_pending = 0; uint32_t register_enb_pending = 0;
...@@ -117,17 +110,13 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, ...@@ -117,17 +110,13 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
{ {
/* note: there is an implicit relationship between the data structure and the message name */ /* note: there is an implicit relationship between the data structure and the message name */
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ); msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
RCconfig_S1(msg_p, enb_id); RCconfig_S1(msg_p, enb_id);
if (enb_id == 0) RCconfig_gtpu(); if (enb_id == 0) RCconfig_gtpu();
LOG_I(ENB_APP,"default drx %d\n",((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx)); LOG_I(ENB_APP,"default drx %d\n",((S1AP_REGISTER_ENB_REQ(msg_p)).default_drx));
LOG_I(ENB_APP,"[eNB %d] eNB_app_register for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id)); LOG_I(ENB_APP,"[eNB %d] eNB_app_register for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
register_enb_pending++; register_enb_pending++;
} }
} }
...@@ -137,22 +126,16 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//, ...@@ -137,22 +126,16 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end) static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end) {
{
uint32_t enb_id; uint32_t enb_id;
MessageDef *msg_p; MessageDef *msg_p;
uint32_t register_enb_x2_pending = 0; uint32_t register_enb_x2_pending = 0;
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) { for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
{ {
msg_p = itti_alloc_new_message (TASK_ENB_APP, X2AP_REGISTER_ENB_REQ); msg_p = itti_alloc_new_message (TASK_ENB_APP, X2AP_REGISTER_ENB_REQ);
RCconfig_X2(msg_p, enb_id); RCconfig_X2(msg_p, enb_id);
itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
register_enb_x2_pending++; register_enb_x2_pending++;
} }
} }
...@@ -161,8 +144,7 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end) ...@@ -161,8 +144,7 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void *eNB_app_task(void *args_p) void *eNB_app_task(void *args_p) {
{
uint32_t enb_nb = RC.nb_inst; uint32_t enb_nb = RC.nb_inst;
uint32_t enb_id_start = 0; uint32_t enb_id_start = 0;
uint32_t enb_id_end = enb_id_start + enb_nb; uint32_t enb_id_end = enb_id_start + enb_nb;
...@@ -178,15 +160,10 @@ void *eNB_app_task(void *args_p) ...@@ -178,15 +160,10 @@ void *eNB_app_task(void *args_p)
int result; int result;
/* for no gcc warnings */ /* for no gcc warnings */
(void)instance; (void)instance;
itti_mark_task_ready (TASK_ENB_APP); itti_mark_task_ready (TASK_ENB_APP);
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__); LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
RCconfig_L1(); RCconfig_L1();
RCconfig_macrlc(); RCconfig_macrlc();
LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst); LOG_I(PHY, "%s() RC.nb_L1_inst:%d\n", __FUNCTION__, RC.nb_L1_inst);
if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n"); if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n");
...@@ -194,14 +171,12 @@ void *eNB_app_task(void *args_p) ...@@ -194,14 +171,12 @@ void *eNB_app_task(void *args_p)
AssertFatal (enb_nb <= RC.nb_inst, AssertFatal (enb_nb <= RC.nb_inst,
"Number of eNB is greater than eNB defined in configuration file (%d/%d)!", "Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
enb_nb, RC.nb_inst); enb_nb, RC.nb_inst);
LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst); LOG_I(ENB_APP,"Allocating eNB_RRC_INST for %d instances\n",RC.nb_inst);
RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *)); RC.rrc = (eNB_RRC_INST **)malloc(RC.nb_inst*sizeof(eNB_RRC_INST *));
LOG_I(PHY, "%s() RC.nb_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_inst, RC.rrc); LOG_I(PHY, "%s() RC.nb_inst:%d RC.rrc:%p\n", __FUNCTION__, RC.nb_inst, RC.rrc);
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) { for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
RC.rrc[enb_id] = (eNB_RRC_INST*)malloc(sizeof(eNB_RRC_INST)); RC.rrc[enb_id] = (eNB_RRC_INST *)malloc(sizeof(eNB_RRC_INST));
LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, enb_id, RC.rrc[enb_id], enb_id+1, enb_id_end); LOG_I(PHY, "%s() Creating RRC instance RC.rrc[%d]:%p (%d of %d)\n", __FUNCTION__, enb_id, RC.rrc[enb_id], enb_id+1, enb_id_end);
memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST)); memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST));
configure_rrc(enb_id); configure_rrc(enb_id);
...@@ -220,7 +195,6 @@ void *eNB_app_task(void *args_p) ...@@ -220,7 +195,6 @@ void *eNB_app_task(void *args_p)
do { do {
// Wait for a message // Wait for a message
itti_receive_msg (TASK_ENB_APP, &msg_p); itti_receive_msg (TASK_ENB_APP, &msg_p);
instance = ITTI_MSG_INSTANCE (msg_p); instance = ITTI_MSG_INSTANCE (msg_p);
switch (ITTI_MSG_ID(msg_p)) { switch (ITTI_MSG_ID(msg_p)) {
...@@ -241,7 +215,6 @@ void *eNB_app_task(void *args_p) ...@@ -241,7 +215,6 @@ void *eNB_app_task(void *args_p)
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p), LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
DevAssert(register_enb_pending > 0); DevAssert(register_enb_pending > 0);
register_enb_pending--; register_enb_pending--;
...@@ -255,10 +228,8 @@ void *eNB_app_task(void *args_p) ...@@ -255,10 +228,8 @@ void *eNB_app_task(void *args_p)
if (registered_enb == enb_nb) { if (registered_enb == enb_nb) {
/* If all eNB are registered, start L2L1 task */ /* If all eNB are registered, start L2L1 task */
MessageDef *msg_init_p; MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE); msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p); itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else { } else {
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n", LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY); enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
...@@ -267,7 +238,6 @@ void *eNB_app_task(void *args_p) ...@@ -267,7 +238,6 @@ void *eNB_app_task(void *args_p)
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &enb_register_retry_timer_id) < 0) { NULL, &enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
sleep(ENB_REGISTER_RETRY_DELAY); sleep(ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */ /* Restart the registration process */
registered_enb = 0; registered_enb = 0;
...@@ -283,9 +253,9 @@ void *eNB_app_task(void *args_p) ...@@ -283,9 +253,9 @@ void *eNB_app_task(void *args_p)
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p), LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme); S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
/* TODO handle recovering of registration */ /* TODO handle recovering of registration */
} }
break; break;
case TIMER_HAS_EXPIRED: case TIMER_HAS_EXPIRED:
...@@ -304,19 +274,18 @@ void *eNB_app_task(void *args_p) ...@@ -304,19 +274,18 @@ void *eNB_app_task(void *args_p)
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end); x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
} }
} /* if (EPC_MODE_ENABLED) */ } /* if (EPC_MODE_ENABLED) */
break; break;
case X2AP_DEREGISTERED_ENB_IND: case X2AP_DEREGISTERED_ENB_IND:
LOG_W(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p), LOG_W(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p),
X2AP_DEREGISTERED_ENB_IND(msg_p).nb_x2); X2AP_DEREGISTERED_ENB_IND(msg_p).nb_x2);
/* TODO handle recovering of registration */ /* TODO handle recovering of registration */
break; break;
case X2AP_REGISTER_ENB_CNF: case X2AP_REGISTER_ENB_CNF:
LOG_I(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p), LOG_I(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p),
X2AP_REGISTER_ENB_CNF(msg_p).nb_x2); X2AP_REGISTER_ENB_CNF(msg_p).nb_x2);
DevAssert(x2_register_enb_pending > 0); DevAssert(x2_register_enb_pending > 0);
x2_register_enb_pending--; x2_register_enb_pending--;
...@@ -329,19 +298,17 @@ void *eNB_app_task(void *args_p) ...@@ -329,19 +298,17 @@ void *eNB_app_task(void *args_p)
if (x2_register_enb_pending == 0) { if (x2_register_enb_pending == 0) {
if (x2_registered_enb == enb_nb) { if (x2_registered_enb == enb_nb) {
/* If all eNB are registered, start RRC HO task */ /* If all eNB are registered, start RRC HO task */
} else {
}else {
uint32_t x2_not_associated = enb_nb - x2_registered_enb; uint32_t x2_not_associated = enb_nb - x2_registered_enb;
LOG_W(ENB_APP, " %d eNB %s not associated with the target\n", LOG_W(ENB_APP, " %d eNB %s not associated with the target\n",
x2_not_associated, x2_not_associated > 1 ? "are" : "is"); x2_not_associated, x2_not_associated > 1 ? "are" : "is");
// timer to retry // timer to retry
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */ /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (X2AP_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, if (timer_setup (X2AP_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP,
INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL, INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL,
&x2_enb_register_retry_timer_id) < 0) { &x2_enb_register_retry_timer_id) < 0) {
LOG_E(ENB_APP, " Can not start eNB X2AP register: retry timer, use \"sleep\" instead!\n"); LOG_E(ENB_APP, " Can not start eNB X2AP register: retry timer, use \"sleep\" instead!\n");
sleep(X2AP_ENB_REGISTER_RETRY_DELAY); sleep(X2AP_ENB_REGISTER_RETRY_DELAY);
/* Restart the registration process */ /* Restart the registration process */
x2_registered_enb = 0; x2_registered_enb = 0;
...@@ -364,12 +331,10 @@ void *eNB_app_task(void *args_p) ...@@ -364,12 +331,10 @@ void *eNB_app_task(void *args_p)
return NULL; return NULL;
} }
void handle_reconfiguration(module_id_t mod_id) void handle_reconfiguration(module_id_t mod_id) {
{
struct timespec start, end; struct timespec start, end;
clock_gettime(CLOCK_MONOTONIC, &start); clock_gettime(CLOCK_MONOTONIC, &start);
flexran_agent_info_t *flexran = RC.flexran[mod_id]; flexran_agent_info_t *flexran = RC.flexran[mod_id];
LOG_I(ENB_APP, "lte-softmodem soft-restart requested\n"); LOG_I(ENB_APP, "lte-softmodem soft-restart requested\n");
if (ENB_WAIT == flexran->node_ctrl_state) { if (ENB_WAIT == flexran->node_ctrl_state) {
...@@ -392,8 +357,10 @@ void handle_reconfiguration(module_id_t mod_id) ...@@ -392,8 +357,10 @@ void handle_reconfiguration(module_id_t mod_id)
LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id); LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id);
pthread_mutex_lock(&flexran->mutex_node_ctrl); pthread_mutex_lock(&flexran->mutex_node_ctrl);
flexran->node_ctrl_state = ENB_WAIT; flexran->node_ctrl_state = ENB_WAIT;
while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state) while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl); pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
pthread_mutex_unlock(&flexran->mutex_node_ctrl); pthread_mutex_unlock(&flexran->mutex_node_ctrl);
} }
...@@ -405,11 +372,13 @@ void handle_reconfiguration(module_id_t mod_id) ...@@ -405,11 +372,13 @@ void handle_reconfiguration(module_id_t mod_id)
clock_gettime(CLOCK_MONOTONIC, &end); clock_gettime(CLOCK_MONOTONIC, &end);
end.tv_sec -= start.tv_sec; end.tv_sec -= start.tv_sec;
if (end.tv_nsec >= start.tv_nsec) { if (end.tv_nsec >= start.tv_nsec) {
end.tv_nsec -= start.tv_nsec; end.tv_nsec -= start.tv_nsec;
} else { } else {
end.tv_sec -= 1; end.tv_sec -= 1;
end.tv_nsec = end.tv_nsec - start.tv_nsec + 1000000000; end.tv_nsec = end.tv_nsec - start.tv_nsec + 1000000000;
} }
LOG_I(ENB_APP, "lte-softmodem restart succeeded in %ld.%ld s\n", end.tv_sec, end.tv_nsec / 1000000); LOG_I(ENB_APP, "lte-softmodem restart succeeded in %ld.%ld s\n", end.tv_sec, end.tv_nsec / 1000000);
} }
This diff is collapsed.
...@@ -45,14 +45,12 @@ ...@@ -45,14 +45,12 @@
#include "common/ran_context.h" #include "common/ran_context.h"
extern FILL_UL_INFO_MUTEX_t fill_ul_mutex; extern FILL_UL_INFO_MUTEX_t fill_ul_mutex;
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
extern void openair_rrc_top_init_ue( int eMBMS_active, char* uecap_xer, uint8_t cba_group_active, uint8_t HO_active); extern void openair_rrc_top_init_ue( int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) //init as MR void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) { //init as MR
{
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n", LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
module_idP, frameP, eNB_index); module_idP, frameP, eNB_index);
if (first_sync == 1 && !(EPC_MODE_ENABLED)) { if (first_sync == 1 && !(EPC_MODE_ENABLED)) {
//layer2_init_UE(module_idP); //layer2_init_UE(module_idP);
openair_rrc_ue_init(module_idP, eNB_index); openair_rrc_ue_init(module_idP, eNB_index);
...@@ -63,34 +61,26 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char e ...@@ -63,34 +61,26 @@ void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char e
void void
mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
uint16_t eNB_index) uint16_t eNB_index) {
{
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index); // Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
} }
int int
mac_top_init_ue(int eMBMS_active, char *uecap_xer, mac_top_init_ue(int eMBMS_active, char *uecap_xer,
uint8_t cba_group_active, uint8_t HO_active) uint8_t cba_group_active, uint8_t HO_active) {
{
int i; int i;
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST); LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
if (NB_UE_INST > 0) { if (NB_UE_INST > 0) {
UE_mac_inst = UE_mac_inst =
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST)); (UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
AssertFatal(UE_mac_inst != NULL, AssertFatal(UE_mac_inst != NULL,
"[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n", "[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n",
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST,
sizeof(UE_MAC_INST)); sizeof(UE_MAC_INST));
LOG_D(MAC, "[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n", LOG_D(MAC, "[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n",
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, UE_mac_inst); NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, UE_mac_inst);
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST)); bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
for (i = 0; i < NB_UE_INST; i++) { for (i = 0; i < NB_UE_INST; i++) {
...@@ -101,7 +91,7 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer, ...@@ -101,7 +91,7 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer,
} }
// mutex below are used for multiple UE's L2 FAPI simulation. // mutex below are used for multiple UE's L2 FAPI simulation.
if (nfapi_mode == 3){ if (nfapi_mode == 3) {
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL); pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL); pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL); pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
...@@ -113,18 +103,11 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer, ...@@ -113,18 +103,11 @@ mac_top_init_ue(int eMBMS_active, char *uecap_xer,
LOG_I(MAC, "[MAIN] calling RRC\n"); LOG_I(MAC, "[MAIN] calling RRC\n");
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
HO_active); HO_active);
LOG_I(MAC, "[MAIN][INIT] Init function finished\n"); LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
return (0); return (0);
} }
int rlcmac_init_global_param_ue(void) int rlcmac_init_global_param_ue(void) {
{
LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n"); LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n");
if (rlc_module_init() != 0) { if (rlc_module_init() != 0) {
...@@ -132,20 +115,16 @@ int rlcmac_init_global_param_ue(void) ...@@ -132,20 +115,16 @@ int rlcmac_init_global_param_ue(void)
} }
pdcp_layer_init(); pdcp_layer_init();
LOG_I(MAC, "[MAIN] Init Global Param Done\n"); LOG_I(MAC, "[MAIN] Init Global Param Done\n");
return 0; return 0;
} }
int int
l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,
uint8_t HO_active) uint8_t HO_active) {
{
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n"); LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
// NB_NODE=2; // NB_NODE=2;
// NB_INST=2; // NB_INST=2;
rlcmac_init_global_param_ue(); rlcmac_init_global_param_ue();
LOG_I(MAC, "[MAIN] init UE MAC functions \n"); LOG_I(MAC, "[MAIN] init UE MAC functions \n");
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active); mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
......
...@@ -179,13 +179,14 @@ boolean_t pdcp_data_req( ...@@ -179,13 +179,14 @@ boolean_t pdcp_data_req(
if (pdcp_pdu_p != NULL) { if (pdcp_pdu_p != NULL) {
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP); memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) { if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
rlc_util_print_hex_octets(PDCP, rlc_util_print_hex_octets(PDCP,
(unsigned char *)&pdcp_pdu_p->data[0], (unsigned char *)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP); sdu_buffer_sizeP);
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP); LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
} }
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p
,NULL, NULL ,NULL, NULL
); );
...@@ -442,7 +443,6 @@ pdcp_data_ind( ...@@ -442,7 +443,6 @@ pdcp_data_ind(
uint8_t oo_flag=0; uint8_t oo_flag=0;
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
uint8_t *gtpu_buffer_p = NULL; uint8_t *gtpu_buffer_p = NULL;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN);
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP, LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP,
"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP); "[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
...@@ -473,7 +473,7 @@ pdcp_data_ind( ...@@ -473,7 +473,7 @@ pdcp_data_ind(
LOG_D(PDCP, "Data indication notification for PDCP entity from UE %x to eNB %u " LOG_D(PDCP, "Data indication notification for PDCP entity from UE %x to eNB %u "
"and radio bearer ID %d rlc sdu size %d ctxt_pP->enb_flag %d\n", "and radio bearer ID %d rlc sdu size %d ctxt_pP->enb_flag %d\n",
ctxt_pP->rnti, ctxt_pP->rnti,
ctxt_pP->module_id , ctxt_pP->module_id,
rb_idP, rb_idP,
sdu_buffer_sizeP, sdu_buffer_sizeP,
ctxt_pP->enb_flag); ctxt_pP->enb_flag);
...@@ -723,7 +723,6 @@ pdcp_data_ind( ...@@ -723,7 +723,6 @@ pdcp_data_ind(
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
packet_forwarded = TRUE; packet_forwarded = TRUE;
} }
} else { } else {
packet_forwarded = FALSE; packet_forwarded = FALSE;
} }
...@@ -762,6 +761,7 @@ pdcp_data_ind( ...@@ -762,6 +761,7 @@ pdcp_data_ind(
// set ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst for IP layer here // set ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst for IP layer here
if (ctxt_pP->enb_flag == ENB_FLAG_NO) { if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id; ((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
/* for the UE compiled in S1 mode, we need 1 here /* for the UE compiled in S1 mode, we need 1 here
* for the UE compiled in noS1 mode, we need 0 * for the UE compiled in noS1 mode, we need 0
...@@ -769,16 +769,18 @@ pdcp_data_ind( ...@@ -769,16 +769,18 @@ pdcp_data_ind(
*/ */
if (nfapi_mode == 3) { if (nfapi_mode == 3) {
#ifdef UESIM_EXPANSION #ifdef UESIM_EXPANSION
if (UE_NAS_USE_TUN) { if (UE_NAS_USE_TUN) {
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id; ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
} else { } else {
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 0; ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 0;
} }
#else #else
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id; ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
#endif #endif
} else { } else {
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1; ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 1;
} }
} }
} else { } else {
...@@ -822,12 +824,13 @@ pdcp_data_ind( ...@@ -822,12 +824,13 @@ pdcp_data_ind(
Pdcp_stats_rx_bytes_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset); Pdcp_stats_rx_bytes_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
Pdcp_stats_rx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=sequence_number; Pdcp_stats_rx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=sequence_number;
if (oo_flag == 1 ){ if (oo_flag == 1 ) {
Pdcp_stats_rx_outoforder[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++; Pdcp_stats_rx_outoforder[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
} else { } else {
LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" PDCP_DATA_IND SDU DROPPED, OUT OF ORDER \n", LOG_E(PDCP, PROTOCOL_PDCP_CTXT_FMT" PDCP_DATA_IND SDU DROPPED, OUT OF ORDER \n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p)); PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
} }
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]); Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]); Pdcp_stats_rx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn; Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
...@@ -1129,7 +1132,6 @@ rrc_pdcp_config_asn1_req ( ...@@ -1129,7 +1132,6 @@ rrc_pdcp_config_asn1_req (
int i,j; int i,j;
LTE_MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_p = NULL; LTE_MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_p = NULL;
LTE_MBMS_SessionInfo_r9_t *MBMS_SessionInfo_p = NULL; LTE_MBMS_SessionInfo_r9_t *MBMS_SessionInfo_p = NULL;
LOG_T(PDCP, PROTOCOL_CTXT_FMT" %s() SRB2ADD %p DRB2ADD %p DRB2RELEASE %p\n", LOG_T(PDCP, PROTOCOL_CTXT_FMT" %s() SRB2ADD %p DRB2ADD %p DRB2RELEASE %p\n",
PROTOCOL_CTXT_ARGS(ctxt_pP), PROTOCOL_CTXT_ARGS(ctxt_pP),
__FUNCTION__, __FUNCTION__,
...@@ -1419,7 +1421,6 @@ rrc_pdcp_config_asn1_req ( ...@@ -1419,7 +1421,6 @@ rrc_pdcp_config_asn1_req (
} }
} }
if (pmch_InfoList_r9_pP != NULL) { if (pmch_InfoList_r9_pP != NULL) {
for (i=0; i<pmch_InfoList_r9_pP->list.count; i++) { for (i=0; i<pmch_InfoList_r9_pP->list.count; i++) {
mbms_SessionInfoList_r9_p = &(pmch_InfoList_r9_pP->list.array[i]->mbms_SessionInfoList_r9); mbms_SessionInfoList_r9_p = &(pmch_InfoList_r9_pP->list.array[i]->mbms_SessionInfoList_r9);
...@@ -1893,6 +1894,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) { ...@@ -1893,6 +1894,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
netlink_init(); netlink_init();
} }
} }
return pdcp_params.optmask ; return pdcp_params.optmask ;
} }
...@@ -1937,7 +1939,6 @@ void pdcp_layer_init(void) ...@@ -1937,7 +1939,6 @@ void pdcp_layer_init(void)
int i,j; int i,j;
mbms_session_id_t session_id; mbms_session_id_t session_id;
mbms_service_id_t service_id; mbms_service_id_t service_id;
/* /*
* Initialize SDU list * Initialize SDU list
*/ */
...@@ -1946,7 +1947,6 @@ void pdcp_layer_init(void) ...@@ -1946,7 +1947,6 @@ void pdcp_layer_init(void)
AssertFatal(pdcp_coll_p != NULL, "UNRECOVERABLE error, PDCP hashtable_create failed"); AssertFatal(pdcp_coll_p != NULL, "UNRECOVERABLE error, PDCP hashtable_create failed");
for (instance = 0; instance < MAX_MOBILES_PER_ENB; instance++) { for (instance = 0; instance < MAX_MOBILES_PER_ENB; instance++) {
for (service_id = 0; service_id < LTE_maxServiceCount; service_id++) { for (service_id = 0; service_id < LTE_maxServiceCount; service_id++) {
for (session_id = 0; session_id < LTE_maxSessionPerPMCH; session_id++) { for (session_id = 0; session_id < LTE_maxSessionPerPMCH; session_id++) {
memset(&pdcp_mbms_array_ue[instance][service_id][session_id], 0, sizeof(pdcp_mbms_t)); memset(&pdcp_mbms_array_ue[instance][service_id][session_id], 0, sizeof(pdcp_mbms_t));
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
# define __PDCP_H__ # define __PDCP_H__
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef NON_ACCESS_STRATUM #ifndef NON_ACCESS_STRATUM
#include "UTIL/MEM/mem_block.h" #include "UTIL/MEM/mem_block.h"
#include "UTIL/LISTS/list.h" #include "UTIL/LISTS/list.h"
#endif //NON_ACCESS_STRATUM #endif //NON_ACCESS_STRATUM
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "RRC/LTE/rrc_defs.h" #include "RRC/LTE/rrc_defs.h"
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
#include "LTE_SRB-ToAddMod.h" #include "LTE_SRB-ToAddMod.h"
#include "LTE_SRB-ToAddModList.h" #include "LTE_SRB-ToAddModList.h"
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
#include "LTE_MBMS-SessionInfoList-r9.h" #include "LTE_MBMS-SessionInfoList-r9.h"
#include "LTE_PMCH-InfoList-r9.h" #include "LTE_PMCH-InfoList-r9.h"
#endif #endif
#define PDCP_USE_NETLINK_BIT (1<< 11) #define PDCP_USE_NETLINK_BIT (1<< 11)
...@@ -108,7 +108,7 @@ uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; ...@@ -108,7 +108,7 @@ uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX];
uint32_t Pdcp_stats_rx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; uint32_t Pdcp_stats_rx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX];
uint32_t Pdcp_stats_rx_outoforder[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; uint32_t Pdcp_stats_rx_outoforder[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX];
void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctxt_pP); void pdcp_update_perioidical_stats(const protocol_ctxt_t *const ctxt_pP);
/*Packet Probing for agent PDCP*/ /*Packet Probing for agent PDCP*/
...@@ -237,19 +237,19 @@ typedef struct pdcp_mbms_s { ...@@ -237,19 +237,19 @@ typedef struct pdcp_mbms_s {
* @ingroup _pdcp * @ingroup _pdcp
*/ */
boolean_t pdcp_data_req( boolean_t pdcp_data_req(
protocol_ctxt_t* ctxt_pP, protocol_ctxt_t *ctxt_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const rb_id_t rb_id, const rb_id_t rb_id,
const mui_t muiP, const mui_t muiP,
const confirm_t confirmP, \ const confirm_t confirmP, \
const sdu_size_t sdu_buffer_size, const sdu_size_t sdu_buffer_size,
unsigned char* const sdu_buffer, unsigned char *const sdu_buffer,
const pdcp_transmission_mode_t mode const pdcp_transmission_mode_t mode
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,const uint32_t * const sourceL2Id ,const uint32_t *const sourceL2Id
,const uint32_t * const destinationL2Id ,const uint32_t *const destinationL2Id
#endif #endif
); );
/*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t) /*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t)
* \brief This functions handles data transfer indications coming from RLC * \brief This functions handles data transfer indications coming from RLC
...@@ -265,12 +265,12 @@ boolean_t pdcp_data_req( ...@@ -265,12 +265,12 @@ boolean_t pdcp_data_req(
* @ingroup _pdcp * @ingroup _pdcp
*/ */
boolean_t pdcp_data_ind( boolean_t pdcp_data_ind(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP, const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id, const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size, const sdu_size_t sdu_buffer_size,
mem_block_t* const sdu_buffer); mem_block_t *const sdu_buffer);
/*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t) /*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t)
* \brief This functions initializes relevant PDCP entity * \brief This functions initializes relevant PDCP entity
...@@ -283,7 +283,7 @@ boolean_t pdcp_data_ind( ...@@ -283,7 +283,7 @@ boolean_t pdcp_data_ind(
* @ingroup _pdcp * @ingroup _pdcp
*/ */
void rrc_pdcp_config_req ( void rrc_pdcp_config_req (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const uint32_t actionP, const uint32_t actionP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
...@@ -304,7 +304,7 @@ void rrc_pdcp_config_req ( ...@@ -304,7 +304,7 @@ void rrc_pdcp_config_req (
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
boolean_t rrc_pdcp_config_asn1_req ( boolean_t rrc_pdcp_config_asn1_req (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list, LTE_SRB_ToAddModList_t *const srb2add_list,
LTE_DRB_ToAddModList_t *const drb2add_list, LTE_DRB_ToAddModList_t *const drb2add_list,
LTE_DRB_ToReleaseList_t *const drb2release_list, LTE_DRB_ToReleaseList_t *const drb2release_list,
...@@ -316,7 +316,7 @@ boolean_t rrc_pdcp_config_asn1_req ( ...@@ -316,7 +316,7 @@ boolean_t rrc_pdcp_config_asn1_req (
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
#endif #endif
,rb_id_t *const defaultDRB ,rb_id_t *const defaultDRB
); );
/*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode) /*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
* \brief Function for RRC to configure a Radio Bearer. * \brief Function for RRC to configure a Radio Bearer.
...@@ -339,7 +339,7 @@ boolean_t rrc_pdcp_config_asn1_req ( ...@@ -339,7 +339,7 @@ boolean_t rrc_pdcp_config_asn1_req (
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
boolean_t pdcp_config_req_asn1 ( boolean_t pdcp_config_req_asn1 (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
pdcp_t *const pdcp_pP, pdcp_t *const pdcp_pP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const rlc_mode_t rlc_mode, const rlc_mode_t rlc_mode,
...@@ -360,7 +360,7 @@ boolean_t pdcp_config_req_asn1 ( ...@@ -360,7 +360,7 @@ boolean_t pdcp_config_req_asn1 (
* \param[in] ctxt_pP Running context. * \param[in] ctxt_pP Running context.
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP); void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP);
/*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP) /*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function for RRC to remove UE from PDCP module hashtable * \brief Function for RRC to remove UE from PDCP module hashtable
...@@ -368,7 +368,7 @@ void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP); ...@@ -368,7 +368,7 @@ void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP);
* \return A status about the processing, OK or error code. * \return A status about the processing, OK or error code.
*/ */
boolean_t pdcp_remove_UE( boolean_t pdcp_remove_UE(
const protocol_ctxt_t* const ctxt_pP); const protocol_ctxt_t *const ctxt_pP);
/*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t) /*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t)
* \brief This functions is unused * \brief This functions is unused
...@@ -388,7 +388,7 @@ boolean_t pdcp_remove_UE( ...@@ -388,7 +388,7 @@ boolean_t pdcp_remove_UE(
* @ingroup _pdcp * @ingroup _pdcp
*/ */
void pdcp_run ( void pdcp_run (
const protocol_ctxt_t* const ctxt_pP); const protocol_ctxt_t *const ctxt_pP);
uint64_t pdcp_module_init (uint64_t pdcp_optmask); uint64_t pdcp_module_init (uint64_t pdcp_optmask);
void pdcp_module_cleanup (void); void pdcp_module_cleanup (void);
void pdcp_layer_init (void); void pdcp_layer_init (void);
...@@ -396,10 +396,10 @@ void pdcp_layer_cleanup (void); ...@@ -396,10 +396,10 @@ void pdcp_layer_cleanup (void);
#define PDCP2NW_DRIVER_FIFO 21 #define PDCP2NW_DRIVER_FIFO 21
#define NW_DRIVER2PDCP_FIFO 22 #define NW_DRIVER2PDCP_FIFO 22
int pdcp_fifo_flush_sdus ( const protocol_ctxt_t* const ctxt_pP); int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t* const ctxt_pP); int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t* const ctxt_pP); int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t *const ctxt_pP);
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t* const ctxt_pP); void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -506,8 +506,8 @@ rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB]; ...@@ -506,8 +506,8 @@ rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];
rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode
unsigned int pdcp_eNB_UE_instance_to_rnti_index; unsigned int pdcp_eNB_UE_instance_to_rnti_index;
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
#endif #endif
sdu_size_t pdcp_output_sdu_bytes_to_write; sdu_size_t pdcp_output_sdu_bytes_to_write;
sdu_size_t pdcp_output_header_bytes_to_write; sdu_size_t pdcp_output_header_bytes_to_write;
......
...@@ -259,14 +259,12 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -259,14 +259,12 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
} }
} else if (pc5s_header->traffic_type == TRAFFIC_PC5S_SIGNALLING) { //if containing PC5-S message -> send to other UE } else if (pc5s_header->traffic_type == TRAFFIC_PC5S_SIGNALLING) { //if containing PC5-S message -> send to other UE
LOG_D(PDCP,"Received PC5-S message ... send to the other UE\n"); LOG_D(PDCP,"Received PC5-S message ... send to the other UE\n");
LOG_D(PDCP,"Received PC5-S message, traffic_type: %d)\n", pc5s_header->traffic_type); LOG_D(PDCP,"Received PC5-S message, traffic_type: %d)\n", pc5s_header->traffic_type);
LOG_D(PDCP,"Received PC5-S message, rbid: %d)\n", pc5s_header->rb_id); LOG_D(PDCP,"Received PC5-S message, rbid: %d)\n", pc5s_header->rb_id);
LOG_D(PDCP,"Received PC5-S message, data_size: %d)\n", pc5s_header->data_size); LOG_D(PDCP,"Received PC5-S message, data_size: %d)\n", pc5s_header->data_size);
LOG_D(PDCP,"Received PC5-S message, inst: %d)\n", pc5s_header->inst); LOG_D(PDCP,"Received PC5-S message, inst: %d)\n", pc5s_header->inst);
LOG_D(PDCP,"Received PC5-S message,sourceL2Id: 0x%08x\n)\n", pc5s_header->sourceL2Id); LOG_D(PDCP,"Received PC5-S message,sourceL2Id: 0x%08x\n)\n", pc5s_header->sourceL2Id);
LOG_D(PDCP,"Received PC5-S message,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id); LOG_D(PDCP,"Received PC5-S message,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id);
#ifdef OAI_EMU #ifdef OAI_EMU
// overwrite function input parameters, because only one netlink socket for all instances // overwrite function input parameters, because only one netlink socket for all instances
...@@ -430,7 +428,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -430,7 +428,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
} }
} }
while ((len > 0) && (rlc_data_req_flag !=0)) { while ((len > 0) && (rlc_data_req_flag !=0)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 );
...@@ -495,7 +492,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -495,7 +492,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id" //#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
ctxt.frame = ctxt_cpy.frame; ctxt.frame = ctxt_cpy.frame;
ctxt.enb_flag = ctxt_cpy.enb_flag; ctxt.enb_flag = ctxt_cpy.enb_flag;
LOG_D(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d, source L2Id = 0x%08x, destination L2Id = 0x%08x \n", pdcp_read_header_g.rb_id, pdcp_read_header_g.sourceL2Id, LOG_D(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d, source L2Id = 0x%08x, destination L2Id = 0x%08x \n", pdcp_read_header_g.rb_id, pdcp_read_header_g.sourceL2Id,
pdcp_read_header_g.destinationL2Id); pdcp_read_header_g.destinationL2Id);
...@@ -621,7 +617,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -621,7 +617,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rab_id = pdcp_p->rb_id; rab_id = pdcp_p->rb_id;
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n", LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
ctxt.frame, ctxt.frame,
pdcp_read_header_g.inst, pdcp_read_header_g.inst,
...@@ -636,7 +631,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) { ...@@ -636,7 +631,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
ctxt.module_id, ctxt.module_id,
ctxt.rnti, ctxt.rnti,
rab_id); rab_id);
MSC_LOG_RX_MESSAGE( MSC_LOG_RX_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
/* Bugfix for version of GCC = 4.4.3 (Ubuntu 10.04) */ /* Bugfix for version of GCC = 4.4.3 (Ubuntu 10.04) */
#if GCC_VERSION <= 40403 #if GCC_VERSION <= 40403
# include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#include <linux/netlink.h> #include <linux/netlink.h>
...@@ -93,13 +93,11 @@ pdcp_netlink_init( ...@@ -93,13 +93,11 @@ pdcp_netlink_init(
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int i; int i;
int nb_inst_enb; int nb_inst_enb;
int nb_inst_ue; int nb_inst_ue;
pthread_attr_t attr; pthread_attr_t attr;
struct sched_param sched_param; struct sched_param sched_param;
reset_meas(&ip_pdcp_stats_tmp); reset_meas(&ip_pdcp_stats_tmp);
nb_inst_enb = 1; nb_inst_enb = 1;
nb_inst_ue = 1; nb_inst_ue = 1;
...@@ -108,8 +106,8 @@ pdcp_netlink_init( ...@@ -108,8 +106,8 @@ pdcp_netlink_init(
nb_inst_enb = 0; nb_inst_enb = 0;
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n"); LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
} else { } else {
/* #warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues" */ /* #warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues" */
pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state*)); pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state *));
pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t)); pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t));
LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb); LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
...@@ -123,11 +121,9 @@ pdcp_netlink_init( ...@@ -123,11 +121,9 @@ pdcp_netlink_init(
} }
} }
if (nb_inst_ue > 0) { if (nb_inst_ue > 0) {
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*)); pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state *));
pdcp_netlink_nb_element_ue = malloc(nb_inst_ue * sizeof(uint32_t)); pdcp_netlink_nb_element_ue = malloc(nb_inst_ue * sizeof(uint32_t));
LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue); LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue);
for (i = 0; i < nb_inst_ue; i++) { for (i = 0; i < nb_inst_ue; i++) {
...@@ -148,7 +144,6 @@ pdcp_netlink_init( ...@@ -148,7 +144,6 @@ pdcp_netlink_init(
} }
sched_param.sched_priority = 10; sched_param.sched_priority = 10;
pthread_attr_setschedpolicy(&attr, SCHED_RR); pthread_attr_setschedpolicy(&attr, SCHED_RR);
pthread_attr_setschedparam(&attr, &sched_param); pthread_attr_setschedparam(&attr, &sched_param);
...@@ -171,21 +166,21 @@ pdcp_netlink_init( ...@@ -171,21 +166,21 @@ pdcp_netlink_init(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int int
pdcp_netlink_dequeue_element( pdcp_netlink_dequeue_element(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
struct pdcp_netlink_element_s** data_ppP struct pdcp_netlink_element_s **data_ppP
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int ret = 0; int ret = 0;
if (ctxt_pP->enb_flag) { if (ctxt_pP->enb_flag) {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->module_id], (void**)data_ppP); ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->module_id], (void **)data_ppP);
if (ret != 0) { if (ret != 0) {
LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->module_id); LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->module_id);
} }
} else { } else {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->module_id], (void**)data_ppP); ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->module_id], (void **)data_ppP);
if (ret != 0) { if (ret != 0) {
LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ctxt_pP->module_id); LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ctxt_pP->module_id);
...@@ -209,8 +204,8 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -209,8 +204,8 @@ void *pdcp_netlink_thread_fct(void *arg)
memset(nl_rx_buf, 0, NL_MAX_PAYLOAD); memset(nl_rx_buf, 0, NL_MAX_PAYLOAD);
LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd); LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd);
MSC_START_USE(); MSC_START_USE();
while (1) {
while (1) {
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0); len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
if (len == 0) { if (len == 0) {
...@@ -267,7 +262,6 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -267,7 +262,6 @@ void *pdcp_netlink_thread_fct(void *arg)
} }
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id); LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id);
/* Enqueue the element in the right queue */ /* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[module_id], new_data_p); lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[module_id], new_data_p);
stop_meas(&ip_pdcp_stats_tmp); stop_meas(&ip_pdcp_stats_tmp);
...@@ -280,7 +274,6 @@ void *pdcp_netlink_thread_fct(void *arg) ...@@ -280,7 +274,6 @@ void *pdcp_netlink_thread_fct(void *arg)
} }
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id); LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id);
/* Enqueue the element in the right queue */ /* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[module_id], new_data_p); lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[module_id], new_data_p);
stop_meas(&ip_pdcp_stats_tmp); stop_meas(&ip_pdcp_stats_tmp);
......
...@@ -375,7 +375,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, ...@@ -375,7 +375,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
//DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0); //DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
if(sdu_sizeP <= 0) { if(sdu_sizeP <= 0) {
LOG_E(RLC, "sdu_sizeP %d, file %s, line %d\n", sdu_sizeP, __FILE__ ,__LINE__); LOG_E(RLC, "sdu_sizeP %d, file %s, line %d\n", sdu_sizeP, __FILE__,__LINE__);
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
...@@ -564,8 +564,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, ...@@ -564,8 +564,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
} }
#else #else
} } else { /* MBMS_flag != 0 */
else { /* MBMS_flag != 0 */
free_mem_block(sdu_pP, __func__); free_mem_block(sdu_pP, __func__);
LOG_E(RLC, "MBMS_flag != 0 while Rel10/Rel14 is not defined...\n"); LOG_E(RLC, "MBMS_flag != 0 while Rel10/Rel14 is not defined...\n");
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter module_id out of bounds :%d\n", __FILE__, __LINE__, module_idP); //handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter module_id out of bounds :%d\n", __FILE__, __LINE__, module_idP);
...@@ -616,7 +615,7 @@ void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP, ...@@ -616,7 +615,7 @@ void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
if (srb_flagP) { if (srb_flagP) {
if (rlc_rrc_data_conf != NULL) { if (rlc_rrc_data_conf != NULL) {
rlc_rrc_data_conf (ctxt_pP, rb_idP , muiP, statusP); rlc_rrc_data_conf (ctxt_pP, rb_idP, muiP, statusP);
} }
} }
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
#if ENABLE_RAL #if ENABLE_RAL
# include "collection/hashtable/obj_hashtable.h" #include "collection/hashtable/obj_hashtable.h"
#endif #endif
...@@ -244,14 +244,14 @@ typedef struct eNB_RRC_UE_NB_IoT_s { ...@@ -244,14 +244,14 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
* message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete) * message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete)
* this because it could happen that more messages are transmitted at the same time * this because it could happen that more messages are transmitted at the same time
*/ */
LTE_SRB_ToAddModList_NB_r13_t* SRB_configList;//for SRB1 and SRB1bis LTE_SRB_ToAddModList_NB_r13_t *SRB_configList;//for SRB1 and SRB1bis
LTE_SRB_ToAddModList_NB_r13_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; LTE_SRB_ToAddModList_NB_r13_t *SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
LTE_DRB_ToAddModList_NB_r13_t* DRB_configList; //for all the DRBs LTE_DRB_ToAddModList_NB_r13_t *DRB_configList; //for all the DRBs
LTE_DRB_ToAddModList_NB_r13_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid LTE_DRB_ToAddModList_NB_r13_t *DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
struct LTE_PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT; struct LTE_PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated_NB_IoT;
LTE_MAC_MainConfig_NB_r13_t* mac_MainConfig_NB_IoT; LTE_MAC_MainConfig_NB_r13_t *mac_MainConfig_NB_IoT;
//No SPS(semi-persistent scheduling) in NB-IoT //No SPS(semi-persistent scheduling) in NB-IoT
//No Measurement report in NB-IoT //No Measurement report in NB-IoT
...@@ -360,12 +360,12 @@ typedef struct { ...@@ -360,12 +360,12 @@ typedef struct {
uint8_t sizeof_SIB16_NB_IoT; uint8_t sizeof_SIB16_NB_IoT;
//TS 36.331 V14.2.1 //TS 36.331 V14.2.1
// uint8_t *SIB15_NB; // uint8_t *SIB15_NB;
// uint8_t sizeof_SIB15_NB; // uint8_t sizeof_SIB15_NB;
// uint8_t *SIB20_NB; // uint8_t *SIB20_NB;
// uint8_t sizeof_SIB20_NB; // uint8_t sizeof_SIB20_NB;
// uint8_t *SIB22_NB; // uint8_t *SIB22_NB;
// uint8_t sizeof_SIB22_NB; // uint8_t sizeof_SIB22_NB;
//implicit parameters needed //implicit parameters needed
int Ncp; //cyclic prefix for DL int Ncp; //cyclic prefix for DL
...@@ -453,7 +453,7 @@ typedef struct eNB_RRC_INST_NB_IoT_s { ...@@ -453,7 +453,7 @@ typedef struct eNB_RRC_INST_NB_IoT_s {
typedef struct OAI_UECapability_NB_IoT_s { typedef struct OAI_UECapability_NB_IoT_s {
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT]; uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
uint8_t sdu_size; uint8_t sdu_size;
////NB-IoT------ ////NB-IoT------
LTE_UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE LTE_UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE
} OAI_UECapability_NB_IoT_t; } OAI_UECapability_NB_IoT_t;
...@@ -499,7 +499,7 @@ typedef struct UE_RRC_INST_NB_IoT_s { ...@@ -499,7 +499,7 @@ typedef struct UE_RRC_INST_NB_IoT_s {
SystemInformationBlockType10_t *sib10[NB_CNX_UE]; SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE]; SystemInformationBlockType11_t *sib11[NB_CNX_UE];
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
uint8_t MBMS_flag; uint8_t MBMS_flag;
uint8_t *MCCH_MESSAGE[NB_CNX_UE]; uint8_t *MCCH_MESSAGE[NB_CNX_UE];
uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE]; uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
...@@ -507,11 +507,11 @@ typedef struct UE_RRC_INST_NB_IoT_s { ...@@ -507,11 +507,11 @@ typedef struct UE_RRC_INST_NB_IoT_s {
MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE]; MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE]; SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE]; SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
#endif #endif
#ifdef CBA #ifdef CBA
uint8_t num_active_cba_groups; uint8_t num_active_cba_groups;
uint16_t cba_rnti[NUM_MAX_CBA_GROUP]; uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
#endif #endif
uint8_t num_srb; uint8_t num_srb;
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE]; struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE]; struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
...@@ -537,14 +537,14 @@ typedef struct UE_RRC_INST_NB_IoT_s { ...@@ -537,14 +537,14 @@ typedef struct UE_RRC_INST_NB_IoT_s {
float rsrq_db[7]; float rsrq_db[7];
float rsrp_db_filtered[7]; float rsrp_db_filtered[7];
float rsrq_db_filtered[7]; float rsrq_db_filtered[7];
#if ENABLE_RAL #if ENABLE_RAL
obj_hash_table_t *ral_meas_thresholds; obj_hash_table_t *ral_meas_thresholds;
ral_transaction_id_t scan_transaction_id; ral_transaction_id_t scan_transaction_id;
#endif #endif
#if defined(ENABLE_SECURITY) #if defined(ENABLE_SECURITY)
// KeNB as computed from parameters within USIM card // // KeNB as computed from parameters within USIM card //
uint8_t kenb[32]; uint8_t kenb[32];
#endif #endif
// Used integrity/ciphering algorithms // // Used integrity/ciphering algorithms //
CipheringAlgorithm_r12_t ciphering_algorithm; CipheringAlgorithm_r12_t ciphering_algorithm;
......
...@@ -179,7 +179,6 @@ static int rrc_set_state (module_id_t ue_mod_idP, Rrc_State_t state) { ...@@ -179,7 +179,6 @@ static int rrc_set_state (module_id_t ue_mod_idP, Rrc_State_t state) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState ) { static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState ) {
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
switch (UE_rrc_inst[ue_mod_idP].RrcState) { switch (UE_rrc_inst[ue_mod_idP].RrcState) {
case RRC_STATE_INACTIVE: case RRC_STATE_INACTIVE:
...@@ -197,8 +196,7 @@ static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState ) ...@@ -197,8 +196,7 @@ static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState )
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState); "Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
break; break;
} }
} }
if (UE_rrc_inst[ue_mod_idP].RrcSubState != subState) { if (UE_rrc_inst[ue_mod_idP].RrcSubState != subState) {
UE_rrc_inst[ue_mod_idP].RrcSubState = subState; UE_rrc_inst[ue_mod_idP].RrcSubState = subState;
...@@ -595,17 +593,14 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *c ...@@ -595,17 +593,14 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *c
const char *nas_msg; const char *nas_msg;
int nas_msg_length; int nas_msg_length;
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data; nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length; nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
} else { } else {
nas_msg = nas_attach_req_imsi; nas_msg = nas_attach_req_imsi;
nas_msg_length = sizeof(nas_attach_req_imsi); nas_msg_length = sizeof(nas_attach_req_imsi);
} }
size = do_RRCConnectionSetupComplete(ctxt_pP->module_id, buffer, Transaction_id, nas_msg_length, nas_msg); size = do_RRCConnectionSetupComplete(ctxt_pP->module_id, buffer, Transaction_id, nas_msg_length, nas_msg);
LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n", LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n",
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index); ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
...@@ -810,6 +805,7 @@ rrc_ue_establish_drb( ...@@ -810,6 +805,7 @@ rrc_ue_establish_drb(
(void)ip_addr_offset4; (void)ip_addr_offset4;
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n", LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity); ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity);
/* /*
rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD, rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE); (eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE);
...@@ -845,6 +841,7 @@ rrc_ue_establish_drb( ...@@ -845,6 +841,7 @@ rrc_ue_establish_drb(
# endif # endif
} }
return(0); return(0);
} }
...@@ -1908,7 +1905,6 @@ rrc_ue_process_rrcConnectionReconfiguration( ...@@ -1908,7 +1905,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
} }
*/ */
/* Check if there is dedicated NAS information to forward to NAS */ /* Check if there is dedicated NAS information to forward to NAS */
if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) { if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) {
int list_count; int list_count;
...@@ -1972,7 +1968,6 @@ rrc_ue_process_rrcConnectionReconfiguration( ...@@ -1972,7 +1968,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p); itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
} }
#endif #endif
} // c1 present } // c1 present
} // critical extensions present } // critical extensions present
} }
...@@ -2241,7 +2236,6 @@ rrc_ue_decode_dcch( ...@@ -2241,7 +2236,6 @@ rrc_ue_decode_dcch(
UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED; UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED;
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n", LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",
ctxt_pP->module_id, target_eNB_index); ctxt_pP->module_id, target_eNB_index);
#if ENABLE_RAL #if ENABLE_RAL
{ {
MessageDef *message_ral_p = NULL; MessageDef *message_ral_p = NULL;
...@@ -2286,7 +2280,6 @@ rrc_ue_decode_dcch( ...@@ -2286,7 +2280,6 @@ rrc_ue_decode_dcch(
LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND to mRAL\n"); LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND to mRAL\n");
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p); itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
} }
#endif #endif
} else { } else {
rrc_ue_generate_RRCConnectionReconfigurationComplete( rrc_ue_generate_RRCConnectionReconfigurationComplete(
...@@ -3497,8 +3490,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) { ...@@ -3497,8 +3490,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
#endif #endif
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n", LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count ); (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
} } else {
else {
LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" ); LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" );
return -1; return -1;
} }
...@@ -3561,8 +3553,6 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) { ...@@ -3561,8 +3553,6 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index ); rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index );
} }
if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_IDLE) { if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_IDLE) {
LOG_I( RRC, "[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n", ctxt_pP->module_id ); LOG_I( RRC, "[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n", ctxt_pP->module_id );
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_SI_RECEIVED; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State = RRC_SI_RECEIVED;
...@@ -3825,7 +3815,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) { ...@@ -3825,7 +3815,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
sib1->schedulingInfoList.list.count); sib1->schedulingInfoList.list.count);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI , VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_OUT);
return 0; return 0;
} }
...@@ -4093,7 +4083,7 @@ uint8_t check_trigger_meas_event( ...@@ -4093,7 +4083,7 @@ uint8_t check_trigger_meas_event(
uint8_t eNB_offset; uint8_t eNB_offset;
// uint8_t currentCellIndex = frame_parms->Nid_cell; // uint8_t currentCellIndex = frame_parms->Nid_cell;
uint8_t tmp_offset; uint8_t tmp_offset;
LOG_I(RRC,"[UE %d] ofn(%ld) ocn(%ld) hys(%ld) ofs(%ld) ocs(%ld) a3_offset(%ld) ttt(%ld) rssi %3.1f\n", LOG_D(RRC,"[UE %d] ofn(%ld) ocn(%ld) hys(%ld) ofs(%ld) ocs(%ld) a3_offset(%ld) ttt(%ld) rssi %3.1f\n",
ue_mod_idP, ue_mod_idP,
ofn,ocn,hys,ofs,ocs,a3_offset,ttt, ofn,ocn,hys,ofs,ocs,a3_offset,ttt,
10*log10(get_RSSI(ue_mod_idP,0))-get_rx_total_gain_dB(ue_mod_idP,0)); 10*log10(get_RSSI(ue_mod_idP,0))-get_rx_total_gain_dB(ue_mod_idP,0));
...@@ -5024,7 +5014,7 @@ rrc_control_socket_init() { ...@@ -5024,7 +5014,7 @@ rrc_control_socket_init() {
// error("ERROR: Failed on opening socket"); // error("ERROR: Failed on opening socket");
optval = 1; optval = 1;
setsockopt(ctrl_sock_fd, SOL_SOCKET, SO_REUSEADDR, setsockopt(ctrl_sock_fd, SOL_SOCKET, SO_REUSEADDR,
(const void *)&optval , sizeof(int)); (const void *)&optval, sizeof(int));
//build the server's address //build the server's address
bzero((char *) &rrc_ctrl_socket_addr, sizeof(rrc_ctrl_socket_addr)); bzero((char *) &rrc_ctrl_socket_addr, sizeof(rrc_ctrl_socket_addr));
rrc_ctrl_socket_addr.sin_family = AF_INET; rrc_ctrl_socket_addr.sin_family = AF_INET;
......
This diff is collapsed.
...@@ -41,20 +41,18 @@ extern RAN_CONTEXT_t RC; ...@@ -41,20 +41,18 @@ extern RAN_CONTEXT_t RC;
int int
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP, const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
uint8_t *inde_list uint8_t *inde_list
) ) {
{
rnti_t rnti; rnti_t rnti;
int i; int i;
struct rrc_eNB_ue_context_s* ue_context_p = NULL; struct rrc_eNB_ue_context_s *ue_context_p = NULL;
if (create_tunnel_resp_pP) { if (create_tunnel_resp_pP) {
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RX CREATE_TUNNEL_RESP num tunnels %u \n", LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RX CREATE_TUNNEL_RESP num tunnels %u \n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
create_tunnel_resp_pP->num_tunnels); create_tunnel_resp_pP->num_tunnels);
rnti = create_tunnel_resp_pP->rnti; rnti = create_tunnel_resp_pP->rnti;
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[ctxt_pP->module_id], RC.rrc[ctxt_pP->module_id],
...@@ -64,7 +62,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( ...@@ -64,7 +62,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i]; ue_context_p->ue_context.enb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i];
ue_context_p->ue_context.enb_gtp_addrs[inde_list[i]] = create_tunnel_resp_pP->enb_addr; ue_context_p->ue_context.enb_gtp_addrs[inde_list[i]] = create_tunnel_resp_pP->enb_addr;
ue_context_p->ue_context.enb_gtp_ebi[inde_list[i]] = create_tunnel_resp_pP->eps_bearer_id[i]; ue_context_p->ue_context.enb_gtp_ebi[inde_list[i]] = create_tunnel_resp_pP->eps_bearer_id[i];
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel (%u, %u) bearer UE context index %u, msg index %u, id %u, gtp addr len %d \n", LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel (%u, %u) bearer UE context index %u, msg index %u, id %u, gtp addr len %d \n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
create_tunnel_resp_pP->enb_S1u_teid[i], create_tunnel_resp_pP->enb_S1u_teid[i],
...@@ -74,6 +71,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( ...@@ -74,6 +71,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
create_tunnel_resp_pP->eps_bearer_id[i], create_tunnel_resp_pP->eps_bearer_id[i],
create_tunnel_resp_pP->enb_addr.length); create_tunnel_resp_pP->enb_addr.length);
} }
MSC_LOG_RX_MESSAGE( MSC_LOG_RX_MESSAGE(
MSC_RRC_ENB, MSC_RRC_ENB,
MSC_GTPU_ENB, MSC_GTPU_ENB,
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
*\return 0 when successful, -1 if the UE index can not be retrieved. */ *\return 0 when successful, -1 if the UE index can not be retrieved. */
int int
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP, const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
uint8_t *inde_list uint8_t *inde_list
); );
......
This diff is collapsed.
...@@ -49,36 +49,36 @@ typedef struct rrc_ue_s1ap_ids_s { ...@@ -49,36 +49,36 @@ typedef struct rrc_ue_s1ap_ids_s {
int int
rrc_eNB_S1AP_compare_ue_ids( rrc_eNB_S1AP_compare_ue_ids(
struct rrc_ue_s1ap_ids_s* c1_pP, struct rrc_ue_s1ap_ids_s *c1_pP,
struct rrc_ue_s1ap_ids_s* c2_pP struct rrc_ue_s1ap_ids_s *c2_pP
); );
struct rrc_rnti_tree_s; struct rrc_rnti_tree_s;
RB_PROTOTYPE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids); RB_PROTOTYPE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids);
struct rrc_ue_s1ap_ids_s* struct rrc_ue_s1ap_ids_s *
rrc_eNB_S1AP_get_ue_ids( rrc_eNB_S1AP_get_ue_ids(
eNB_RRC_INST* const rrc_instance_pP, eNB_RRC_INST *const rrc_instance_pP,
const uint16_t ue_initial_id, const uint16_t ue_initial_id,
const uint32_t eNB_ue_s1ap_id const uint32_t eNB_ue_s1ap_id
); );
void void
rrc_eNB_S1AP_remove_ue_ids( rrc_eNB_S1AP_remove_ue_ids(
eNB_RRC_INST* const rrc_instance_pP, eNB_RRC_INST *const rrc_instance_pP,
struct rrc_ue_s1ap_ids_s* const ue_ids_pP struct rrc_ue_s1ap_ids_s *const ue_ids_pP
); );
void void
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(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,
const uint8_t ho_state const uint8_t ho_state
); );
int int
rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(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,
const uint8_t ho_state const uint8_t ho_state
); );
...@@ -89,8 +89,8 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* cons ...@@ -89,8 +89,8 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* cons
*/ */
void void
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP( rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
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
); );
/*! \fn void rrc_eNB_send_S1AP_UPLINK_NAS(const protocol_ctxt_t * const ctxt_pP, eNB_RRC_UE_t * const ue_context_pP, UL_DCCH_Message_t * const ul_dcch_msg) /*! \fn void rrc_eNB_send_S1AP_UPLINK_NAS(const protocol_ctxt_t * const ctxt_pP, eNB_RRC_UE_t * const ue_context_pP, UL_DCCH_Message_t * const ul_dcch_msg)
...@@ -101,9 +101,9 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP( ...@@ -101,9 +101,9 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
*/ */
void void
rrc_eNB_send_S1AP_UPLINK_NAS( rrc_eNB_send_S1AP_UPLINK_NAS(
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,
LTE_UL_DCCH_Message_t* const ul_dcch_msg LTE_UL_DCCH_Message_t *const ul_dcch_msg
); );
/*! \fn void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(const protocol_ctxt_t * const ctxt_pP, eNB_RRC_UE_t * const ue_context_pP, UL_DCCH_Message_t *ul_dcch_msg) /*! \fn void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(const protocol_ctxt_t * const ctxt_pP, eNB_RRC_UE_t * const ue_context_pP, UL_DCCH_Message_t *ul_dcch_msg)
...@@ -113,9 +113,9 @@ rrc_eNB_send_S1AP_UPLINK_NAS( ...@@ -113,9 +113,9 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
*\param ul_dcch_msg The message receive by RRC holding the NAS message. *\param ul_dcch_msg The message receive by RRC holding the NAS message.
*/ */
void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND( void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
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,
LTE_UL_DCCH_Message_t* ul_dcch_msg LTE_UL_DCCH_Message_t *ul_dcch_msg
); );
/*! \fn rrc_eNB_send_S1AP_NAS_FIRST_REQ(const protocol_ctxt_t* const ctxt_pP,eNB_RRC_UE_t *const ue_context_pP, RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete) /*! \fn rrc_eNB_send_S1AP_NAS_FIRST_REQ(const protocol_ctxt_t* const ctxt_pP,eNB_RRC_UE_t *const ue_context_pP, RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete)
...@@ -127,9 +127,9 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND( ...@@ -127,9 +127,9 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
*/ */
void void
rrc_eNB_send_S1AP_NAS_FIRST_REQ( rrc_eNB_send_S1AP_NAS_FIRST_REQ(
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,
LTE_RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete LTE_RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete
); );
...@@ -143,7 +143,7 @@ the UE-associated S1-logical connection over the S1 interface. . ...@@ -143,7 +143,7 @@ the UE-associated S1-logical connection over the S1 interface. .
*/ */
void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ ( void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ (
const module_id_t enb_mod_idP, const module_id_t enb_mod_idP,
const rrc_eNB_ue_context_t* const ue_context_pP, const rrc_eNB_ue_context_t *const ue_context_pP,
const s1ap_Cause_t causeP, const s1ap_Cause_t causeP,
const long cause_valueP const long cause_valueP
); );
...@@ -186,7 +186,7 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name ...@@ -186,7 +186,7 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
*\param xid transaction identifier *\param xid transaction identifier
*\return 0 when successful, -1 if the UE index can not be retrieved. *\return 0 when successful, -1 if the UE index can not be retrieved.
*/ */
int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid ); int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t xid );
/*! \fn rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance); /*! \fn rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
*\brief process a S1AP dedicated E_RAB modify request message received from S1AP. *\brief process a S1AP dedicated E_RAB modify request message received from S1AP.
...@@ -204,7 +204,7 @@ int rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_nam ...@@ -204,7 +204,7 @@ int rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_nam
*\param xid transaction identifier *\param xid transaction identifier
*\return 0 when successful, -1 if the UE index can not be retrieved. *\return 0 when successful, -1 if the UE index can not be retrieved.
*/ */
int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid ); int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t xid );
/*! \fn rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance) /*! \fn rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance)
*\brief process a S1AP_UE_CTXT_MODIFICATION_REQ message received from S1AP. *\brief process a S1AP_UE_CTXT_MODIFICATION_REQ message received from S1AP.
...@@ -244,8 +244,8 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance ...@@ -244,8 +244,8 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
void void
rrc_pdcp_config_security( rrc_pdcp_config_security(
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,
const uint8_t send_security_mode_command const uint8_t send_security_mode_command
); );
/*! \fn rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *msg_name, instance_t instance); /*! \fn rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *msg_name, instance_t instance);
...@@ -264,10 +264,10 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms ...@@ -264,10 +264,10 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms
*\param xid transaction identifier *\param xid transaction identifier
*\return 0 when successful, -1 if the UE index can not be retrieved. *\return 0 when successful, -1 if the UE index can not be retrieved.
*/ */
int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid ); int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t xid );
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP, int rrc_eNB_send_PATH_SWITCH_REQ(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 rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance); int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance);
#endif /* RRC_ENB_S1AP_H_ */ #endif /* RRC_ENB_S1AP_H_ */
This diff is collapsed.
...@@ -133,8 +133,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need ...@@ -133,8 +133,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
* \enddot * \enddot
*/ */
enum enum {
{
STATE_START_OCG, /*!< \brief initiate OCG */ STATE_START_OCG, /*!< \brief initiate OCG */
STATE_GET_OPT, /*!< \brief get options of OCG command */ STATE_GET_OPT, /*!< \brief get options of OCG command */
STATE_DETECT_FILE, /*!< \brief detect the configuration file in folder USER_XML_FOLDER */ STATE_DETECT_FILE, /*!< \brief detect the configuration file in folder USER_XML_FOLDER */
...@@ -569,7 +568,7 @@ typedef struct { ...@@ -569,7 +568,7 @@ typedef struct {
} Layer; } Layer;
typedef struct { typedef struct {
char * level; char *level;
char *verbosity; char *verbosity;
int interval; int interval;
} Log_Emu; } Log_Emu;
...@@ -596,8 +595,8 @@ typedef struct { ...@@ -596,8 +595,8 @@ typedef struct {
Log_Emu log_emu; Log_Emu log_emu;
Packet_Trace packet_trace; Packet_Trace packet_trace;
Seed seed; Seed seed;
char * curve; char *curve;
char * background_stats; char *background_stats;
// CLI tags are in Info // CLI tags are in Info
//char g_log_level[20]; //char g_log_level[20];
} Emulation_Config; } Emulation_Config;
...@@ -675,7 +674,7 @@ typedef struct { ...@@ -675,7 +674,7 @@ typedef struct {
unsigned char cba_group_active; unsigned char cba_group_active;
unsigned char cba_backoff; unsigned char cba_backoff;
unsigned char handover_active; unsigned char handover_active;
char * otg_traffic; char *otg_traffic;
unsigned char otg_bg_traffic_enabled; unsigned char otg_bg_traffic_enabled;
unsigned char omg_model_rn; unsigned char omg_model_rn;
unsigned char omg_model_enb; unsigned char omg_model_enb;
...@@ -703,7 +702,7 @@ typedef struct { ...@@ -703,7 +702,7 @@ typedef struct {
node_function_t node_function[MAX_NUM_CCs]; node_function_t node_function[MAX_NUM_CCs];
node_timing_t node_timing[MAX_NUM_CCs]; node_timing_t node_timing[MAX_NUM_CCs];
unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref lte_frame_type_t (header file reorganization needed) unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref lte_frame_type_t (header file reorganization needed)
char * frame_type_name[MAX_NUM_CCs]; char *frame_type_name[MAX_NUM_CCs];
unsigned char tdd_config[MAX_NUM_CCs]; unsigned char tdd_config[MAX_NUM_CCs];
unsigned char tdd_config_S[MAX_NUM_CCs]; unsigned char tdd_config_S[MAX_NUM_CCs];
unsigned char extended_prefix_flag[MAX_NUM_CCs]; unsigned char extended_prefix_flag[MAX_NUM_CCs];
......
...@@ -82,23 +82,18 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header, ...@@ -82,23 +82,18 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header,
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
{
LOG_FUNC_IN; LOG_FUNC_IN;
int header_result; int header_result;
int decode_result; int decode_result;
uint8_t *buffer_log = buffer; uint8_t *buffer_log = buffer;
uint32_t len_log = len; uint32_t len_log = len;
int down_link; int down_link;
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME))) # if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
down_link = 0; down_link = 0;
# else # else
down_link = 1; down_link = 1;
# endif # endif
/* First decode the EMM message header */ /* First decode the EMM message header */
header_result = _emm_msg_decode_header(&msg->header, buffer, len); header_result = _emm_msg_decode_header(&msg->header, buffer, len);
...@@ -110,7 +105,6 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) ...@@ -110,7 +105,6 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
buffer += header_result; buffer += header_result;
len -= header_result; len -= header_result;
LOG_TRACE(INFO, "EMM-MSG - Message Type 0x%02x", msg->header.message_type); LOG_TRACE(INFO, "EMM-MSG - Message Type 0x%02x", msg->header.message_type);
switch(msg->header.message_type) { switch(msg->header.message_type) {
...@@ -281,24 +275,17 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) ...@@ -281,24 +275,17 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len) int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
{
LOG_FUNC_IN; LOG_FUNC_IN;
int header_result; int header_result;
int encode_result; int encode_result;
uint8_t *buffer_log = buffer; uint8_t *buffer_log = buffer;
int down_link; int down_link;
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME))) # if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
down_link = 1; down_link = 1;
# else # else
down_link = 0; down_link = 0;
# endif # endif
/* First encode the EMM message header */ /* First encode the EMM message header */
header_result = _emm_msg_encode_header(&msg->header, buffer, len); header_result = _emm_msg_encode_header(&msg->header, buffer, len);
...@@ -492,8 +479,7 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len) ...@@ -492,8 +479,7 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _emm_msg_decode_header(emm_msg_header_t *header, static int _emm_msg_decode_header(emm_msg_header_t *header,
const uint8_t *buffer, uint32_t len) const uint8_t *buffer, uint32_t len) {
{
int size = 0; int size = 0;
/* Check the buffer length */ /* Check the buffer length */
...@@ -535,8 +521,7 @@ static int _emm_msg_decode_header(emm_msg_header_t *header, ...@@ -535,8 +521,7 @@ static int _emm_msg_decode_header(emm_msg_header_t *header,
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _emm_msg_encode_header(const emm_msg_header_t *header, static int _emm_msg_encode_header(const emm_msg_header_t *header,
uint8_t *buffer, uint32_t len) uint8_t *buffer, uint32_t len) {
{
int size = 0; int size = 0;
/* Check the buffer length */ /* Check the buffer length */
...@@ -555,7 +540,6 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header, ...@@ -555,7 +540,6 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header,
ENCODE_U8(buffer + size, *(uint8_t *)(header), size); ENCODE_U8(buffer + size, *(uint8_t *)(header), size);
/* Encode the message type */ /* Encode the message type */
ENCODE_U8(buffer + size, header->message_type, size); ENCODE_U8(buffer + size, header->message_type, size);
return (size); return (size);
} }
...@@ -58,13 +58,13 @@ Description Implements the API used by the NAS layer running in the UE ...@@ -58,13 +58,13 @@ Description Implements the API used by the NAS layer running in the UE
/****************** E X P O R T E D F U N C T I O N S ******************/ /****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/ /****************************************************************************/
int user_api_initialize(user_api_id_t *user_api_id, const char* host, const char* port, const char* devname, const char* devparams); int user_api_initialize(user_api_id_t *user_api_id, const char *host, const char *port, const char *devname, const char *devparams);
int user_api_emm_callback(user_api_id_t *user_api_id, Stat_t stat, tac_t tac, ci_t ci, AcT_t AcT, const char* data, size_t size); int user_api_emm_callback(user_api_id_t *user_api_id, Stat_t stat, tac_t tac, ci_t ci, AcT_t AcT, const char *data, size_t size);
int user_api_esm_callback(user_api_id_t *user_api_id, int cid, network_pdn_state_t state); int user_api_esm_callback(user_api_id_t *user_api_id, int cid, network_pdn_state_t state);
int user_api_get_fd(user_api_id_t *user_api_id); int user_api_get_fd(user_api_id_t *user_api_id);
const void* user_api_get_data(user_at_commands_t *commands, int index); const void *user_api_get_data(user_at_commands_t *commands, int index);
int user_api_read_data(user_api_id_t *user_api_id); int user_api_read_data(user_api_id_t *user_api_id);
int user_api_set_data(user_api_id_t *user_api_id, char *message); int user_api_set_data(user_api_id_t *user_api_id, char *message);
...@@ -72,6 +72,6 @@ int user_api_send_data(user_api_id_t *user_api_id, int length); ...@@ -72,6 +72,6 @@ int user_api_send_data(user_api_id_t *user_api_id, int length);
void user_api_close(user_api_id_t *user_api_id); void user_api_close(user_api_id_t *user_api_id);
int user_api_decode_data(user_api_id_t *user_api_id, user_at_commands_t *commands, int length); int user_api_decode_data(user_api_id_t *user_api_id, user_at_commands_t *commands, int length);
int user_api_encode_data(user_api_id_t *user_api_id, const void* data, int add_success_code); int user_api_encode_data(user_api_id_t *user_api_id, const void *data, int add_success_code);
#endif /* __USER_API_H__ */ #endif /* __USER_API_H__ */
...@@ -58,7 +58,7 @@ Description Defines the EPS Mobility Management procedure call manager, ...@@ -58,7 +58,7 @@ Description Defines the EPS Mobility Management procedure call manager,
* EPS Mobility Management sublayer * EPS Mobility Management sublayer
*/ */
typedef int (*emm_indication_callback_t) (user_api_id_t *user_api_id, Stat_t, tac_t, ci_t, AcT_t, typedef int (*emm_indication_callback_t) (user_api_id_t *user_api_id, Stat_t, tac_t, ci_t, AcT_t,
const char*, size_t); const char *, size_t);
/****************************************************************************/ /****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/ /******************** G L O B A L V A R I A B L E S ********************/
......
...@@ -103,18 +103,13 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *, ...@@ -103,18 +103,13 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *,
int esm_ebr_context_create( int esm_ebr_context_create(
esm_data_t *esm_data, int ueid, esm_data_t *esm_data, int ueid,
int pid, int ebi, int is_default, int pid, int ebi, int is_default,
const network_qos_t *qos, const network_tft_t *tft) const network_qos_t *qos, const network_tft_t *tft) {
{
int bid = 0; int bid = 0;
esm_data_context_t *esm_ctx = NULL; esm_data_context_t *esm_ctx = NULL;
esm_pdn_t *pdn = NULL; esm_pdn_t *pdn = NULL;
LOG_FUNC_IN; LOG_FUNC_IN;
esm_ctx = esm_data; esm_ctx = esm_data;
bid = ESM_DATA_EPS_BEARER_MAX; bid = ESM_DATA_EPS_BEARER_MAX;
LOG_TRACE(INFO, "ESM-PROC - Create new %s EPS bearer context (ebi=%d) " LOG_TRACE(INFO, "ESM-PROC - Create new %s EPS bearer context (ebi=%d) "
"for PDN connection (pid=%d)", "for PDN connection (pid=%d)",
(is_default)? "default" : "dedicated", ebi, pid); (is_default)? "default" : "dedicated", ebi, pid);
...@@ -162,7 +157,7 @@ int esm_ebr_context_create( ...@@ -162,7 +157,7 @@ int esm_ebr_context_create(
esm_bearer_t *ebr = (esm_bearer_t *)malloc(sizeof(esm_bearer_t)); esm_bearer_t *ebr = (esm_bearer_t *)malloc(sizeof(esm_bearer_t));
if (ebr != NULL) { if (ebr != NULL) {
memset(ebr, 0 , sizeof(esm_bearer_t)); memset(ebr, 0, sizeof(esm_bearer_t));
/* Increment the total number of active EPS bearers */ /* Increment the total number of active EPS bearers */
esm_ctx->n_ebrs += 1; esm_ctx->n_ebrs += 1;
/* Increment the number of EPS bearer for this PDN connection */ /* Increment the number of EPS bearer for this PDN connection */
...@@ -214,6 +209,7 @@ int esm_ebr_context_create( ...@@ -214,6 +209,7 @@ int esm_ebr_context_create(
switch (pdn->type) { switch (pdn->type) {
case NET_PDN_TYPE_IPV4V6: case NET_PDN_TYPE_IPV4V6:
//ipv6_addr[0] = pdn->ip_addr[4]; //ipv6_addr[0] = pdn->ip_addr[4];
/* TODO? */ /* TODO? */
...@@ -224,9 +220,7 @@ int esm_ebr_context_create( ...@@ -224,9 +220,7 @@ int esm_ebr_context_create(
((pdn->ip_addr[1] << 16) & 0x00FF0000) | ((pdn->ip_addr[1] << 16) & 0x00FF0000) |
((pdn->ip_addr[2] << 8) & 0x0000FF00) | ((pdn->ip_addr[2] << 8) & 0x0000FF00) |
( pdn->ip_addr[3] & 0x000000FF); ( pdn->ip_addr[3] & 0x000000FF);
in_addr.s_addr = htonl(in_addr.s_addr); in_addr.s_addr = htonl(in_addr.s_addr);
tmp = inet_ntoa(in_addr); tmp = inet_ntoa(in_addr);
//AssertFatal(tmp , //AssertFatal(tmp ,
// "error in PDN IPv4 address %x", // "error in PDN IPv4 address %x",
...@@ -274,7 +268,7 @@ int esm_ebr_context_create( ...@@ -274,7 +268,7 @@ int esm_ebr_context_create(
strcpy(broadcast, ipv4_addr); strcpy(broadcast, ipv4_addr);
} }
if(nfapi_mode ==3){ if(nfapi_mode ==3) {
// this is for L2 FAPI simulator. // this is for L2 FAPI simulator.
// change for multiple UE's like 256UEs. // change for multiple UE's like 256UEs.
// if it's made too many tables , OS may crush so we use one table. // if it's made too many tables , OS may crush so we use one table.
...@@ -292,7 +286,6 @@ int esm_ebr_context_create( ...@@ -292,7 +286,6 @@ int esm_ebr_context_create(
ipv4_addr, 201, ipv4_addr, 201,
UE_NAS_USE_TUN?"oaitun_ue":"oip", UE_NAS_USE_TUN?"oaitun_ue":"oip",
inst_nic + 1, 201); inst_nic + 1, 201);
inst_pdcp_list[inst_nic] = ueid; inst_pdcp_list[inst_nic] = ueid;
#else #else
res = sprintf(command_line, res = sprintf(command_line,
...@@ -321,9 +314,11 @@ int esm_ebr_context_create( ...@@ -321,9 +314,11 @@ int esm_ebr_context_create(
UE_NAS_USE_TUN?"oaitun_ue":"oip", UE_NAS_USE_TUN?"oaitun_ue":"oip",
ueid + 1, ueid + 201); ueid + 1, ueid + 201);
} }
if ( res<0 ) { if ( res<0 ) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string"); LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string");
} }
LOG_TRACE(INFO, "ESM-PROC - executing %s ", LOG_TRACE(INFO, "ESM-PROC - executing %s ",
command_line); command_line);
...@@ -384,16 +379,13 @@ int esm_ebr_context_create( ...@@ -384,16 +379,13 @@ int esm_ebr_context_create(
** ** ** **
***************************************************************************/ ***************************************************************************/
int esm_ebr_context_release(nas_user_t *user, int esm_ebr_context_release(nas_user_t *user,
int ebi, int *pid, int *bid) int ebi, int *pid, int *bid) {
{
int found = FALSE; int found = FALSE;
esm_pdn_t *pdn = NULL; esm_pdn_t *pdn = NULL;
esm_data_context_t *esm_ctx; esm_data_context_t *esm_ctx;
esm_ebr_data_t *esm_ebr_data = user->esm_ebr_data; esm_ebr_data_t *esm_ebr_data = user->esm_ebr_data;
user_api_id_t *user_api_id = user->user_api_id; user_api_id_t *user_api_id = user->user_api_id;
LOG_FUNC_IN; LOG_FUNC_IN;
esm_ctx = user->esm_data; esm_ctx = user->esm_data;
if (ebi != ESM_EBI_UNASSIGNED) { if (ebi != ESM_EBI_UNASSIGNED) {
...@@ -498,7 +490,6 @@ int esm_ebr_context_release(nas_user_t *user, ...@@ -498,7 +490,6 @@ int esm_ebr_context_release(nas_user_t *user,
*/ */
for (i = 1; pdn->n_bearers > 0; i++) { for (i = 1; pdn->n_bearers > 0; i++) {
if (pdn->bearer[i]) { if (pdn->bearer[i]) {
LOG_TRACE(WARNING, "ESM-PROC - Release EPS bearer context " LOG_TRACE(WARNING, "ESM-PROC - Release EPS bearer context "
"(ebi=%d)", pdn->bearer[i]->ebi); "(ebi=%d)", pdn->bearer[i]->ebi);
...@@ -510,10 +501,8 @@ int esm_ebr_context_release(nas_user_t *user, ...@@ -510,10 +501,8 @@ int esm_ebr_context_release(nas_user_t *user,
/* Set the EPS bearer context state to INACTIVE */ /* Set the EPS bearer context state to INACTIVE */
esm_ebr_set_status(user_api_id, esm_ebr_data, pdn->bearer[i]->ebi, esm_ebr_set_status(user_api_id, esm_ebr_data, pdn->bearer[i]->ebi,
ESM_EBR_INACTIVE, TRUE); ESM_EBR_INACTIVE, TRUE);
/* Release EPS bearer data */ /* Release EPS bearer data */
esm_ebr_release(esm_ebr_data, pdn->bearer[i]->ebi); esm_ebr_release(esm_ebr_data, pdn->bearer[i]->ebi);
// esm_ebr_release() // esm_ebr_release()
/* Release dedicated EPS bearer data */ /* Release dedicated EPS bearer data */
free(pdn->bearer[i]); free(pdn->bearer[i]);
...@@ -535,7 +524,6 @@ int esm_ebr_context_release(nas_user_t *user, ...@@ -535,7 +524,6 @@ int esm_ebr_context_release(nas_user_t *user,
} }
} }
/* 3GPP TS 24.301, section 6.4.4.6 /* 3GPP TS 24.301, section 6.4.4.6
* If the UE locally deactivated all EPS bearer contexts, the UE * If the UE locally deactivated all EPS bearer contexts, the UE
* shall perform a local detach and enter state EMM-DEREGISTERED. * shall perform a local detach and enter state EMM-DEREGISTERED.
...@@ -584,10 +572,8 @@ int esm_ebr_context_release(nas_user_t *user, ...@@ -584,10 +572,8 @@ int esm_ebr_context_release(nas_user_t *user,
** Others: None ** ** Others: None **
** ** ** **
***************************************************************************/ ***************************************************************************/
int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi) int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi) {
{
LOG_FUNC_IN; LOG_FUNC_IN;
int pid; int pid;
for (pid = 0; pid < ESM_DATA_PDN_MAX; pid++) { for (pid = 0; pid < ESM_DATA_PDN_MAX; pid++) {
...@@ -635,10 +621,8 @@ int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi) ...@@ -635,10 +621,8 @@ int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi)
***************************************************************************/ ***************************************************************************/
int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi, int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi,
const network_tft_t *tft, const network_tft_t *tft,
esm_ebr_context_tft_t operation) esm_ebr_context_tft_t operation) {
{
LOG_FUNC_IN; LOG_FUNC_IN;
int rc = RETURNerror; int rc = RETURNerror;
int i; int i;
...@@ -704,8 +688,7 @@ int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi, ...@@ -704,8 +688,7 @@ int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi,
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1, static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1,
const network_tft_t *tft2) const network_tft_t *tft2) {
{
int i; int i;
int j; int j;
...@@ -746,8 +729,7 @@ static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1, ...@@ -746,8 +729,7 @@ static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1,
** ** ** **
***************************************************************************/ ***************************************************************************/
static int _esm_ebr_context_check_precedence(const network_tft_t *tft1, static int _esm_ebr_context_check_precedence(const network_tft_t *tft1,
const network_tft_t *tft2) const network_tft_t *tft2) {
{
int i; int i;
int j; int j;
......
...@@ -51,7 +51,6 @@ int create_tasks(uint32_t enb_nb) { ...@@ -51,7 +51,6 @@ int create_tasks(uint32_t enb_nb) {
} }
} }
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
if (enb_nb > 0) { if (enb_nb > 0) {
if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) { if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) {
...@@ -83,7 +82,6 @@ int create_tasks(uint32_t enb_nb) { ...@@ -83,7 +82,6 @@ int create_tasks(uint32_t enb_nb) {
} }
} /* if (EPC_MODE_ENABLED) */ } /* if (EPC_MODE_ENABLED) */
if (enb_nb > 0) { if (enb_nb > 0) {
LOG_I(RRC,"Creating RRC eNB Task\n"); LOG_I(RRC,"Creating RRC eNB Task\n");
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
int create_tasks_ue(uint32_t ue_nb) { int create_tasks_ue(uint32_t ue_nb) {
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb); LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1); itti_wait_ready(1);
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
# if defined(NAS_BUILT_IN_UE) # if defined(NAS_BUILT_IN_UE)
...@@ -55,6 +56,7 @@ int create_tasks_ue(uint32_t ue_nb) { ...@@ -55,6 +56,7 @@ int create_tasks_ue(uint32_t ue_nb) {
return -1; return -1;
} }
} }
# endif # endif
} /* EPC_MODE_ENABLED */ } /* EPC_MODE_ENABLED */
......
This diff is collapsed.
This diff is collapsed.
...@@ -98,7 +98,9 @@ void get_common_options(void) { ...@@ -98,7 +98,9 @@ void get_common_options(void) {
unsigned int is_nos1exec(char *exepath) { unsigned int is_nos1exec(char *exepath) {
if ( strcmp( basename(exepath), "lte-softmodem-nos1") == 0) if ( strcmp( basename(exepath), "lte-softmodem-nos1") == 0)
return 1; return 1;
if ( strcmp( basename(exepath), "lte-uesoftmodem-nos1") == 0) if ( strcmp( basename(exepath), "lte-uesoftmodem-nos1") == 0)
return 1; return 1;
return 0; return 0;
} }
...@@ -608,9 +608,12 @@ int main( int argc, char **argv ) { ...@@ -608,9 +608,12 @@ int main( int argc, char **argv ) {
logInit(); logInit();
printf("Reading in command-line options\n"); printf("Reading in command-line options\n");
get_options (); get_options ();
if (is_nos1exec(argv[0]) ) if (is_nos1exec(argv[0]) )
set_softmodem_optmask(SOFTMODEM_NOS1_BIT); set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
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);
...@@ -628,8 +631,7 @@ int main( int argc, char **argv ) { ...@@ -628,8 +631,7 @@ int main( int argc, char **argv ) {
} }
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
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
...@@ -638,7 +640,6 @@ int main( int argc, char **argv ) { ...@@ -638,7 +640,6 @@ int main( int argc, char **argv ) {
} }
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
init_opt(); init_opt();
// 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);
...@@ -654,6 +655,7 @@ int main( int argc, char **argv ) { ...@@ -654,6 +655,7 @@ int main( int argc, char **argv ) {
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx); fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT); pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT);
# #
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) {
...@@ -666,6 +668,7 @@ int main( int argc, char **argv ) { ...@@ -666,6 +668,7 @@ int main( int argc, char **argv ) {
printf("No ITTI, Initializing L1\n"); printf("No ITTI, Initializing L1\n");
RCconfig_L1(); RCconfig_L1();
} }
/* 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();
...@@ -745,8 +748,7 @@ int main( int argc, char **argv ) { ...@@ -745,8 +748,7 @@ int main( int argc, char **argv ) {
LOG_I(ENB_APP,"NFAPI MODE:%s\n", nfapi_mode_str); LOG_I(ENB_APP,"NFAPI MODE:%s\n", nfapi_mode_str);
if (nfapi_mode==2) {// VNF
if (nfapi_mode==2) {// VNF
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
init_ru_vnf(); // ru pointer is necessary for pre_scd. init_ru_vnf(); // ru pointer is necessary for pre_scd.
#endif #endif
...@@ -767,7 +769,6 @@ if (nfapi_mode==2) {// VNF ...@@ -767,7 +769,6 @@ if (nfapi_mode==2) {// VNF
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);
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator. // RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
...@@ -776,7 +777,8 @@ if (nfapi_mode==2) {// VNF ...@@ -776,7 +777,8 @@ if (nfapi_mode==2) {// VNF
if (RC.nb_RU >0 && nfapi_mode != 2) { if (RC.nb_RU >0 && nfapi_mode != 2) {
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);
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment