srsLTE/srsenb/hdr/phy/phy.h

107 lines
3.2 KiB
C
Raw Normal View History

2019-04-26 12:27:38 -07:00
/*
* Copyright 2013-2019 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"
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"
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 {
typedef struct {
2019-01-17 03:42:01 -08:00
srslte_cell_t cell;
asn1::rrc::prach_cfg_sib_s prach_cnfg;
asn1::rrc::pdsch_cfg_common_s pdsch_cnfg;
asn1::rrc::pusch_cfg_common_s pusch_cnfg;
asn1::rrc::pucch_cfg_common_s pucch_cnfg;
asn1::rrc::srs_ul_cfg_common_c srs_ul_cnfg;
} phy_cfg_t;
2017-06-01 03:25:57 -07:00
class phy : public phy_interface_stack_lte
2017-06-01 03:25:57 -07:00
{
public:
phy();
bool init(phy_args_t* args,
phy_cfg_t* common_cfg,
srslte::radio* radio_handler,
stack_interface_phy_lte* stack,
srslte::log_filter* log_h);
bool init(phy_args_t* args,
phy_cfg_t* common_cfg,
srslte::radio* radio_handler,
stack_interface_phy_lte* stack,
std::vector<srslte::log_filter*> log_vec);
2017-06-01 03:25:57 -07:00
void stop();
/* MAC->PHY interface */
2019-04-23 01:53:11 -07:00
int add_rnti(uint16_t rnti, bool is_temporal = false);
2017-06-01 03:25:57 -07:00
void rem_rnti(uint16_t rnti);
2019-04-23 01:53:11 -07:00
void set_mch_period_stop(uint32_t stop);
/*RRC-PHY interface*/
2019-01-17 03:42:01 -08:00
void configure_mbsfn(asn1::rrc::sib_type2_s* sib2, asn1::rrc::sib_type13_r9_s* sib13, asn1::rrc::mcch_msg_s mcch);
2017-06-01 03:25:57 -07:00
static uint32_t tti_to_SFN(uint32_t tti);
static uint32_t tti_to_subf(uint32_t tti);
void start_plot();
2019-01-17 03:42:01 -08:00
void set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated);
2017-06-01 03:25:57 -07:00
void get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]);
private:
phy_rrc_cfg_t phy_rrc_config;
2017-06-01 03:25:57 -07:00
uint32_t nof_workers;
const static int MAX_WORKERS = 4;
const static int DEFAULT_WORKERS = 2;
2018-09-26 05:30:39 -07:00
const static int PRACH_WORKER_THREAD_PRIO = 3;
2017-06-01 03:25:57 -07:00
const static int SF_RECV_THREAD_PRIO = 1;
2018-09-26 05:30:39 -07:00
const static int WORKERS_THREAD_PRIO = 2;
2017-06-01 03:25:57 -07:00
srslte::radio *radio_handler;
srslte::log *log_h;
2017-06-01 03:25:57 -07:00
srslte::thread_pool workers_pool;
2019-04-23 01:53:11 -07:00
std::vector<sf_worker> workers;
phy_common workers_common;
2017-06-01 03:25:57 -07:00
prach_worker prach;
txrx tx_rx;
srslte_prach_cfg_t prach_cfg;
void parse_config(phy_cfg_t* cfg);
};
} // namespace srsenb
2018-03-31 10:04:04 -07:00
#endif // SRSENB_PHY_H