mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
3.3 KiB
C
103 lines
3.3 KiB
C
6 years ago
|
/*
|
||
|
* Copyright 2013-2019 Software Radio Systems Limited
|
||
8 years ago
|
*
|
||
|
* This file is part of srsLTE.
|
||
|
*
|
||
6 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
8 years ago
|
* 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.
|
||
|
*
|
||
6 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
8 years ago
|
* 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.
|
||
|
*
|
||
|
* A copy of the GNU Affero General Public License can be found in
|
||
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
8 years ago
|
|
||
|
#include <map>
|
||
|
#include "srslte/interfaces/ue_interfaces.h"
|
||
|
#include "srslte/interfaces/enb_interfaces.h"
|
||
|
#include "srslte/upper/rlc.h"
|
||
|
|
||
7 years ago
|
#ifndef SRSENB_RLC_H
|
||
|
#define SRSENB_RLC_H
|
||
8 years ago
|
|
||
7 years ago
|
typedef struct {
|
||
|
uint32_t lcid;
|
||
|
uint32_t plmn;
|
||
|
uint16_t mtch_stop;
|
||
|
uint8_t *payload;
|
||
|
}mch_service_t;
|
||
|
|
||
8 years ago
|
namespace srsenb {
|
||
|
|
||
|
class rlc : public rlc_interface_mac,
|
||
|
public rlc_interface_rrc,
|
||
|
public rlc_interface_pdcp
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
void init(pdcp_interface_rlc *pdcp_, rrc_interface_rlc *rrc_, mac_interface_rlc *mac_,
|
||
|
srslte::mac_interface_timers *mac_timers_, srslte::log *log_h);
|
||
|
void stop();
|
||
|
|
||
|
// rlc_interface_rrc
|
||
|
void clear_buffer(uint16_t rnti);
|
||
|
void add_user(uint16_t rnti);
|
||
|
void rem_user(uint16_t rnti);
|
||
|
void add_bearer(uint16_t rnti, uint32_t lcid);
|
||
8 years ago
|
void add_bearer(uint16_t rnti, uint32_t lcid, srslte::srslte_rlc_config_t cnfg);
|
||
7 years ago
|
void add_bearer_mrb(uint16_t rnti, uint32_t lcid);
|
||
8 years ago
|
|
||
|
// rlc_interface_pdcp
|
||
6 years ago
|
void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu);
|
||
7 years ago
|
bool rb_is_um(uint16_t rnti, uint32_t lcid);
|
||
8 years ago
|
std::string get_rb_name(uint32_t lcid);
|
||
8 years ago
|
|
||
|
// rlc_interface_mac
|
||
|
int read_pdu(uint16_t rnti, uint32_t lcid, uint8_t *payload, uint32_t nof_bytes);
|
||
|
void read_pdu_bcch_dlsch(uint32_t sib_index, uint8_t *payload);
|
||
|
void write_pdu(uint16_t rnti, uint32_t lcid, uint8_t *payload, uint32_t nof_bytes);
|
||
|
void read_pdu_pcch(uint8_t *payload, uint32_t buffer_size);
|
||
|
|
||
6 years ago
|
private:
|
||
|
class user_interface : public srsue::pdcp_interface_rlc, public srsue::rrc_interface_rlc
|
||
8 years ago
|
{
|
||
6 years ago
|
public:
|
||
6 years ago
|
void write_pdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu);
|
||
|
void write_pdu_bcch_bch(srslte::unique_byte_buffer_t sdu);
|
||
|
void write_pdu_bcch_dlsch(srslte::unique_byte_buffer_t sdu);
|
||
|
void write_pdu_pcch(srslte::unique_byte_buffer_t sdu);
|
||
|
void write_pdu_mch(uint32_t lcid, srslte::unique_byte_buffer_t sdu) {}
|
||
8 years ago
|
void max_retx_attempted();
|
||
8 years ago
|
std::string get_rb_name(uint32_t lcid);
|
||
8 years ago
|
uint16_t rnti;
|
||
|
|
||
6 years ago
|
srsenb::pdcp_interface_rlc *pdcp;
|
||
|
srsenb::rrc_interface_rlc *rrc;
|
||
|
std::unique_ptr<srslte::rlc> rlc;
|
||
|
srsenb::rlc *parent;
|
||
7 years ago
|
};
|
||
|
|
||
|
pthread_rwlock_t rwlock;
|
||
|
|
||
8 years ago
|
std::map<uint32_t,user_interface> users;
|
||
7 years ago
|
std::vector<mch_service_t> mch_services;
|
||
|
|
||
8 years ago
|
mac_interface_rlc *mac;
|
||
|
pdcp_interface_rlc *pdcp;
|
||
|
rrc_interface_rlc *rrc;
|
||
|
srslte::log *log_h;
|
||
|
srslte::byte_buffer_pool *pool;
|
||
|
srslte::mac_interface_timers *mac_timers;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
7 years ago
|
#endif // SRSENB_RLC_H
|