Commit 07a28fa4 authored by Ben Wojtowicz's avatar Ben Wojtowicz

Version 0.13.0: Added MAC control element handling, PHICH support, TPC...

Version 0.13.0: Added MAC control element handling, PHICH support, TPC support, and RRC DL CCCH message support to the LTE library, added PCAP support, UL and DL CCCH MAC support, communication up to RRC, UL CCCH RRC support, radio bearer, timer, and timer manager support to the eNodeB.
parent 58ed2375
......@@ -23,7 +23,7 @@
########################################################################
cmake_minimum_required(VERSION 2.6)
project(openLTE CXX C)
set(openLTE_version 0.12.1)
set(openLTE_version 0.13.0)
enable_testing()
#select the release build type by default to get optimization flags
......
......@@ -99,3 +99,7 @@ v00.12.01 Pulled in patches from Astrasel to initialize the frequency offset
from Andrew Murphy to add DCI 1C unpacking to the LTE library, also
added support for PRB allocation differences in each slot and fixed
a bug in lte_fdd_dl_transmit relating to PDCCH REG mapping.
v00.13.00 Added MAC control element handling, PHICH support, TPC support, and
RRC DL CCCH message support to the LTE library, added PCAP support,
UL and DL CCCH MAC support, communication up to RRC, UL CCCH RRC
support, radio bearer, timer, and timer manager support to the eNodeB.
......@@ -46,6 +46,7 @@
bandwidth.
03/26/2014 Ben Wojtowicz Using the latest LTE library.
04/12/2014 Ben Wojtowicz Using the latest LTE library.
05/04/2014 Ben Wojtowicz Added PHICH support.
*******************************************************************************/
......@@ -92,6 +93,9 @@ LTE_fdd_dl_fg_samp_buf::LTE_fdd_dl_fg_samp_buf(size_t out_size_val)
gr::io_signature::make(MIN_IN, MAX_IN, sizeof(int8)),
gr::io_signature::make(MIN_OUT, MAX_OUT, out_size_val))
{
uint32 i;
uint32 j;
// Parse the inputs
if(out_size_val == sizeof(gr_complex))
{
......@@ -231,6 +235,14 @@ LTE_fdd_dl_fg_samp_buf::LTE_fdd_dl_fg_samp_buf(size_t out_size_val)
sib8.params_1xrtt_present = false;
// PCFICH
pcfich.cfi = 2;
// PHICH
for(i=0; i<25; i++)
{
for(j=0; j<8; j++)
{
phich.present[i][j] = false;
}
}
// Initialize the configuration
need_config = true;
......
......@@ -11,6 +11,9 @@ add_executable(LTE_fdd_enodeb
src/LTE_fdd_enb_msgq.cc
src/LTE_fdd_enb_user.cc
src/LTE_fdd_enb_user_mgr.cc
src/LTE_fdd_enb_rb.cc
src/LTE_fdd_enb_timer.cc
src/LTE_fdd_enb_timer_mgr.cc
src/LTE_fdd_enb_radio.cc
src/LTE_fdd_enb_phy.cc
src/LTE_fdd_enb_mac.cc
......
......@@ -29,6 +29,7 @@
03/26/2014 Ben Wojtowicz Using the latest LTE library.
04/12/2014 Ben Wojtowicz Pulled in a patch from Max Suraev for more
descriptive start failures.
05/04/2014 Ben Wojtowicz Added PCAP support and more error types.
*******************************************************************************/
......@@ -77,6 +78,10 @@ typedef enum{
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_N_ITEMS,
}LTE_FDD_ENB_ERROR_ENUM;
static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"none",
......@@ -94,7 +99,11 @@ static const char LTE_fdd_enb_error_text[LTE_FDD_ENB_ERROR_N_ITEMS][100] = {"non
"C-RNTI not found",
"cant schedule",
"variable not dynamic",
"unable to set master clock rate"};
"unable to set master clock rate",
"RB not setup",
"RB already setup",
"no message in queue",
"timer not found"};
typedef enum{
LTE_FDD_ENB_DEBUG_TYPE_ERROR = 0,
......@@ -103,10 +112,10 @@ typedef enum{
LTE_FDD_ENB_DEBUG_TYPE_DEBUG,
LTE_FDD_ENB_DEBUG_TYPE_N_ITEMS,
}LTE_FDD_ENB_DEBUG_TYPE_ENUM;
static const char LTE_fdd_enb_debug_type_text[LTE_FDD_ENB_DEBUG_TYPE_N_ITEMS][100] = {"error",
static const char LTE_fdd_enb_debug_type_text[LTE_FDD_ENB_DEBUG_TYPE_N_ITEMS][100] = {"error ",
"warning",
"info",
"debug"};
"info ",
"debug "};
typedef enum{
LTE_FDD_ENB_DEBUG_LEVEL_RADIO = 0,
......@@ -117,19 +126,31 @@ typedef enum{
LTE_FDD_ENB_DEBUG_LEVEL_RRC,
LTE_FDD_ENB_DEBUG_LEVEL_MME,
LTE_FDD_ENB_DEBUG_LEVEL_USER,
LTE_FDD_ENB_DEBUG_LEVEL_RB,
LTE_FDD_ENB_DEBUG_LEVEL_TIMER,
LTE_FDD_ENB_DEBUG_LEVEL_IFACE,
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",
"phy",
"mac",
"rlc",
"pdcp",
"rrc",
"mme",
"user",
"phy ",
"mac ",
"rlc ",
"pdcp ",
"rrc ",
"mme ",
"user ",
"rb ",
"timer",
"iface"};
typedef enum{
LTE_FDD_ENB_PCAP_DIRECTION_UL = 0,
LTE_FDD_ENB_PCAP_DIRECTION_DL,
LTE_FDD_ENB_PCAP_DIRECTION_N_ITEMS,
}LTE_FDD_ENB_PCAP_DIRECTION_ENUM;
static const char LTE_fdd_enb_pcap_direction_text[LTE_FDD_ENB_PCAP_DIRECTION_N_ITEMS][20] = {"UL",
"DL"};
typedef enum{
LTE_FDD_ENB_VAR_TYPE_DOUBLE = 0,
LTE_FDD_ENB_VAR_TYPE_INT64,
......@@ -174,6 +195,7 @@ typedef enum{
LTE_FDD_ENB_PARAM_SYSTEM_INFO_PERIODICITY,
LTE_FDD_ENB_PARAM_DEBUG_TYPE,
LTE_FDD_ENB_PARAM_DEBUG_LEVEL,
LTE_FDD_ENB_PARAM_ENABLE_PCAP,
// Radio parameters managed by LTE_fdd_enb_radio
LTE_FDD_ENB_PARAM_AVAILABLE_RADIOS,
......@@ -219,6 +241,7 @@ static const char lte_fdd_enb_param_text[LTE_FDD_ENB_PARAM_N_ITEMS][100] = {"ban
"system_info_periodicity",
"debug_type",
"debug_level",
"enable_pcap",
"available_radios",
"selected_radio_name",
"selected_radio_idx",
......@@ -256,6 +279,8 @@ public:
void send_ctrl_error_msg(LTE_FDD_ENB_ERROR_ENUM error, 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, 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_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 fn_combo, LIBLTE_MSG_STRUCT *msg);
static void handle_ctrl_msg(std::string msg);
static void handle_ctrl_connect(void);
static void handle_ctrl_disconnect(void);
......@@ -266,6 +291,7 @@ public:
static void handle_debug_error(LIBTOOLS_SOCKET_WRAP_ERROR_ENUM err);
boost::mutex ctrl_mutex;
boost::mutex debug_mutex;
FILE *pcap_fd;
libtools_socket_wrap *ctrl_socket;
libtools_socket_wrap *debug_socket;
int16 ctrl_port;
......
......@@ -26,6 +26,7 @@
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
01/18/2014 Ben Wojtowicz Cached a copy of the interface class.
05/04/2014 Ben Wojtowicz Added ULSCH handling.
*******************************************************************************/
......@@ -39,6 +40,7 @@
#include "LTE_fdd_enb_interface.h"
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_msgq.h"
#include "LTE_fdd_enb_user.h"
#include "liblte_mac.h"
#include <boost/thread/mutex.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
......@@ -119,12 +121,19 @@ private:
void handle_pusch_decode(LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT *pusch_decode);
// RLC Message Handlers
// Message Parsers
// State Machines
// Message Constructors
void handle_sdu_ready(LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT *sdu_ready);
// MAC PDU Handlers
void handle_ulsch_ccch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_MSG_STRUCT *sdu);
void handle_ulsch_dcch_sdu(LTE_fdd_enb_user *user, uint32 lcid, LIBLTE_MSG_STRUCT *sdu);
void handle_ulsch_ext_power_headroom_report(LTE_fdd_enb_user *user, LIBLTE_MAC_EXT_POWER_HEADROOM_CE_STRUCT *ext_power_headroom);
void handle_ulsch_power_headroom_report(LTE_fdd_enb_user *user, LIBLTE_MAC_POWER_HEADROOM_CE_STRUCT *power_headroom);
void handle_ulsch_c_rnti(LTE_fdd_enb_user *user, LIBLTE_MAC_C_RNTI_CE_STRUCT *c_rnti);
void handle_ulsch_truncated_bsr(LTE_fdd_enb_user *user, LIBLTE_MAC_TRUNCATED_BSR_CE_STRUCT *truncated_bsr);
void handle_ulsch_short_bsr(LTE_fdd_enb_user *user, LIBLTE_MAC_SHORT_BSR_CE_STRUCT *short_bsr);
void handle_ulsch_long_bsr(LTE_fdd_enb_user *user, LIBLTE_MAC_LONG_BSR_CE_STRUCT *long_bsr);
// Data Constructors
void construct_random_access_response(uint8 preamble, uint16 timing_adv, uint32 fn_combo);
// Scheduler
......
......@@ -27,6 +27,8 @@
11/09/2013 Ben Wojtowicz Created file
01/18/2014 Ben Wojtowicz Added the ability to set priorities.
03/26/2014 Ben Wojtowicz Added RNTI to PUSCH decode message.
05/04/2014 Ben Wojtowicz Added messages for MAC, RLC, PDCP, and RRC
communication.
*******************************************************************************/
......@@ -37,6 +39,7 @@
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_user.h"
#include "liblte_rrc.h"
#include "liblte_phy.h"
#include <boost/interprocess/ipc/message_queue.hpp>
......@@ -71,6 +74,24 @@ typedef enum{
LTE_FDD_ENB_MESSAGE_TYPE_PUCCH_DECODE,
LTE_FDD_ENB_MESSAGE_TYPE_PUSCH_DECODE,
// RLC -> MAC Messages
LTE_FDD_ENB_MESSAGE_TYPE_MAC_SDU_READY,
// MAC -> RLC Messages
LTE_FDD_ENB_MESSAGE_TYPE_RLC_PDU_READY,
// PDCP -> RLC Messages
LTE_FDD_ENB_MESSAGE_TYPE_RLC_SDU_READY,
// RLC -> PDCP Messages
LTE_FDD_ENB_MESSAGE_TYPE_PDCP_PDU_READY,
// RRC -> PDCP Messages
LTE_FDD_ENB_MESSAGE_TYPE_PDCP_SDU_READY,
// PDCP -> RRC Messages
LTE_FDD_ENB_MESSAGE_TYPE_RRC_PDU_READY,
LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS,
}LTE_FDD_ENB_MESSAGE_TYPE_ENUM;
static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS][100] = {"Kill",
......@@ -79,7 +100,13 @@ static const char LTE_fdd_enb_message_type_text[LTE_FDD_ENB_MESSAGE_TYPE_N_ITEMS
"Ready to send",
"PRACH decode",
"PUCCH decode",
"PUSCH decode"};
"PUSCH decode",
"MAC sdu ready",
"RLC pdu ready",
"RLC sdu ready",
"PDCP pdu ready",
"PDCP sdu ready",
"RRC pdu ready"};
typedef enum{
LTE_FDD_ENB_DEST_LAYER_PHY = 0,
......@@ -137,6 +164,42 @@ typedef struct{
uint16 rnti;
}LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT;
// RLC -> MAC Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT;
// MAC -> RLC Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT;
// PDCP -> RLC Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT;
// RLC -> PDCP Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT;
// RRC -> PDCP Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT;
// PDCP -> RRC Messages
typedef struct{
LTE_fdd_enb_user *user;
LTE_fdd_enb_rb *rb;
}LTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT;
typedef union{
// Generic Messages
......@@ -149,6 +212,24 @@ typedef union{
LTE_FDD_ENB_PRACH_DECODE_MSG_STRUCT prach_decode;
LTE_FDD_ENB_PUCCH_DECODE_MSG_STRUCT pucch_decode;
LTE_FDD_ENB_PUSCH_DECODE_MSG_STRUCT pusch_decode;
// RLC -> MAC Messages
LTE_FDD_ENB_MAC_SDU_READY_MSG_STRUCT mac_sdu_ready;
// MAC -> RLC Messages
LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT rlc_pdu_ready;
// PDCP -> RLC Messages
LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT rlc_sdu_ready;
// RLC -> PDCP Messages
LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT pdcp_pdu_ready;
// RRC -> PDCP Messages
LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT pdcp_sdu_ready;
// PDCP -> RRC Messages
LTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT rrc_pdu_ready;
}LTE_FDD_ENB_MESSAGE_UNION;
typedef struct{
......
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
Copyright 2013-2014 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
......@@ -25,6 +25,7 @@
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added communication to RLC and RRC.
*******************************************************************************/
......@@ -91,6 +92,12 @@ private:
boost::interprocess::message_queue *pdcp_rlc_mq;
boost::interprocess::message_queue *pdcp_rrc_mq;
// RLC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_PDCP_PDU_READY_MSG_STRUCT *pdu_ready);
// RRC Message Handlers
void handle_sdu_ready(LTE_FDD_ENB_PDCP_SDU_READY_MSG_STRUCT *sdu_ready);
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
......
......@@ -27,6 +27,7 @@
11/09/2013 Ben Wojtowicz Created file
01/18/2014 Ben Wojtowicz Cached a copy of the interface class and
added the ability to handle late subframes.
05/04/2014 Ben Wojtowicz Added PHICH support.
*******************************************************************************/
......@@ -112,12 +113,13 @@ private:
LTE_FDD_ENB_PDSCH_SCHEDULE_MSG_STRUCT mac_pdsch_schedule[10];
LTE_FDD_ENB_PUSCH_SCHEDULE_MSG_STRUCT mac_pusch_schedule[10];
LIBLTE_PHY_PCFICH_STRUCT pcfich;
LIBLTE_PHY_PHICH_STRUCT phich;
LIBLTE_PHY_PHICH_STRUCT phich[10];
LIBLTE_PHY_PDCCH_STRUCT pdcch;
LIBLTE_PHY_SUBFRAME_STRUCT dl_subframe;
LIBLTE_MSG_STRUCT dl_rrc_msg;
uint32 dl_fn_combo;
uint32 last_rts_fn_combo;
uint32 second_counter;
bool late_subfr;
// Uplink
......
/*******************************************************************************
Copyright 2014 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_rb.h
Description: Contains all the definitions for the LTE FDD eNodeB
radio bearer class.
Revision History
---------- ------------- --------------------------------------------
05/04/2014 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_RB_H__
#define __LTE_FDD_ENB_RB_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_interface.h"
#include "liblte_rrc.h"
#include <list>
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
typedef enum{
LTE_FDD_ENB_RB_SRB0 = 0,
LTE_FDD_ENB_RB_SRB1,
LTE_FDD_ENB_RB_SRB2,
LTE_FDD_ENB_RB_N_ITEMS,
}LTE_FDD_ENB_RB_ENUM;
static const char LTE_fdd_enb_rb_text[LTE_FDD_ENB_RB_N_ITEMS][20] = {"SRB0",
"SRB1",
"SRB2"};
typedef enum{
LTE_FDD_ENB_RRC_PROC_IDLE = 0,
LTE_FDD_ENB_RRC_PROC_RRC_CON_REQ,
LTE_FDD_ENB_RRC_PROC_N_ITEMS,
}LTE_FDD_ENB_RRC_PROC_ENUM;
static const char LTE_fdd_enb_rrc_proc_text[LTE_FDD_ENB_RRC_PROC_N_ITEMS][20] = {"IDLE",
"RRC CON REQ"};
typedef enum{
LTE_FDD_ENB_RRC_STATE_IDLE = 0,
LTE_FDD_ENB_RRC_STATE_RRC_CON_SETUP_SENT,
LTE_FDD_ENB_RRC_STATE_N_ITEMS,
}LTE_FDD_ENB_RRC_STATE_ENUM;
static const char LTE_fdd_enb_rrc_state_text[LTE_FDD_ENB_RRC_STATE_N_ITEMS][20] = {"IDLE",
"RRC CON SETUP SENT"};
typedef enum{
LTE_FDD_ENB_PDCP_CONFIG_N_A = 0,
LTE_FDD_ENB_PDCP_CONFIG_N_ITEMS,
}LTE_FDD_ENB_PDCP_CONFIG_ENUM;
static const char LTE_fdd_enb_pdcp_config_text[LTE_FDD_ENB_PDCP_CONFIG_N_ITEMS][20] = {"N/A"};
typedef enum{
LTE_FDD_ENB_RLC_CONFIG_TM = 0,
LTE_FDD_ENB_RLC_CONFIG_UM,
LTE_FDD_ENB_RLC_CONFIG_AM,
LTE_FDD_ENB_RLC_CONFIG_N_ITEMS,
}LTE_FDD_ENB_RLC_CONFIG_ENUM;
static const char LTE_fdd_enb_rlc_config_text[LTE_FDD_ENB_RLC_CONFIG_N_ITEMS][20] = {"TM",
"UM",
"AM"};
typedef enum{
LTE_FDD_ENB_MAC_CONFIG_TM = 0,
LTE_FDD_ENB_MAC_CONFIG_N_ITEMS,
}LTE_FDD_ENB_MAC_CONFIG_ENUM;
static const char LTE_fdd_enb_mac_config_text[LTE_FDD_ENB_MAC_CONFIG_N_ITEMS][20] = {"TM"};
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
class LTE_fdd_enb_rb
{
public:
// Constructor/Destructor
LTE_fdd_enb_rb(LTE_FDD_ENB_RB_ENUM _rb);
~LTE_fdd_enb_rb();
// Identity
LTE_FDD_ENB_RB_ENUM get_rb_id(void);
// RRC
LIBLTE_RRC_UL_CCCH_MSG_STRUCT ul_ccch_msg;
LIBLTE_RRC_DL_CCCH_MSG_STRUCT dl_ccch_msg;
void queue_rrc_pdu(LIBLTE_MSG_STRUCT *pdu);
LTE_FDD_ENB_ERROR_ENUM get_next_rrc_pdu(LIBLTE_MSG_STRUCT **pdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_rrc_pdu(void);
void set_rrc_procedure(LTE_FDD_ENB_RRC_PROC_ENUM procedure, uint16 rnti);
LTE_FDD_ENB_RRC_PROC_ENUM get_rrc_procedure(void);
void set_rrc_state(LTE_FDD_ENB_RRC_STATE_ENUM state, uint16 rnti);
LTE_FDD_ENB_RRC_STATE_ENUM get_rrc_state(void);
// PDCP
void queue_pdcp_pdu(LIBLTE_MSG_STRUCT *pdu);
LTE_FDD_ENB_ERROR_ENUM get_next_pdcp_pdu(LIBLTE_MSG_STRUCT **pdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_pdcp_pdu(void);
void queue_pdcp_sdu(LIBLTE_MSG_STRUCT *sdu);
LTE_FDD_ENB_ERROR_ENUM get_next_pdcp_sdu(LIBLTE_MSG_STRUCT **sdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_pdcp_sdu(void);
LTE_FDD_ENB_PDCP_CONFIG_ENUM get_pdcp_config(void);
// RLC
void queue_rlc_pdu(LIBLTE_MSG_STRUCT *pdu);
LTE_FDD_ENB_ERROR_ENUM get_next_rlc_pdu(LIBLTE_MSG_STRUCT **pdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_rlc_pdu(void);
void queue_rlc_sdu(LIBLTE_MSG_STRUCT *sdu);
LTE_FDD_ENB_ERROR_ENUM get_next_rlc_sdu(LIBLTE_MSG_STRUCT **sdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_rlc_sdu(void);
LTE_FDD_ENB_RLC_CONFIG_ENUM get_rlc_config(void);
// MAC
void queue_mac_sdu(LIBLTE_MSG_STRUCT *sdu);
LTE_FDD_ENB_ERROR_ENUM get_next_mac_sdu(LIBLTE_MSG_STRUCT **sdu);
LTE_FDD_ENB_ERROR_ENUM delete_next_mac_sdu(void);
LTE_FDD_ENB_MAC_CONFIG_ENUM get_mac_config(void);
private:
// Identity
LTE_FDD_ENB_RB_ENUM rb;
// RRC
boost::mutex rrc_pdu_queue_mutex;
std::list<LIBLTE_MSG_STRUCT *> rrc_pdu_queue;
LTE_FDD_ENB_RRC_PROC_ENUM rrc_procedure;
LTE_FDD_ENB_RRC_STATE_ENUM rrc_state;
// PDCP
boost::mutex pdcp_pdu_queue_mutex;
boost::mutex pdcp_sdu_queue_mutex;
std::list<LIBLTE_MSG_STRUCT *> pdcp_pdu_queue;
std::list<LIBLTE_MSG_STRUCT *> pdcp_sdu_queue;
LTE_FDD_ENB_PDCP_CONFIG_ENUM pdcp_config;
// RLC
boost::mutex rlc_pdu_queue_mutex;
boost::mutex rlc_sdu_queue_mutex;
std::list<LIBLTE_MSG_STRUCT *> rlc_pdu_queue;
std::list<LIBLTE_MSG_STRUCT *> rlc_sdu_queue;
LTE_FDD_ENB_RLC_CONFIG_ENUM rlc_config;
// MAC
boost::mutex mac_sdu_queue_mutex;
std::list<LIBLTE_MSG_STRUCT *> mac_sdu_queue;
LTE_FDD_ENB_MAC_CONFIG_ENUM mac_config;
// Generic
void queue_msg(LIBLTE_MSG_STRUCT *msg, boost::mutex *mutex, std::list<LIBLTE_MSG_STRUCT *> *queue);
LTE_FDD_ENB_ERROR_ENUM get_next_msg(boost::mutex *mutex, std::list<LIBLTE_MSG_STRUCT *> *queue, LIBLTE_MSG_STRUCT **msg);
LTE_FDD_ENB_ERROR_ENUM delete_next_msg(boost::mutex *mutex, std::list<LIBLTE_MSG_STRUCT *> *queue);
};
#endif /* __LTE_FDD_ENB_RB_H__ */
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
Copyright 2013-2014 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
......@@ -25,6 +25,7 @@
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added communication to MAC and PDCP.
*******************************************************************************/
......@@ -91,6 +92,18 @@ private:
boost::interprocess::message_queue *rlc_mac_mq;
boost::interprocess::message_queue *rlc_pdcp_mq;
// MAC Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_RLC_PDU_READY_MSG_STRUCT *pdu_ready);
void handle_tm_pdu(LIBLTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_um_pdu(LIBLTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_am_pdu(LIBLTE_MSG_STRUCT *pdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// PDCP Message Handlers
void handle_sdu_ready(LTE_FDD_ENB_RLC_SDU_READY_MSG_STRUCT *sdu_ready);
void handle_tm_sdu(LIBLTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_um_sdu(LIBLTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
void handle_am_sdu(LIBLTE_MSG_STRUCT *sdu, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
......
/*******************************************************************************
Copyright 2013 Ben Wojtowicz
Copyright 2013-2014 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
......@@ -25,6 +25,8 @@
Revision History
---------- ------------- --------------------------------------------
11/09/2013 Ben Wojtowicz Created file
05/04/2014 Ben Wojtowicz Added PDCP communication and UL CCCH state
machine.
*******************************************************************************/
......@@ -36,6 +38,7 @@
*******************************************************************************/
#include "LTE_fdd_enb_cnfg_db.h"
#include "LTE_fdd_enb_user.h"
#include "LTE_fdd_enb_msgq.h"
#include <boost/thread/mutex.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
......@@ -91,6 +94,20 @@ private:
boost::interprocess::message_queue *rrc_pdcp_mq;
boost::interprocess::message_queue *rrc_mme_mq;
// PDCP Message Handlers
void handle_pdu_ready(LTE_FDD_ENB_RRC_PDU_READY_MSG_STRUCT *pdu_ready);
// MME Message Handlers
// State Machines
void ul_ccch_message_sm(LIBLTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Parsers
void parse_ul_ccch_message(LIBLTE_MSG_STRUCT *msg, LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Message Senders
void send_rrc_con_setup(LTE_fdd_enb_user *user, LTE_fdd_enb_rb *rb);
// Parameters
boost::mutex sys_info_mutex;
LTE_FDD_ENB_SYS_INFO_STRUCT sys_info;
......
/*******************************************************************************
Copyright 2014 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_timer.h
Description: Contains all the definitions for the LTE FDD eNodeB
timer class.
Revision History
---------- ------------- --------------------------------------------
05/04/2014 Ben Wojtowicz Created file
*******************************************************************************/
#ifndef __LTE_FDD_ENB_TIMER_H__
#define __LTE_FDD_ENB_TIMER_H__
/*******************************************************************************
INCLUDES
*******************************************************************************/
#include "LTE_fdd_enb_interface.h"
/*******************************************************************************
DEFINES
*******************************************************************************/
/*******************************************************************************
FORWARD DECLARATIONS
*******************************************************************************/
/*******************************************************************************
TYPEDEFS
*******************************************************************************/
/*******************************************************************************
CLASS DECLARATIONS
*******************************************************************************/
// Timer callback
class timer_cb
{
public:
typedef void (*FuncType)(void*, uint32);
timer_cb();
timer_cb(FuncType f, void* o);
void operator()(uint32 id);
private:
FuncType func;
void *obj;
};
template<class class_type, void (class_type::*Func)(uint32)>