mirror of https://github.com/PentHertz/srsLTE.git
Separate PHY interface to add rnti and pregenerate sequences. Calculate the sequences on the reception of ConnectionSetup instead of PRACH
This commit is contained in:
parent
3634b351e4
commit
3ddbc258ea
|
@ -199,9 +199,8 @@ public:
|
||||||
*
|
*
|
||||||
* @param rnti identifier of the user
|
* @param rnti identifier of the user
|
||||||
* @param pcell_index Primary cell (PCell) index
|
* @param pcell_index Primary cell (PCell) index
|
||||||
* @param is_temporal Indicates whether the UE is temporal
|
|
||||||
*/
|
*/
|
||||||
virtual int add_rnti(uint16_t rnti, uint32_t pcell_index, bool is_temporal) = 0;
|
virtual int add_rnti(uint16_t rnti, uint32_t pcell_index) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes an RNTI context from all the physical layer components, including secondary cells
|
* Removes an RNTI context from all the physical layer components, including secondary cells
|
||||||
|
@ -209,6 +208,14 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void rem_rnti(uint16_t rnti) = 0;
|
virtual void rem_rnti(uint16_t rnti) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pregenerates the scrambling sequences for a given RNTI.
|
||||||
|
* WARNING: This function make take several ms to complete.
|
||||||
|
*
|
||||||
|
* @param rnti identifier of the user
|
||||||
|
*/
|
||||||
|
virtual int pregen_sequences(uint16_t rnti) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param stop
|
* @param stop
|
||||||
|
|
|
@ -42,8 +42,9 @@ public:
|
||||||
cf_t* get_buffer_tx(uint32_t antenna_idx);
|
cf_t* get_buffer_tx(uint32_t antenna_idx);
|
||||||
void set_tti(uint32_t tti);
|
void set_tti(uint32_t tti);
|
||||||
|
|
||||||
int add_rnti(uint16_t rnti, bool is_temporal);
|
int add_rnti(uint16_t rnti);
|
||||||
void rem_rnti(uint16_t rnti);
|
void rem_rnti(uint16_t rnti);
|
||||||
|
int pregen_sequences(uint16_t rnti);
|
||||||
uint32_t get_nof_rnti();
|
uint32_t get_nof_rnti();
|
||||||
|
|
||||||
/* These are used by the GUI plotting tools */
|
/* These are used by the GUI plotting tools */
|
||||||
|
|
|
@ -51,8 +51,9 @@ public:
|
||||||
std::string get_type() override { return "lte"; };
|
std::string get_type() override { return "lte"; };
|
||||||
|
|
||||||
/* MAC->PHY interface */
|
/* MAC->PHY interface */
|
||||||
int add_rnti(uint16_t rnti, uint32_t pcell_index, bool is_temporal) override;
|
int add_rnti(uint16_t rnti, uint32_t pcell_index) override;
|
||||||
void rem_rnti(uint16_t rnti) final;
|
void rem_rnti(uint16_t rnti) final;
|
||||||
|
int pregen_sequences(uint16_t rnti) override;
|
||||||
void set_mch_period_stop(uint32_t stop) final;
|
void set_mch_period_stop(uint32_t stop) final;
|
||||||
void set_activation_deactivation_scell(uint16_t rnti,
|
void set_activation_deactivation_scell(uint16_t rnti,
|
||||||
const std::array<bool, SRSLTE_MAX_CARRIERS>& activation) override;
|
const std::array<bool, SRSLTE_MAX_CARRIERS>& activation) override;
|
||||||
|
|
|
@ -41,8 +41,9 @@ public:
|
||||||
cf_t* get_buffer_rx(uint32_t cc_idx, uint32_t antenna_idx);
|
cf_t* get_buffer_rx(uint32_t cc_idx, uint32_t antenna_idx);
|
||||||
void set_time(uint32_t tti, uint32_t tx_worker_cnt, srslte_timestamp_t tx_time);
|
void set_time(uint32_t tti, uint32_t tx_worker_cnt, srslte_timestamp_t tx_time);
|
||||||
|
|
||||||
int add_rnti(uint16_t rnti, uint32_t cc_idx, bool is_temporal);
|
int add_rnti(uint16_t rnti, uint32_t cc_idx);
|
||||||
void rem_rnti(uint16_t rnti);
|
void rem_rnti(uint16_t rnti);
|
||||||
|
int pregen_sequences(uint16_t rnti);
|
||||||
uint32_t get_nof_rnti();
|
uint32_t get_nof_rnti();
|
||||||
|
|
||||||
/* These are used by the GUI plotting tools */
|
/* These are used by the GUI plotting tools */
|
||||||
|
|
|
@ -127,14 +127,14 @@ void cc_worker::init(phy_common* phy_, srslte::log* log_h_, uint32_t cc_idx_)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup SI-RNTI in PHY */
|
/* Setup SI-RNTI in PHY */
|
||||||
add_rnti(SRSLTE_SIRNTI, false);
|
add_rnti(SRSLTE_SIRNTI);
|
||||||
|
|
||||||
/* Setup P-RNTI in PHY */
|
/* Setup P-RNTI in PHY */
|
||||||
add_rnti(SRSLTE_PRNTI, false);
|
add_rnti(SRSLTE_PRNTI);
|
||||||
|
|
||||||
/* Setup RA-RNTI in PHY */
|
/* Setup RA-RNTI in PHY */
|
||||||
for (int i = SRSLTE_RARNTI_START; i <= SRSLTE_RARNTI_END; i++) {
|
for (int i = SRSLTE_RARNTI_START; i <= SRSLTE_RARNTI_END; i++) {
|
||||||
add_rnti(i, false);
|
add_rnti(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (srslte_softbuffer_tx_init(&temp_mbsfn_softbuffer, nof_prb)) {
|
if (srslte_softbuffer_tx_init(&temp_mbsfn_softbuffer, nof_prb)) {
|
||||||
|
@ -180,25 +180,25 @@ void cc_worker::set_tti(uint32_t tti_)
|
||||||
tti_tx_ul = TTI_RX_ACK(tti_rx);
|
tti_tx_ul = TTI_RX_ACK(tti_rx);
|
||||||
}
|
}
|
||||||
|
|
||||||
int cc_worker::add_rnti(uint16_t rnti, bool is_temporal)
|
int cc_worker::pregen_sequences(uint16_t rnti)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (not is_temporal) {
|
|
||||||
if (srslte_enb_dl_add_rnti(&enb_dl, rnti)) {
|
if (srslte_enb_dl_add_rnti(&enb_dl, rnti)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (srslte_enb_ul_add_rnti(&enb_ul, rnti)) {
|
if (srslte_enb_ul_add_rnti(&enb_ul, rnti)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
return SRSLTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex.lock();
|
int cc_worker::add_rnti(uint16_t rnti)
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mutex);
|
||||||
|
|
||||||
// Create user unless already exists
|
// Create user unless already exists
|
||||||
if (ue_db.count(rnti) == 0) {
|
if (ue_db.count(rnti) == 0) {
|
||||||
ue_db[rnti] = new ue(rnti);
|
ue_db[rnti] = new ue(rnti);
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
|
||||||
|
|
||||||
return SRSLTE_SUCCESS;
|
return SRSLTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ void phy::stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** MAC->PHY interface **********/
|
/***** MAC->PHY interface **********/
|
||||||
int phy::add_rnti(uint16_t rnti, uint32_t pcell_index, bool is_temporal)
|
int phy::add_rnti(uint16_t rnti, uint32_t pcell_index)
|
||||||
{
|
{
|
||||||
if (SRSLTE_RNTI_ISUSER(rnti)) {
|
if (SRSLTE_RNTI_ISUSER(rnti)) {
|
||||||
// Create default PHY configuration with the desired PCell index
|
// Create default PHY configuration with the desired PCell index
|
||||||
|
@ -161,7 +161,7 @@ int phy::add_rnti(uint16_t rnti, uint32_t pcell_index, bool is_temporal)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < nof_workers; i++) {
|
for (uint32_t i = 0; i < nof_workers; i++) {
|
||||||
if (workers[i].add_rnti(rnti, pcell_index, is_temporal) != SRSLTE_SUCCESS) {
|
if (workers[i].add_rnti(rnti, pcell_index) != SRSLTE_SUCCESS) {
|
||||||
return SRSLTE_ERROR;
|
return SRSLTE_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,16 @@ void phy::rem_rnti(uint16_t rnti)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int phy::pregen_sequences(uint16_t rnti)
|
||||||
|
{
|
||||||
|
for (uint32_t i = 0; i < nof_workers; i++) {
|
||||||
|
if (workers[i].pregen_sequences(rnti) != SRSLTE_SUCCESS) {
|
||||||
|
return SRSLTE_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SRSLTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
void phy::set_mch_period_stop(uint32_t stop)
|
void phy::set_mch_period_stop(uint32_t stop)
|
||||||
{
|
{
|
||||||
workers_common.set_mch_period_stop(stop);
|
workers_common.set_mch_period_stop(stop);
|
||||||
|
@ -241,7 +251,7 @@ void phy::set_config_dedicated(uint16_t rnti, const phy_rrc_dedicated_list_t& de
|
||||||
if (config.configured) {
|
if (config.configured) {
|
||||||
// Add RNTI to all SF workers
|
// Add RNTI to all SF workers
|
||||||
for (uint32_t w = 0; w < nof_workers; w++) {
|
for (uint32_t w = 0; w < nof_workers; w++) {
|
||||||
workers[w].add_rnti(rnti, config.enb_cc_idx, false);
|
workers[w].add_rnti(rnti, config.enb_cc_idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,12 +129,22 @@ void sf_worker::set_time(uint32_t tti_, uint32_t tx_worker_cnt_, srslte_timestam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sf_worker::add_rnti(uint16_t rnti, uint32_t cc_idx, bool is_temporal)
|
int sf_worker::pregen_sequences(uint16_t rnti)
|
||||||
|
{
|
||||||
|
for (auto& w : cc_workers) {
|
||||||
|
if (w->pregen_sequences(rnti)) {
|
||||||
|
return SRSLTE_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return SRSLTE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sf_worker::add_rnti(uint16_t rnti, uint32_t cc_idx)
|
||||||
{
|
{
|
||||||
int ret = SRSLTE_ERROR;
|
int ret = SRSLTE_ERROR;
|
||||||
|
|
||||||
if (cc_idx < cc_workers.size()) {
|
if (cc_idx < cc_workers.size()) {
|
||||||
cc_workers[cc_idx]->add_rnti(rnti, is_temporal);
|
cc_workers[cc_idx]->add_rnti(rnti);
|
||||||
ret = SRSLTE_SUCCESS;
|
ret = SRSLTE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,8 +212,8 @@ int mac::ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg)
|
||||||
if (not ue_ptr->is_phy_added) {
|
if (not ue_ptr->is_phy_added) {
|
||||||
Info("Registering RNTI=0x%X to PHY...\n", rnti);
|
Info("Registering RNTI=0x%X to PHY...\n", rnti);
|
||||||
// Register new user in PHY with first CC index
|
// Register new user in PHY with first CC index
|
||||||
if (phy_h->add_rnti(rnti, (SRSLTE_MRNTI) ? 0 : cfg->supported_cc_list.front().enb_cc_idx, false) == SRSLTE_ERROR) {
|
if (phy_h->pregen_sequences(rnti) == SRSLTE_ERROR) {
|
||||||
Error("Registering new UE RNTI=0x%X to PHY\n", rnti);
|
Error("Generating sequences for UE RNTI=0x%X\n", rnti);
|
||||||
}
|
}
|
||||||
Info("Done registering RNTI=0x%X to PHY...\n", rnti);
|
Info("Done registering RNTI=0x%X to PHY...\n", rnti);
|
||||||
ue_ptr->is_phy_added = true;
|
ue_ptr->is_phy_added = true;
|
||||||
|
@ -528,7 +528,7 @@ void mac::rach_detected(uint32_t tti, uint32_t enb_cc_idx, uint32_t preamble_idx
|
||||||
rrc_h->add_user(rnti, ue_cfg);
|
rrc_h->add_user(rnti, ue_cfg);
|
||||||
|
|
||||||
// Add temporal rnti to the PHY
|
// Add temporal rnti to the PHY
|
||||||
if (phy_h->add_rnti(rnti, enb_cc_idx, true) != SRSLTE_SUCCESS) {
|
if (phy_h->add_rnti(rnti, enb_cc_idx) != SRSLTE_SUCCESS) {
|
||||||
Error("Registering temporal-rnti=0x%x to PHY\n", rnti);
|
Error("Registering temporal-rnti=0x%x to PHY\n", rnti);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue