2019-04-26 12:27:38 -07:00
|
|
|
/*
|
2020-03-13 04:12:52 -07:00
|
|
|
* Copyright 2013-2020 Software Radio Systems Limited
|
2017-05-18 03:52:29 -07:00
|
|
|
*
|
2019-04-26 12:27:38 -07:00
|
|
|
* This file is part of srsLTE.
|
2017-05-18 03:52:29 -07:00
|
|
|
*
|
2019-04-26 12:27:38 -07:00
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
2017-05-18 03:52:29 -07:00
|
|
|
* 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.
|
|
|
|
*
|
2019-04-26 12:27:38 -07:00
|
|
|
* srsLTE is distributed in the hope that it will be useful,
|
2017-05-18 03:52:29 -07:00
|
|
|
* 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/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSLTE_RLC_TM_H
|
|
|
|
#define SRSLTE_RLC_TM_H
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2017-05-31 14:39:17 -07:00
|
|
|
#include "srslte/common/buffer_pool.h"
|
|
|
|
#include "srslte/common/common.h"
|
2019-12-16 07:04:22 -08:00
|
|
|
#include "srslte/common/log.h"
|
2017-06-01 03:25:42 -07:00
|
|
|
#include "srslte/interfaces/ue_interfaces.h"
|
2017-05-31 14:39:17 -07:00
|
|
|
#include "srslte/upper/rlc_common.h"
|
2019-12-16 07:04:22 -08:00
|
|
|
#include "srslte/upper/rlc_tx_queue.h"
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2017-06-01 03:25:42 -07:00
|
|
|
namespace srslte {
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2020-04-14 13:32:01 -07:00
|
|
|
class rlc_tm final : public rlc_common
|
2017-05-18 03:52:29 -07:00
|
|
|
{
|
|
|
|
public:
|
2020-03-25 07:57:29 -07:00
|
|
|
rlc_tm(srslte::log_ref log_,
|
2019-09-04 06:28:09 -07:00
|
|
|
uint32_t lcid_,
|
|
|
|
srsue::pdcp_interface_rlc* pdcp_,
|
|
|
|
srsue::rrc_interface_rlc* rrc_,
|
2019-10-21 10:00:49 -07:00
|
|
|
srslte::timer_handler* timers_,
|
2019-09-04 06:28:09 -07:00
|
|
|
uint32_t queue_len = 16);
|
2018-07-05 02:00:19 -07:00
|
|
|
~rlc_tm();
|
2020-04-14 13:32:01 -07:00
|
|
|
bool configure(const rlc_config_t& cnfg) override;
|
2017-09-19 06:15:25 -07:00
|
|
|
void stop();
|
2018-07-08 15:26:58 -07:00
|
|
|
void reestablish();
|
2019-12-16 07:04:22 -08:00
|
|
|
void empty_queue();
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2019-12-16 07:04:22 -08:00
|
|
|
rlc_mode_t get_mode();
|
|
|
|
uint32_t get_bearer();
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2019-10-23 02:53:00 -07:00
|
|
|
rlc_bearer_metrics_t get_metrics();
|
2019-12-16 07:04:22 -08:00
|
|
|
void reset_metrics();
|
2018-07-23 06:44:50 -07:00
|
|
|
|
2017-05-18 03:52:29 -07:00
|
|
|
// PDCP interface
|
2019-05-13 07:34:15 -07:00
|
|
|
void write_sdu(unique_byte_buffer_t sdu, bool blocking);
|
2019-11-25 07:16:37 -08:00
|
|
|
void discard_sdu(uint32_t discard_sn);
|
2017-05-18 03:52:29 -07:00
|
|
|
|
|
|
|
// MAC interface
|
2018-11-30 03:26:37 -08:00
|
|
|
bool has_data();
|
2017-05-18 03:52:29 -07:00
|
|
|
uint32_t get_buffer_state();
|
2019-12-16 07:04:22 -08:00
|
|
|
int read_pdu(uint8_t* payload, uint32_t nof_bytes);
|
|
|
|
void write_pdu(uint8_t* payload, uint32_t nof_bytes);
|
2017-05-18 03:52:29 -07:00
|
|
|
|
|
|
|
private:
|
2019-06-12 03:51:49 -07:00
|
|
|
byte_buffer_pool* pool = nullptr;
|
2020-03-25 07:57:29 -07:00
|
|
|
srslte::log_ref log;
|
2019-06-12 03:51:49 -07:00
|
|
|
uint32_t lcid = 0;
|
|
|
|
srsue::pdcp_interface_rlc* pdcp = nullptr;
|
|
|
|
srsue::rrc_interface_rlc* rrc = nullptr;
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2019-06-12 03:51:49 -07:00
|
|
|
bool tx_enabled = true;
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2019-10-23 02:53:00 -07:00
|
|
|
rlc_bearer_metrics_t metrics = {};
|
2018-07-23 06:44:50 -07:00
|
|
|
|
2017-05-18 03:52:29 -07:00
|
|
|
// Thread-safe queues for MAC messages
|
2019-12-16 07:04:22 -08:00
|
|
|
rlc_tx_queue ul_queue;
|
2017-05-18 03:52:29 -07:00
|
|
|
};
|
|
|
|
|
2019-08-07 05:32:14 -07:00
|
|
|
} // namespace srslte
|
2017-05-18 03:52:29 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSLTE_RLC_TM_H
|