renamed SRSUE_ constants to SRSLTE_

master
Ismael Gomez 8 years ago
parent 129b34201d
commit 5e030dc805

@ -38,17 +38,17 @@
DEFINES DEFINES
*******************************************************************************/ *******************************************************************************/
#define SRSUE_UE_CATEGORY 4 #define SRSLTE_UE_CATEGORY 4
#define SRSUE_N_SRB 3 #define SRSLTE_N_SRB 3
#define SRSUE_N_DRB 8 #define SRSLTE_N_DRB 8
#define SRSUE_N_RADIO_BEARERS 11 #define SRSLTE_N_RADIO_BEARERS 11
// Cat 3 UE - Max number of DL-SCH transport block bits received within a TTI // Cat 3 UE - Max number of DL-SCH transport block bits received within a TTI
// 3GPP 36.306 Table 4.1.1 // 3GPP 36.306 Table 4.1.1
#define SRSUE_MAX_BUFFER_SIZE_BITS 102048 #define SRSLTE_MAX_BUFFER_SIZE_BITS 102048
#define SRSUE_MAX_BUFFER_SIZE_BYTES 12756 #define SRSLTE_MAX_BUFFER_SIZE_BYTES 12756
#define SRSUE_BUFFER_HEADER_OFFSET 1024 #define SRSLTE_BUFFER_HEADER_OFFSET 1024
#define SRSLTE_BUFFER_POOL_LOG_ENABLED #define SRSLTE_BUFFER_POOL_LOG_ENABLED
@ -118,7 +118,7 @@ static const char rb_id_text[RB_ID_N_ITEMS][20] = { "SRB0",
class byte_buffer_t{ class byte_buffer_t{
public: public:
uint32_t N_bytes; uint32_t N_bytes;
uint8_t buffer[SRSUE_MAX_BUFFER_SIZE_BYTES]; uint8_t buffer[SRSLTE_MAX_BUFFER_SIZE_BYTES];
uint8_t *msg; uint8_t *msg;
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED #ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
char debug_name[128]; char debug_name[128];
@ -127,7 +127,7 @@ public:
byte_buffer_t():N_bytes(0) byte_buffer_t():N_bytes(0)
{ {
timestamp_is_set = false; timestamp_is_set = false;
msg = &buffer[SRSUE_BUFFER_HEADER_OFFSET]; msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
next = NULL; next = NULL;
} }
byte_buffer_t(const byte_buffer_t& buf) byte_buffer_t(const byte_buffer_t& buf)
@ -146,7 +146,7 @@ public:
} }
void reset() void reset()
{ {
msg = &buffer[SRSUE_BUFFER_HEADER_OFFSET]; msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
N_bytes = 0; N_bytes = 0;
timestamp_is_set = false; timestamp_is_set = false;
} }
@ -190,7 +190,7 @@ private:
struct bit_buffer_t{ struct bit_buffer_t{
uint32_t N_bits; uint32_t N_bits;
uint8_t buffer[SRSUE_MAX_BUFFER_SIZE_BITS]; uint8_t buffer[SRSLTE_MAX_BUFFER_SIZE_BITS];
uint8_t *msg; uint8_t *msg;
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED #ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
char debug_name[128]; char debug_name[128];
@ -198,7 +198,7 @@ struct bit_buffer_t{
bit_buffer_t():N_bits(0) bit_buffer_t():N_bits(0)
{ {
msg = &buffer[SRSUE_BUFFER_HEADER_OFFSET]; msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
} }
bit_buffer_t(const bit_buffer_t& buf){ bit_buffer_t(const bit_buffer_t& buf){
N_bits = buf.N_bits; N_bits = buf.N_bits;
@ -214,7 +214,7 @@ struct bit_buffer_t{
} }
void reset() void reset()
{ {
msg = &buffer[SRSUE_BUFFER_HEADER_OFFSET]; msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
N_bits = 0; N_bits = 0;
timestamp_is_set = false; timestamp_is_set = false;
} }

@ -67,7 +67,7 @@ public:
private: private:
log *pdcp_log; log *pdcp_log;
pdcp_entity pdcp_array[SRSUE_N_RADIO_BEARERS]; pdcp_entity pdcp_array[SRSLTE_N_RADIO_BEARERS];
srsue::rlc_interface_pdcp *rlc; srsue::rlc_interface_pdcp *rlc;
srsue::rrc_interface_pdcp *rrc; srsue::rrc_interface_pdcp *rrc;

@ -86,10 +86,10 @@ private:
srsue::rrc_interface_rlc *rrc; srsue::rrc_interface_rlc *rrc;
srslte::mac_interface_timers *mac_timers; srslte::mac_interface_timers *mac_timers;
srsue::ue_interface *ue; srsue::ue_interface *ue;
srslte::rlc_entity rlc_array[SRSUE_N_RADIO_BEARERS]; srslte::rlc_entity rlc_array[SRSLTE_N_RADIO_BEARERS];
long ul_tput_bytes[SRSUE_N_RADIO_BEARERS]; long ul_tput_bytes[SRSLTE_N_RADIO_BEARERS];
long dl_tput_bytes[SRSUE_N_RADIO_BEARERS]; long dl_tput_bytes[SRSLTE_N_RADIO_BEARERS];
struct timeval metrics_time[3]; struct timeval metrics_time[3];
bool valid_lcid(uint32_t lcid); bool valid_lcid(uint32_t lcid);

@ -229,8 +229,8 @@ void gw::run_thread()
running = true; running = true;
while(run_enable) while(run_enable)
{ {
if (SRSUE_MAX_BUFFER_SIZE_BYTES-SRSUE_BUFFER_HEADER_OFFSET > idx) { if (SRSLTE_MAX_BUFFER_SIZE_BYTES-SRSLTE_BUFFER_HEADER_OFFSET > idx) {
N_bytes = read(tun_fd, &pdu->msg[idx], SRSUE_MAX_BUFFER_SIZE_BYTES-SRSUE_BUFFER_HEADER_OFFSET - idx); N_bytes = read(tun_fd, &pdu->msg[idx], SRSLTE_MAX_BUFFER_SIZE_BYTES-SRSLTE_BUFFER_HEADER_OFFSET - idx);
} else { } else {
gw_log->error("GW pdu buffer full - gw receive thread exiting.\n"); gw_log->error("GW pdu buffer full - gw receive thread exiting.\n");
gw_log->console("GW pdu buffer full - gw receive thread exiting.\n"); gw_log->console("GW pdu buffer full - gw receive thread exiting.\n");

@ -48,7 +48,7 @@ void pdcp::stop()
void pdcp::reset() void pdcp::reset()
{ {
for(uint32_t i=0;i<SRSUE_N_RADIO_BEARERS;i++) { for(uint32_t i=0;i<SRSLTE_N_RADIO_BEARERS;i++) {
pdcp_array[i].reset(); pdcp_array[i].reset();
} }
@ -66,8 +66,8 @@ void pdcp::write_sdu(uint32_t lcid, byte_buffer_t *sdu)
void pdcp::add_bearer(uint32_t lcid, LIBLTE_RRC_PDCP_CONFIG_STRUCT *cnfg) void pdcp::add_bearer(uint32_t lcid, LIBLTE_RRC_PDCP_CONFIG_STRUCT *cnfg)
{ {
if(lcid < 0 || lcid >= SRSUE_N_RADIO_BEARERS) { if(lcid < 0 || lcid >= SRSLTE_N_RADIO_BEARERS) {
pdcp_log->error("Radio bearer id must be in [0:%d] - %d\n", SRSUE_N_RADIO_BEARERS, lcid); pdcp_log->error("Radio bearer id must be in [0:%d] - %d\n", SRSLTE_N_RADIO_BEARERS, lcid);
return; return;
} }
if (!pdcp_array[lcid].is_active()) { if (!pdcp_array[lcid].is_active()) {
@ -116,8 +116,8 @@ void pdcp::write_pdu_pcch(byte_buffer_t *sdu)
*******************************************************************************/ *******************************************************************************/
bool pdcp::valid_lcid(uint32_t lcid) bool pdcp::valid_lcid(uint32_t lcid)
{ {
if(lcid < 0 || lcid >= SRSUE_N_RADIO_BEARERS) { if(lcid < 0 || lcid >= SRSLTE_N_RADIO_BEARERS) {
pdcp_log->error("Radio bearer id must be in [0:%d] - %d", SRSUE_N_RADIO_BEARERS, lcid); pdcp_log->error("Radio bearer id must be in [0:%d] - %d", SRSLTE_N_RADIO_BEARERS, lcid);
return false; return false;
} }
if(!pdcp_array[lcid].is_active()) { if(!pdcp_array[lcid].is_active()) {

@ -57,8 +57,8 @@ void rlc::init(srsue::pdcp_interface_rlc *pdcp_,
void rlc::reset_metrics() void rlc::reset_metrics()
{ {
bzero(dl_tput_bytes, sizeof(long)*SRSUE_N_RADIO_BEARERS); bzero(dl_tput_bytes, sizeof(long)*SRSLTE_N_RADIO_BEARERS);
bzero(ul_tput_bytes, sizeof(long)*SRSUE_N_RADIO_BEARERS); bzero(ul_tput_bytes, sizeof(long)*SRSLTE_N_RADIO_BEARERS);
} }
void rlc::stop() void rlc::stop()
@ -75,7 +75,7 @@ void rlc::get_metrics(rlc_metrics_t &m)
m.dl_tput_mbps = 0; m.dl_tput_mbps = 0;
m.ul_tput_mbps = 0; m.ul_tput_mbps = 0;
for (int i=0;i<SRSUE_N_RADIO_BEARERS;i++) { for (int i=0;i<SRSLTE_N_RADIO_BEARERS;i++) {
m.dl_tput_mbps += (dl_tput_bytes[i]*8/(double)1e6)/secs; m.dl_tput_mbps += (dl_tput_bytes[i]*8/(double)1e6)/secs;
m.ul_tput_mbps += (ul_tput_bytes[i]*8/(double)1e6)/secs; m.ul_tput_mbps += (ul_tput_bytes[i]*8/(double)1e6)/secs;
if(rlc_array[i].active()) { if(rlc_array[i].active()) {
@ -92,7 +92,7 @@ void rlc::get_metrics(rlc_metrics_t &m)
void rlc::reset() void rlc::reset()
{ {
for(uint32_t i=0; i<SRSUE_N_RADIO_BEARERS; i++) { for(uint32_t i=0; i<SRSLTE_N_RADIO_BEARERS; i++) {
if(rlc_array[i].active()) if(rlc_array[i].active())
rlc_array[i].reset(); rlc_array[i].reset();
} }
@ -210,8 +210,8 @@ void rlc::add_bearer(uint32_t lcid)
void rlc::add_bearer(uint32_t lcid, LIBLTE_RRC_RLC_CONFIG_STRUCT *cnfg) void rlc::add_bearer(uint32_t lcid, LIBLTE_RRC_RLC_CONFIG_STRUCT *cnfg)
{ {
if(lcid < 0 || lcid >= SRSUE_N_RADIO_BEARERS) { if(lcid < 0 || lcid >= SRSLTE_N_RADIO_BEARERS) {
rlc_log->error("Radio bearer id must be in [0:%d] - %d\n", SRSUE_N_RADIO_BEARERS, lcid); rlc_log->error("Radio bearer id must be in [0:%d] - %d\n", SRSLTE_N_RADIO_BEARERS, lcid);
return; return;
} }
@ -249,7 +249,7 @@ void rlc::add_bearer(uint32_t lcid, LIBLTE_RRC_RLC_CONFIG_STRUCT *cnfg)
*******************************************************************************/ *******************************************************************************/
bool rlc::valid_lcid(uint32_t lcid) bool rlc::valid_lcid(uint32_t lcid)
{ {
if(lcid < 0 || lcid >= SRSUE_N_RADIO_BEARERS) { if(lcid < 0 || lcid >= SRSLTE_N_RADIO_BEARERS) {
return false; return false;
} }
if(!rlc_array[lcid].active()) { if(!rlc_array[lcid].active()) {

@ -84,7 +84,7 @@ void rlc::clear_buffer(uint16_t rnti)
if (users.count(rnti)) { if (users.count(rnti)) {
log_h->info("Clearing buffer rnti=0x%x\n", rnti); log_h->info("Clearing buffer rnti=0x%x\n", rnti);
users[rnti].rlc->reset(); users[rnti].rlc->reset();
for (int i=0;i<SRSUE_N_RADIO_BEARERS;i++) { for (int i=0;i<SRSLTE_N_RADIO_BEARERS;i++) {
mac->rlc_buffer_state(rnti, i, 0, 0); mac->rlc_buffer_state(rnti, i, 0, 0);
} }
} }

@ -89,7 +89,7 @@ void s1ap::run_thread()
{ {
srslte::byte_buffer_t *pdu = pool_allocate; srslte::byte_buffer_t *pdu = pool_allocate;
uint32_t sz = SRSUE_MAX_BUFFER_SIZE_BYTES - SRSUE_BUFFER_HEADER_OFFSET; uint32_t sz = SRSLTE_MAX_BUFFER_SIZE_BYTES - SRSLTE_BUFFER_HEADER_OFFSET;
running = true; running = true;
// Connect to MME // Connect to MME

@ -281,7 +281,7 @@ private:
while(running) { while(running) {
if (tun_fd > 0) { if (tun_fd > 0) {
pdu->msg[0] = 0x0; pdu->msg[0] = 0x0;
N_bytes = read(tun_fd, &pdu->msg[idx], SRSUE_MAX_BUFFER_SIZE_BYTES-SRSUE_BUFFER_HEADER_OFFSET - idx); N_bytes = read(tun_fd, &pdu->msg[idx], SRSLTE_MAX_BUFFER_SIZE_BYTES-SRSLTE_BUFFER_HEADER_OFFSET - idx);
} }
if(N_bytes > 0) if(N_bytes > 0)
{ {

@ -79,7 +79,7 @@ void rrc::init(phy_interface_rrc *phy_,
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
ue_category = SRSUE_UE_CATEGORY; ue_category = SRSLTE_UE_CATEGORY;
transaction_id = 0; transaction_id = 0;
@ -318,7 +318,7 @@ void rrc::write_pdu_bcch_dlsch(byte_buffer_t *pdu)
void rrc::write_pdu_pcch(byte_buffer_t *pdu) void rrc::write_pdu_pcch(byte_buffer_t *pdu)
{ {
if (pdu->N_bytes > 0 && pdu->N_bytes < SRSUE_MAX_BUFFER_SIZE_BITS) { if (pdu->N_bytes > 0 && pdu->N_bytes < SRSLTE_MAX_BUFFER_SIZE_BITS) {
rrc_log->info_hex(pdu->msg, pdu->N_bytes, "PCCH message received %d bytes\n", pdu->N_bytes); rrc_log->info_hex(pdu->msg, pdu->N_bytes, "PCCH message received %d bytes\n", pdu->N_bytes);
rrc_log->info("PCCH message Stack latency: %ld us\n", pdu->get_latency_us()); rrc_log->info("PCCH message Stack latency: %ld us\n", pdu->get_latency_us());
rrc_log->console("PCCH message received %d bytes\n", pdu->N_bytes); rrc_log->console("PCCH message received %d bytes\n", pdu->N_bytes);

@ -369,7 +369,7 @@ private:
log_h->info("TUN/TAP reader thread running\n"); log_h->info("TUN/TAP reader thread running\n");
while(running) { while(running) {
N_bytes = read(tun_fd, &pdu->msg[idx], SRSUE_MAX_BUFFER_SIZE_BYTES-SRSUE_BUFFER_HEADER_OFFSET - idx); N_bytes = read(tun_fd, &pdu->msg[idx], SRSLTE_MAX_BUFFER_SIZE_BYTES-SRSLTE_BUFFER_HEADER_OFFSET - idx);
if(N_bytes > 0 && read_enable) if(N_bytes > 0 && read_enable)
{ {
pdu->N_bytes = idx + N_bytes; pdu->N_bytes = idx + N_bytes;

Loading…
Cancel
Save