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
This commit is contained in:
+13
-6
@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) {
|
||||
logparams_dump[i].numelt = 0;
|
||||
}
|
||||
|
||||
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_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_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
@@ -385,7 +385,6 @@ int logInit (void) {
|
||||
register_log_component("OCG","",OCG);
|
||||
register_log_component("PERF","",PERF);
|
||||
register_log_component("OIP","",OIP);
|
||||
register_log_component("CLI","",CLI);
|
||||
register_log_component("MSC","log",MSC);
|
||||
register_log_component("OCM","log",OCM);
|
||||
register_log_component("HW","",HW);
|
||||
@@ -408,6 +407,8 @@ int logInit (void) {
|
||||
register_log_component("X2AP","",X2AP);
|
||||
register_log_component("LOADER","log",LOADER);
|
||||
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++)
|
||||
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) {
|
||||
|
||||
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
|
||||
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],
|
||||
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
|
||||
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
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
va_list args;
|
||||
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);
|
||||
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, ... ) {
|
||||
va_list args;
|
||||
char *wbuf;
|
||||
@@ -474,7 +481,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
|
||||
|
||||
if (wbuf != NULL) {
|
||||
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);
|
||||
pos=pos+pos2;
|
||||
va_end(args);
|
||||
|
||||
@@ -198,7 +198,6 @@ typedef enum {
|
||||
NAS,
|
||||
PERF,
|
||||
OIP,
|
||||
CLI,
|
||||
MSC,
|
||||
OCM,
|
||||
UDP_,
|
||||
@@ -218,6 +217,8 @@ typedef enum {
|
||||
X2AP,
|
||||
LOADER,
|
||||
ASN,
|
||||
NFAPI_VNF,
|
||||
NFAPI_PNF,
|
||||
MAX_LOG_PREDEF_COMPONENTS,
|
||||
}
|
||||
comp_name_t;
|
||||
@@ -286,6 +287,7 @@ extern "C" {
|
||||
int logInit (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 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, ... );
|
||||
int set_log(int component, 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
|
||||
# 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_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 */
|
||||
# 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 */
|
||||
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
|
||||
|
||||
|
||||
@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
|
||||
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
|
||||
# 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
|
||||
@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE
|
||||
GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
|
||||
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 ####
|
||||
|
||||
+366
-555
File diff suppressed because it is too large
Load Diff
@@ -606,7 +606,7 @@ void vnf_deallocate(void *ptr) {
|
||||
void vnf_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) {
|
||||
va_list args;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,10 +126,10 @@ int netlink_init_tun(void) {
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
// TX PART
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
/* Fill the netlink message header */
|
||||
/* Fill the netlink message header */
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
@@ -140,13 +140,14 @@ int netlink_init_tun(void) {
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
// RX PART
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
} /* for */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define EMU_PROTO_H_
|
||||
|
||||
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,
|
||||
unsigned int next_slot, uint8_t is_master);
|
||||
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
|
||||
|
||||
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_data(void);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
-------------------
|
||||
AUTHOR : Francois TABURET
|
||||
COMPANY : NOKIA BellLabs France
|
||||
EMAIL : francois.taburet@nokia-bell-labs.com
|
||||
EMAIL : francois.taburet@nokia-bell-labs.com
|
||||
|
||||
*/
|
||||
|
||||
@@ -80,8 +80,7 @@ int config_check_band_frequencies( int ind,
|
||||
int16_t band,
|
||||
uint32_t downlink_frequency,
|
||||
int32_t uplink_frequency_offset,
|
||||
uint32_t frame_type)
|
||||
{
|
||||
uint32_t frame_type) {
|
||||
int errors = 0;
|
||||
|
||||
if (band > 0) {
|
||||
@@ -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++) {
|
||||
if (band == eutra_bands[band_index].band) {
|
||||
uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset;
|
||||
|
||||
AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++,
|
||||
"enb %d downlink frequency %u too low (%u) for band %d!",
|
||||
ind, downlink_frequency, eutra_bands[band_index].dl_min, band);
|
||||
AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++,
|
||||
"enb %d downlink frequency %u too high (%u) for band %d!",
|
||||
ind, downlink_frequency, eutra_bands[band_index].dl_max, band);
|
||||
|
||||
AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++,
|
||||
"enb %d uplink frequency %u too low (%u) for band %d!",
|
||||
ind, uplink_frequency, eutra_bands[band_index].ul_min, band);
|
||||
AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++,
|
||||
"enb %d uplink frequency %u too high (%u) for band %d!",
|
||||
ind, uplink_frequency, eutra_bands[band_index].ul_max, band);
|
||||
|
||||
AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++,
|
||||
"enb %d invalid frame type (%d/%d) for band %d!",
|
||||
ind, eutra_bands[band_index].frame_type, frame_type, band);
|
||||
@@ -112,7 +108,6 @@ int config_check_band_frequencies( int ind,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
+111
-142
@@ -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;
|
||||
// int CC_id;
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
|
||||
if (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");
|
||||
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;
|
||||
MessageDef *msg_p;
|
||||
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)//,
|
||||
{
|
||||
/* 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);
|
||||
|
||||
RCconfig_S1(msg_p, enb_id);
|
||||
|
||||
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,"[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);
|
||||
|
||||
register_enb_pending++;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
MessageDef *msg_p;
|
||||
uint32_t register_enb_x2_pending = 0;
|
||||
|
||||
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);
|
||||
|
||||
RCconfig_X2(msg_p, enb_id);
|
||||
|
||||
itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
|
||||
register_enb_x2_pending++;
|
||||
}
|
||||
}
|
||||
@@ -161,9 +144,8 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void *eNB_app_task(void *args_p)
|
||||
{
|
||||
uint32_t enb_nb = RC.nb_inst;
|
||||
void *eNB_app_task(void *args_p) {
|
||||
uint32_t enb_nb = RC.nb_inst;
|
||||
uint32_t enb_id_start = 0;
|
||||
uint32_t enb_id_end = enb_id_start + enb_nb;
|
||||
uint32_t register_enb_pending=0;
|
||||
@@ -178,15 +160,10 @@ void *eNB_app_task(void *args_p)
|
||||
int result;
|
||||
/* for no gcc warnings */
|
||||
(void)instance;
|
||||
|
||||
itti_mark_task_ready (TASK_ENB_APP);
|
||||
|
||||
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
|
||||
|
||||
RCconfig_L1();
|
||||
|
||||
RCconfig_macrlc();
|
||||
|
||||
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");
|
||||
@@ -194,24 +171,22 @@ void *eNB_app_task(void *args_p)
|
||||
AssertFatal (enb_nb <= RC.nb_inst,
|
||||
"Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
|
||||
enb_nb, 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 *));
|
||||
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++) {
|
||||
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);
|
||||
memset((void *)RC.rrc[enb_id],0,sizeof(eNB_RRC_INST));
|
||||
configure_rrc(enb_id);
|
||||
}
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
/* Try to register each eNB */
|
||||
/* Try to register each eNB */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to register each eNB with each other */
|
||||
x2_registered_enb = 0;
|
||||
@@ -220,141 +195,133 @@ void *eNB_app_task(void *args_p)
|
||||
do {
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_ENB_APP, &msg_p);
|
||||
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case TERMINATE_MESSAGE:
|
||||
LOG_W(ENB_APP, " *** Exiting ENB_APP thread\n");
|
||||
itti_exit_task ();
|
||||
break;
|
||||
case TERMINATE_MESSAGE:
|
||||
LOG_W(ENB_APP, " *** Exiting ENB_APP thread\n");
|
||||
itti_exit_task ();
|
||||
break;
|
||||
|
||||
case MESSAGE_TEST:
|
||||
LOG_I(ENB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p));
|
||||
break;
|
||||
case MESSAGE_TEST:
|
||||
LOG_I(ENB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p));
|
||||
break;
|
||||
|
||||
case SOFT_RESTART_MESSAGE:
|
||||
handle_reconfiguration(instance);
|
||||
break;
|
||||
case SOFT_RESTART_MESSAGE:
|
||||
handle_reconfiguration(instance);
|
||||
break;
|
||||
|
||||
case S1AP_REGISTER_ENB_CNF:
|
||||
case S1AP_REGISTER_ENB_CNF:
|
||||
if (EPC_MODE_ENABLED) {
|
||||
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);
|
||||
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);
|
||||
DevAssert(register_enb_pending > 0);
|
||||
register_enb_pending--;
|
||||
|
||||
DevAssert(register_enb_pending > 0);
|
||||
register_enb_pending--;
|
||||
/* Check if at least eNB is registered with one MME */
|
||||
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
|
||||
registered_enb++;
|
||||
}
|
||||
|
||||
/* Check if at least eNB is registered with one MME */
|
||||
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
|
||||
registered_enb++;
|
||||
}
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (register_enb_pending == 0) {
|
||||
if (registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start L2L1 task */
|
||||
MessageDef *msg_init_p;
|
||||
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
} else {
|
||||
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);
|
||||
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (register_enb_pending == 0) {
|
||||
if (registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start L2L1 task */
|
||||
MessageDef *msg_init_p;
|
||||
|
||||
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
|
||||
} else {
|
||||
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);
|
||||
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
NULL, &enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
|
||||
|
||||
sleep(ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
NULL, &enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
|
||||
sleep(ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case S1AP_DEREGISTERED_ENB_IND:
|
||||
if (EPC_MODE_ENABLED) {
|
||||
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);
|
||||
case S1AP_DEREGISTERED_ENB_IND:
|
||||
if (EPC_MODE_ENABLED) {
|
||||
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);
|
||||
/* TODO handle recovering of registration */
|
||||
}
|
||||
|
||||
/* TODO handle recovering of registration */
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
case TIMER_HAS_EXPIRED:
|
||||
if (EPC_MODE_ENABLED) {
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", ITTI_MSG_NAME (msg_p), TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == x2_enb_register_retry_timer_id) {
|
||||
/* Restart the registration process */
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
break;
|
||||
|
||||
case X2AP_DEREGISTERED_ENB_IND:
|
||||
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);
|
||||
|
||||
/* TODO handle recovering of registration */
|
||||
break;
|
||||
|
||||
case X2AP_REGISTER_ENB_CNF:
|
||||
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);
|
||||
|
||||
DevAssert(x2_register_enb_pending > 0);
|
||||
x2_register_enb_pending--;
|
||||
|
||||
/* Check if at least eNB is registered with one target eNB */
|
||||
if (X2AP_REGISTER_ENB_CNF(msg_p).nb_x2 > 0) {
|
||||
x2_registered_enb++;
|
||||
}
|
||||
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (x2_register_enb_pending == 0) {
|
||||
if (x2_registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start RRC HO task */
|
||||
|
||||
}else {
|
||||
uint32_t x2_not_associated = enb_nb - x2_registered_enb;
|
||||
|
||||
LOG_W(ENB_APP, " %d eNB %s not associated with the target\n",
|
||||
x2_not_associated, x2_not_associated > 1 ? "are" : "is");
|
||||
// timer to retry
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (X2AP_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP,
|
||||
INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL,
|
||||
&x2_enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB X2AP register: retry timer, use \"sleep\" instead!\n");
|
||||
|
||||
sleep(X2AP_ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
|
||||
break;
|
||||
|
||||
case X2AP_DEREGISTERED_ENB_IND:
|
||||
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);
|
||||
/* TODO handle recovering of registration */
|
||||
break;
|
||||
|
||||
case X2AP_REGISTER_ENB_CNF:
|
||||
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);
|
||||
DevAssert(x2_register_enb_pending > 0);
|
||||
x2_register_enb_pending--;
|
||||
|
||||
/* Check if at least eNB is registered with one target eNB */
|
||||
if (X2AP_REGISTER_ENB_CNF(msg_p).nb_x2 > 0) {
|
||||
x2_registered_enb++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (x2_register_enb_pending == 0) {
|
||||
if (x2_registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start RRC HO task */
|
||||
} else {
|
||||
uint32_t x2_not_associated = enb_nb - x2_registered_enb;
|
||||
LOG_W(ENB_APP, " %d eNB %s not associated with the target\n",
|
||||
x2_not_associated, x2_not_associated > 1 ? "are" : "is");
|
||||
|
||||
default:
|
||||
LOG_E(ENB_APP, "Received unexpected message %s\n", ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
// timer to retry
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (X2AP_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP,
|
||||
INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL,
|
||||
&x2_enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB X2AP register: retry timer, use \"sleep\" instead!\n");
|
||||
sleep(X2AP_ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(ENB_APP, "Received unexpected message %s\n", ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
}
|
||||
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
@@ -364,12 +331,10 @@ void *eNB_app_task(void *args_p)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void handle_reconfiguration(module_id_t mod_id)
|
||||
{
|
||||
void handle_reconfiguration(module_id_t mod_id) {
|
||||
struct timespec start, end;
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
flexran_agent_info_t *flexran = RC.flexran[mod_id];
|
||||
|
||||
LOG_I(ENB_APP, "lte-softmodem soft-restart requested\n");
|
||||
|
||||
if (ENB_WAIT == flexran->node_ctrl_state) {
|
||||
@@ -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);
|
||||
pthread_mutex_lock(&flexran->mutex_node_ctrl);
|
||||
flexran->node_ctrl_state = ENB_WAIT;
|
||||
|
||||
while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
|
||||
pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
|
||||
|
||||
pthread_mutex_unlock(&flexran->mutex_node_ctrl);
|
||||
}
|
||||
|
||||
@@ -405,11 +372,13 @@ void handle_reconfiguration(module_id_t mod_id)
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &end);
|
||||
end.tv_sec -= start.tv_sec;
|
||||
|
||||
if (end.tv_nsec >= start.tv_nsec) {
|
||||
end.tv_nsec -= start.tv_nsec;
|
||||
} else {
|
||||
end.tv_sec -= 1;
|
||||
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);
|
||||
}
|
||||
|
||||
+781
-883
File diff suppressed because it is too large
Load Diff
@@ -45,110 +45,89 @@
|
||||
#include "common/ran_context.h"
|
||||
extern FILL_UL_INFO_MUTEX_t fill_ul_mutex;
|
||||
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
|
||||
{
|
||||
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
|
||||
module_idP, frameP, eNB_index);
|
||||
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",
|
||||
module_idP, frameP, eNB_index);
|
||||
|
||||
|
||||
if (first_sync == 1 && !(EPC_MODE_ENABLED)) {
|
||||
//layer2_init_UE(module_idP);
|
||||
openair_rrc_ue_init(module_idP, eNB_index);
|
||||
} else {
|
||||
rrc_in_sync_ind(module_idP, frameP, eNB_index);
|
||||
}
|
||||
if (first_sync == 1 && !(EPC_MODE_ENABLED)) {
|
||||
//layer2_init_UE(module_idP);
|
||||
openair_rrc_ue_init(module_idP, eNB_index);
|
||||
} else {
|
||||
rrc_in_sync_ind(module_idP, frameP, eNB_index);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
|
||||
uint16_t eNB_index)
|
||||
{
|
||||
|
||||
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
|
||||
uint16_t eNB_index) {
|
||||
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
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;
|
||||
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
|
||||
|
||||
int i;
|
||||
if (NB_UE_INST > 0) {
|
||||
UE_mac_inst =
|
||||
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
AssertFatal(UE_mac_inst != NULL,
|
||||
"[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,
|
||||
sizeof(UE_MAC_INST));
|
||||
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);
|
||||
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
|
||||
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 0) {
|
||||
UE_mac_inst =
|
||||
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
|
||||
AssertFatal(UE_mac_inst != NULL,
|
||||
"[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,
|
||||
sizeof(UE_MAC_INST));
|
||||
|
||||
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);
|
||||
|
||||
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
|
||||
for (i = 0; i < NB_UE_INST; i++) {
|
||||
ue_init_mac(i);
|
||||
}
|
||||
} else {
|
||||
UE_mac_inst = NULL;
|
||||
for (i = 0; i < NB_UE_INST; i++) {
|
||||
ue_init_mac(i);
|
||||
}
|
||||
} else {
|
||||
UE_mac_inst = NULL;
|
||||
}
|
||||
|
||||
// mutex below are used for multiple UE's L2 FAPI simulation.
|
||||
if (nfapi_mode == 3){
|
||||
pthread_mutex_init(&fill_ul_mutex.rx_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.harq_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.cqi_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.rach_mutex,NULL);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "[MAIN] calling RRC\n");
|
||||
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
|
||||
HO_active);
|
||||
|
||||
|
||||
LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
|
||||
|
||||
return (0);
|
||||
// mutex below are used for multiple UE's L2 FAPI simulation.
|
||||
if (nfapi_mode == 3) {
|
||||
pthread_mutex_init(&fill_ul_mutex.rx_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.harq_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.cqi_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.rach_mutex,NULL);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "[MAIN] calling RRC\n");
|
||||
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
|
||||
HO_active);
|
||||
LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
|
||||
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");
|
||||
|
||||
if (rlc_module_init() != 0) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n");
|
||||
|
||||
if (rlc_module_init() != 0) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
pdcp_layer_init();
|
||||
|
||||
LOG_I(MAC, "[MAIN] Init Global Param Done\n");
|
||||
|
||||
return 0;
|
||||
pdcp_layer_init();
|
||||
LOG_I(MAC, "[MAIN] Init Global Param Done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,
|
||||
uint8_t HO_active)
|
||||
{
|
||||
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
|
||||
// NB_NODE=2;
|
||||
// NB_INST=2;
|
||||
|
||||
rlcmac_init_global_param_ue();
|
||||
LOG_I(MAC, "[MAIN] init UE MAC functions \n");
|
||||
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
|
||||
return (1);
|
||||
uint8_t HO_active) {
|
||||
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
|
||||
// NB_NODE=2;
|
||||
// NB_INST=2;
|
||||
rlcmac_init_global_param_ue();
|
||||
LOG_I(MAC, "[MAIN] init UE MAC functions \n");
|
||||
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
@@ -179,13 +179,14 @@ boolean_t pdcp_data_req(
|
||||
|
||||
if (pdcp_pdu_p != NULL) {
|
||||
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
|
||||
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
|
||||
rlc_util_print_hex_octets(PDCP,
|
||||
(unsigned char *)&pdcp_pdu_p->data[0],
|
||||
sdu_buffer_sizeP);
|
||||
|
||||
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
|
||||
,NULL, NULL
|
||||
);
|
||||
@@ -336,10 +337,10 @@ boolean_t pdcp_data_req(
|
||||
}
|
||||
|
||||
LOG_E(PDCP, "[FRAME %5u][%s][PDCP][MOD %u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
ctxt_pP->frame,
|
||||
(ctxt_pP->enb_flag) ? "eNB" : "UE",
|
||||
ctxt_pP->module_id,
|
||||
rb_idP);
|
||||
ctxt_pP->frame,
|
||||
(ctxt_pP->enb_flag) ? "eNB" : "UE",
|
||||
ctxt_pP->module_id,
|
||||
rb_idP);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -442,7 +443,6 @@ pdcp_data_ind(
|
||||
uint8_t oo_flag=0;
|
||||
MessageDef *message_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);
|
||||
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);
|
||||
@@ -473,7 +473,7 @@ pdcp_data_ind(
|
||||
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",
|
||||
ctxt_pP->rnti,
|
||||
ctxt_pP->module_id ,
|
||||
ctxt_pP->module_id,
|
||||
rb_idP,
|
||||
sdu_buffer_sizeP,
|
||||
ctxt_pP->enb_flag);
|
||||
@@ -701,29 +701,28 @@ pdcp_data_ind(
|
||||
if (LINK_ENB_PDCP_TO_GTPV1U) {
|
||||
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
|
||||
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY");
|
||||
memcpy(>pu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], &sdu_buffer_pP->data[payload_offset], sdu_buffer_sizeP - payload_offset);
|
||||
message_p = itti_alloc_new_message(TASK_PDCP_ENB, GTPV1U_ENB_TUNNEL_DATA_REQ);
|
||||
AssertFatal(message_p != NULL, "OUT OF MEMORY");
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).length = sdu_buffer_sizeP - payload_offset;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
}
|
||||
|
||||
} else {
|
||||
packet_forwarded = FALSE;
|
||||
}
|
||||
@@ -762,23 +761,26 @@ pdcp_data_ind(
|
||||
// set ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst for IP layer here
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
/* for the UE compiled in S1 mode, we need 1 here
|
||||
* for the UE compiled in noS1 mode, we need 0
|
||||
* TODO: be sure of this
|
||||
*/
|
||||
/* for the UE compiled in S1 mode, we need 1 here
|
||||
* for the UE compiled in noS1 mode, we need 0
|
||||
* TODO: be sure of this
|
||||
*/
|
||||
if (nfapi_mode == 3) {
|
||||
#ifdef UESIM_EXPANSION
|
||||
|
||||
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 {
|
||||
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 0;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 0;
|
||||
}
|
||||
|
||||
#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
|
||||
} else {
|
||||
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -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_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]++;
|
||||
} else {
|
||||
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_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;
|
||||
@@ -1129,7 +1132,6 @@ rrc_pdcp_config_asn1_req (
|
||||
int i,j;
|
||||
LTE_MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_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",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
__FUNCTION__,
|
||||
@@ -1419,7 +1421,6 @@ rrc_pdcp_config_asn1_req (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (pmch_InfoList_r9_pP != NULL) {
|
||||
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);
|
||||
@@ -1893,6 +1894,7 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
netlink_init();
|
||||
}
|
||||
}
|
||||
|
||||
return pdcp_params.optmask ;
|
||||
}
|
||||
|
||||
@@ -1937,7 +1939,6 @@ void pdcp_layer_init(void)
|
||||
int i,j;
|
||||
mbms_session_id_t session_id;
|
||||
mbms_service_id_t service_id;
|
||||
|
||||
/*
|
||||
* Initialize SDU list
|
||||
*/
|
||||
@@ -1946,7 +1947,6 @@ void pdcp_layer_init(void)
|
||||
AssertFatal(pdcp_coll_p != NULL, "UNRECOVERABLE error, PDCP hashtable_create failed");
|
||||
|
||||
for (instance = 0; instance < MAX_MOBILES_PER_ENB; instance++) {
|
||||
|
||||
for (service_id = 0; service_id < LTE_maxServiceCount; service_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));
|
||||
|
||||
+101
-101
@@ -26,7 +26,7 @@
|
||||
* \version 1.0
|
||||
*/
|
||||
|
||||
/** @defgroup _pdcp PDCP
|
||||
/** @defgroup _pdcp PDCP
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
@@ -35,8 +35,8 @@
|
||||
# define __PDCP_H__
|
||||
//-----------------------------------------------------------------------------
|
||||
#ifndef NON_ACCESS_STRATUM
|
||||
#include "UTIL/MEM/mem_block.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
#include "UTIL/MEM/mem_block.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
#endif //NON_ACCESS_STRATUM
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
@@ -47,8 +47,8 @@
|
||||
#include "LTE_SRB-ToAddMod.h"
|
||||
#include "LTE_SRB-ToAddModList.h"
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
#include "LTE_MBMS-SessionInfoList-r9.h"
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#include "LTE_MBMS-SessionInfoList-r9.h"
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#endif
|
||||
|
||||
#define PDCP_USE_NETLINK_BIT (1<< 11)
|
||||
@@ -74,8 +74,8 @@ extern int pdcp_instance_cnt;
|
||||
#define PROTOCOL_PDCP_CTXT_FMT PROTOCOL_CTXT_FMT"[%s %02u] "
|
||||
|
||||
#define PROTOCOL_PDCP_CTXT_ARGS(CTXT_Pp, pDCP_Pp) PROTOCOL_CTXT_ARGS(CTXT_Pp),\
|
||||
(pDCP_Pp->is_srb) ? "SRB" : "DRB",\
|
||||
pDCP_Pp->rb_id
|
||||
(pDCP_Pp->is_srb) ? "SRB" : "DRB",\
|
||||
pDCP_Pp->rb_id
|
||||
int init_pdcp_thread(void);
|
||||
void cleanup_pdcp_thread(void);
|
||||
|
||||
@@ -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_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*/
|
||||
@@ -119,12 +119,12 @@ typedef struct pdcp_enb_s {
|
||||
uint16_t uid[MAX_MOBILES_PER_ENB];
|
||||
rnti_t rnti[MAX_MOBILES_PER_ENB];
|
||||
uint16_t num_ues;
|
||||
|
||||
|
||||
uint64_t sfn;
|
||||
frame_t frame;
|
||||
sub_frame_t subframe;
|
||||
|
||||
} pdcp_enb_t;
|
||||
|
||||
} pdcp_enb_t;
|
||||
|
||||
pdcp_enb_t pdcp_enb[MAX_NUM_CCs];
|
||||
|
||||
@@ -149,7 +149,7 @@ typedef struct pdcp_s {
|
||||
boolean_t is_ue;
|
||||
boolean_t is_srb;
|
||||
|
||||
/* Configured security algorithms */
|
||||
/* Configured security algorithms */
|
||||
uint8_t cipheringAlgorithm;
|
||||
uint8_t integrityProtAlgorithm;
|
||||
|
||||
@@ -237,19 +237,19 @@ typedef struct pdcp_mbms_s {
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
boolean_t pdcp_data_req(
|
||||
protocol_ctxt_t* ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP, \
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char* const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode
|
||||
protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP, \
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,const uint32_t * const sourceL2Id
|
||||
,const uint32_t * const destinationL2Id
|
||||
,const uint32_t *const sourceL2Id
|
||||
,const uint32_t *const destinationL2Id
|
||||
#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)
|
||||
* \brief This functions handles data transfer indications coming from RLC
|
||||
@@ -265,12 +265,12 @@ boolean_t pdcp_data_req(
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
boolean_t pdcp_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
mem_block_t* const sdu_buffer);
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
mem_block_t *const sdu_buffer);
|
||||
|
||||
/*! \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
|
||||
@@ -283,11 +283,11 @@ boolean_t pdcp_data_ind(
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
void rrc_pdcp_config_req (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint32_t actionP,
|
||||
const rb_id_t rb_idP,
|
||||
const uint8_t security_modeP);
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint32_t actionP,
|
||||
const rb_id_t rb_idP,
|
||||
const uint8_t security_modeP);
|
||||
|
||||
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
|
||||
* \brief Function for RRC to configure a Radio Bearer.
|
||||
@@ -304,19 +304,19 @@ void rrc_pdcp_config_req (
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
boolean_t rrc_pdcp_config_asn1_req (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
LTE_SRB_ToAddModList_t *const srb2add_list,
|
||||
LTE_DRB_ToAddModList_t *const drb2add_list,
|
||||
LTE_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
LTE_SRB_ToAddModList_t *const srb2add_list,
|
||||
LTE_DRB_ToAddModList_t *const drb2add_list,
|
||||
LTE_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
#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)
|
||||
* \brief Function for RRC to configure a Radio Bearer.
|
||||
@@ -339,36 +339,36 @@ boolean_t rrc_pdcp_config_asn1_req (
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
boolean_t pdcp_config_req_asn1 (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rlc_mode_t rlc_mode,
|
||||
const uint32_t action,
|
||||
const uint16_t lc_id,
|
||||
const uint16_t mch_id,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t rb_sn,
|
||||
const uint8_t rb_report,
|
||||
const uint16_t header_compression_profile,
|
||||
const uint8_t security_mode,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc);
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rlc_mode_t rlc_mode,
|
||||
const uint32_t action,
|
||||
const uint16_t lc_id,
|
||||
const uint16_t mch_id,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t rb_sn,
|
||||
const uint8_t rb_report,
|
||||
const uint16_t header_compression_profile,
|
||||
const uint8_t security_mode,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc);
|
||||
|
||||
/*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP)
|
||||
* \brief Function (for RRC) to add a new UE in PDCP module
|
||||
* \param[in] ctxt_pP Running context.
|
||||
* \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)
|
||||
* \brief Function for RRC to remove UE from PDCP module hashtable
|
||||
* \brief Function for RRC to remove UE from PDCP module hashtable
|
||||
* \param[in] ctxt_pP Running context.
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
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)
|
||||
* \brief This functions is unused
|
||||
@@ -388,7 +388,7 @@ boolean_t pdcp_remove_UE(
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
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);
|
||||
void pdcp_module_cleanup (void);
|
||||
void pdcp_layer_init (void);
|
||||
@@ -396,10 +396,10 @@ void pdcp_layer_cleanup (void);
|
||||
#define PDCP2NW_DRIVER_FIFO 21
|
||||
#define NW_DRIVER2PDCP_FIFO 22
|
||||
|
||||
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 ( const protocol_ctxt_t* const ctxt_pP);
|
||||
void pdcp_fifo_read_input_sdus_from_otg ( 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 ( const protocol_ctxt_t *const ctxt_pP);
|
||||
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -448,26 +448,26 @@ struct sockaddr_in pdcp_sin;
|
||||
void pdcp_pc5_socket_init(void);
|
||||
|
||||
typedef struct {
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t traffic_type;
|
||||
uint32_t sourceL2Id;
|
||||
uint32_t destinationL2Id;
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t traffic_type;
|
||||
uint32_t sourceL2Id;
|
||||
uint32_t destinationL2Id;
|
||||
} __attribute__((__packed__)) pc5s_header_t;
|
||||
|
||||
//new PC5S-message
|
||||
typedef struct {
|
||||
unsigned char bytes[PC5_SIGNALLING_PAYLOAD_SIZE];
|
||||
unsigned char bytes[PC5_SIGNALLING_PAYLOAD_SIZE];
|
||||
} __attribute__((__packed__)) PC5SignallingMessage ;
|
||||
|
||||
//example of PC5-S messages
|
||||
typedef struct {
|
||||
pc5s_header_t pc5s_header;
|
||||
union {
|
||||
uint8_t status;
|
||||
PC5SignallingMessage pc5_signalling_message;
|
||||
} pc5sPrimitive;
|
||||
pc5s_header_t pc5s_header;
|
||||
union {
|
||||
uint8_t status;
|
||||
PC5SignallingMessage pc5_signalling_message;
|
||||
} pc5sPrimitive;
|
||||
} __attribute__((__packed__)) sidelink_pc5s_element;
|
||||
|
||||
|
||||
@@ -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
|
||||
unsigned int pdcp_eNB_UE_instance_to_rnti_index;
|
||||
#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_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_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
|
||||
#endif
|
||||
sdu_size_t pdcp_output_sdu_bytes_to_write;
|
||||
sdu_size_t pdcp_output_header_bytes_to_write;
|
||||
@@ -520,33 +520,33 @@ sdu_size_t pdcp_input_sdu_size_read;
|
||||
sdu_size_t pdcp_input_sdu_remaining_size_to_read;
|
||||
|
||||
#define PDCP_COLL_KEY_VALUE(mODULE_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(rB_iD)) << 25) | \
|
||||
(((hash_key_t)(iS_sRB)) << 33) | \
|
||||
(((hash_key_t)(0x55)) << 34))
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(rB_iD)) << 25) | \
|
||||
(((hash_key_t)(iS_sRB)) << 33) | \
|
||||
(((hash_key_t)(0x55)) << 34))
|
||||
|
||||
// hash key to the same PDCP as indexed by PDCP_COLL_KEY_VALUE(... rB_iD, iS_sRB=0) where rB_iD
|
||||
// is the default DRB ID. The hidden code 0x55 indicates the key is indexed by (rB_iD,is_sRB)
|
||||
// whereas the hidden code 0xaa indicates the key is for default DRB only
|
||||
#define PDCP_COLL_KEY_DEFAULT_DRB_VALUE(mODULE_iD, rNTI, iS_eNB) \
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(0xff)) << 25) | \
|
||||
(((hash_key_t)(0x00)) << 33) | \
|
||||
(((hash_key_t)(0xaa)) << 34))
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(0xff)) << 25) | \
|
||||
(((hash_key_t)(0x00)) << 33) | \
|
||||
(((hash_key_t)(0xaa)) << 34))
|
||||
|
||||
// service id max val is maxServiceCount = 16 (asn1_constants.h)
|
||||
|
||||
#define PDCP_COLL_KEY_MBMS_VALUE(mODULE_iD, rNTI, iS_eNB, sERVICE_ID, sESSION_ID) \
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(sERVICE_ID)) << 32) | \
|
||||
(((hash_key_t)(sESSION_ID)) << 37) | \
|
||||
(((hash_key_t)(0x0000000000000001)) << 63))
|
||||
((hash_key_t)mODULE_iD | \
|
||||
(((hash_key_t)(rNTI)) << 8) | \
|
||||
(((hash_key_t)(iS_eNB)) << 24) | \
|
||||
(((hash_key_t)(sERVICE_ID)) << 32) | \
|
||||
(((hash_key_t)(sESSION_ID)) << 37) | \
|
||||
(((hash_key_t)(0x0000000000000001)) << 63))
|
||||
|
||||
extern hash_table_t *pdcp_coll_p;
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ extern struct msghdr nas_msg_rx;
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
#ifdef UESIM_EXPANSION
|
||||
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
|
||||
extern Packet_OTG_List_t *otg_pdcp_buffer;
|
||||
@@ -175,7 +175,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL, 0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt.instance, rab_id, rab_id, len);
|
||||
pdcp_data_req(&ctxt, SRB_FLAG_NO, rab_id, RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO, len, (unsigned char *)nl_rx_buf,
|
||||
@@ -207,43 +207,43 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
|
||||
hashtable_rc_t h_rc;
|
||||
struct pdcp_netlink_element_s *data_p = NULL;
|
||||
/* avoid gcc warnings */
|
||||
/* avoid gcc warnings */
|
||||
(void)data_p;
|
||||
module_id_t ue_id = 0;
|
||||
pdcp_t *pdcp_p = NULL;
|
||||
//TTN for D2D (PC5S)
|
||||
//TTN for D2D (PC5S)
|
||||
int prose_addr_len;
|
||||
char send_buf[BUFSIZE], receive_buf[BUFSIZE];
|
||||
//int optval;
|
||||
//int optval;
|
||||
int bytes_received;
|
||||
sidelink_pc5s_element *sl_pc5s_msg_recv = NULL;
|
||||
sidelink_pc5s_element *sl_pc5s_msg_send = NULL;
|
||||
//uint32_t sourceL2Id;
|
||||
//uint32_t groupL2Id;
|
||||
//module_id_t module_id = 0;
|
||||
//uint32_t sourceL2Id;
|
||||
//uint32_t groupL2Id;
|
||||
//module_id_t module_id = 0;
|
||||
pc5s_header_t *pc5s_header;
|
||||
static unsigned char pdcp_read_state_g =0;
|
||||
int len = 1;
|
||||
int msg_len;
|
||||
rb_id_t rab_id = 0;
|
||||
int rlc_data_req_flag = 3;
|
||||
//TTN for D2D (PC5S)
|
||||
//TTN for D2D (PC5S)
|
||||
prose_addr_len = sizeof(prose_pdcp_addr);
|
||||
// receive a message from ProSe App
|
||||
// receive a message from ProSe App
|
||||
memset(receive_buf, 0, BUFSIZE);
|
||||
bytes_received = recvfrom(pdcp_pc5_sockfd, receive_buf, BUFSIZE, 0,
|
||||
(struct sockaddr *) &prose_pdcp_addr, (socklen_t *)&prose_addr_len);
|
||||
(struct sockaddr *) &prose_pdcp_addr, (socklen_t *)&prose_addr_len);
|
||||
|
||||
// if (bytes_received < 0){
|
||||
// LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n");
|
||||
// exit(EXIT_FAILURE);
|
||||
// }
|
||||
// if (bytes_received < 0){
|
||||
// LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n");
|
||||
// exit(EXIT_FAILURE);
|
||||
// }
|
||||
if (bytes_received > 0) {
|
||||
pc5s_header = calloc(1, sizeof(pc5s_header_t));
|
||||
memcpy((void *)pc5s_header, (void *)receive_buf, sizeof(pc5s_header_t));
|
||||
|
||||
if (pc5s_header->traffic_type == TRAFFIC_PC5S_SESSION_INIT) {
|
||||
//send reply to ProSe app
|
||||
//send reply to ProSe app
|
||||
LOG_D(PDCP,"Received a request to open PDCP socket and establish a new PDCP session ... send response to ProSe App \n");
|
||||
memset(send_buf, 0, BUFSIZE);
|
||||
sl_pc5s_msg_send = calloc(1, sizeof(sidelink_pc5s_element));
|
||||
@@ -259,17 +259,15 @@ 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
|
||||
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, 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, 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,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id);
|
||||
|
||||
#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
|
||||
if (pc5s_header->inst < oai_emulation.info.nb_enb_local) {
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ENB_FLAG_YES;
|
||||
@@ -286,13 +284,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
|
||||
CHECK_CTXT_ARGS(&ctxt);
|
||||
AssertFatal (rab_id < LTE_maxDRB, "RB id is too high (%u/%d)!\n", rab_id, LTE_maxDRB);
|
||||
/*LGpdcp_read_header.inst = (pc5s_header.inst >= oai_emulation.info.nb_enb_local) ? \
|
||||
pc5s_header.inst - oai_emulation.info.nb_enb_local+ NB_eNB_INST + oai_emulation.info.first_ue_local :
|
||||
pc5s_header.inst + oai_emulation.info.first_enb_local;*/
|
||||
/*LGpdcp_read_header.inst = (pc5s_header.inst >= oai_emulation.info.nb_enb_local) ? \
|
||||
pc5s_header.inst - oai_emulation.info.nb_enb_local+ NB_eNB_INST + oai_emulation.info.first_ue_local :
|
||||
pc5s_header.inst + oai_emulation.info.first_enb_local;*/
|
||||
#else // OAI_EMU
|
||||
/* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
|
||||
// pc5s_header.inst = 0;
|
||||
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
|
||||
/* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
|
||||
// pc5s_header.inst = 0;
|
||||
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ctxt_cpy.enb_flag;
|
||||
LOG_I(PDCP, "[PDCP] pc5s_header->rb_id = %d\n", pc5s_header->rb_id);
|
||||
@@ -309,7 +307,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
|
||||
#endif
|
||||
|
||||
//UE
|
||||
//UE
|
||||
if (!ctxt.enb_flag) {
|
||||
if (rab_id != 0) {
|
||||
if (rab_id == UE_IP_DEFAULT_RAB_ID) {
|
||||
@@ -331,34 +329,89 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
rab_id = pdcp_p->rb_id;
|
||||
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %d \n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
bytes_received,
|
||||
pc5s_header->rb_id);
|
||||
LOG_I(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
|
||||
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %d \n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
bytes_received,
|
||||
pc5s_header->rb_id);
|
||||
LOG_I(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
pc5s_header->data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
rab_id,
|
||||
pc5s_header->data_size);
|
||||
pdcp_data_req(
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pc5s_header->data_size,
|
||||
(unsigned char *)receive_buf,
|
||||
PDCP_TRANSMISSION_MODE_DATA,
|
||||
&pc5s_header->sourceL2Id,
|
||||
&pc5s_header->destinationL2Id
|
||||
);
|
||||
} else {
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(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,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
rab_id,
|
||||
pc5s_header->data_size);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
pc5s_header->data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id,
|
||||
key);
|
||||
}
|
||||
} else { //if (rab_id == 0)
|
||||
LOG_D(PDCP, "Forcing send on DEFAULT_RAB_ID\n");
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB DEFAULT_RAB_ID %u]\n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
pc5s_header->data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
DEFAULT_RAB_ID);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
rab_id,
|
||||
DEFAULT_RAB_ID,
|
||||
pc5s_header->data_size);
|
||||
pdcp_data_req(
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pc5s_header->data_size,
|
||||
@@ -367,293 +420,305 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
&pc5s_header->sourceL2Id,
|
||||
&pc5s_header->destinationL2Id
|
||||
);
|
||||
} else {
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(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,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
rab_id,
|
||||
pc5s_header->data_size);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
pc5s_header->data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id,
|
||||
key);
|
||||
}
|
||||
} else { //if (rab_id == 0)
|
||||
LOG_D(PDCP, "Forcing send on DEFAULT_RAB_ID\n");
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB DEFAULT_RAB_ID %u]\n",
|
||||
ctxt.frame,
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
pc5s_header->data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
DEFAULT_RAB_ID);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
DEFAULT_RAB_ID,
|
||||
pc5s_header->data_size);
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pc5s_header->data_size,
|
||||
(unsigned char *)receive_buf,
|
||||
PDCP_TRANSMISSION_MODE_DATA,
|
||||
&pc5s_header->sourceL2Id,
|
||||
&pc5s_header->destinationL2Id
|
||||
);
|
||||
}
|
||||
|
||||
free (sl_pc5s_msg_recv);
|
||||
free (sl_pc5s_msg_send);
|
||||
}
|
||||
|
||||
free (sl_pc5s_msg_recv);
|
||||
free (sl_pc5s_msg_send);
|
||||
}
|
||||
}
|
||||
|
||||
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_BUFFER, 1 );
|
||||
len = recvmsg(nas_sock_fd[0], &nas_msg_rx, 0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 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_BUFFER, 1 );
|
||||
len = recvmsg(nas_sock_fd[0], &nas_msg_rx, 0);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 0 );
|
||||
if (len<=0) {
|
||||
// nothing in pdcp NAS socket
|
||||
//LOG_D(PDCP, "[PDCP][NETLINK] Nothing in socket, length %d \n", len);
|
||||
} else {
|
||||
msg_len = len;
|
||||
|
||||
if (len<=0) {
|
||||
// nothing in pdcp NAS socket
|
||||
//LOG_D(PDCP, "[PDCP][NETLINK] Nothing in socket, length %d \n", len);
|
||||
} else {
|
||||
msg_len = len;
|
||||
|
||||
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
|
||||
NLMSG_OK (nas_nlh_rx, msg_len);
|
||||
nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, msg_len)) {
|
||||
if (nas_nlh_rx->nlmsg_type == NLMSG_DONE) {
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_DONE\n");
|
||||
//return;
|
||||
}
|
||||
|
||||
if (nas_nlh_rx->nlmsg_type == NLMSG_ERROR) {
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_ERROR\n");
|
||||
}
|
||||
|
||||
if (pdcp_read_state_g == 0) {
|
||||
if (nas_nlh_rx->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
|
||||
pdcp_read_state_g = 1; //get
|
||||
memcpy((void *)&pdcp_read_header_g, (void *)NLMSG_DATA(nas_nlh_rx), sizeof(pdcp_data_req_header_t));
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] RX pdcp_data_req_header_t inst %u, rb_id %u data_size %d, source L2Id 0x%08x, destination L2Id 0x%08x\n",
|
||||
pdcp_read_header_g.inst, pdcp_read_header_g.rb_id, pdcp_read_header_g.data_size,pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id );
|
||||
} else {
|
||||
LOG_E(PDCP, "[PDCP][NETLINK] WRONG size %d should be sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)\n",
|
||||
nas_nlh_rx->nlmsg_len);
|
||||
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
|
||||
NLMSG_OK (nas_nlh_rx, msg_len);
|
||||
nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, msg_len)) {
|
||||
if (nas_nlh_rx->nlmsg_type == NLMSG_DONE) {
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_DONE\n");
|
||||
//return;
|
||||
}
|
||||
} else {
|
||||
pdcp_read_state_g = 0;
|
||||
// print_active_requests()
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %zu\n",
|
||||
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
|
||||
|
||||
if (nas_nlh_rx->nlmsg_type == NLMSG_ERROR) {
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_ERROR\n");
|
||||
}
|
||||
|
||||
if (pdcp_read_state_g == 0) {
|
||||
if (nas_nlh_rx->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
|
||||
pdcp_read_state_g = 1; //get
|
||||
memcpy((void *)&pdcp_read_header_g, (void *)NLMSG_DATA(nas_nlh_rx), sizeof(pdcp_data_req_header_t));
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] RX pdcp_data_req_header_t inst %u, rb_id %u data_size %d, source L2Id 0x%08x, destination L2Id 0x%08x\n",
|
||||
pdcp_read_header_g.inst, pdcp_read_header_g.rb_id, pdcp_read_header_g.data_size,pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id );
|
||||
} else {
|
||||
LOG_E(PDCP, "[PDCP][NETLINK] WRONG size %d should be sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)\n",
|
||||
nas_nlh_rx->nlmsg_len);
|
||||
}
|
||||
} else {
|
||||
pdcp_read_state_g = 0;
|
||||
// print_active_requests()
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %zu\n",
|
||||
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
|
||||
#ifdef OAI_EMU
|
||||
|
||||
// overwrite function input parameters, because only one netlink socket for all instances
|
||||
if (pdcp_read_header_g.inst < oai_emulation.info.nb_enb_local) {
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ENB_FLAG_YES;
|
||||
ctxt.module_id = pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;
|
||||
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id ][pdcp_read_header_g.rb_id / LTE_maxDRB + oai_emulation.info.first_ue_local];
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
} else {
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ENB_FLAG_NO;
|
||||
ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local;
|
||||
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
}
|
||||
|
||||
CHECK_CTXT_ARGS(&ctxt);
|
||||
AssertFatal (rab_id < LTE_maxDRB, "RB id is too high (%u/%d)!\n", rab_id, LTE_maxDRB);
|
||||
#else // OAI_EMU
|
||||
/* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
|
||||
// pdcp_read_header_g.inst = 0;
|
||||
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
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,
|
||||
pdcp_read_header_g.destinationL2Id);
|
||||
|
||||
if (ctxt_cpy.enb_flag) {
|
||||
ctxt.module_id = 0;
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
ctxt.rnti = pdcp_eNB_UE_instance_to_rnti[pdcp_read_header_g.rb_id / LTE_maxDRB];
|
||||
} else {
|
||||
if (nfapi_mode == 3) {
|
||||
#ifdef UESIM_EXPANSION
|
||||
ctxt.module_id = inst_pdcp_list[pdcp_read_header_g.inst];
|
||||
#else
|
||||
ctxt.module_id = pdcp_read_header_g.inst;
|
||||
#endif
|
||||
// overwrite function input parameters, because only one netlink socket for all instances
|
||||
if (pdcp_read_header_g.inst < oai_emulation.info.nb_enb_local) {
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ENB_FLAG_YES;
|
||||
ctxt.module_id = pdcp_read_header_g.inst + oai_emulation.info.first_enb_local;
|
||||
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id ][pdcp_read_header_g.rb_id / LTE_maxDRB + oai_emulation.info.first_ue_local];
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
} else {
|
||||
ctxt.module_id = 0;
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
ctxt.enb_flag = ENB_FLAG_NO;
|
||||
ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local;
|
||||
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
}
|
||||
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
|
||||
}
|
||||
CHECK_CTXT_ARGS(&ctxt);
|
||||
AssertFatal (rab_id < LTE_maxDRB, "RB id is too high (%u/%d)!\n", rab_id, LTE_maxDRB);
|
||||
#else // OAI_EMU
|
||||
/* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
|
||||
// pdcp_read_header_g.inst = 0;
|
||||
//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
|
||||
ctxt.frame = ctxt_cpy.frame;
|
||||
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,
|
||||
pdcp_read_header_g.destinationL2Id);
|
||||
|
||||
if (ctxt_cpy.enb_flag) {
|
||||
ctxt.module_id = 0;
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
ctxt.rnti = pdcp_eNB_UE_instance_to_rnti[pdcp_read_header_g.rb_id / LTE_maxDRB];
|
||||
} else {
|
||||
if (nfapi_mode == 3) {
|
||||
#ifdef UESIM_EXPANSION
|
||||
ctxt.module_id = inst_pdcp_list[pdcp_read_header_g.inst];
|
||||
#else
|
||||
ctxt.module_id = pdcp_read_header_g.inst;
|
||||
#endif
|
||||
} else {
|
||||
ctxt.module_id = 0;
|
||||
}
|
||||
|
||||
rab_id = pdcp_read_header_g.rb_id % LTE_maxDRB;
|
||||
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (ctxt.enb_flag) {
|
||||
if (rab_id != 0) {
|
||||
rab_id = rab_id % LTE_maxDRB;
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
|
||||
if (ctxt.enb_flag) {
|
||||
if (rab_id != 0) {
|
||||
rab_id = rab_id % LTE_maxDRB;
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
|
||||
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
len,
|
||||
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
|
||||
pdcp_read_header_g.rb_id);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
pdcp_read_header_g.data_size);
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u]UE %u][RB %u]\n",
|
||||
ctxt_cpy.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
pdcp_data_req(&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA
|
||||
,NULL, NULL
|
||||
);
|
||||
} else {
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE, DROPPED\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
}
|
||||
} else { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast
|
||||
// is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
|
||||
//#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
|
||||
for (ue_id = 0; ue_id < NB_UE_INST; ue_id++) {
|
||||
if (oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id] != NOT_A_RNTI) {
|
||||
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id];
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB DEFAULT_RAB_ID %u]\n",
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
len,
|
||||
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
|
||||
pdcp_read_header_g.rb_id);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
pdcp_read_header_g.data_size);
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u]UE %u][RB %u]\n",
|
||||
ctxt_cpy.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
pdcp_data_req(&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA
|
||||
,NULL, NULL
|
||||
);
|
||||
} else {
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE, DROPPED\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
DEFAULT_RAB_ID);
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA
|
||||
,NULL, NULL
|
||||
);
|
||||
rab_id);
|
||||
}
|
||||
} else { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast
|
||||
// is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
|
||||
//#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
|
||||
for (ue_id = 0; ue_id < NB_UE_INST; ue_id++) {
|
||||
if (oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id] != NOT_A_RNTI) {
|
||||
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id];
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB DEFAULT_RAB_ID %u]\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
DEFAULT_RAB_ID);
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA
|
||||
,NULL, NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else { // enb_flag
|
||||
if (rab_id != 0) {
|
||||
if (rab_id == UE_IP_DEFAULT_RAB_ID) {
|
||||
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
|
||||
ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
|
||||
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
|
||||
LOG_D(PDCP,"request key %x : (%d,%x,%d,%d)\n",
|
||||
(uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
|
||||
} else {
|
||||
rab_id = rab_id % LTE_maxDRB;
|
||||
LOG_D(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n",
|
||||
ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
|
||||
LOG_D(PDCP,"request key %x : (%d,%x,%d,%d)\n",
|
||||
(uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
|
||||
}
|
||||
} else { // enb_flag
|
||||
if (rab_id != 0) {
|
||||
if (rab_id == UE_IP_DEFAULT_RAB_ID) {
|
||||
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
|
||||
ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
|
||||
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
|
||||
LOG_D(PDCP,"request key %x : (%d,%x,%d,%d)\n",
|
||||
(uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
|
||||
} else {
|
||||
rab_id = rab_id % LTE_maxDRB;
|
||||
LOG_D(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n",
|
||||
ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
|
||||
LOG_D(PDCP,"request key %x : (%d,%x,%d,%d)\n",
|
||||
(uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
|
||||
}
|
||||
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
rab_id = pdcp_p->rb_id;
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
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",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
len,
|
||||
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
|
||||
pdcp_read_header_g.rb_id);
|
||||
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
pdcp_read_header_g.data_size);
|
||||
|
||||
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,
|
||||
pdcp_read_header_g.inst,
|
||||
len,
|
||||
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
|
||||
pdcp_read_header_g.rb_id);
|
||||
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
|
||||
if(nfapi_mode == 3) {
|
||||
pdcp_data_req(
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
pdcp_data_req(
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA,
|
||||
&pdcp_read_header_g.sourceL2Id,
|
||||
&pdcp_read_header_g.destinationL2Id
|
||||
);
|
||||
}
|
||||
} else {
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(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,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
pdcp_read_header_g.data_size);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id,
|
||||
key);
|
||||
}
|
||||
} else {
|
||||
LOG_D(PDCP, "Forcing send on DEFAULT_RAB_ID\n");
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB DEFAULT_RAB_ID %u]\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
|
||||
DEFAULT_RAB_ID);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
DEFAULT_RAB_ID,
|
||||
pdcp_read_header_g.data_size);
|
||||
|
||||
if(nfapi_mode == 3) {
|
||||
pdcp_data_req(
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
@@ -663,10 +728,10 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
pdcp_data_req(
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
rab_id,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
@@ -676,89 +741,18 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t *const ctxt_pP) {
|
||||
&pdcp_read_header_g.destinationL2Id
|
||||
);
|
||||
}
|
||||
} else {
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(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,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
pdcp_read_header_g.data_size);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id,
|
||||
key);
|
||||
}
|
||||
} else {
|
||||
LOG_D(PDCP, "Forcing send on DEFAULT_RAB_ID\n");
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB DEFAULT_RAB_ID %u]\n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
pdcp_read_header_g.data_size,
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
DEFAULT_RAB_ID);
|
||||
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_IP_ENB:MSC_IP_UE,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
DEFAULT_RAB_ID,
|
||||
pdcp_read_header_g.data_size);
|
||||
|
||||
if(nfapi_mode == 3) {
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
pdcp_data_req (
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
DEFAULT_RAB_ID,
|
||||
RLC_MUI_UNDEFINED,
|
||||
RLC_SDU_CONFIRM_NO,
|
||||
pdcp_read_header_g.data_size,
|
||||
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
|
||||
PDCP_TRANSMISSION_MODE_DATA,
|
||||
&pdcp_read_header_g.sourceL2Id,
|
||||
&pdcp_read_header_g.destinationL2Id
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 0 );
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 0 );
|
||||
}
|
||||
|
||||
return len;
|
||||
} else { /* PDCP_USE_NETLINK */
|
||||
return 0;
|
||||
} else { /* PDCP_USE_NETLINK */
|
||||
return 0;
|
||||
} // else PDCP_USE_NETLINK
|
||||
} /* #else UE_NAS_USE_TUN */
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/* Bugfix for version of GCC = 4.4.3 (Ubuntu 10.04) */
|
||||
#if GCC_VERSION <= 40403
|
||||
# include <sys/socket.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include <linux/netlink.h>
|
||||
@@ -93,13 +93,11 @@ pdcp_netlink_init(
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
int i;
|
||||
int nb_inst_enb;
|
||||
int nb_inst_ue;
|
||||
pthread_attr_t attr;
|
||||
struct sched_param sched_param;
|
||||
|
||||
reset_meas(&ip_pdcp_stats_tmp);
|
||||
nb_inst_enb = 1;
|
||||
nb_inst_ue = 1;
|
||||
@@ -108,8 +106,8 @@ pdcp_netlink_init(
|
||||
nb_inst_enb = 0;
|
||||
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
|
||||
} else {
|
||||
/* #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*));
|
||||
/* #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_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);
|
||||
|
||||
@@ -123,11 +121,9 @@ pdcp_netlink_init(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
|
||||
LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue);
|
||||
|
||||
for (i = 0; i < nb_inst_ue; i++) {
|
||||
@@ -148,7 +144,6 @@ pdcp_netlink_init(
|
||||
}
|
||||
|
||||
sched_param.sched_priority = 10;
|
||||
|
||||
pthread_attr_setschedpolicy(&attr, SCHED_RR);
|
||||
pthread_attr_setschedparam(&attr, &sched_param);
|
||||
|
||||
@@ -171,21 +166,21 @@ pdcp_netlink_init(
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
pdcp_netlink_dequeue_element(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
struct pdcp_netlink_element_s** data_ppP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
struct pdcp_netlink_element_s **data_ppP
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
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) {
|
||||
LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->module_id);
|
||||
}
|
||||
} 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) {
|
||||
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)
|
||||
memset(nl_rx_buf, 0, NL_MAX_PAYLOAD);
|
||||
LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd);
|
||||
MSC_START_USE();
|
||||
while (1) {
|
||||
|
||||
while (1) {
|
||||
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
|
||||
|
||||
if (len == 0) {
|
||||
@@ -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);
|
||||
|
||||
/* Enqueue the element in the right queue */
|
||||
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[module_id], new_data_p);
|
||||
stop_meas(&ip_pdcp_stats_tmp);
|
||||
@@ -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);
|
||||
|
||||
/* Enqueue the element in the right queue */
|
||||
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[module_id], new_data_p);
|
||||
stop_meas(&ip_pdcp_stats_tmp);
|
||||
|
||||
@@ -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);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -564,8 +564,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
|
||||
}
|
||||
|
||||
#else
|
||||
}
|
||||
else { /* MBMS_flag != 0 */
|
||||
} else { /* MBMS_flag != 0 */
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
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);
|
||||
@@ -616,7 +615,7 @@ void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP,
|
||||
//-----------------------------------------------------------------------------
|
||||
if (srb_flagP) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -651,12 +650,12 @@ rlc_module_init (void) {
|
||||
}
|
||||
|
||||
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].service_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].session_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].service_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].session_id = 0;
|
||||
}
|
||||
|
||||
for (k=0; k < NB_RB_MBMS_MAX; k++) {
|
||||
rlc_mbms_rbid2lcid_eNB[0][k] = RLC_LC_UNALLOCATED;
|
||||
rlc_mbms_rbid2lcid_eNB[0][k] = RLC_LC_UNALLOCATED;
|
||||
}
|
||||
|
||||
pool_buffer_init();
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
|
||||
#if ENABLE_RAL
|
||||
# include "collection/hashtable/obj_hashtable.h"
|
||||
#include "collection/hashtable/obj_hashtable.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -92,12 +92,12 @@ typedef struct uid_linear_allocator_NB_IoT_s {
|
||||
|
||||
//left as they are --> used in LAYER2/epenair2_proc.c and UE side
|
||||
typedef enum UE_STATE_NB_IoT_e {
|
||||
RRC_INACTIVE_NB_IoT=0,
|
||||
RRC_IDLE_NB_IoT,
|
||||
RRC_SI_RECEIVED_NB_IoT,
|
||||
RRC_CONNECTED_NB_IoT,
|
||||
RRC_RECONFIGURED_NB_IoT,
|
||||
RRC_HO_EXECUTION_NB_IoT //maybe not needed?
|
||||
RRC_INACTIVE_NB_IoT=0,
|
||||
RRC_IDLE_NB_IoT,
|
||||
RRC_SI_RECEIVED_NB_IoT,
|
||||
RRC_CONNECTED_NB_IoT,
|
||||
RRC_RECONFIGURED_NB_IoT,
|
||||
RRC_HO_EXECUTION_NB_IoT //maybe not needed?
|
||||
} UE_STATE_NB_IoT_t;
|
||||
|
||||
|
||||
@@ -238,20 +238,20 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
|
||||
*
|
||||
* SRB_configList --> is used for the actual list of SRBs that is managed/that should be send over the RRC message
|
||||
* SRB_configList2--> refers to all the SRBs configured for that specific transaction identifier
|
||||
* this because in a single transaction one or more SRBs could be established
|
||||
* and you want to keep memory on what happen for every transaction
|
||||
* this because in a single transaction one or more SRBs could be established
|
||||
* and you want to keep memory on what happen for every transaction
|
||||
* Transaction ID (xid): is used to associate the proper RRC....Complete message received by the UE to the corresponding
|
||||
* message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete)
|
||||
* this because it could happen that more messages are transmitted at the same time
|
||||
* message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete)
|
||||
* 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_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
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
|
||||
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
|
||||
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_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
|
||||
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
|
||||
|
||||
struct LTE_PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT;
|
||||
LTE_MAC_MainConfig_NB_r13_t* mac_MainConfig_NB_IoT;
|
||||
struct LTE_PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated_NB_IoT;
|
||||
LTE_MAC_MainConfig_NB_r13_t *mac_MainConfig_NB_IoT;
|
||||
|
||||
//No SPS(semi-persistent scheduling) in NB-IoT
|
||||
//No Measurement report in NB-IoT
|
||||
@@ -303,7 +303,7 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
|
||||
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
|
||||
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
|
||||
|
||||
//Which timers are referring to?
|
||||
//Which timers are referring to?
|
||||
uint32_t ul_failure_timer;
|
||||
uint32_t ue_release_timer;
|
||||
//threshold of the release timer--> set in RRCConnectionRelease
|
||||
@@ -340,13 +340,13 @@ typedef struct rrc_eNB_ue_context_NB_IoT_s {
|
||||
typedef struct {
|
||||
|
||||
// buffer that contains the encoded messages
|
||||
uint8_t *MIB_NB_IoT;
|
||||
uint8_t sizeof_MIB_NB_IoT;
|
||||
uint8_t *MIB_NB_IoT;
|
||||
uint8_t sizeof_MIB_NB_IoT;
|
||||
|
||||
uint8_t *SIB1_NB_IoT;
|
||||
uint8_t sizeof_SIB1_NB_IoT;
|
||||
uint8_t *SIB23_NB_IoT;
|
||||
uint8_t sizeof_SIB23_NB_IoT;
|
||||
uint8_t *SIB23_NB_IoT;
|
||||
uint8_t sizeof_SIB23_NB_IoT;
|
||||
|
||||
|
||||
//not actually implemented in OAI
|
||||
@@ -360,18 +360,18 @@ typedef struct {
|
||||
uint8_t sizeof_SIB16_NB_IoT;
|
||||
|
||||
//TS 36.331 V14.2.1
|
||||
// uint8_t *SIB15_NB;
|
||||
// uint8_t sizeof_SIB15_NB;
|
||||
// uint8_t *SIB20_NB;
|
||||
// uint8_t sizeof_SIB20_NB;
|
||||
// uint8_t *SIB22_NB;
|
||||
// uint8_t sizeof_SIB22_NB;
|
||||
// uint8_t *SIB15_NB;
|
||||
// uint8_t sizeof_SIB15_NB;
|
||||
// uint8_t *SIB20_NB;
|
||||
// uint8_t sizeof_SIB20_NB;
|
||||
// uint8_t *SIB22_NB;
|
||||
// uint8_t sizeof_SIB22_NB;
|
||||
|
||||
//implicit parameters needed
|
||||
int Ncp; //cyclic prefix for DL
|
||||
int Ncp_UL; //cyclic prefix for UL
|
||||
int Ncp_UL; //cyclic prefix for UL
|
||||
int p_eNB; //number of tx antenna port
|
||||
int p_rx_eNB; //number of receiving antenna ports
|
||||
int p_rx_eNB; //number of receiving antenna ports
|
||||
uint32_t dl_CarrierFreq; //detected by the UE
|
||||
uint32_t ul_CarrierFreq; //detected by the UE
|
||||
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
|
||||
@@ -381,12 +381,12 @@ typedef struct {
|
||||
LTE_BCCH_DL_SCH_Message_NB_t siblock1_NB_IoT; //SIB1-NB
|
||||
LTE_BCCH_DL_SCH_Message_NB_t systemInformation_NB_IoT; //SI
|
||||
|
||||
LTE_SystemInformationBlockType1_NB_t *sib1_NB_IoT;
|
||||
LTE_SystemInformationBlockType2_NB_r13_t *sib2_NB_IoT;
|
||||
LTE_SystemInformationBlockType3_NB_r13_t *sib3_NB_IoT;
|
||||
LTE_SystemInformationBlockType1_NB_t *sib1_NB_IoT;
|
||||
LTE_SystemInformationBlockType2_NB_r13_t *sib2_NB_IoT;
|
||||
LTE_SystemInformationBlockType3_NB_r13_t *sib3_NB_IoT;
|
||||
//not implemented yet
|
||||
LTE_SystemInformationBlockType4_NB_r13_t *sib4_NB_IoT;
|
||||
LTE_SystemInformationBlockType5_NB_r13_t *sib5_NB_IoT;
|
||||
LTE_SystemInformationBlockType4_NB_r13_t *sib4_NB_IoT;
|
||||
LTE_SystemInformationBlockType5_NB_r13_t *sib5_NB_IoT;
|
||||
LTE_SystemInformationBlockType14_NB_r13_t *sib14_NB_IoT;
|
||||
LTE_SystemInformationBlockType16_NB_r13_t *sib16_NB_IoT;
|
||||
|
||||
@@ -402,9 +402,9 @@ typedef struct {
|
||||
SystemInformationBlockType20_NB_r14_t *sib20;
|
||||
SystemInformationBlockType22_NB_r14_t *sib22;
|
||||
|
||||
uint8_t SCPTM_flag;
|
||||
uint8_t sizeof_SC_MCHH_MESS[];
|
||||
SC_MCCH_Message_NB_t scptm;*/
|
||||
uint8_t SCPTM_flag;
|
||||
uint8_t sizeof_SC_MCHH_MESS[];
|
||||
SC_MCCH_Message_NB_t scptm;*/
|
||||
|
||||
|
||||
} rrc_eNB_carrier_data_NB_IoT_t;
|
||||
@@ -451,9 +451,9 @@ typedef struct eNB_RRC_INST_NB_IoT_s {
|
||||
|
||||
//not needed for the moment
|
||||
typedef struct OAI_UECapability_NB_IoT_s {
|
||||
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
|
||||
uint8_t sdu_size;
|
||||
////NB-IoT------
|
||||
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
|
||||
uint8_t sdu_size;
|
||||
////NB-IoT------
|
||||
LTE_UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE
|
||||
} OAI_UECapability_NB_IoT_t;
|
||||
|
||||
@@ -472,7 +472,7 @@ typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
uint8_t UECapability_size;
|
||||
|
||||
UE_RRC_INFO_NB_IoT Info[NB_SIG_CNX_UE];
|
||||
|
||||
|
||||
SRB_INFO_NB_IoT Srb0[NB_SIG_CNX_UE];
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1[NB_CNX_UE];
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb2[NB_CNX_UE];
|
||||
@@ -499,7 +499,7 @@ typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
SystemInformationBlockType10_t *sib10[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 *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 {
|
||||
MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
|
||||
SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
|
||||
SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
|
||||
#endif
|
||||
#ifdef CBA
|
||||
#endif
|
||||
#ifdef CBA
|
||||
uint8_t num_active_cba_groups;
|
||||
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
|
||||
#endif
|
||||
#endif
|
||||
uint8_t num_srb;
|
||||
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
|
||||
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
|
||||
@@ -537,14 +537,14 @@ typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
float rsrq_db[7];
|
||||
float rsrp_db_filtered[7];
|
||||
float rsrq_db_filtered[7];
|
||||
#if ENABLE_RAL
|
||||
#if ENABLE_RAL
|
||||
obj_hash_table_t *ral_meas_thresholds;
|
||||
ral_transaction_id_t scan_transaction_id;
|
||||
#endif
|
||||
#if defined(ENABLE_SECURITY)
|
||||
#endif
|
||||
#if defined(ENABLE_SECURITY)
|
||||
// KeNB as computed from parameters within USIM card //
|
||||
uint8_t kenb[32];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Used integrity/ciphering algorithms //
|
||||
CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
switch (UE_rrc_inst[ue_mod_idP].RrcState) {
|
||||
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 )
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (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
|
||||
const char *nas_msg;
|
||||
int nas_msg_length;
|
||||
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
|
||||
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
|
||||
} else {
|
||||
|
||||
nas_msg = 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);
|
||||
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);
|
||||
@@ -810,6 +805,7 @@ rrc_ue_establish_drb(
|
||||
(void)ip_addr_offset4;
|
||||
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);
|
||||
|
||||
/*
|
||||
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);
|
||||
@@ -845,6 +841,7 @@ rrc_ue_establish_drb(
|
||||
|
||||
# endif
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1908,7 +1905,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/* Check if there is dedicated NAS information to forward to NAS */
|
||||
if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) {
|
||||
int list_count;
|
||||
@@ -1972,7 +1968,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // c1 present
|
||||
} // critical extensions present
|
||||
}
|
||||
@@ -2241,7 +2236,6 @@ rrc_ue_decode_dcch(
|
||||
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",
|
||||
ctxt_pP->module_id, target_eNB_index);
|
||||
|
||||
#if ENABLE_RAL
|
||||
{
|
||||
MessageDef *message_ral_p = NULL;
|
||||
@@ -2286,7 +2280,6 @@ rrc_ue_decode_dcch(
|
||||
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);
|
||||
}
|
||||
|
||||
#endif
|
||||
} else {
|
||||
rrc_ue_generate_RRCConnectionReconfigurationComplete(
|
||||
@@ -3497,8 +3490,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
#endif
|
||||
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
|
||||
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" );
|
||||
return -1;
|
||||
}
|
||||
@@ -3559,9 +3551,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
#endif
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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 );
|
||||
@@ -3825,7 +3815,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -4093,7 +4083,7 @@ uint8_t check_trigger_meas_event(
|
||||
uint8_t eNB_offset;
|
||||
// uint8_t currentCellIndex = frame_parms->Nid_cell;
|
||||
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,
|
||||
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));
|
||||
@@ -5024,7 +5014,7 @@ rrc_control_socket_init() {
|
||||
// error("ERROR: Failed on opening socket");
|
||||
optval = 1;
|
||||
setsockopt(ctrl_sock_fd, SOL_SOCKET, SO_REUSEADDR,
|
||||
(const void *)&optval , sizeof(int));
|
||||
(const void *)&optval, sizeof(int));
|
||||
//build the server's address
|
||||
bzero((char *) &rrc_ctrl_socket_addr, sizeof(rrc_ctrl_socket_addr));
|
||||
rrc_ctrl_socket_addr.sin_family = AF_INET;
|
||||
|
||||
+350
-390
File diff suppressed because it is too large
Load Diff
@@ -41,20 +41,18 @@ extern RAN_CONTEXT_t RC;
|
||||
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
)
|
||||
{
|
||||
) {
|
||||
rnti_t rnti;
|
||||
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) {
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RX CREATE_TUNNEL_RESP num tunnels %u \n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
create_tunnel_resp_pP->num_tunnels);
|
||||
|
||||
rnti = create_tunnel_resp_pP->rnti;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
RC.rrc[ctxt_pP->module_id],
|
||||
@@ -64,26 +62,26 @@ 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_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];
|
||||
|
||||
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),
|
||||
create_tunnel_resp_pP->enb_S1u_teid[i],
|
||||
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]],
|
||||
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]],
|
||||
inde_list[i],
|
||||
i,
|
||||
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_RRC_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u",
|
||||
0,0,rnti,
|
||||
create_tunnel_resp_pP->num_tunnels,
|
||||
ue_context_p->ue_context.enb_gtp_ebi[0],
|
||||
ue_context_p->ue_context.enb_gtp_teid[0]);
|
||||
(void)rnti; /* avoid gcc warning "set but not used" */
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u",
|
||||
0,0,rnti,
|
||||
create_tunnel_resp_pP->num_tunnels,
|
||||
ue_context_p->ue_context.enb_gtp_ebi[0],
|
||||
ue_context_p->ue_context.enb_gtp_teid[0]);
|
||||
(void)rnti; /* avoid gcc warning "set but not used" */
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved. */
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
);
|
||||
|
||||
|
||||
+75
-117
@@ -67,7 +67,7 @@ extern RAN_CONTEXT_t RC;
|
||||
extern int
|
||||
gtpv1u_delete_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_delete_tunnel_req_t * const req_pP);
|
||||
const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
|
||||
|
||||
/* Value to indicate an invalid UE initial id */
|
||||
static const uint16_t UE_INITIAL_ID_INVALID = 0;
|
||||
@@ -218,8 +218,7 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
result2->ue_initial_id,
|
||||
result->eNB_ue_s1ap_id,
|
||||
result2->eNB_ue_s1ap_id);
|
||||
|
||||
// Still return *result
|
||||
// Still return *result
|
||||
}
|
||||
}
|
||||
} // end if if (eNB_ue_s1ap_id > 0)
|
||||
@@ -227,7 +226,6 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in initial_id2_s1ap_ids ue_initial_id %"PRIu16"\n",
|
||||
rrc_instance_pP - RC.rrc[0],
|
||||
ue_initial_id);
|
||||
|
||||
return NULL;
|
||||
/*
|
||||
* At the moment this is written, this case shouldn't (cannot) happen and is equivalent to an error.
|
||||
@@ -256,8 +254,7 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p, eNB_ue_s1ap_id); // get s1ap_eNB_ue_context
|
||||
} else {
|
||||
LOG_E(S1AP, "[eNB instance %d] Couldn't find the eNB S1AP context\n",
|
||||
instance);
|
||||
|
||||
instance);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -281,7 +278,6 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", even when looking at S1AP context\n",
|
||||
rrc_instance_pP - RC.rrc[0],
|
||||
eNB_ue_s1ap_id);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
} // end if (h_rc != HASH_TABLE_OK)
|
||||
@@ -302,7 +298,6 @@ rrc_eNB_S1AP_remove_ue_ids(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
hashtable_rc_t h_rc;
|
||||
|
||||
if (rrc_instance_pP == NULL) {
|
||||
@@ -314,8 +309,10 @@ rrc_eNB_S1AP_remove_ue_ids(
|
||||
LOG_E(RRC, "Trying to free a NULL S1AP UE IDs\n");
|
||||
return;
|
||||
}
|
||||
|
||||
const uint16_t ue_initial_id = ue_ids_pP->ue_initial_id;
|
||||
const uint32_t eNB_ue_s1ap_id = ue_ids_pP->eNB_ue_s1ap_id;
|
||||
|
||||
if (eNB_ue_s1ap_id > 0) {
|
||||
h_rc = hashtable_remove(rrc_instance_pP->s1ap_id2_s1ap_ids, (hash_key_t)eNB_ue_s1ap_id);
|
||||
|
||||
@@ -644,7 +641,7 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
== LTE_ULInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS)) {
|
||||
/* This message hold a dedicated info NAS payload, forward it to NAS */
|
||||
struct LTE_ULInformationTransfer_r8_IEs__dedicatedInfoType *dedicatedInfoType =
|
||||
&ulInformationTransfer->criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType;
|
||||
&ulInformationTransfer->criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType;
|
||||
uint32_t pdu_length;
|
||||
uint8_t *pdu_buffer;
|
||||
MessageDef *msg_p;
|
||||
@@ -809,13 +806,11 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code = BIT_STRING_to_uint8 (&r_mme->mmec);
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id = BIT_STRING_to_uint16 (&r_mme->mmegi);
|
||||
|
||||
ue_context_pP->ue_context.ue_gummei.mcc = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc;
|
||||
ue_context_pP->ue_context.ue_gummei.mnc = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc;
|
||||
ue_context_pP->ue_context.ue_gummei.mnc_len = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len;
|
||||
ue_context_pP->ue_context.ue_gummei.mme_code = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code;
|
||||
ue_context_pP->ue_context.ue_gummei.mme_group_id = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id;
|
||||
|
||||
MSC_LOG_TX_MESSAGE(MSC_S1AP_ENB,
|
||||
MSC_S1AP_MME,
|
||||
(const char *)&message_p->ittiMsg.s1ap_nas_first_req,
|
||||
@@ -962,7 +957,6 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p->ue_context.mme_ue_s1ap_id = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).mme_ue_s1ap_id;
|
||||
|
||||
/* Save e RAB information for later */
|
||||
{
|
||||
int i;
|
||||
@@ -1751,7 +1745,6 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
uint32_t T; /* DRX cycle */
|
||||
|
||||
for (uint16_t tai_size = 0; tai_size < S1AP_PAGING_IND(msg_p).tai_size; tai_size++) {
|
||||
|
||||
LOG_D(RRC,"[eNB %d] In S1AP_PAGING_IND: MCC %d, MNC %d, TAC %d\n", instance, S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc,
|
||||
S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc, S1AP_PAGING_IND(msg_p).tac[tai_size]);
|
||||
|
||||
@@ -1773,7 +1766,8 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
/* set T = min(Tc,Tue) */
|
||||
T = Tc < Tue ? Ttab[Tc] : Ttab[Tue];
|
||||
/* set pcch_nB = PCCH-Config->nB */
|
||||
pcch_nB = (uint32_t)RC.rrc[instance]->configuration.radioresourceconfig[CC_id].pcch_nB;
|
||||
pcch_nB = (uint32_t)RC.rrc[instance]->configuration.radioresourceconfig[CC_id].pcch_nB;
|
||||
|
||||
switch (pcch_nB) {
|
||||
case LTE_PCCH_Config__nB_fourT:
|
||||
Ns = 4;
|
||||
@@ -1899,143 +1893,116 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
}
|
||||
|
||||
/*NN: careful about the typcast of xid (long -> uint8_t*/
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP){
|
||||
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP) {
|
||||
MessageDef *msg_p = NULL;
|
||||
int e_rab = 0;
|
||||
int e_rabs_done = 0;
|
||||
|
||||
rrc_ue_s1ap_ids_t* rrc_ue_s1ap_ids_p = NULL;
|
||||
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
|
||||
hashtable_rc_t h_rc;
|
||||
|
||||
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
|
||||
uint8_t inde_list[ue_context_pP->ue_context.nb_of_e_rabs];
|
||||
memset(inde_list, 0, ue_context_pP->ue_context.nb_of_e_rabs*sizeof(uint8_t));
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_PATH_SWITCH_REQ);
|
||||
|
||||
ue_context_pP->ue_context.ue_initial_id = get_next_ue_initial_id (ctxt_pP->module_id);
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
|
||||
|
||||
rrc_ue_s1ap_ids_p = malloc(sizeof(*rrc_ue_s1ap_ids_p));
|
||||
rrc_ue_s1ap_ids_p->ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
|
||||
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
|
||||
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
|
||||
|
||||
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
|
||||
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
|
||||
rrc_ue_s1ap_ids_p);
|
||||
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
|
||||
rrc_ue_s1ap_ids_p);
|
||||
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_E(S1AP, "[eNB %d] Error while hashtable_insert in initial_id2_s1ap_ids ue_initial_id %u\n",
|
||||
ctxt_pP->module_id, ue_context_pP->ue_context.ue_initial_id);
|
||||
ctxt_pP->module_id, ue_context_pP->ue_context.ue_initial_id);
|
||||
}
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).mme_ue_s1ap_id = ue_context_pP->ue_context.mme_ue_s1ap_id;
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mcc = ue_context_pP->ue_context.ue_gummei.mcc;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mnc = ue_context_pP->ue_context.ue_gummei.mnc;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mnc_len = ue_context_pP->ue_context.ue_gummei.mnc_len;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mme_code = ue_context_pP->ue_context.ue_gummei.mme_code;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mme_group_id = ue_context_pP->ue_context.ue_gummei.mme_group_id;
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).security_capabilities.encryption_algorithms=ue_context_pP->ue_context.security_capabilities.encryption_algorithms;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).security_capabilities.integrity_algorithms=ue_context_pP->ue_context.security_capabilities.integrity_algorithms;
|
||||
|
||||
LOG_I (RRC,"Path switch request: nb nb_of_e_rabs %u status %u\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status);
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status);
|
||||
memset(&create_tunnel_req, 0, sizeof(create_tunnel_req));
|
||||
|
||||
memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
|
||||
// the context for UE to be handovered is obtained through ho_req message
|
||||
for (e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_e_rabs ; e_rab++) {
|
||||
|
||||
if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED) {
|
||||
|
||||
create_tunnel_req.eps_bearer_id[e_rabs_done] = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[e_rabs_done] = ue_context_pP->ue_context.e_rab[e_rab].param.gtp_teid;
|
||||
memcpy(&create_tunnel_req.sgw_addr[e_rabs_done],
|
||||
&ue_context_pP->ue_context.e_rab[e_rab].param.sgw_addr,
|
||||
sizeof(transport_layer_addr_t));
|
||||
|
||||
inde_list[e_rabs_done] = e_rab;
|
||||
e_rabs_done++;
|
||||
}
|
||||
}
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs = e_rabs_done;
|
||||
|
||||
create_tunnel_req.rnti = ue_context_pP->ue_context.rnti;
|
||||
create_tunnel_req.num_tunnels = e_rabs_done;
|
||||
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
ctxt_pP->instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
|
||||
ctxt_pP->instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
ctxt_pP,
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
ctxt_pP,
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
|
||||
for (e_rab = 0; e_rab < e_rabs_done; e_rab++) {
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id = create_tunnel_resp.eps_bearer_id[e_rab];
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid = create_tunnel_resp.enb_S1u_teid[e_rab];
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr;
|
||||
|
||||
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
|
||||
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status,
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[0],
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[1],
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[2],
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[3]);
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id = create_tunnel_resp.eps_bearer_id[e_rab];
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid = create_tunnel_resp.enb_S1u_teid[e_rab];
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr;
|
||||
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
|
||||
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status,
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[0],
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[1],
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[2],
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[3]);
|
||||
}
|
||||
|
||||
// NN: add conditions for e_rabs_failed
|
||||
if (e_rabs_done > 0) {
|
||||
|
||||
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_PATH_SWITCH_REQ (msg_p),
|
||||
sizeof(s1ap_path_switch_req_t),
|
||||
MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done);
|
||||
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
// NN: add conditions for e_rabs_failed
|
||||
if (e_rabs_done > 0) {
|
||||
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_PATH_SWITCH_REQ (msg_p),
|
||||
sizeof(s1ap_path_switch_req_t),
|
||||
MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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) {
|
||||
uint16_t ue_initial_id;
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
//gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
//gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
|
||||
gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req;
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
int i;
|
||||
|
||||
ue_initial_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_initial_id;
|
||||
eNB_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
@@ -2045,29 +2012,23 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
|
||||
if (ue_context_p == NULL) {
|
||||
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
|
||||
//MessageDef *msg_fail_p = NULL;
|
||||
|
||||
LOG_W(RRC, "[eNB %d] In S1AP_PATH_SWITCH_REQ_ACK: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
|
||||
//msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_PATH_SWITCH_REQ_ACK_FAIL);
|
||||
//S1AP_PATH_SWITCH_REQ_ACK (msg_fail_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
|
||||
// TODO add failure cause when defined!
|
||||
|
||||
//itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p);
|
||||
return (-1);
|
||||
} else {
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p->ue_context.mme_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).mme_ue_s1ap_id;
|
||||
|
||||
/* Save e RAB information for later */
|
||||
{
|
||||
for (i = 0;
|
||||
i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg
|
||||
i++) {
|
||||
// assume that we are releasing all the DRBs
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_TORELEASE;
|
||||
i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg
|
||||
i++) {
|
||||
// assume that we are releasing all the DRBs
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_TORELEASE;
|
||||
}
|
||||
|
||||
//memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
|
||||
@@ -2076,40 +2037,38 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
|
||||
// keep the previous bearer
|
||||
// the index for the rec
|
||||
for (i = 0;
|
||||
i < 1;//nb_e_rabs_tobeswitched; // go over total number of e_rabs received through x2_ho_req msg
|
||||
i++) {
|
||||
i < 1;//nb_e_rabs_tobeswitched; // go over total number of e_rabs received through x2_ho_req msg
|
||||
i++) {
|
||||
LOG_I(RRC,"Bearer re-established with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
|
||||
/* Harmonize with enb_gtp_teid, enb_gtp_addrs, and enb_gtp_rbi vars in the top level structure */
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_REESTABLISHED;
|
||||
//ue_context_p->ue_context.e_rab[i].param.e_rab_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].e_rab_id;
|
||||
//ue_context_p->ue_context.e_rab[i].param.sgw_addr= S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].sgw_addr;
|
||||
//ue_context_p->ue_context.e_rab[i].param.gtp_teid = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].gtp_teid;
|
||||
/* Tunnel must have been already created in X2_HO_REQ procedure */
|
||||
/* Harmonize with enb_gtp_teid, enb_gtp_addrs, and enb_gtp_rbi vars in the top level structure */
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_REESTABLISHED;
|
||||
//ue_context_p->ue_context.e_rab[i].param.e_rab_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].e_rab_id;
|
||||
//ue_context_p->ue_context.e_rab[i].param.sgw_addr= S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].sgw_addr;
|
||||
//ue_context_p->ue_context.e_rab[i].param.gtp_teid = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[i].gtp_teid;
|
||||
/* Tunnel must have been already created in X2_HO_REQ procedure */
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.setup_e_rabs=i;
|
||||
ue_context_p->ue_context.nb_of_e_rabs=i;
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.ue_ambr=S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_ambr;
|
||||
|
||||
|
||||
ue_context_p->ue_context.nb_release_of_e_rabs = S1AP_PATH_SWITCH_REQ_ACK (msg_p).nb_e_rabs_tobereleased;
|
||||
memset(&delete_tunnel_req, 0 , sizeof(delete_tunnel_req));
|
||||
memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req));
|
||||
|
||||
for (i = 0;
|
||||
i < ue_context_p->ue_context.nb_release_of_e_rabs;
|
||||
i++) {
|
||||
i < ue_context_p->ue_context.nb_release_of_e_rabs;
|
||||
i++) {
|
||||
LOG_I(RRC,"Bearer released with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
|
||||
ue_context_p->ue_context.e_rabs_tobereleased[i]=S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[i].e_rab_id;
|
||||
delete_tunnel_req.eps_bearer_id[i] = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[i].e_rab_id;
|
||||
|
||||
}
|
||||
if (ue_context_p->ue_context.nb_release_of_e_rabs>0){
|
||||
|
||||
if (ue_context_p->ue_context.nb_release_of_e_rabs>0) {
|
||||
delete_tunnel_req.rnti= ue_context_p->ue_context.rnti;
|
||||
delete_tunnel_req.num_erab= ue_context_p->ue_context.nb_release_of_e_rabs;
|
||||
/* this could also be done through ITTI message */
|
||||
gtpv1u_delete_s1u_tunnel(instance,
|
||||
&delete_tunnel_req);
|
||||
&delete_tunnel_req);
|
||||
/* TBD: release the DRB not admitted */
|
||||
//rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(&ctxt, ue_context_p, 0);
|
||||
}
|
||||
@@ -2117,9 +2076,8 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
|
||||
/* Security key */
|
||||
ue_context_p->ue_context.next_hop_chain_count=S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_hop_chain_count;
|
||||
memcpy ( ue_context_p->ue_context.next_security_key,
|
||||
S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key,
|
||||
SECURITY_KEY_LENGTH);
|
||||
|
||||
S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key,
|
||||
SECURITY_KEY_LENGTH);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,38 +49,38 @@ typedef struct rrc_ue_s1ap_ids_s {
|
||||
|
||||
int
|
||||
rrc_eNB_S1AP_compare_ue_ids(
|
||||
struct rrc_ue_s1ap_ids_s* c1_pP,
|
||||
struct rrc_ue_s1ap_ids_s* c2_pP
|
||||
struct rrc_ue_s1ap_ids_s *c1_pP,
|
||||
struct rrc_ue_s1ap_ids_s *c2_pP
|
||||
);
|
||||
|
||||
struct rrc_rnti_tree_s;
|
||||
|
||||
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(
|
||||
eNB_RRC_INST* const rrc_instance_pP,
|
||||
eNB_RRC_INST *const rrc_instance_pP,
|
||||
const uint16_t ue_initial_id,
|
||||
const uint32_t eNB_ue_s1ap_id
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_S1AP_remove_ue_ids(
|
||||
eNB_RRC_INST* const rrc_instance_pP,
|
||||
struct rrc_ue_s1ap_ids_s* const ue_ids_pP
|
||||
eNB_RRC_INST *const rrc_instance_pP,
|
||||
struct rrc_ue_s1ap_ids_s *const ue_ids_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
int
|
||||
rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
/*! \fn void rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(uint8_t mod_id, uint8_t ue_index)
|
||||
*\brief create a S1AP_INITIAL_CONTEXT_SETUP_RESP for S1AP.
|
||||
@@ -89,8 +89,8 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* cons
|
||||
*/
|
||||
void
|
||||
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_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)
|
||||
@@ -101,9 +101,9 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
*/
|
||||
void
|
||||
rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_UL_DCCH_Message_t* const ul_dcch_msg
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
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)
|
||||
@@ -113,9 +113,9 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
*\param ul_dcch_msg The message receive by RRC holding the NAS message.
|
||||
*/
|
||||
void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_UL_DCCH_Message_t* ul_dcch_msg
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
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)
|
||||
@@ -127,9 +127,9 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
|
||||
*/
|
||||
void
|
||||
rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete
|
||||
);
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ the UE-associated S1-logical connection over the S1 interface. .
|
||||
*/
|
||||
void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ (
|
||||
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 long cause_valueP
|
||||
);
|
||||
@@ -183,10 +183,10 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
*\brief send a S1AP dedicated E_RAB setup response
|
||||
*\param ctxt_pP contxt infirmation
|
||||
*\param e_contxt_pP ue specific context at the eNB
|
||||
*\param xid transaction identifier
|
||||
*\param xid transaction identifier
|
||||
*\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);
|
||||
*\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
|
||||
*\param xid transaction identifier
|
||||
*\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)
|
||||
*\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
|
||||
|
||||
void
|
||||
rrc_pdcp_config_security(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
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);
|
||||
@@ -264,10 +264,10 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms
|
||||
*\param xid transaction identifier
|
||||
*\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,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP);
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_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);
|
||||
|
||||
#endif /* RRC_ENB_S1AP_H_ */
|
||||
|
||||
+123
-123
@@ -43,7 +43,7 @@ void openair_rrc_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_a
|
||||
char
|
||||
openair_rrc_eNB_configuration(
|
||||
const module_id_t enb_mod_idP,
|
||||
RrcConfigurationReq* configuration
|
||||
RrcConfigurationReq *configuration
|
||||
);
|
||||
|
||||
char openair_rrc_eNB_init(
|
||||
@@ -55,21 +55,21 @@ char openair_rrc_ue_init(
|
||||
void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role);
|
||||
void
|
||||
openair_rrc_on(
|
||||
const protocol_ctxt_t* const ctxt_pP);
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
void
|
||||
openair_rrc_on_ue(
|
||||
const protocol_ctxt_t* const ctxt_pP);
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
void rrc_top_cleanup(void);
|
||||
|
||||
/** \brief Function to update eNB timers every subframe.
|
||||
/** \brief Function to update eNB timers every subframe.
|
||||
@param ctxt_pP running context
|
||||
@param enb_index
|
||||
@param CC_id
|
||||
*/
|
||||
RRC_status_t
|
||||
rrc_rx_tx(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -80,7 +80,7 @@ rrc_rx_tx(
|
||||
*/
|
||||
RRC_status_t
|
||||
rrc_rx_tx_ue(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t enb_index,
|
||||
const int CC_id
|
||||
);
|
||||
@@ -91,7 +91,7 @@ rrc_rx_tx_ue(
|
||||
\param ctxt_pP Running context
|
||||
\param Srb_info Pointer to SRB_INFO structure (SRB0)
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* const Srb_info, const uint8_t eNB_index );
|
||||
int rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const SRB_INFO *const Srb_info, const uint8_t eNB_index );
|
||||
|
||||
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
|
||||
\param ctxt_pP Running context
|
||||
@@ -100,17 +100,17 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* co
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
void
|
||||
rrc_ue_decode_dcch(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t* const Buffer,
|
||||
const uint8_t *const Buffer,
|
||||
const uint8_t eNB_indexP
|
||||
);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int decode_SL_Discovery_Message(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
const uint8_t* Sdu,
|
||||
const uint8_t *Sdu,
|
||||
const uint8_t Sdu_len);
|
||||
#endif
|
||||
|
||||
@@ -119,7 +119,7 @@ int decode_SL_Discovery_Message(
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
void
|
||||
rrc_ue_generate_RRCConnectionRequest(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index
|
||||
);
|
||||
|
||||
@@ -129,8 +129,8 @@ rrc_ue_generate_RRCConnectionRequest(
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
void
|
||||
rrc_ue_process_rrcConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
LTE_RRCConnectionReconfiguration_t* rrcConnectionReconfiguration,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
|
||||
uint8_t eNB_index
|
||||
);
|
||||
|
||||
@@ -164,9 +164,9 @@ int32_t rrc_ue_establish_drb(module_id_t module_idP,frame_t frameP,uint8_t eNB_
|
||||
*/
|
||||
void
|
||||
rrc_ue_process_mobilityControlInfo(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
struct LTE_MobilityControlInfo* const mobilityControlInfo
|
||||
struct LTE_MobilityControlInfo *const mobilityControlInfo
|
||||
);
|
||||
|
||||
/** \brief Process a measConfig Message and configure PHY/MAC
|
||||
@@ -175,9 +175,9 @@ rrc_ue_process_mobilityControlInfo(
|
||||
\param measConfig Pointer to MeasConfig IE from configuration*/
|
||||
void
|
||||
rrc_ue_process_measConfig(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
LTE_MeasConfig_t* const measConfig
|
||||
LTE_MeasConfig_t *const measConfig
|
||||
);
|
||||
|
||||
/** \brief Process a RadioResourceConfigDedicated Message and configure PHY/MAC
|
||||
@@ -185,7 +185,7 @@ rrc_ue_process_measConfig(
|
||||
\param eNB_index Index of corresponding CH/eNB
|
||||
\param radioResourceConfigDedicated Pointer to RadioResourceConfigDedicated IE from configuration*/
|
||||
void rrc_ue_process_radioResourceConfigDedicated(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
uint8_t eNB_index,
|
||||
LTE_RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
|
||||
|
||||
@@ -202,8 +202,8 @@ void rrc_ue_process_sidelink_radioResourceConfig(
|
||||
uint8_t eNB_index,
|
||||
LTE_SystemInformationBlockType18_r12_t *sib18,
|
||||
LTE_SystemInformationBlockType19_r12_t *sib19,
|
||||
LTE_SL_CommConfig_r12_t* sl_CommConfig,
|
||||
LTE_SL_DiscConfig_r12_t* sl_DiscConfig);
|
||||
LTE_SL_CommConfig_r12_t *sl_CommConfig,
|
||||
LTE_SL_DiscConfig_r12_t *sl_DiscConfig);
|
||||
|
||||
/** \brief Init control socket to listen to incoming packets from ProSe App
|
||||
*
|
||||
@@ -223,8 +223,8 @@ uint8_t rrc_eNB_get_next_transaction_identifier(module_id_t module_idP);
|
||||
\param Srb_info Pointer to SRB0 information structure (buffer, etc.)*/
|
||||
int
|
||||
rrc_eNB_decode_ccch(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
const SRB_INFO* const Srb_info,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const SRB_INFO *const Srb_info,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -234,9 +234,9 @@ rrc_eNB_decode_ccch(
|
||||
\param sdu_size Size of incoming SDU*/
|
||||
int
|
||||
rrc_eNB_decode_dcch(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t* const Rx_sdu,
|
||||
const uint8_t *const Rx_sdu,
|
||||
const sdu_size_t sdu_sizeP
|
||||
);
|
||||
|
||||
@@ -245,8 +245,8 @@ rrc_eNB_decode_dcch(
|
||||
\param ue_context_pP UE context*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionSetup(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -256,8 +256,8 @@ rrc_eNB_generate_RRCConnectionSetup(
|
||||
\param CC_id Component Carrier ID*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionReestablishmentReject(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -267,9 +267,9 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
|
||||
\param rrcConnectionSetupComplete Pointer to RRCConnectionSetupComplete message*/
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionSetupComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete
|
||||
);
|
||||
|
||||
/**\brief Process the RRCConnectionReconfigurationComplete based on information coming from UE
|
||||
@@ -280,8 +280,8 @@ rrc_eNB_process_RRCConnectionSetupComplete(
|
||||
*/
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
const uint8_t xid
|
||||
);
|
||||
|
||||
@@ -290,41 +290,41 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
\param ue_context_pP UE context of UE receiving the message*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionRelease(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state,
|
||||
agent_reconf_rrc * trig_param
|
||||
);
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state,
|
||||
agent_reconf_rrc *trig_param
|
||||
);
|
||||
void
|
||||
rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t* buffer,
|
||||
int *_size
|
||||
//const uint8_t ho_state
|
||||
);
|
||||
rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *buffer,
|
||||
int *_size
|
||||
//const uint8_t ho_state
|
||||
);
|
||||
void
|
||||
rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s* ue_context_p, protocol_ctxt_t* const ctxt_pP);
|
||||
rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s *ue_context_p, protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
int freq_to_arfcn10(int band, unsigned long freq);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
@@ -333,16 +333,16 @@ rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
\param ue_context_pP UE context of UE receiving the message*/
|
||||
void
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t xid,
|
||||
uint32_t nas_length,
|
||||
uint8_t* nas_buffer
|
||||
uint8_t *nas_buffer
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP);
|
||||
void
|
||||
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP);
|
||||
|
||||
|
||||
|
||||
@@ -366,9 +366,9 @@ void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_re
|
||||
\param ue_module_idP Index of UE transmitting the messages*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t* const nas_pdu,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *const nas_pdu,
|
||||
const uint32_t nas_length
|
||||
);
|
||||
|
||||
@@ -379,10 +379,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
\param n_discoveryMessages Number of discovery messages*/
|
||||
int
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_SL_DestinationInfoList_r12_t *destinationInfoList,
|
||||
int n_discoveryMessages
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_SL_DestinationInfoList_r12_t *destinationInfoList,
|
||||
int n_discoveryMessages
|
||||
);
|
||||
|
||||
/** \brief process the received SidelinkUEInformation message at eNB
|
||||
@@ -390,9 +390,9 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
|
||||
\param sidelinkUEInformation sidelinkUEInformation message from UE*/
|
||||
uint8_t
|
||||
rrc_eNB_process_SidelinkUEInformation(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
LTE_SidelinkUEInformation_r12_t* sidelinkUEInformation
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
LTE_SidelinkUEInformation_r12_t *sidelinkUEInformation
|
||||
);
|
||||
|
||||
/** \brief Get a Resource Pool to transmit SL communication
|
||||
@@ -400,9 +400,9 @@ rrc_eNB_process_SidelinkUEInformation(
|
||||
\param ue_context_pP UE context
|
||||
\param destinationInfoList Pointer to the list of SL destinations*/
|
||||
LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_SL_DestinationInfoList_r12_t *destinationInfoList
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_SL_DestinationInfoList_r12_t *destinationInfoList
|
||||
);
|
||||
|
||||
/** \brief Get a Resource Pool for Discovery
|
||||
@@ -410,9 +410,9 @@ LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool(
|
||||
\param ue_context_pP UE context
|
||||
\param n_discoveryMessages Number of discovery messages*/
|
||||
LTE_SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
int n_discoveryMessages
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
int n_discoveryMessages
|
||||
);
|
||||
|
||||
/** \brief Process request from control socket
|
||||
@@ -428,7 +428,7 @@ mac_rrc_data_req(
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const uint8_t mbsfn_sync_area
|
||||
);
|
||||
|
||||
@@ -440,11 +440,11 @@ mac_rrc_data_ind(
|
||||
const sub_frame_t sub_frameP,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,
|
||||
const uint8_t* sduP,
|
||||
const uint8_t *sduP,
|
||||
const sdu_size_t sdu_lenP,
|
||||
const uint8_t mbsfn_sync_areaP
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, const boolean_t brOption
|
||||
, const boolean_t brOption
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -455,7 +455,7 @@ mac_rrc_data_req_ue(
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const mac_enb_index_t eNB_indexP,
|
||||
const uint8_t mbsfn_sync_area
|
||||
);
|
||||
@@ -468,7 +468,7 @@ mac_rrc_data_ind_ue(
|
||||
const sub_frame_t sub_frameP,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,
|
||||
const uint8_t* sduP,
|
||||
const uint8_t *sduP,
|
||||
const sdu_size_t sdu_lenP,
|
||||
const mac_enb_index_t eNB_indexP,
|
||||
const uint8_t mbsfn_sync_areaP
|
||||
@@ -477,84 +477,84 @@ mac_rrc_data_ind_ue(
|
||||
void mac_sync_ind( module_id_t Mod_instP, uint8_t status);
|
||||
|
||||
void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
|
||||
void mac_eNB_rrc_uplane_failure(const module_id_t Mod_instP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
|
||||
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rnti);
|
||||
|
||||
uint8_t
|
||||
rrc_data_req(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_size,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
uint8_t
|
||||
|
||||
rrc_data_req_ue(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t* const buffer_pP
|
||||
const uint8_t *const buffer_pP
|
||||
);
|
||||
|
||||
void rrc_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index);
|
||||
|
||||
void rrc_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
|
||||
|
||||
int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area );
|
||||
int decode_MCCH_Message( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const uint8_t *const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area );
|
||||
|
||||
int decode_BCCH_DLSCH_Message(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
uint8_t* const Sdu,
|
||||
uint8_t *const Sdu,
|
||||
const uint8_t Sdu_len,
|
||||
const uint8_t rsrq,
|
||||
const uint8_t rsrp );
|
||||
|
||||
int decode_PCCH_DLSCH_Message(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
uint8_t* const Sdu,
|
||||
uint8_t *const Sdu,
|
||||
const uint8_t Sdu_len);
|
||||
|
||||
void
|
||||
ue_meas_filtering(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index
|
||||
);
|
||||
|
||||
void
|
||||
ue_measurement_report_triggering(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index
|
||||
);
|
||||
|
||||
@@ -572,35 +572,35 @@ mac_UE_get_rrc_status(
|
||||
|
||||
void
|
||||
rrc_eNB_generate_UECapabilityEnquiry(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_SecurityModeCommand(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_process_MeasurementReport(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const LTE_MeasResults_t* const measResults2
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
const LTE_MeasResults_t *const measResults2
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_HandoverPreparationInformation(
|
||||
//const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t* buffer,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *buffer,
|
||||
int *_size
|
||||
//LTE_PhysCellId_t targetPhyId
|
||||
);
|
||||
|
||||
void
|
||||
check_handovers(
|
||||
protocol_ctxt_t* const ctxt_pP
|
||||
protocol_ctxt_t *const ctxt_pP
|
||||
);
|
||||
|
||||
//void rrc_ue_process_ueCapabilityEnquiry(uint8_t module_idP,uint32_t frame,UECapabilityEnquiry_t *UECapabilityEnquiry,uint8_t eNB_index);
|
||||
@@ -624,15 +624,15 @@ void rrc_eNB_emulation_notify_ue_module_id(
|
||||
|
||||
void
|
||||
rrc_eNB_free_mem_UE_context(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
struct rrc_eNB_ue_context_s* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
struct rrc_eNB_ue_context_s *const ue_context_pP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
rrc_eNB_free_UE(
|
||||
const module_id_t enb_mod_idP,
|
||||
const struct rrc_eNB_ue_context_s* const ue_context_pP
|
||||
const module_id_t enb_mod_idP,
|
||||
const struct rrc_eNB_ue_context_s *const ue_context_pP
|
||||
);
|
||||
|
||||
long binary_search_int(int elements[], long numElem, int value);
|
||||
@@ -642,10 +642,10 @@ long binary_search_float(float elements[], long numElem, float value);
|
||||
void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active);
|
||||
|
||||
void openair_rrc_top_init_ue(
|
||||
int eMBMS_active,
|
||||
char* uecap_xer,
|
||||
uint8_t cba_group_active,
|
||||
uint8_t HO_active
|
||||
int eMBMS_active,
|
||||
char *uecap_xer,
|
||||
uint8_t cba_group_active,
|
||||
uint8_t HO_active
|
||||
);
|
||||
pthread_mutex_t rrc_release_freelist;
|
||||
RRC_release_list_t rrc_release_info;
|
||||
|
||||
@@ -133,8 +133,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
|
||||
* \enddot
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
STATE_START_OCG, /*!< \brief initiate OCG */
|
||||
STATE_GET_OPT, /*!< \brief get options of OCG command */
|
||||
STATE_DETECT_FILE, /*!< \brief detect the configuration file in folder USER_XML_FOLDER */
|
||||
@@ -569,7 +568,7 @@ typedef struct {
|
||||
} Layer;
|
||||
|
||||
typedef struct {
|
||||
char * level;
|
||||
char *level;
|
||||
char *verbosity;
|
||||
int interval;
|
||||
} Log_Emu;
|
||||
@@ -596,8 +595,8 @@ typedef struct {
|
||||
Log_Emu log_emu;
|
||||
Packet_Trace packet_trace;
|
||||
Seed seed;
|
||||
char * curve;
|
||||
char * background_stats;
|
||||
char *curve;
|
||||
char *background_stats;
|
||||
// CLI tags are in Info
|
||||
//char g_log_level[20];
|
||||
} Emulation_Config;
|
||||
@@ -675,7 +674,7 @@ typedef struct {
|
||||
unsigned char cba_group_active;
|
||||
unsigned char cba_backoff;
|
||||
unsigned char handover_active;
|
||||
char * otg_traffic;
|
||||
char *otg_traffic;
|
||||
unsigned char otg_bg_traffic_enabled;
|
||||
unsigned char omg_model_rn;
|
||||
unsigned char omg_model_enb;
|
||||
@@ -703,7 +702,7 @@ typedef struct {
|
||||
node_function_t node_function[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)
|
||||
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_S[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,
|
||||
** 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;
|
||||
|
||||
int header_result;
|
||||
int decode_result;
|
||||
uint8_t *buffer_log = buffer;
|
||||
uint32_t len_log = len;
|
||||
int down_link;
|
||||
|
||||
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
|
||||
down_link = 0;
|
||||
# else
|
||||
down_link = 1;
|
||||
# endif
|
||||
|
||||
|
||||
/* First decode the EMM message header */
|
||||
header_result = _emm_msg_decode_header(&msg->header, buffer, len);
|
||||
|
||||
@@ -110,144 +105,143 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
|
||||
buffer += header_result;
|
||||
len -= header_result;
|
||||
|
||||
LOG_TRACE(INFO, "EMM-MSG - Message Type 0x%02x", msg->header.message_type);
|
||||
|
||||
switch(msg->header.message_type) {
|
||||
case EMM_INFORMATION:
|
||||
decode_result = decode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
case EMM_INFORMATION:
|
||||
decode_result = decode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REJECT:
|
||||
decode_result = decode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REJECT:
|
||||
decode_result = decode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_FAILURE:
|
||||
decode_result = decode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_FAILURE:
|
||||
decode_result = decode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DETACH_ACCEPT:
|
||||
decode_result = decode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
case DETACH_ACCEPT:
|
||||
decode_result = decode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SERVICE_REJECT:
|
||||
decode_result = decode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
case SERVICE_REJECT:
|
||||
decode_result = decode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REQUEST:
|
||||
decode_result = decode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REQUEST:
|
||||
decode_result = decode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
decode_result = decode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
decode_result = decode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REQUEST:
|
||||
decode_result = decode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
case ATTACH_REQUEST:
|
||||
decode_result = decode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case EMM_STATUS:
|
||||
decode_result = decode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
case EMM_STATUS:
|
||||
decode_result = decode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_RESPONSE:
|
||||
decode_result = decode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
case IDENTITY_RESPONSE:
|
||||
decode_result = decode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_REQUEST:
|
||||
decode_result = decode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
case IDENTITY_REQUEST:
|
||||
decode_result = decode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
decode_result = decode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
decode_result = decode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
decode_result = decode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
decode_result = decode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_ACCEPT:
|
||||
decode_result = decode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
case ATTACH_ACCEPT:
|
||||
decode_result = decode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
decode_result = decode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
decode_result = decode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
decode_result = decode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
decode_result = decode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REJECT:
|
||||
decode_result = decode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
case ATTACH_REJECT:
|
||||
decode_result = decode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_COMPLETE:
|
||||
decode_result = decode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
case ATTACH_COMPLETE:
|
||||
decode_result = decode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
decode_result = decode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
decode_result = decode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
decode_result = decode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
decode_result = decode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_REJECT:
|
||||
decode_result = decode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
case SECURITY_MODE_REJECT:
|
||||
decode_result = decode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case DETACH_REQUEST:
|
||||
decode_result = decode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
case DETACH_REQUEST:
|
||||
decode_result = decode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
decode_result = decode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
decode_result = decode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMMAND:
|
||||
decode_result = decode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMMAND:
|
||||
decode_result = decode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
decode_result = decode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
decode_result = decode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
decode_result = decode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
decode_result = decode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
decode_result = TLV_DECODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
decode_result = TLV_DECODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
}
|
||||
|
||||
if (decode_result < 0) {
|
||||
@@ -281,24 +275,17 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
** 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;
|
||||
|
||||
int header_result;
|
||||
int encode_result;
|
||||
|
||||
|
||||
uint8_t *buffer_log = buffer;
|
||||
int down_link;
|
||||
|
||||
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
|
||||
down_link = 1;
|
||||
# else
|
||||
down_link = 0;
|
||||
# endif
|
||||
|
||||
|
||||
/* First encode the EMM message header */
|
||||
header_result = _emm_msg_encode_header(&msg->header, buffer, len);
|
||||
|
||||
@@ -312,144 +299,144 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
len -= header_result;
|
||||
|
||||
switch(msg->header.message_type) {
|
||||
case EMM_INFORMATION:
|
||||
encode_result = encode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
case EMM_INFORMATION:
|
||||
encode_result = encode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REJECT:
|
||||
encode_result = encode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REJECT:
|
||||
encode_result = encode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_FAILURE:
|
||||
encode_result = encode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_FAILURE:
|
||||
encode_result = encode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DETACH_ACCEPT:
|
||||
encode_result = encode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
case DETACH_ACCEPT:
|
||||
encode_result = encode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SERVICE_REJECT:
|
||||
encode_result = encode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
case SERVICE_REJECT:
|
||||
encode_result = encode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REQUEST:
|
||||
encode_result = encode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REQUEST:
|
||||
encode_result = encode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
encode_result = encode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
encode_result = encode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REQUEST:
|
||||
encode_result = encode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
case ATTACH_REQUEST:
|
||||
encode_result = encode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case EMM_STATUS:
|
||||
encode_result = encode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
case EMM_STATUS:
|
||||
encode_result = encode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_RESPONSE:
|
||||
encode_result = encode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
case IDENTITY_RESPONSE:
|
||||
encode_result = encode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_REQUEST:
|
||||
encode_result = encode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
case IDENTITY_REQUEST:
|
||||
encode_result = encode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
encode_result = encode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
encode_result = encode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
encode_result = encode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
encode_result = encode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_ACCEPT:
|
||||
encode_result = encode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
case ATTACH_ACCEPT:
|
||||
encode_result = encode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
encode_result = encode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
encode_result = encode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
encode_result = encode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
encode_result = encode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REJECT:
|
||||
encode_result = encode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
case ATTACH_REJECT:
|
||||
encode_result = encode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_COMPLETE:
|
||||
encode_result = encode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
case ATTACH_COMPLETE:
|
||||
encode_result = encode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
encode_result = encode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
encode_result = encode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
encode_result = encode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
encode_result = encode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_REJECT:
|
||||
encode_result = encode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
case SECURITY_MODE_REJECT:
|
||||
encode_result = encode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case DETACH_REQUEST:
|
||||
encode_result = encode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
case DETACH_REQUEST:
|
||||
encode_result = encode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
encode_result = encode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
encode_result = encode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMMAND:
|
||||
encode_result = encode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMMAND:
|
||||
encode_result = encode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
encode_result = encode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
encode_result = encode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
encode_result = encode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
encode_result = encode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case SERVICE_REQUEST:
|
||||
encode_result = encode_service_request(&msg->service_request, buffer, len);
|
||||
break;
|
||||
case SERVICE_REQUEST:
|
||||
encode_result = encode_service_request(&msg->service_request, buffer, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
encode_result = TLV_ENCODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
encode_result = TLV_ENCODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
}
|
||||
|
||||
if (encode_result < 0) {
|
||||
@@ -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,
|
||||
const uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
const uint8_t *buffer, uint32_t len) {
|
||||
int size = 0;
|
||||
|
||||
/* Check the buffer length */
|
||||
@@ -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,
|
||||
uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
uint8_t *buffer, uint32_t len) {
|
||||
int size = 0;
|
||||
|
||||
/* Check the buffer length */
|
||||
@@ -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 the message type */
|
||||
ENCODE_U8(buffer + size, header->message_type, size);
|
||||
|
||||
return (size);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ******************/
|
||||
/****************************************************************************/
|
||||
|
||||
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_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_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);
|
||||
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_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__ */
|
||||
|
||||
@@ -58,7 +58,7 @@ Description Defines the EPS Mobility Management procedure call manager,
|
||||
* 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,
|
||||
const char*, size_t);
|
||||
const char *, size_t);
|
||||
|
||||
/****************************************************************************/
|
||||
/******************** 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 *,
|
||||
int esm_ebr_context_create(
|
||||
esm_data_t *esm_data, int ueid,
|
||||
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;
|
||||
esm_data_context_t *esm_ctx = NULL;
|
||||
esm_pdn_t *pdn = NULL;
|
||||
|
||||
LOG_FUNC_IN;
|
||||
|
||||
esm_ctx = esm_data;
|
||||
|
||||
bid = ESM_DATA_EPS_BEARER_MAX;
|
||||
|
||||
LOG_TRACE(INFO, "ESM-PROC - Create new %s EPS bearer context (ebi=%d) "
|
||||
"for PDN connection (pid=%d)",
|
||||
(is_default)? "default" : "dedicated", ebi, pid);
|
||||
@@ -162,7 +157,7 @@ int esm_ebr_context_create(
|
||||
esm_bearer_t *ebr = (esm_bearer_t *)malloc(sizeof(esm_bearer_t));
|
||||
|
||||
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 */
|
||||
esm_ctx->n_ebrs += 1;
|
||||
/* Increment the number of EPS bearer for this PDN connection */
|
||||
@@ -203,78 +198,77 @@ int esm_ebr_context_create(
|
||||
|
||||
// LG ADD TEMP
|
||||
{
|
||||
char *tmp = NULL;
|
||||
char ipv4_addr[INET_ADDRSTRLEN];
|
||||
//char ipv6_addr[INET6_ADDRSTRLEN];
|
||||
char *netmask = NULL;
|
||||
char broadcast[INET_ADDRSTRLEN];
|
||||
struct in_addr in_addr;
|
||||
char command_line[500];
|
||||
int res = -1;
|
||||
char *tmp = NULL;
|
||||
char ipv4_addr[INET_ADDRSTRLEN];
|
||||
//char ipv6_addr[INET6_ADDRSTRLEN];
|
||||
char *netmask = NULL;
|
||||
char broadcast[INET_ADDRSTRLEN];
|
||||
struct in_addr in_addr;
|
||||
char command_line[500];
|
||||
int res = -1;
|
||||
|
||||
switch (pdn->type) {
|
||||
case NET_PDN_TYPE_IPV4V6:
|
||||
//ipv6_addr[0] = pdn->ip_addr[4];
|
||||
/* TODO? */
|
||||
switch (pdn->type) {
|
||||
case NET_PDN_TYPE_IPV4V6:
|
||||
|
||||
// etc
|
||||
case NET_PDN_TYPE_IPV4:
|
||||
// in_addr is in network byte order
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
|
||||
( pdn->ip_addr[3] & 0x000000FF);
|
||||
//ipv6_addr[0] = pdn->ip_addr[4];
|
||||
/* TODO? */
|
||||
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
|
||||
tmp = inet_ntoa(in_addr);
|
||||
//AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(ipv4_addr, tmp);
|
||||
|
||||
if (IN_CLASSA(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.0.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((255 << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSB(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSC(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.255.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
// etc
|
||||
case NET_PDN_TYPE_IPV4:
|
||||
// in_addr is in network byte order
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else {
|
||||
netmask = "255.255.255.255";
|
||||
strcpy(broadcast, ipv4_addr);
|
||||
}
|
||||
( pdn->ip_addr[3] & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
//AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(ipv4_addr, tmp);
|
||||
|
||||
if(nfapi_mode ==3){
|
||||
if (IN_CLASSA(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.0.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((255 << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSB(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSC(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.255.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else {
|
||||
netmask = "255.255.255.255";
|
||||
strcpy(broadcast, ipv4_addr);
|
||||
}
|
||||
|
||||
if(nfapi_mode ==3) {
|
||||
// this is for L2 FAPI simulator.
|
||||
// change for multiple UE's like 256UEs.
|
||||
// if it's made too many tables , OS may crush so we use one table.
|
||||
@@ -282,74 +276,75 @@ int esm_ebr_context_create(
|
||||
#ifdef UESIM_EXPANSION
|
||||
uint16_t inst_nic = (pdn->ip_addr[3] & 0x000000FF) - 2;
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/24 table %d && "
|
||||
"ip rule add to %s/24 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
inst_nic + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, 201,
|
||||
ipv4_addr, 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
inst_nic + 1, 201);
|
||||
|
||||
inst_pdcp_list[inst_nic] = ueid;
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/24 table %d && "
|
||||
"ip rule add to %s/24 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
inst_nic + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, 201,
|
||||
ipv4_addr, 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
inst_nic + 1, 201);
|
||||
inst_pdcp_list[inst_nic] = ueid;
|
||||
#else
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ueid + 201);
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ueid + 201);
|
||||
#endif
|
||||
} // PDCP_USE_NETLINK
|
||||
} else {
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ueid + 201);
|
||||
}
|
||||
if ( res<0 ) {
|
||||
} // PDCP_USE_NETLINK
|
||||
} else {
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ueid + 201);
|
||||
}
|
||||
|
||||
if ( res<0 ) {
|
||||
LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string");
|
||||
}
|
||||
LOG_TRACE(INFO, "ESM-PROC - executing %s ",
|
||||
command_line);
|
||||
}
|
||||
|
||||
/* Calling system() here disrupts UE's realtime processing in some cases.
|
||||
* This may be because of the call to fork(), which, for some
|
||||
* unidentified reason, interacts badly with other (realtime) threads.
|
||||
* background_system() is a replacement mechanism relying on a
|
||||
* background process that does the system() and reports result to
|
||||
* the parent process (lte-softmodem, oaisim, ...). The background
|
||||
* process is created very early in the life of the parent process.
|
||||
* The processes interact through standard pipes. See
|
||||
* common/utils/system.c for details.
|
||||
*/
|
||||
if (background_system(command_line) != 0)
|
||||
LOG_TRACE(ERROR, "ESM-PROC - failed command '%s'", command_line);
|
||||
LOG_TRACE(INFO, "ESM-PROC - executing %s ",
|
||||
command_line);
|
||||
|
||||
break;
|
||||
/* Calling system() here disrupts UE's realtime processing in some cases.
|
||||
* This may be because of the call to fork(), which, for some
|
||||
* unidentified reason, interacts badly with other (realtime) threads.
|
||||
* background_system() is a replacement mechanism relying on a
|
||||
* background process that does the system() and reports result to
|
||||
* the parent process (lte-softmodem, oaisim, ...). The background
|
||||
* process is created very early in the life of the parent process.
|
||||
* The processes interact through standard pipes. See
|
||||
* common/utils/system.c for details.
|
||||
*/
|
||||
if (background_system(command_line) != 0)
|
||||
LOG_TRACE(ERROR, "ESM-PROC - failed command '%s'", command_line);
|
||||
|
||||
case NET_PDN_TYPE_IPV6:
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// AssertFatal(0, "Forced stop in NAS UE");
|
||||
case NET_PDN_TYPE_IPV6:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// AssertFatal(0, "Forced stop in NAS UE");
|
||||
}
|
||||
|
||||
/* Return the EPS bearer identity of the default EPS bearer
|
||||
@@ -384,16 +379,13 @@ int esm_ebr_context_create(
|
||||
** **
|
||||
***************************************************************************/
|
||||
int esm_ebr_context_release(nas_user_t *user,
|
||||
int ebi, int *pid, int *bid)
|
||||
{
|
||||
int ebi, int *pid, int *bid) {
|
||||
int found = FALSE;
|
||||
esm_pdn_t *pdn = NULL;
|
||||
esm_data_context_t *esm_ctx;
|
||||
esm_ebr_data_t *esm_ebr_data = user->esm_ebr_data;
|
||||
user_api_id_t *user_api_id = user->user_api_id;
|
||||
|
||||
LOG_FUNC_IN;
|
||||
|
||||
esm_ctx = user->esm_data;
|
||||
|
||||
if (ebi != ESM_EBI_UNASSIGNED) {
|
||||
@@ -498,7 +490,6 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
*/
|
||||
for (i = 1; pdn->n_bearers > 0; i++) {
|
||||
if (pdn->bearer[i]) {
|
||||
|
||||
LOG_TRACE(WARNING, "ESM-PROC - Release EPS bearer context "
|
||||
"(ebi=%d)", pdn->bearer[i]->ebi);
|
||||
|
||||
@@ -509,11 +500,9 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
|
||||
/* Set the EPS bearer context state to INACTIVE */
|
||||
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 */
|
||||
esm_ebr_release(esm_ebr_data, pdn->bearer[i]->ebi);
|
||||
|
||||
// esm_ebr_release()
|
||||
/* Release dedicated EPS bearer data */
|
||||
free(pdn->bearer[i]);
|
||||
@@ -535,7 +524,6 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 3GPP TS 24.301, section 6.4.4.6
|
||||
* If the UE locally deactivated all EPS bearer contexts, the UE
|
||||
* shall perform a local detach and enter state EMM-DEREGISTERED.
|
||||
@@ -584,10 +572,8 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
** 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;
|
||||
|
||||
int 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)
|
||||
***************************************************************************/
|
||||
int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi,
|
||||
const network_tft_t *tft,
|
||||
esm_ebr_context_tft_t operation)
|
||||
{
|
||||
esm_ebr_context_tft_t operation) {
|
||||
LOG_FUNC_IN;
|
||||
|
||||
int rc = RETURNerror;
|
||||
int i;
|
||||
|
||||
@@ -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,
|
||||
const network_tft_t *tft2)
|
||||
{
|
||||
const network_tft_t *tft2) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
@@ -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,
|
||||
const network_tft_t *tft2)
|
||||
{
|
||||
const network_tft_t *tft2) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
# include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "x2ap_eNB.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "x2ap_eNB.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALue.h"
|
||||
#include "lteRALenb.h"
|
||||
@@ -51,7 +51,6 @@ int create_tasks(uint32_t enb_nb) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
if (enb_nb > 0) {
|
||||
if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) {
|
||||
@@ -83,7 +82,6 @@ int create_tasks(uint32_t enb_nb) {
|
||||
}
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
|
||||
|
||||
if (enb_nb > 0) {
|
||||
LOG_I(RRC,"Creating RRC eNB Task\n");
|
||||
|
||||
|
||||
@@ -40,10 +40,11 @@
|
||||
int create_tasks_ue(uint32_t ue_nb) {
|
||||
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
|
||||
itti_wait_ready(1);
|
||||
if (EPC_MODE_ENABLED) {
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
# if defined(NAS_BUILT_IN_UE)
|
||||
|
||||
if (ue_nb > 0) {
|
||||
if (ue_nb > 0) {
|
||||
nas_user_container_t *users = calloc(1, sizeof(*users));
|
||||
|
||||
if (users == NULL) abort();
|
||||
@@ -55,6 +56,7 @@ int create_tasks_ue(uint32_t ue_nb) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
} /* EPC_MODE_ENABLED */
|
||||
|
||||
|
||||
+68
-96
@@ -150,16 +150,16 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) {
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
//L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx;
|
||||
|
||||
// *******************************************************************
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
RU_t *ru = RC.ru[0];
|
||||
RU_t *ru = RC.ru[0];
|
||||
#endif
|
||||
|
||||
if (eNB ==NULL) {
|
||||
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
|
||||
return -1;
|
||||
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nfapi_mode == 1) {
|
||||
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
||||
uint16_t frame = proc->frame_rx;
|
||||
@@ -213,42 +213,41 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 1 );
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
if (nfapi_mode == 2){
|
||||
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
|
||||
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
|
||||
|
||||
// L2-emulator can work only one eNB.
|
||||
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
if (nfapi_mode == 2) {
|
||||
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
|
||||
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
|
||||
// L2-emulator can work only one eNB.
|
||||
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
|
||||
if (pthread_mutex_lock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error locking proc mutex for eNB pre scd\n");
|
||||
exit_fun("error locking mutex_time");
|
||||
}
|
||||
|
||||
ru->proc.instance_pre_scd++;
|
||||
|
||||
if (ru->proc.instance_pre_scd == 0) {
|
||||
if (pthread_cond_signal(&ru->proc.cond_pre_scd) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB pre scd\n" );
|
||||
exit_fun( "ERROR pthread_cond_signal cond_pre_scd" );
|
||||
}
|
||||
}else{
|
||||
LOG_E( PHY, "[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d\n",
|
||||
proc->frame_rx,proc->subframe_rx,ru->proc.instance_pre_scd );
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
|
||||
exit_fun("error unlocking mutex_pre_scd");
|
||||
}
|
||||
if (pthread_mutex_lock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error locking proc mutex for eNB pre scd\n");
|
||||
exit_fun("error locking mutex_time");
|
||||
}
|
||||
#endif
|
||||
|
||||
ru->proc.instance_pre_scd++;
|
||||
|
||||
if (ru->proc.instance_pre_scd == 0) {
|
||||
if (pthread_cond_signal(&ru->proc.cond_pre_scd) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB pre scd\n" );
|
||||
exit_fun( "ERROR pthread_cond_signal cond_pre_scd" );
|
||||
}
|
||||
} else {
|
||||
LOG_E( PHY, "[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d\n",
|
||||
proc->frame_rx,proc->subframe_rx,ru->proc.instance_pre_scd );
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
|
||||
exit_fun("error unlocking mutex_pre_scd");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
eNB->UL_INFO.frame = proc->frame_rx;
|
||||
eNB->UL_INFO.subframe = proc->subframe_rx;
|
||||
@@ -313,9 +312,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
}
|
||||
|
||||
|
||||
static void* L1_thread_tx(void* param) {
|
||||
|
||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
static void *L1_thread_tx(void *param) {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
char thread_name[100];
|
||||
@@ -326,7 +324,8 @@ static void* L1_thread_tx(void* param) {
|
||||
|
||||
while (!oai_exit) {
|
||||
if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break;
|
||||
if (oai_exit) break;
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
// *****************************************
|
||||
// TX processing for subframe n+4
|
||||
@@ -338,8 +337,6 @@ static void* L1_thread_tx(void* param) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
|
||||
pthread_mutex_lock( &proc->mutex );
|
||||
proc->instance_cnt = -1;
|
||||
|
||||
@@ -348,6 +345,7 @@ static void* L1_thread_tx(void* param) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex );
|
||||
wakeup_txfh(proc,eNB);
|
||||
}
|
||||
@@ -361,29 +359,25 @@ static void* L1_thread_tx(void* param) {
|
||||
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
||||
*/
|
||||
|
||||
static void* L1_thread( void* param ) {
|
||||
|
||||
static void *L1_thread( void *param ) {
|
||||
static int eNB_thread_rxtx_status;
|
||||
//L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
L1_rxtx_proc_t *proc;
|
||||
|
||||
// Working
|
||||
if(nfapi_mode ==2){
|
||||
proc = (L1_rxtx_proc_t*)param;
|
||||
}
|
||||
else{
|
||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
if(nfapi_mode ==2) {
|
||||
proc = (L1_rxtx_proc_t *)param;
|
||||
} else {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
proc = &eNB_proc->L1_proc;
|
||||
}
|
||||
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
|
||||
char thread_name[100];
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
// set default return value
|
||||
eNB_thread_rxtx_status = 0;
|
||||
|
||||
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
pthread_setname_np( pthread_self(),"rxtx processing");
|
||||
@@ -409,10 +403,12 @@ static void* L1_thread( void* param ) {
|
||||
}
|
||||
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
if (nfapi_mode!=2){
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB);
|
||||
|
||||
if (nfapi_mode!=2) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB);
|
||||
}
|
||||
} // while !oai_exit
|
||||
|
||||
@@ -422,8 +418,7 @@ static void* L1_thread( void* param ) {
|
||||
return &eNB_thread_rxtx_status;
|
||||
}
|
||||
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru)
|
||||
{
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru) {
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
@@ -433,7 +428,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
|
||||
if (!oai_exit) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
|
||||
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
L1_proc->frame_rx = ru_proc->frame_rx;
|
||||
L1_proc->subframe_rx = ru_proc->subframe_rx;
|
||||
@@ -441,6 +435,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10;
|
||||
|
||||
if (rxtx(eNB,L1_proc,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
|
||||
|
||||
ru_proc->timestamp_tx = L1_proc->timestamp_tx;
|
||||
ru_proc->subframe_tx = L1_proc->subframe_tx;
|
||||
ru_proc->frame_tx = L1_proc->frame_tx;
|
||||
@@ -448,11 +443,8 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
}
|
||||
|
||||
int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
|
||||
RU_t *ru;
|
||||
RU_proc_t *ru_proc;
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
@@ -461,19 +453,22 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eNB->proc.mutex_RU_tx);
|
||||
eNB->proc.RU_mask_tx = 0;
|
||||
pthread_mutex_unlock(&eNB->proc.mutex_RU_tx);
|
||||
|
||||
if (release_thread(&proc->mutex_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) return(-1);
|
||||
|
||||
for(int i=0; i<eNB->num_RU; i++)
|
||||
{
|
||||
for(int i=0; i<eNB->num_RU; i++) {
|
||||
ru = eNB->RU_list[i];
|
||||
ru_proc = &ru->proc;
|
||||
|
||||
if (ru_proc->instance_cnt_eNBs == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs );
|
||||
exit_fun( "error locking mutex_eNB" );
|
||||
@@ -485,14 +480,13 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
ru_proc->subframe_tx = proc->subframe_tx;
|
||||
ru_proc->frame_tx = proc->frame_tx;
|
||||
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_unlock( &ru_proc->mutex_eNBs );
|
||||
}
|
||||
|
||||
@@ -500,30 +494,24 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
|
||||
int wakeup_tx(PHY_VARS_eNB *eNB) {
|
||||
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
|
||||
L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
|
||||
if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) {
|
||||
LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n");
|
||||
exit_fun("ERROR pthread_lock");
|
||||
return(-1);
|
||||
}
|
||||
while(L1_proc_tx->instance_cnt == 0){
|
||||
|
||||
while(L1_proc_tx->instance_cnt == 0) {
|
||||
pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex);
|
||||
}
|
||||
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
|
||||
|
||||
L1_proc_tx->subframe_rx = L1_proc->subframe_rx;
|
||||
L1_proc_tx->frame_rx = L1_proc->frame_rx;
|
||||
L1_proc_tx->subframe_tx = L1_proc->subframe_tx;
|
||||
@@ -536,18 +524,15 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_unlock( &L1_proc_tx->mutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
|
||||
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int i;
|
||||
struct timespec wait;
|
||||
@@ -575,7 +560,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
if (L1_proc->instance_cnt == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 thread busy, dropping\n",L1_proc->frame_rx,L1_proc->subframe_rx);
|
||||
return(-1);
|
||||
@@ -590,9 +574,8 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// transmitted timestamp of the next TX slot (first).
|
||||
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
|
||||
// we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti,
|
||||
@@ -615,7 +598,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
@@ -678,7 +660,6 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
@@ -750,7 +731,6 @@ static void *eNB_thread_prach( void *param ) {
|
||||
static int eNB_thread_prach_status;
|
||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
|
||||
@@ -787,7 +767,6 @@ static void *eNB_thread_prach_br( void *param ) {
|
||||
static int eNB_thread_prach_status;
|
||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
|
||||
@@ -868,7 +847,6 @@ void init_eNB_proc(int inst) {
|
||||
LOG_I(PHY,"Initializing eNB processes instance:%d CC_id %d \n",inst,CC_id);
|
||||
#endif
|
||||
proc = &eNB->proc;
|
||||
|
||||
L1_proc = &proc->L1_proc;
|
||||
L1_proc_tx = &proc->L1_proc_tx;
|
||||
L1_proc->instance_cnt = -1;
|
||||
@@ -878,14 +856,12 @@ void init_eNB_proc(int inst) {
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_synch = -1;
|
||||
proc->CC_id = CC_id;
|
||||
|
||||
proc->CC_id = CC_id;
|
||||
proc->first_rx =1;
|
||||
proc->first_tx =1;
|
||||
proc->RU_mask_tx = (1<<eNB->num_RU)-1;
|
||||
proc->RU_mask =0;
|
||||
proc->RU_mask_prach =0;
|
||||
|
||||
pthread_mutex_init( &eNB->UL_INFO_mutex, NULL);
|
||||
pthread_mutex_init( &L1_proc->mutex, NULL);
|
||||
pthread_mutex_init( &L1_proc_tx->mutex, NULL);
|
||||
@@ -895,7 +871,6 @@ void init_eNB_proc(int inst) {
|
||||
pthread_mutex_init( &L1_proc_tx->mutex_RUs, NULL);
|
||||
pthread_cond_init( &L1_proc->cond_RUs, NULL);
|
||||
pthread_cond_init( &L1_proc_tx->cond_RUs, NULL);
|
||||
|
||||
pthread_mutex_init( &proc->mutex_prach, NULL);
|
||||
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
|
||||
pthread_mutex_init( &proc->mutex_RU,NULL);
|
||||
@@ -948,7 +923,6 @@ void init_eNB_proc(int inst) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
#endif
|
||||
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
@@ -989,7 +963,6 @@ void kill_eNB_proc(int inst) {
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB=RC.eNB[inst][CC_id];
|
||||
|
||||
proc = &eNB->proc;
|
||||
L1_proc = &proc->L1_proc;
|
||||
L1_proc_tx = &proc->L1_proc_tx;
|
||||
@@ -1006,7 +979,6 @@ void kill_eNB_proc(int inst) {
|
||||
L1_proc->instance_cnt = 0;
|
||||
pthread_cond_signal(&L1_proc->cond);
|
||||
pthread_mutex_unlock(&L1_proc->mutex);
|
||||
|
||||
pthread_mutex_lock(&L1_proc_tx->mutex);
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
pthread_cond_signal(&L1_proc_tx->cond);
|
||||
@@ -1036,10 +1008,11 @@ void kill_eNB_proc(int inst) {
|
||||
|
||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
||||
LOG_I(PHY, "Joining L1_proc mutex/cond\n");
|
||||
pthread_join( L1_proc->pthread, (void**)&status );
|
||||
pthread_join( L1_proc->pthread, (void **)&status );
|
||||
LOG_I(PHY, "Joining L1_proc_tx mutex/cond\n");
|
||||
pthread_join( L1_proc_tx->pthread, (void**)&status );
|
||||
pthread_join( L1_proc_tx->pthread, (void **)&status );
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Destroying L1_proc mutex/cond\n");
|
||||
pthread_mutex_destroy( &L1_proc->mutex );
|
||||
pthread_cond_destroy( &L1_proc->cond );
|
||||
@@ -1050,7 +1023,6 @@ void kill_eNB_proc(int inst) {
|
||||
pthread_cond_destroy( &L1_proc_tx->cond );
|
||||
pthread_mutex_destroy( &L1_proc_tx->mutex_RUs );
|
||||
pthread_cond_destroy( &L1_proc_tx->cond_RUs );
|
||||
|
||||
pthread_attr_destroy(&proc->attr_prach);
|
||||
pthread_attr_destroy(&proc->attr_asynch_rxtx);
|
||||
pthread_attr_destroy(&L1_proc->attr);
|
||||
|
||||
+1043
-1192
File diff suppressed because it is too large
Load Diff
@@ -98,7 +98,9 @@ void get_common_options(void) {
|
||||
unsigned int is_nos1exec(char *exepath) {
|
||||
if ( strcmp( basename(exepath), "lte-softmodem-nos1") == 0)
|
||||
return 1;
|
||||
|
||||
if ( strcmp( basename(exepath), "lte-uesoftmodem-nos1") == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -608,9 +608,12 @@ int main( int argc, char **argv ) {
|
||||
logInit();
|
||||
printf("Reading in command-line options\n");
|
||||
get_options ();
|
||||
|
||||
if (is_nos1exec(argv[0]) )
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
exit(-1);
|
||||
@@ -628,8 +631,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
// initialize mscgen log after ITTI
|
||||
@@ -638,7 +640,6 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
|
||||
init_opt();
|
||||
// to make a graceful exit when ctrl-c is pressed
|
||||
signal(SIGSEGV, signal_handler);
|
||||
@@ -654,6 +655,7 @@ int main( int argc, char **argv ) {
|
||||
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);
|
||||
#
|
||||
|
||||
if (RC.nb_inst > 0) {
|
||||
// don't create if node doesn't connect to RRC/S1/GTP
|
||||
if (create_tasks(1) < 0) {
|
||||
@@ -666,6 +668,7 @@ int main( int argc, char **argv ) {
|
||||
printf("No ITTI, Initializing L1\n");
|
||||
RCconfig_L1();
|
||||
}
|
||||
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
RCconfig_flexran();
|
||||
|
||||
@@ -745,8 +748,7 @@ int main( int argc, char **argv ) {
|
||||
|
||||
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)
|
||||
init_ru_vnf(); // ru pointer is necessary for pre_scd.
|
||||
#endif
|
||||
@@ -767,7 +769,6 @@ if (nfapi_mode==2) {// VNF
|
||||
|
||||
printf("wait_eNBs()\n");
|
||||
wait_eNBs();
|
||||
|
||||
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.
|
||||
@@ -776,7 +777,8 @@ if (nfapi_mode==2) {// VNF
|
||||
if (RC.nb_RU >0 && nfapi_mode != 2) {
|
||||
printf("Initializing RU threads\n");
|
||||
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.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
|
||||
@@ -241,20 +241,20 @@
|
||||
#define SOFTMODEM_BASICSIM_BIT (1<<10)
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
uint32_t do_forms;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
int hw_timing_advance;
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
int single_thread_flag; //eNodeB only
|
||||
int chain_offset;
|
||||
uint32_t do_forms;
|
||||
int numerology;
|
||||
unsigned int start_msc;
|
||||
uint32_t clock_source;
|
||||
int hw_timing_advance;
|
||||
} softmodem_params_t;
|
||||
|
||||
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
|
||||
|
||||
@@ -111,7 +111,7 @@ int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
|
||||
uint8_t nfapi_mode = 0;
|
||||
#ifdef UESIM_EXPANSION
|
||||
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
uint16_t sf_ahead=2;
|
||||
int tddflag;
|
||||
@@ -450,7 +450,7 @@ static void get_options(void) {
|
||||
}
|
||||
|
||||
UE_scan=0;
|
||||
|
||||
|
||||
if (tddflag > 0) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->frame_type = TDD;
|
||||
@@ -683,10 +683,9 @@ int main( int argc, char **argv ) {
|
||||
#endif
|
||||
int CC_id;
|
||||
uint8_t abstraction_flag=0;
|
||||
#ifdef UESIM_EXPANSION
|
||||
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
|
||||
#ifdef UESIM_EXPANSION
|
||||
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
|
||||
#endif
|
||||
|
||||
// Default value for the number of UEs. It will hold,
|
||||
// if not changed from the command line option --num-ues
|
||||
NB_UE_INST=1;
|
||||
@@ -695,9 +694,7 @@ int main( int argc, char **argv ) {
|
||||
int ret;
|
||||
#endif
|
||||
configmodule_interface_t *config_mod;
|
||||
|
||||
start_background_system();
|
||||
|
||||
config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
|
||||
|
||||
if (config_mod == NULL) {
|
||||
@@ -713,11 +710,11 @@ int main( int argc, char **argv ) {
|
||||
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
|
||||
|
||||
get_options ();
|
||||
|
||||
if (is_nos1exec(argv[0]) )
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
|
||||
|
||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 1 && simL1flag != 1 && nfapi_mode != 3) {
|
||||
@@ -728,15 +725,17 @@ int main( int argc, char **argv ) {
|
||||
printf("NFAPI_MODE value: %d \n", nfapi_mode);
|
||||
|
||||
// Checking option of nums_ue_thread.
|
||||
if(NB_THREAD_INST < 1){
|
||||
if(NB_THREAD_INST < 1) {
|
||||
printf("Running with 0 UE rxtx thread, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Checking option's relation between nums_ue_thread and num-ues
|
||||
if(NB_UE_INST <NB_THREAD_INST ){
|
||||
if(NB_UE_INST <NB_THREAD_INST ) {
|
||||
printf("Number of UEs < number of UE rxtx threads, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Not sure if the following is needed here
|
||||
/*if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
if (UE_flag == 0) {
|
||||
@@ -748,8 +747,6 @@ int main( int argc, char **argv ) {
|
||||
nfapi_mode = 4;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
@@ -824,7 +821,6 @@ int main( int argc, char **argv ) {
|
||||
RCConfig_sim();
|
||||
}
|
||||
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
#ifndef DEADLINE_SCHEDULER
|
||||
printf("NO deadline scheduler\n");
|
||||
@@ -856,7 +852,7 @@ int main( int argc, char **argv ) {
|
||||
exit_fun("Error getting processor affinity ");
|
||||
}
|
||||
|
||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||
memset(cpu_affinity, 0, sizeof(cpu_affinity));
|
||||
|
||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||
if (CPU_ISSET(j, &cpuset)) {
|
||||
@@ -869,6 +865,7 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||
#endif
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
if (create_tasks_ue(NB_UE_INST) < 0) {
|
||||
printf("cannot create ITTI tasks\n");
|
||||
exit(-1); // need a softer mode
|
||||
@@ -914,19 +911,16 @@ int main( int argc, char **argv ) {
|
||||
|
||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
if (nfapi_mode==3) // UE-STUB-PNF
|
||||
{
|
||||
config_sync_var=0;
|
||||
wait_nfapi_init("main?");
|
||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
if (nfapi_mode==3) { // UE-STUB-PNF
|
||||
config_sync_var=0;
|
||||
wait_nfapi_init("main?");
|
||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
} else {
|
||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||
frame_parms[0]);
|
||||
}
|
||||
else {
|
||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||
frame_parms[0]);
|
||||
}
|
||||
|
||||
|
||||
if (get_softmodem_params()->phy_test==0) {
|
||||
printf("Filling UE band info\n");
|
||||
@@ -934,13 +928,15 @@ int main( int argc, char **argv ) {
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if (nfapi_mode!=3){
|
||||
number_of_cards = 1;
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
if (nfapi_mode!=3) {
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
}
|
||||
|
||||
// connect the TX/RX buffers
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user