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.
90 lines
2.4 KiB
C
90 lines
2.4 KiB
C
4 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
|
*
|
||
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#ifndef SRSRAN_SCHED_NR_H
|
||
|
#define SRSRAN_SCHED_NR_H
|
||
|
|
||
4 years ago
|
#include "sched_nr_cfg.h"
|
||
4 years ago
|
#include "sched_nr_interface.h"
|
||
|
#include "sched_nr_ue.h"
|
||
|
#include "srsran/adt/pool/cached_alloc.h"
|
||
3 years ago
|
#include "srsran/common/slot_point.h"
|
||
4 years ago
|
#include <array>
|
||
|
extern "C" {
|
||
|
#include "srsran/config.h"
|
||
|
}
|
||
|
|
||
|
namespace srsenb {
|
||
|
|
||
4 years ago
|
namespace sched_nr_impl {
|
||
3 years ago
|
|
||
|
class cc_worker;
|
||
|
|
||
4 years ago
|
} // namespace sched_nr_impl
|
||
4 years ago
|
|
||
4 years ago
|
class sched_nr final : public sched_nr_interface
|
||
|
{
|
||
|
public:
|
||
3 years ago
|
explicit sched_nr();
|
||
4 years ago
|
~sched_nr() override;
|
||
3 years ago
|
|
||
|
void stop();
|
||
3 years ago
|
int config(const sched_args_t& sched_cfg, srsran::const_span<cell_cfg_t> cell_list) override;
|
||
4 years ago
|
void ue_cfg(uint16_t rnti, const ue_cfg_t& cfg) override;
|
||
3 years ago
|
void ue_rem(uint16_t rnti) override;
|
||
4 years ago
|
|
||
3 years ago
|
int dl_rach_info(const rar_info_t& rar_info, const ue_cfg_t& uecfg);
|
||
3 years ago
|
|
||
4 years ago
|
void dl_ack_info(uint16_t rnti, uint32_t cc, uint32_t pid, uint32_t tb_idx, bool ack) override;
|
||
3 years ago
|
void ul_crc_info(uint16_t rnti, uint32_t cc, uint32_t pid, bool crc) override;
|
||
3 years ago
|
void ul_sr_info(uint16_t rnti) override;
|
||
3 years ago
|
void ul_bsr(uint16_t rnti, uint32_t lcg_id, uint32_t bsr) override;
|
||
3 years ago
|
void dl_buffer_state(uint16_t rnti, uint32_t lcid, uint32_t newtx, uint32_t retx);
|
||
4 years ago
|
|
||
3 years ago
|
/// Called once per slot in a non-concurrent fashion
|
||
3 years ago
|
void slot_indication(slot_point slot_tx) override;
|
||
|
dl_res_t* get_dl_sched(slot_point pdsch_tti, uint32_t cc) override;
|
||
|
ul_res_t* get_ul_sched(slot_point pusch_tti, uint32_t cc) override;
|
||
4 years ago
|
|
||
3 years ago
|
void get_metrics(mac_metrics_t& metrics);
|
||
|
|
||
4 years ago
|
private:
|
||
3 years ago
|
int ue_cfg_impl(uint16_t rnti, const ue_cfg_t& cfg);
|
||
|
int add_ue_impl(uint16_t rnti, std::unique_ptr<sched_nr_impl::ue> u);
|
||
4 years ago
|
|
||
4 years ago
|
// args
|
||
3 years ago
|
sched_nr_impl::sched_params_t cfg;
|
||
|
srslog::basic_logger* logger = nullptr;
|
||
4 years ago
|
|
||
3 years ago
|
// slot-specific
|
||
|
slot_point current_slot_tx;
|
||
|
std::atomic<int> worker_count{0};
|
||
|
|
||
|
using slot_cc_worker = sched_nr_impl::cc_worker;
|
||
|
std::vector<std::unique_ptr<sched_nr_impl::cc_worker> > cc_workers;
|
||
4 years ago
|
|
||
|
using ue_map_t = sched_nr_impl::ue_map_t;
|
||
3 years ago
|
ue_map_t ue_db;
|
||
4 years ago
|
|
||
3 years ago
|
// Feedback management
|
||
3 years ago
|
class event_manager;
|
||
|
std::unique_ptr<event_manager> pending_events;
|
||
3 years ago
|
|
||
|
// metrics extraction
|
||
|
class ue_metrics_manager;
|
||
|
std::unique_ptr<ue_metrics_manager> metrics_handler;
|
||
4 years ago
|
};
|
||
|
|
||
|
} // namespace srsenb
|
||
|
|
||
|
#endif // SRSRAN_SCHED_NR_H
|