Commit 4f095f39 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.18.3: Added more MME encoding and decoding, RLC UMD header extension...

Version 0.18.3: Added more MME encoding and decoding, RLC UMD header extension support, and higher order modulation scheme support to PHY in the LTE library, split the error enum into common.h, moved to a new message queue using semaphores and circular buffers, added IP PCAP support, split UL/DL QoS TTI frequency, added user reset to RB class, added RLC UMD multiple data support, added UTC timestamps to the debug log port, added higher order modulation scheme support in MAC, fixed C-RNTI assign/release management, changed RTS timing, fixed user switch in MME/RRC, added clear RB support and fixed copy RB in the user class for LTE_fdd_enodeb.
parent 99eccc54
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.18.2)
set(openLTE_version 0.18.3)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -162,3 +162,13 @@ v00.18.02 Fixed several bugs in LTE_fdd_enodeb. Specifically, cleaned up th
message, added more time spec information in radio debug, copying
SRB1 PDCP config to SRB2, fixed a UMD reassembly bug, and did a hack
to get around a crash when releasing a C-RNTI in LTE_fdd_enodeb.
v00.18.03 Added more MME encoding and decoding, RLC UMD header extension
support, and higher order modulation scheme support to PHY in the LTE
library, split the error enum into common.h, moved to a new message
queue using semaphores and circular buffers, added IP PCAP support,
split UL/DL QoS TTI frequency, added user reset to RB class, added
RLC UMD multiple data support, added UTC timestamps to the debug
log port, added higher order modulation scheme support in MAC, fixed
C-RNTI assign/release management, changed RTS timing, fixed user
switch in MME/RRC, added clear RB support and fixed copy RB in the
user class for LTE_fdd_enodeb.
/*******************************************************************************
Copyright 2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************
File: LTE_fdd_enb_common.h
Description: Contains all the common definitions for the LTE FDD eNodeB.
Revision History
---------- ------------- --------------------------------------------
02/15/2015 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_COMMON_H__
#define __LTE_FDD_ENB_COMMON_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef enum{
LTE_FDD_ENB_ERROR_NONE = 0,
LTE_FDD_ENB_ERROR_INVALID_COMMAND,
LTE_FDD_ENB_ERROR_INVALID_PARAM,
LTE_FDD_ENB_ERROR_OUT_OF_BOUNDS,
LTE_FDD_ENB_ERROR_EXCEPTION,
LTE_FDD_ENB_ERROR_ALREADY_STARTED,
LTE_FDD_ENB_ERROR_ALREADY_STOPPED,
LTE_FDD_ENB_ERROR_CANT_START,
LTE_FDD_ENB_ERROR_CANT_STOP,
LTE_FDD_ENB_ERROR_BAD_ALLOC,
LTE_FDD_ENB_ERROR_USER_NOT_FOUND,
LTE_FDD_ENB_ERROR_NO_FREE_C_RNTI,
LTE_FDD_ENB_ERROR_C_RNTI_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_SCHEDULE,
LTE_FDD_ENB_ERROR_VARIABLE_NOT_DYNAMIC,
LTE_FDD_ENB_ERROR_MASTER_CLOCK_FAIL,
LTE_FDD_ENB_ERROR_NO_MSG_IN_QUEUE,
LTE_FDD_ENB_ERROR_RB_NOT_SETUP,
LTE_FDD_ENB_ERROR_RB_ALREADY_SETUP,
LTE_FDD_ENB_ERROR_TIMER_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_REASSEMBLE_SDU,
LTE_FDD_ENB_ERROR_DUPLICATE_ENTRY,
LTE_FDD_ENB_ERROR_READ_ONLY,
LTE_FDD_ENB_ERROR_N_ITEMS,
}LTE_FDD_ENB_ERROR_ENUM;
static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"none",
"invalid command",
"invalid parameter",
"out of bounds",
"exception",
"already started",
"already stopped",
"cant start",
"cant stop",
"bad alloc",
"user not found",
"no free C-RNTI",
"C-RNTI not found",
"cant schedule",
"variable not dynamic",
"unable to set master clock rate",
"no message in queue",
"RB not setup",
"RB already setup",
"timer not found",
"cant reassemble SDU",
"duplicate entry",
"read only"};
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
#endif /* __LTE_FDD_ENB_COMMON_H__ */
/*******************************************************************************
Copyright 2014 Ben Wojtowicz
Copyright 2014-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -26,6 +26,7 @@
---------- ------------- --------------------------------------------
11/29/2014 Ben Wojtowicz Created file
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
02/15/2015 Ben Wojtowicz Moved to new message queue.
*******************************************************************************/
......@@ -67,7 +68,7 @@ public:
// Start/Stop
bool is_started(void);
LTE_FDD_ENB_ERROR_ENUM start(char *err_str);
LTE_FDD_ENB_ERROR_ENUM start(LTE_fdd_enb_msgq *from_pdcp, LTE_fdd_enb_msgq *to_pdcp, char *err_str, LTE_fdd_enb_interface *iface);
void stop(void);
private:
......@@ -77,13 +78,14 @@ private:
~LTE_fdd_enb_gw();
// Start/Stop
boost::mutex start_mutex;
bool started;
LTE_fdd_enb_interface *interface;
boost::mutex start_mutex;
bool started;
// Communication
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *pdcp_comm_msgq;
boost::interprocess::message_queue *gw_pdcp_olmq;
void handle_pdcp_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_pdcp;
LTE_fdd_enb_msgq *msgq_to_pdcp;
// PDCP Message Handlers
void handle_gw_data(LTE_FDD_ENB_GW_DATA_READY_MSG_STRUCT *gw_data);
......
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -40,6 +40,8 @@
11/01/2014 Ben Wojtowicz Added parameters for IP address assignment,
DNS address, config file, and user file.
11/29/2014 Ben Wojtowicz Added support for the IP gateway.
02/15/2015 Ben Wojtowicz Moved to new messageq queue, added IP pcap
support, and put error enum into common hdr.
*******************************************************************************/
......@@ -50,6 +52,8 @@
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_common.h"
#include "LTE_fdd_enb_msgq.h"
#include "liblte_common.h"
#include "libtools_socket_wrap.h"
#include <boost/thread/mutex.hpp>
......@@ -71,56 +75,6 @@
TYPEDEFS
*******************************************************************************/
typedef enum{
LTE_FDD_ENB_ERROR_NONE = 0,
LTE_FDD_ENB_ERROR_INVALID_COMMAND,
LTE_FDD_ENB_ERROR_INVALID_PARAM,
LTE_FDD_ENB_ERROR_OUT_OF_BOUNDS,
LTE_FDD_ENB_ERROR_EXCEPTION,
LTE_FDD_ENB_ERROR_ALREADY_STARTED,
LTE_FDD_ENB_ERROR_ALREADY_STOPPED,
LTE_FDD_ENB_ERROR_CANT_START,
LTE_FDD_ENB_ERROR_CANT_STOP,
LTE_FDD_ENB_ERROR_BAD_ALLOC,
LTE_FDD_ENB_ERROR_USER_NOT_FOUND,
LTE_FDD_ENB_ERROR_NO_FREE_C_RNTI,
LTE_FDD_ENB_ERROR_C_RNTI_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_SCHEDULE,
LTE_FDD_ENB_ERROR_VARIABLE_NOT_DYNAMIC,
LTE_FDD_ENB_ERROR_MASTER_CLOCK_FAIL,
LTE_FDD_ENB_ERROR_NO_MSG_IN_QUEUE,
LTE_FDD_ENB_ERROR_RB_NOT_SETUP,
LTE_FDD_ENB_ERROR_RB_ALREADY_SETUP,
LTE_FDD_ENB_ERROR_TIMER_NOT_FOUND,
LTE_FDD_ENB_ERROR_CANT_REASSEMBLE_SDU,
LTE_FDD_ENB_ERROR_DUPLICATE_ENTRY,
LTE_FDD_ENB_ERROR_READ_ONLY,
LTE_FDD_ENB_ERROR_N_ITEMS,
}LTE_FDD_ENB_ERROR_ENUM;
static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"none",
"invalid command",
"invalid parameter",
"out of bounds",
"exception",
"already started",
"already stopped",
"cant start",
"cant stop",
"bad alloc",
"user not found",
"no free C-RNTI",
"C-RNTI not found",
"cant schedule",
"variable not dynamic",
"unable to set master clock rate",
"no message in queue",
"RB not setup",
"RB already setup",
"timer not found",
"cant reassemble SDU",
"duplicate entry",
"read only"};
typedef enum{
LTE_FDD_ENB_DEBUG_TYPE_ERROR = 0,
LTE_FDD_ENB_DEBUG_TYPE_WARNING,
......@@ -146,6 +100,7 @@ typedef enum{
LTE_FDD_ENB_DEBUG_LEVEL_RB,
LTE_FDD_ENB_DEBUG_LEVEL_TIMER,
LTE_FDD_ENB_DEBUG_LEVEL_IFACE,
LTE_FDD_ENB_DEBUG_LEVEL_MSGQ,
LTE_FDD_ENB_DEBUG_LEVEL_N_ITEMS,
}LTE_FDD_ENB_DEBUG_LEVEL_ENUM;
static const char LTE_fdd_enb_debug_level_text[LTE_FDD_ENB_DEBUG_LEVEL_N_ITEMS][100] = {"radio",
......@@ -159,7 +114,8 @@ static const char LTE_fdd_enb_debug_level_text[LTE_FDD_ENB_DEBUG_LEVEL_N_ITEMS][
"user",
"rb",
"timer",
"iface"};
"iface",
"msgq"};
typedef enum{
LTE_FDD_ENB_PCAP_DIRECTION_UL = 0,
......@@ -313,8 +269,10 @@ public:
void send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ENUM type, LTE_FDD_ENB_DEBUG_LEVEL_ENUM level, std::string file_name, int32 line, std::string msg, ...);
void send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ENUM type, LTE_FDD_ENB_DEBUG_LEVEL_ENUM level, std::string file_name, int32 line, LIBLTE_BIT_MSG_STRUCT *lte_msg, std::string msg, ...);
void send_debug_msg(LTE_FDD_ENB_DEBUG_TYPE_ENUM type, LTE_FDD_ENB_DEBUG_LEVEL_ENUM level, std::string file_name, int32 line, LIBLTE_BYTE_MSG_STRUCT *lte_msg, std::string msg, ...);
void open_pcap_fd(void);
void send_pcap_msg(LTE_FDD_ENB_PCAP_DIRECTION_ENUM dir, uint32 rnti, uint32 current_tti, uint8 *msg, uint32 N_bits);
void open_lte_pcap_fd(void);
void open_ip_pcap_fd(void);
void send_lte_pcap_msg(LTE_FDD_ENB_PCAP_DIRECTION_ENUM dir, uint32 rnti, uint32 current_tti, uint8 *msg, uint32 N_bits);
void send_ip_pcap_msg(uint8 *msg, uint32 N_bytes);
static void handle_ctrl_msg(std::string msg);
static void handle_ctrl_connect(void);
static void handle_ctrl_disconnect(void);
......@@ -325,7 +283,8 @@ public:
static void handle_debug_error(LIBTOOLS_SOCKET_WRAP_ERROR_ENUM err);
boost::mutex ctrl_mutex;
boost::mutex debug_mutex;
FILE *pcap_fd;
FILE *lte_pcap_fd;
FILE *ip_pcap_fd;
libtools_socket_wrap *ctrl_socket;
libtools_socket_wrap *debug_socket;
int16 ctrl_port;
......@@ -369,6 +328,21 @@ private:
LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, std::string value);
LTE_FDD_ENB_ERROR_ENUM write_value(LTE_FDD_ENB_VAR_STRUCT *var, uint32 value);
bool is_string_valid_as_number(std::string str, uint32 length, uint8 max_value);
// Inter-stack communication
LTE_fdd_enb_msgq *phy_to_mac_comm;
LTE_fdd_enb_msgq *mac_to_phy_comm;
LTE_fdd_enb_msgq *mac_to_rlc_comm;
LTE_fdd_enb_msgq *mac_to_timer_comm;
LTE_fdd_enb_msgq *rlc_to_mac_comm;
LTE_fdd_enb_msgq *rlc_to_pdcp_comm;
LTE_fdd_enb_msgq *pdcp_to_rlc_comm;
LTE_fdd_enb_msgq *pdcp_to_rrc_comm;
LTE_fdd_enb_msgq *rrc_to_pdcp_comm;
LTE_fdd_enb_msgq *rrc_to_mme_comm;
LTE_fdd_enb_msgq *mme_to_rrc_comm;
LTE_fdd_enb_msgq *pdcp_to_gw_comm;
LTE_fdd_enb_msgq *gw_to_pdcp_comm;
};
#endif /* __LTE_FDD_ENB_INTERFACE_H__ */
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -31,6 +31,7 @@
to current_tti.
11/29/2014 Ben Wojtowicz Using the byte message struct for SDUs.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
02/15/2015 Ben Wojtowicz Moved to new message queue.
*******************************************************************************/
......@@ -94,7 +95,7 @@ public:
static void cleanup(void);
// Start/Stop
void start(LTE_fdd_enb_interface *iface);
void start(LTE_fdd_enb_msgq *from_phy, LTE_fdd_enb_msgq *from_rlc, LTE_fdd_enb_msgq *to_phy, LTE_fdd_enb_msgq *to_rlc, LTE_fdd_enb_msgq *to_timer, LTE_fdd_enb_interface *iface);
void stop(void);
// External interface
......@@ -113,12 +114,13 @@ private:
bool started;
// Communication
void handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *phy_comm_msgq;
LTE_fdd_enb_msgq *rlc_comm_msgq;
boost::interprocess::message_queue *mac_phy_olmq;
boost::interprocess::message_queue *mac_rlc_olmq;
void handle_phy_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_phy;
LTE_fdd_enb_msgq *msgq_from_rlc;
LTE_fdd_enb_msgq *msgq_to_phy;
LTE_fdd_enb_msgq *msgq_to_rlc;
LTE_fdd_enb_msgq *msgq_to_timer;
// PHY Message Handlers
void handle_ready_to_send(LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT *rts);
......
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -37,6 +37,7 @@
request support.
12/16/2014 Ben Wojtowicz Added ol extension to message queue and
sending of EMM information message.
02/15/2015 Ben Wojtowicz Moved to new message queue.
*******************************************************************************/
......@@ -79,7 +80,7 @@ public:
static void cleanup(void);
// Start/Stop
void start(void);
void start(LTE_fdd_enb_msgq *from_rrc, LTE_fdd_enb_msgq *to_rrc, LTE_fdd_enb_interface *iface);
void stop(void);
// External interface
......@@ -92,13 +93,14 @@ private:
~LTE_fdd_enb_mme();
// Start/Stop
boost::mutex start_mutex;
bool started;
LTE_fdd_enb_interface *interface;
boost::mutex start_mutex;
bool started;
// Communication
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *rrc_comm_msgq;
boost::interprocess::message_queue *mme_rrc_olmq;
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_rrc;
LTE_fdd_enb_msgq *msgq_to_rrc;
// RRC Message Handlers
void handle_nas_msg(LTE_FDD_ENB_MME_NAS_MSG_READY_MSG_STRUCT *nas_msg);
......
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -34,6 +34,9 @@
11/01/2014 Ben Wojtowicz Added RRC security command, RRC SRB2 setup
command, and RRC command response messages.
11/29/2014 Ben Wojtowicz Added IP gateway communication messages.
02/15/2015 Ben Wojtowicz Moving to new message queue with semaphores
and circular buffers and added a timer tick
message.
*******************************************************************************/
......@@ -47,7 +50,8 @@
#include "LTE_fdd_enb_user.h"
#include "liblte_rrc.h"
#include "liblte_phy.h"
#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/interprocess/sync/interprocess_semaphore.hpp>
#include <boost/circular_buffer.hpp>
#include <string>
/*******************************************************************************
......@@ -85,6 +89,9 @@ typedef enum{
// MAC -> RLC Messages
LTE_FDD_ENB_MESSAGE_TYPE_RLC_PDU_READY,
// MAC -> TIMER Messages
LTE_FDD_ENB_MESSAGE_TYPE_TIMER_TICK,
// PDCP -> RLC Messages
LTE_FDD_ENB_MESSAGE_TYPE_RLC_SDU_READY,
......@@ -122,6 +129,7 @@ static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS
"PUSCH decode",
"MAC sdu ready",
"RLC pdu ready",
"Timer tick",
"RLC sdu ready",
"PDCP pdu ready",
"PDCP sdu ready",
......@@ -141,6 +149,7 @@ typedef enum{
LTE_FDD_ENB_DEST_LAYER_RRC,
LTE_FDD_ENB_DEST_LAYER_MME,
LTE_FDD_ENB_DEST_LAYER_GW,
LTE_FDD_ENB_DEST_LAYER_TIMER_MGR,
LTE_FDD_ENB_DEST_LAYER_ANY,
LTE_FDD_ENB_DEST_LAYER_N_ITEMS,
}LTE_FDD_ENB_DEST_LAYER_ENUM;
......@@ -151,6 +160,7 @@ static const char LTE_fdd_enb_dest_layer_text[LTE_FDD_ENB_DEST_LAYER_N_ITEMS][10
"RRC",
"MME",
"GW",
"TIMER_MGR",
"ANY"};
// Generic Messages
......@@ -175,6 +185,7 @@ typedef struct{
typedef struct{
uint32 dl_current_tti;
uint32 ul_current_tti;
bool late;
}LTE_FDD_ENB_READY_TO_SEND_MSG_STRUCT;
typedef struct{
uint32 current_tti;
......@@ -203,6 +214,11 @@ typedef struct{
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT;
// MAC -> TIMER Messages
typedef struct{
uint32 tick;
}LTE_FDD_ENB_TIMER_TICK_MSG_STRUCT;
// PDCP -> RLC Messages
typedef struct{
LTE_fdd_enb_user *user;
......@@ -296,6 +312,9 @@ typedef union{
// MAC -> RLC Messages
LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT rlc_pdu_ready;
// MAC -> TIMER Messages
LTE_FDD_ENB_TIMER_TICK_MSG_STRUCT timer_tick;
// PDCP -> RLC Messages
LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT rlc_sdu_ready;
......@@ -337,16 +356,16 @@ typedef struct{
class LTE_fdd_enb_msgq_cb
{
public:
typedef void (*FuncType)(void*, LTE_FDD_ENB_MESSAGE_STRUCT*);
typedef void (*FuncType)(void*, LTE_FDD_ENB_MESSAGE_STRUCT&);
LTE_fdd_enb_msgq_cb();
LTE_fdd_enb_msgq_cb(FuncType f, void* o);
void operator()(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void operator()(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
private:
FuncType func;
void *obj;
};
template<class class_type, void (class_type::*Func)(LTE_FDD_ENB_MESSAGE_STRUCT*)>
void LTE_fdd_enb_msgq_cb_wrapper(void *o, LTE_FDD_ENB_MESSAGE_STRUCT *msg)
template<class class_type, void (class_type::*Func)(LTE_FDD_ENB_MESSAGE_STRUCT&)>
void LTE_fdd_enb_msgq_cb_wrapper(void *o, LTE_FDD_ENB_MESSAGE_STRUCT &msg)
{
return (static_cast<class_type*>(o)->*Func)(msg);
}
......@@ -354,33 +373,32 @@ template<class class_type, void (class_type::*Func)(LTE_FDD_ENB_MESSAGE_STRUCT*)
class LTE_fdd_enb_msgq
{
public:
LTE_fdd_enb_msgq(std::string _msgq_name,
LTE_fdd_enb_msgq_cb cb);
LTE_fdd_enb_msgq(std::string _msgq_name,
LTE_fdd_enb_msgq_cb cb,
uint32 _prio);
LTE_fdd_enb_msgq(std::string _msgq_name);
~LTE_fdd_enb_msgq();
// Setup
void attach_rx(LTE_fdd_enb_msgq_cb cb);
void attach_rx(LTE_fdd_enb_msgq_cb cb, uint32 _prio);
// Send/Receive
static void send(const char *mq_name,
LTE_FDD_ENB_MESSAGE_TYPE_ENUM type,
LTE_FDD_ENB_DEST_LAYER_ENUM dest_layer,
LTE_FDD_ENB_MESSAGE_UNION *msg_content,
uint32 msg_content_size);
static void send(boost::interprocess::message_queue *mq,
LTE_FDD_ENB_MESSAGE_TYPE_ENUM type,
LTE_FDD_ENB_DEST_LAYER_ENUM dest_layer,
LTE_FDD_ENB_MESSAGE_UNION *msg_content,
uint32 msg_content_size);
void send(LTE_FDD_ENB_MESSAGE_TYPE_ENUM type,
LTE_FDD_ENB_DEST_LAYER_ENUM dest_layer,
LTE_FDD_ENB_MESSAGE_UNION *msg_content,
uint32 msg_content_size);
void send(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
private:
// Send/Receive
static void* receive_thread(void *inputs);
// Variables
LTE_fdd_enb_msgq_cb callback;
std::string msgq_name;
pthread_t rx_thread;
uint32 prio;
LTE_fdd_enb_msgq_cb callback;
boost::interprocess::interprocess_semaphore *sema;
boost::circular_buffer<LTE_FDD_ENB_MESSAGE_STRUCT> *circ_buf;
std::string msgq_name;
pthread_t rx_thread;
uint32 prio;
bool rx_setup;
};
#endif /* __LTE_FDD_ENB_MSGQ_H__ */
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -28,6 +28,7 @@
05/04/2014 Ben Wojtowicz Added communication to RLC and RRC.
11/29/2014 Ben Wojtowicz Added communication to IP gateway.
12/16/2014 Ben Wojtowicz Added ol extension to message queues.
02/15/2015 Ben Wojtowicz Moved to new message queue.
*******************************************************************************/
......@@ -70,7 +71,7 @@ public:
static void cleanup(void);
// Start/Stop
void start(void);
void start(LTE_fdd_enb_msgq *from_rlc, LTE_fdd_enb_msgq *from_rrc, LTE_fdd_enb_msgq *from_gw, LTE_fdd_enb_msgq *to_rlc, LTE_fdd_enb_msgq *to_rrc, LTE_fdd_enb_msgq *to_gw, LTE_fdd_enb_interface *iface);
void stop(void);
// External interface
......@@ -83,19 +84,20 @@ private:
~LTE_fdd_enb_pdcp();
// Start/Stop
boost::mutex start_mutex;
bool started;
LTE_fdd_enb_interface *interface;
boost::mutex start_mutex;
bool started;
// Communication
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
void handle_gw_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *rlc_comm_msgq;
LTE_fdd_enb_msgq *rrc_comm_msgq;
LTE_fdd_enb_msgq *gw_comm_msgq;
boost::interprocess::message_queue *pdcp_rlc_olmq;
boost::interprocess::message_queue *pdcp_rrc_olmq;
boost::interprocess::message_queue *pdcp_gw_olmq;
void handle_rlc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
void handle_rrc_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
void handle_gw_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_rlc;
LTE_fdd_enb_msgq *msgq_from_rrc;
LTE_fdd_enb_msgq *msgq_from_gw;
LTE_fdd_enb_msgq *msgq_to_rlc;
LTE_fdd_enb_msgq *msgq_to_rrc;
LTE_fdd_enb_msgq *msgq_to_gw;
// RLC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT *pdu_ready);
......
/*******************************************************************************
Copyright 2013-2014 Ben Wojtowicz
Copyright 2013-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -30,6 +30,7 @@
05/04/2014 Ben Wojtowicz Added PHICH support.
06/15/2014 Ben Wojtowicz Changed fn_combo to current_tti.
12/16/2014 Ben Wojtowicz Added ol extension to message queue.
02/15/2015 Ben Wojtowicz Moved to new message queue.
*******************************************************************************/
......@@ -75,7 +76,7 @@ public:
static void cleanup(void);
// Start/Stop
void start(LTE_fdd_enb_interface *iface);
void start(LTE_fdd_enb_msgq *from_mac, LTE_fdd_enb_msgq *to_mac, LTE_fdd_enb_interface *iface);
void stop(void);
// External interface
......@@ -97,9 +98,9 @@ private:
bool started;
// Communication
void handle_mac_msg(LTE_FDD_ENB_MESSAGE_STRUCT *msg);
LTE_fdd_enb_msgq *mac_comm_msgq;
boost::interprocess::message_queue *phy_mac_olmq;
void handle_mac_msg(LTE_FDD_ENB_MESSAGE_STRUCT &msg);
LTE_fdd_enb_msgq *msgq_from_mac;
LTE_fdd_enb_msgq *msgq_to_mac;
// Generic parameters
LIBLTE_PHY_STRUCT *phy_struct;
......
/*******************************************************************************
Copyright 2014 Ben Wojtowicz
Copyright 2014-2015 Ben Wojtowicz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
......@@ -39,6 +39,9 @@
IP gateway and RLC UMD support.
12/16/2014 Ben Wojtowicz Added QoS for default data services.
12/24/2014 Ben Wojtowicz Added asymmetric QoS support.
02/15/2015 Ben Wojtowicz Split UL/DL QoS TTI frequency, added reset
user support, and added multiple UMD RLC data
support.
*******************************************************************************/
......@@ -49,10 +52,11 @@
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_common.h"
#include "liblte_rlc.h"
#include "liblte_rrc.h"
#include <list>
#include <boost/thread/mutex.hpp>
/*******************************************************************************
DEFINES
......@@ -181,7 +185,8 @@ static const char LTE_fdd_enb_qos_text[LTE_FDD_ENB_QOS_N_ITEMS][20] = {"None",
typedef struct{
LTE_FDD_ENB_QOS_ENUM qos;
uint32 tti_frequency;
uint32 ul_tti_frequency;
uint32 dl_tti_frequency;
uint32 ul_bytes_per_subfn;
uint32 dl_bytes_per_subfn;
}LTE_FDD_ENB_QOS_STRUCT;
......@@ -199,6 +204,8 @@ public:
// Identity
LTE_FDD_ENB_RB_ENUM get_rb_id(void);
LTE_fdd_enb_user* get_user(void);
void reset_user(LTE_fdd_enb_user *_user);
// GW
void queue_gw_data_msg(LIBLTE_BYTE_MSG_STRUCT *gw_data);
......@@ -281,7 +288,7 @@ public:
void set_rlc_vrur(uint16 vrur);
uint16 get_rlc_vrur(void);
uint16 get_rlc_um_window_size(void);
void rlc_add_to_um_reception_buffer(LIBLTE_RLC_UMD_PDU_STRUCT *umd_pdu);
void rlc_add_to_um_reception_buffer(LIBLTE_RLC_UMD_PDU_STRUCT *umd_pdu, uint32 idx);
LTE_FDD_ENB_ERROR_ENUM rlc_um_reassemble(LIBLTE_BYTE_MSG_STRUCT *sdu);
void set_rlc_vtus(uint16 vtus);
uint16 get_rlc_vtus(void);
......@@ -294,6 +301,8 @@ public:
void start_ul_sched_timer(uint32 m_seconds);
void stop_ul_sched_timer(void);
void handle_ul_sched_timer_expiry(uint32 timer_id);
void set_last_tti(uint32 last_tti);
uint32 get_last_tti(void);
void set_con_res_id(uint64 con_res_id);
uint64 get_con_res_id(void);
void set_send_con_res_id(bool send_con_res_id);
......@@ -312,7 +321,8 @@ public:
// Generic
void set_qos(LTE_FDD_ENB_QOS_ENUM _qos);
LTE_FDD_ENB_QOS_ENUM get_qos(void);
uint32 get_qos_tti_freq(void);
uint32 get_qos_ul_tti_freq(void);
uint32 get_qos_dl_tti_freq(void);
uint32 get_qos_ul_bytes_per_subfn(void);
uint32 get_qos_dl_