2019-04-26 12:27:38 -07:00
|
|
|
/*
|
2020-03-13 04:12:52 -07:00
|
|
|
* Copyright 2013-2020 Software Radio Systems Limited
|
2017-06-02 03:46:06 -07:00
|
|
|
*
|
|
|
|
* This file is part of srsLTE.
|
|
|
|
*
|
2019-04-26 12:27:38 -07:00
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
2017-06-02 03:46:06 -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-06-02 03:46:06 -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/.
|
|
|
|
*
|
|
|
|
*/
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSENB_PHY_H
|
|
|
|
#define SRSENB_PHY_H
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2019-04-23 01:53:11 -07:00
|
|
|
#include "phy_common.h"
|
|
|
|
#include "sf_worker.h"
|
2019-07-05 12:31:49 -07:00
|
|
|
#include "srsenb/hdr/phy/enb_phy_base.h"
|
2017-06-01 03:25:57 -07:00
|
|
|
#include "srslte/common/log.h"
|
2018-03-28 07:46:40 -07:00
|
|
|
#include "srslte/common/log_filter.h"
|
2017-06-01 03:25:57 -07:00
|
|
|
#include "srslte/common/trace.h"
|
2019-01-17 03:42:01 -08:00
|
|
|
#include "srslte/interfaces/enb_interfaces.h"
|
2017-06-01 03:25:57 -07:00
|
|
|
#include "srslte/interfaces/enb_metrics_interface.h"
|
2020-03-06 06:26:48 -08:00
|
|
|
#include "srslte/interfaces/radio_interfaces.h"
|
2019-01-17 03:42:01 -08:00
|
|
|
#include "srslte/radio/radio.h"
|
|
|
|
#include "txrx.h"
|
2017-06-01 03:25:57 -07:00
|
|
|
|
|
|
|
namespace srsenb {
|
2019-12-05 08:15:15 -08:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
class phy final : public enb_phy_base, public phy_interface_stack_lte, public srslte::phy_interface_radio
|
2017-06-01 03:25:57 -07:00
|
|
|
{
|
|
|
|
public:
|
2019-07-05 07:47:39 -07:00
|
|
|
phy(srslte::logger* logger_);
|
|
|
|
~phy();
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2019-07-05 07:47:39 -07:00
|
|
|
int init(const phy_args_t& args,
|
|
|
|
const phy_cfg_t& cfg,
|
|
|
|
srslte::radio_interface_phy* radio_,
|
|
|
|
stack_interface_phy_lte* stack_);
|
2020-02-23 09:05:55 -08:00
|
|
|
void stop() override;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
std::string get_type() override { return "lte"; };
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2017-06-01 03:25:57 -07:00
|
|
|
/* MAC->PHY interface */
|
2019-10-17 07:44:45 -07:00
|
|
|
void rem_rnti(uint16_t rnti) final;
|
2020-05-21 10:50:58 -07:00
|
|
|
int pregen_sequences(uint16_t rnti) override;
|
2019-10-17 07:44:45 -07:00
|
|
|
void set_mch_period_stop(uint32_t stop) final;
|
2020-03-11 09:15:25 -07:00
|
|
|
void set_activation_deactivation_scell(uint16_t rnti,
|
|
|
|
const std::array<bool, SRSLTE_MAX_CARRIERS>& activation) override;
|
2019-04-23 01:53:11 -07:00
|
|
|
|
2018-05-15 08:01:51 -07:00
|
|
|
/*RRC-PHY interface*/
|
2020-04-14 13:32:01 -07:00
|
|
|
void configure_mbsfn(asn1::rrc::sib_type2_s* sib2,
|
|
|
|
asn1::rrc::sib_type13_r9_s* sib13,
|
|
|
|
const asn1::rrc::mcch_msg_s& mcch) override;
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
void start_plot() override;
|
2020-06-10 08:17:51 -07:00
|
|
|
void set_config(uint16_t rnti, const phy_rrc_cfg_list_t& phy_cfg_list) override;
|
|
|
|
void complete_config(uint16_t rnti) override;
|
2019-01-17 03:42:01 -08:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
void get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]) override;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-08-25 09:07:56 -07:00
|
|
|
void cmd_cell_gain(uint32_t cell_idx, float gain_db) override;
|
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
void radio_overflow() override{};
|
|
|
|
void radio_failure() override{};
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2017-06-01 03:25:57 -07:00
|
|
|
private:
|
2020-06-10 08:17:51 -07:00
|
|
|
phy_cfg_mbsfn_t mbsfn_config = {};
|
|
|
|
uint32_t nof_workers = 0;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-02-26 11:25:49 -08:00
|
|
|
const static int MAX_WORKERS = 4;
|
2019-12-16 07:04:22 -08:00
|
|
|
|
2020-07-01 08:30:34 -07:00
|
|
|
const static int PRACH_WORKER_THREAD_PRIO = 5;
|
2019-12-16 07:04:22 -08:00
|
|
|
const static int SF_RECV_THREAD_PRIO = 1;
|
|
|
|
const static int WORKERS_THREAD_PRIO = 2;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
|
|
|
srslte::radio_interface_phy* radio = nullptr;
|
|
|
|
|
|
|
|
srslte::logger* logger = nullptr;
|
|
|
|
std::vector<std::unique_ptr<srslte::log_filter> > log_vec;
|
|
|
|
srslte::log* log_h = nullptr;
|
|
|
|
|
2019-10-23 07:32:28 -07:00
|
|
|
srslte::thread_pool workers_pool;
|
|
|
|
std::vector<sf_worker> workers;
|
|
|
|
phy_common workers_common;
|
|
|
|
prach_worker_pool prach;
|
|
|
|
txrx tx_rx;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
|
|
|
bool initialized = false;
|
|
|
|
|
|
|
|
srslte_prach_cfg_t prach_cfg = {};
|
|
|
|
|
2020-03-02 08:51:00 -08:00
|
|
|
void parse_common_config(const phy_cfg_t& cfg);
|
2017-06-01 03:25:57 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace srsenb
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSENB_PHY_H
|