Removed redundant error traces

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent 7704c09ce2
commit cade7c8104

@ -2,7 +2,7 @@
* *
* \section COPYRIGHT * \section COPYRIGHT
* *
* Copyright 2013-2021 Software Radio Systems Limited * Copyright 2013-2020 Software Radio Systems Limited
* *
* By using this file, you agree to the terms and conditions set * 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 * forth in the LICENSE file which can be found at the top level of
@ -83,7 +83,7 @@ private:
bool stash_use_tbs_index_alt = false; bool stash_use_tbs_index_alt = false;
srsran::phy_cfg_t phy_cfg; ///< Configuration, it has a default constructor srsran::phy_cfg_t phy_cfg; ///< Configuration, it has a default constructor
srsran::circular_array<bool, TTIMOD_SZ> is_grant_available; ///< Indicates whether there is an available grant srsran::circular_array<bool, TTIMOD_SZ> is_grant_available; ///< Indicates whether there is an available grant
} cell_info_t; };
/** /**
* UE object stored in the PHY common database * UE object stored in the PHY common database
@ -123,7 +123,7 @@ private:
* Internal RNTI addition, it is not thread safe protected * Internal RNTI addition, it is not thread safe protected
* *
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @return SRSLTE_SUCCESS if the RNTI is not duplicated and is added successfully, SRSLTE_ERROR code if it exists * @return SRSRAN_SUCCESS if the RNTI is not duplicated and is added successfully, SRSRAN_ERROR code if it exists
*/ */
inline int _add_rnti(uint16_t rnti); inline int _add_rnti(uint16_t rnti);
@ -223,9 +223,9 @@ private:
* @param rnti provides UE identifier * @param rnti provides UE identifier
* @param enb_cc_idx eNb cell index * @param enb_cc_idx eNb cell index
* @param[out] phy_cfg The PHY configuration of the indicated UE for the indicated eNb carrier/call index. * @param[out] phy_cfg The PHY configuration of the indicated UE for the indicated eNb carrier/call index.
* @return SRSLTE_SUCCESS if provided context is correct, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided context is correct, SRSRAN_ERROR code otherwise
*/ */
inline srsran::phy_cfg_t _get_rnti_config(uint16_t rnti, uint32_t enb_cc_idx) const; inline int _get_rnti_config(uint16_t rnti, uint32_t enb_cc_idx, srsran::phy_cfg_t& phy_cfg) const;
/** /**
* Count number of configured secondary serving cells * Count number of configured secondary serving cells
@ -257,7 +257,7 @@ public:
* Removes a whole UE entry from the UE database * Removes a whole UE entry from the UE database
* *
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @return SRSLTE_SUCCESS if provided RNTI exists, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists, SRSRAN_ERROR code otherwise
*/ */
int rem_rnti(uint16_t rnti); int rem_rnti(uint16_t rnti);
@ -266,7 +266,7 @@ public:
* the primary cell. * the primary cell.
* *
* @param rnti identifier of the user * @param rnti identifier of the user
* @return SRSLTE_SUCCESS if provided RNTI exists, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists, SRSRAN_ERROR code otherwise
*/ */
int complete_config(uint16_t rnti); int complete_config(uint16_t rnti);
@ -276,7 +276,7 @@ public:
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @param scell_idx * @param scell_idx
* @param activate * @param activate
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
int activate_deactivate_scell(uint16_t rnti, uint32_t ue_cc_idx, bool activate); int activate_deactivate_scell(uint16_t rnti, uint32_t ue_cc_idx, bool activate);
@ -294,9 +294,9 @@ public:
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @param cc_idx the eNb cell/carrier identifier * @param cc_idx the eNb cell/carrier identifier
* @param[out] dl_cfg Current DL PHY configuration * @param[out] dl_cfg Current DL PHY configuration
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
srsran_dl_cfg_t get_dl_config(uint16_t rnti, uint32_t enb_cc_idx) const; int get_dl_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_dl_cfg_t& dl_cfg) const;
/** /**
* Get the current DCI configuration for PDSCH physical layer configuration for an RNTI and an eNb cell/carrier * Get the current DCI configuration for PDSCH physical layer configuration for an RNTI and an eNb cell/carrier
@ -304,9 +304,9 @@ public:
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @param cc_idx the eNb cell/carrier identifier * @param cc_idx the eNb cell/carrier identifier
* @param[out] dci_cfg Current DL-DCI configuration * @param[out] dci_cfg Current DL-DCI configuration
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
srsran_dci_cfg_t get_dci_dl_config(uint16_t rnti, uint32_t enb_cc_idx) const; int get_dci_dl_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_dci_cfg_t& dci_cfg) const;
/** /**
* Get the current PUCCH physical layer configuration for an RNTI and an eNb cell/carrier. * Get the current PUCCH physical layer configuration for an RNTI and an eNb cell/carrier.
@ -314,9 +314,9 @@ public:
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @param cc_idx the eNb cell/carrier identifier * @param cc_idx the eNb cell/carrier identifier
* @param[out] ul_cfg Current UL PHY configuration * @param[out] ul_cfg Current UL PHY configuration
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
srsran_ul_cfg_t get_ul_config(uint16_t rnti, uint32_t enb_cc_idx) const; int get_ul_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_ul_cfg_t& ul_cfg) const;
/** /**
* Get the current DCI configuration for PUSCH physical layer configuration for an RNTI and an eNb cell/carrier * Get the current DCI configuration for PUSCH physical layer configuration for an RNTI and an eNb cell/carrier
@ -324,9 +324,9 @@ public:
* @param rnti identifier of the UE * @param rnti identifier of the UE
* @param cc_idx the eNb cell/carrier identifier * @param cc_idx the eNb cell/carrier identifier
* @param[out] dci_cfg Current UL-DCI configuration * @param[out] dci_cfg Current UL-DCI configuration
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
srsran_dci_cfg_t get_dci_ul_config(uint16_t rnti, uint32_t enb_cc_idx) const; int get_dci_ul_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_dci_cfg_t& dci_cfg) const;
/** /**
* Removes all the pending ACKs of all the RNTIs for a given TTI * Removes all the pending ACKs of all the RNTIs for a given TTI
@ -367,9 +367,9 @@ public:
* @param rnti is the UE identifier * @param rnti is the UE identifier
* @param uci_cfg is the UCI configuration * @param uci_cfg is the UCI configuration
* @param uci_value is the UCI received value * @param uci_value is the UCI received value
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
void send_uci_data(uint32_t tti, int send_uci_data(uint32_t tti,
uint16_t rnti, uint16_t rnti,
uint32_t enb_cc_idx, uint32_t enb_cc_idx,
const srsran_uci_cfg_t& uci_cfg, const srsran_uci_cfg_t& uci_cfg,
@ -383,9 +383,9 @@ public:
* @param enb_cc_idx the cell/carrier origin of the transmission * @param enb_cc_idx the cell/carrier origin of the transmission
* @param pid HARQ process identifier * @param pid HARQ process identifier
* @param tb the Resource Allocation for the PUSCH transport block * @param tb the Resource Allocation for the PUSCH transport block
* @return SRSLTE_SUCCESS if provided RNTI exists in the given cell, SRSLTE_ERROR code otherwise * @return SRSRAN_SUCCESS if provided RNTI exists in the given cell, SRSRAN_ERROR code otherwise
*/ */
void set_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid, srsran_ra_tb_t tb); int set_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid, srsran_ra_tb_t tb);
/** /**
* Get the latest UL Transport Block resource allocation for a given RNTI, eNb cell/carrier and UL HARQ process * Get the latest UL Transport Block resource allocation for a given RNTI, eNb cell/carrier and UL HARQ process
@ -396,9 +396,9 @@ public:
* @param cc_idx the cell/carrier origin of the transmission * @param cc_idx the cell/carrier origin of the transmission
* @param pid HARQ process identifier * @param pid HARQ process identifier
* @param[out] ra_tb the Resource Allocation for the PUSCH transport block * @param[out] ra_tb the Resource Allocation for the PUSCH transport block
* @return SRSLTE_SUCCESS if the provided context is valid * @return SRSRAN_SUCCESS if the provided context is valid
*/ */
srsran_ra_tb_t get_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid) const; int get_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid, srsran_ra_tb_t& ra_tb) const;
/** /**
* Flags to true the UL grant available for a given TTI, RNTI and eNb cell/carrier index * Flags to true the UL grant available for a given TTI, RNTI and eNb cell/carrier index

@ -2,7 +2,7 @@
* *
* \section COPYRIGHT * \section COPYRIGHT
* *
* Copyright 2013-2021 Software Radio Systems Limited * Copyright 2013-2020 Software Radio Systems Limited
* *
* By using this file, you agree to the terms and conditions set * 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 * forth in the LICENSE file which can be found at the top level of
@ -262,7 +262,7 @@ void cc_worker::decode_pusch_rnti(stack_interface_phy_lte::ul_sched_grant_t& ul_
uint16_t rnti = ul_grant.dci.rnti; uint16_t rnti = ul_grant.dci.rnti;
// Invalid RNTI // Invalid RNTI
if (rnti == SRSLTE_INVALID_RNTI) { if (rnti == SRSRAN_INVALID_RNTI) {
return; return;
} }
@ -272,7 +272,7 @@ void cc_worker::decode_pusch_rnti(stack_interface_phy_lte::ul_sched_grant_t& ul_
} }
// Get UE configuration // Get UE configuration
if (phy->ue_db.get_ul_config(rnti, cc_idx, ul_cfg) < SRSLTE_SUCCESS) { if (phy->ue_db.get_ul_config(rnti, cc_idx, ul_cfg) < SRSRAN_SUCCESS) {
Error("Error retrieving UL configuration for RNTI %x and CC %d", rnti, cc_idx); Error("Error retrieving UL configuration for RNTI %x and CC %d", rnti, cc_idx);
return; return;
} }
@ -292,7 +292,7 @@ void cc_worker::decode_pusch_rnti(stack_interface_phy_lte::ul_sched_grant_t& ul_
// Use last TBS for this TB in case of mcs>28 // Use last TBS for this TB in case of mcs>28
if (ul_grant.dci.tb.mcs_idx > 28) { if (ul_grant.dci.tb.mcs_idx > 28) {
int rv_idx = grant.tb.rv; int rv_idx = grant.tb.rv;
if (phy->ue_db.get_last_ul_tb(rnti, cc_idx, ul_grant.pid, grant.tb) < SRSLTE_SUCCESS) { if (phy->ue_db.get_last_ul_tb(rnti, cc_idx, ul_grant.pid, grant.tb) < SRSRAN_SUCCESS) {
Error("Error retrieving last UL TB for RNTI %x, CC %d, PID %d", rnti, cc_idx, ul_grant.pid); Error("Error retrieving last UL TB for RNTI %x, CC %d, PID %d", rnti, cc_idx, ul_grant.pid);
return; return;
} }
@ -305,7 +305,7 @@ void cc_worker::decode_pusch_rnti(stack_interface_phy_lte::ul_sched_grant_t& ul_
grant.tb.tbs / 8); grant.tb.tbs / 8);
} }
if (phy->ue_db.set_last_ul_tb(rnti, cc_idx, ul_grant.pid, grant.tb) < SRSLTE_SUCCESS) { if (phy->ue_db.set_last_ul_tb(rnti, cc_idx, ul_grant.pid, grant.tb) < SRSRAN_SUCCESS) {
Error("Error setting last UL TB for RNTI %x, CC %d, PID %d", rnti, cc_idx, ul_grant.pid); Error("Error setting last UL TB for RNTI %x, CC %d, PID %d", rnti, cc_idx, ul_grant.pid);
} }
@ -386,25 +386,30 @@ int cc_worker::decode_pucch()
// If it's a User RNTI and doesn't have PUSCH grant in this TTI // If it's a User RNTI and doesn't have PUSCH grant in this TTI
if (SRSRAN_RNTI_ISUSER(rnti) and phy->ue_db.is_pcell(rnti, cc_idx)) { if (SRSRAN_RNTI_ISUSER(rnti) and phy->ue_db.is_pcell(rnti, cc_idx)) {
srsran_ul_cfg_t ul_cfg = phy->ue_db.get_ul_config(rnti, cc_idx); srsran_ul_cfg_t ul_cfg = {};
if (phy->ue_db.get_ul_config(rnti, cc_idx, ul_cfg) < SRSRAN_SUCCESS) {
Error("Error retrieving last UL configuration for RNTI %x, CC %d", rnti, cc_idx);
continue;
}
// Check if user needs to receive PUCCH // Check if user needs to receive PUCCH
int ret = phy->ue_db.fill_uci_cfg(tti_rx, cc_idx, rnti, false, false, ul_cfg.pucch.uci_cfg); int ret = phy->ue_db.fill_uci_cfg(tti_rx, cc_idx, rnti, false, false, ul_cfg.pucch.uci_cfg);
if (ret < SRSLTE_SUCCESS) { if (ret < SRSRAN_SUCCESS) {
Error("Error retrieving UCI configuration for RNTI %x, CC %d", rnti, cc_idx); Error("Error retrieving UCI configuration for RNTI %x, CC %d", rnti, cc_idx);
continue; continue;
} }
// If ret is more than success, UCI is present // If ret is more than success, UCI is present
if (ret > SRSLTE_SUCCESS) { if (ret > SRSRAN_SUCCESS) {
// Decode PUCCH // Decode PUCCH
if (srsran_enb_ul_get_pucch(&enb_ul, &ul_sf, &ul_cfg.pucch, &pucch_res)) { if (srsran_enb_ul_get_pucch(&enb_ul, &ul_sf, &ul_cfg.pucch, &pucch_res)) {
ERROR("Error getting PUCCH"); Error("Error getting PUCCH");
return SRSRAN_ERROR; continue;
} }
// Send UCI data to MAC // Send UCI data to MAC
if (phy->ue_db.send_uci_data(tti_rx, rnti, cc_idx, ul_cfg.pucch.uci_cfg, pucch_res.uci_data) < SRSLTE_SUCCESS) { if (phy->ue_db.send_uci_data(tti_rx, rnti, cc_idx, ul_cfg.pucch.uci_cfg, pucch_res.uci_data) < SRSRAN_SUCCESS) {
Error("Error sending UCI data for RNTI %x, CC %d", rnti, cc_idx); Error("Error sending UCI data for RNTI %x, CC %d", rnti, cc_idx);
continue; continue;
} }
@ -450,7 +455,12 @@ int cc_worker::encode_pdcch_ul(stack_interface_phy_lte::ul_sched_grant_t* grants
{ {
for (uint32_t i = 0; i < nof_grants; i++) { for (uint32_t i = 0; i < nof_grants; i++) {
if (grants[i].needs_pdcch) { if (grants[i].needs_pdcch) {
srsran_dci_cfg_t dci_cfg = phy->ue_db.get_dci_ul_config(grants[i].dci.rnti, cc_idx); srsran_dci_cfg_t dci_cfg = {};
if (phy->ue_db.get_dci_ul_config(grants[i].dci.rnti, cc_idx, dci_cfg) < SRSRAN_SUCCESS) {
Error("Error retrieving DCI UL configuration for RNTI %x, CC %d", grants[i].dci.rnti, cc_idx);
continue;
}
if (SRSRAN_RNTI_ISUSER(grants[i].dci.rnti)) { if (SRSRAN_RNTI_ISUSER(grants[i].dci.rnti)) {
if (srsran_enb_dl_location_is_common_ncce(&enb_dl, grants[i].dci.location.ncce) && if (srsran_enb_dl_location_is_common_ncce(&enb_dl, grants[i].dci.location.ncce) &&
@ -461,7 +471,7 @@ int cc_worker::encode_pdcch_ul(stack_interface_phy_lte::ul_sched_grant_t* grants
} }
if (srsran_enb_dl_put_pdcch_ul(&enb_dl, &dci_cfg, &grants[i].dci)) { if (srsran_enb_dl_put_pdcch_ul(&enb_dl, &dci_cfg, &grants[i].dci)) {
ERROR("Error putting PUSCH %d", i); Error("Error putting PUSCH %d", i);
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
@ -481,7 +491,12 @@ int cc_worker::encode_pdcch_dl(stack_interface_phy_lte::dl_sched_grant_t* grants
for (uint32_t i = 0; i < nof_grants; i++) { for (uint32_t i = 0; i < nof_grants; i++) {
uint16_t rnti = grants[i].dci.rnti; uint16_t rnti = grants[i].dci.rnti;
if (rnti) { if (rnti) {
srsran_dci_cfg_t dci_cfg = phy->ue_db.get_dci_dl_config(grants[i].dci.rnti, cc_idx); srsran_dci_cfg_t dci_cfg = {};
if (phy->ue_db.get_dci_dl_config(grants[i].dci.rnti, cc_idx, dci_cfg) < SRSRAN_SUCCESS) {
Error("Error retrieving DCI DL configuration for RNTI %x, CC %d", grants[i].dci.rnti, cc_idx);
continue;
}
if (SRSRAN_RNTI_ISUSER(grants[i].dci.rnti) && grants[i].dci.format == SRSRAN_DCI_FORMAT1A) { if (SRSRAN_RNTI_ISUSER(grants[i].dci.rnti) && grants[i].dci.format == SRSRAN_DCI_FORMAT1A) {
if (srsran_enb_dl_location_is_common_ncce(&enb_dl, grants[i].dci.location.ncce) && if (srsran_enb_dl_location_is_common_ncce(&enb_dl, grants[i].dci.location.ncce) &&
@ -544,7 +559,12 @@ int cc_worker::encode_pdsch(stack_interface_phy_lte::dl_sched_grant_t* grants, u
uint16_t rnti = grants[i].dci.rnti; uint16_t rnti = grants[i].dci.rnti;
if (rnti && ue_db.count(rnti)) { if (rnti && ue_db.count(rnti)) {
srsran_dl_cfg_t dl_cfg = phy->ue_db.get_dl_config(rnti, cc_idx); srsran_dl_cfg_t dl_cfg = {};
if (phy->ue_db.get_dl_config(rnti, cc_idx, dl_cfg) < SRSRAN_SUCCESS) {
Error("Error retrieving DCI DL configuration for RNTI %x, CC %d", grants[i].dci.rnti, cc_idx);
continue;
}
// Compute DL grant // Compute DL grant
if (srsran_ra_dl_dci_to_grant( if (srsran_ra_dl_dci_to_grant(

@ -248,7 +248,7 @@ void phy::set_config(uint16_t rnti, const phy_rrc_cfg_list_t& phy_cfg_list)
void phy::complete_config(uint16_t rnti) void phy::complete_config(uint16_t rnti)
{ {
// Forwards call to the UE Database // Forwards call to the UE Database
if (workers_common.ue_db.complete_config(rnti) < SRSLTE_SUCCESS) { if (workers_common.ue_db.complete_config(rnti) < SRSRAN_SUCCESS) {
Error("Error completing configuration for RNTI %x. It does not exist.", rnti); Error("Error completing configuration for RNTI %x. It does not exist.", rnti);
} }
} }

@ -2,7 +2,7 @@
* *
* \section COPYRIGHT * \section COPYRIGHT
* *
* Copyright 2013-2021 Software Radio Systems Limited * Copyright 2013-2020 Software Radio Systems Limited
* *
* By using this file, you agree to the terms and conditions set * 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 * forth in the LICENSE file which can be found at the top level of
@ -29,7 +29,7 @@ inline int phy_ue_db::_add_rnti(uint16_t rnti)
// Assert RNTI does NOT exist // Assert RNTI does NOT exist
if (ue_db.count(rnti)) { if (ue_db.count(rnti)) {
return SRSLTE_ERROR; return SRSRAN_ERROR;
} }
// Create new UE by accesing it // Create new UE by accesing it
@ -52,7 +52,7 @@ inline int phy_ue_db::_add_rnti(uint16_t rnti)
_clear_tti_pending_rnti(tti, rnti); _clear_tti_pending_rnti(tti, rnti);
} }
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
inline void phy_ue_db::_clear_tti_pending_rnti(uint32_t tti, uint16_t rnti) inline void phy_ue_db::_clear_tti_pending_rnti(uint32_t tti, uint16_t rnti)
@ -131,7 +131,6 @@ uint32_t phy_ue_db::_get_uci_enb_cc_idx(uint32_t tti, uint16_t rnti) const
inline int phy_ue_db::_assert_rnti(uint16_t rnti) const inline int phy_ue_db::_assert_rnti(uint16_t rnti) const
{ {
if (not ue_db.count(rnti)) { if (not ue_db.count(rnti)) {
ERROR("Trying to access RNTI 0x%X, it does not exist.", rnti);
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
@ -220,7 +219,7 @@ inline int phy_ue_db::_assert_cell_list_cfg() const
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
inline srsran::phy_cfg_t phy_ue_db::_get_rnti_config(uint16_t rnti, uint32_t enb_cc_idx) const inline int phy_ue_db::_get_rnti_config(uint16_t rnti, uint32_t enb_cc_idx, srsran::phy_cfg_t& phy_cfg) const
{ {
srsran::phy_cfg_t default_cfg = {}; srsran::phy_cfg_t default_cfg = {};
default_cfg.set_defaults(); default_cfg.set_defaults();
@ -230,19 +229,19 @@ inline srsran::phy_cfg_t phy_ue_db::_get_rnti_config(uint16_t rnti, uint32_t enb
// Use default configuration for non-user C-RNTI // Use default configuration for non-user C-RNTI
if (not SRSRAN_RNTI_ISUSER(rnti)) { if (not SRSRAN_RNTI_ISUSER(rnti)) {
return default_cfg; phy_cfg = default_cfg;
return SRSRAN_SUCCESS;
} }
// Make sure the C-RNTI exists and the cell/carrier is configured // Make sure the C-RNTI exists and the cell/carrier is configured
if (_assert_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) { if (_assert_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) {
ERROR("Trying to access cell/carrier %d in RNTI 0x%X. It is not active.", enb_cc_idx, rnti); return SRSRAN_ERROR;
return SRSLTE_ERROR;
} }
// Write the current configuration // Write the current configuration
uint32_t ue_cc_idx = _get_ue_cc_idx(rnti, enb_cc_idx); uint32_t ue_cc_idx = _get_ue_cc_idx(rnti, enb_cc_idx);
phy_cfg = ue_db.at(rnti).cell_info.at(ue_cc_idx).phy_cfg; phy_cfg = ue_db.at(rnti).cell_info.at(ue_cc_idx).phy_cfg;
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
void phy_ue_db::clear_tti_pending_ack(uint32_t tti) void phy_ue_db::clear_tti_pending_ack(uint32_t tti)
@ -336,12 +335,12 @@ int phy_ue_db::rem_rnti(uint16_t rnti)
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
if (ue_db.count(rnti) == 0) { if (ue_db.count(rnti) == 0) {
return SRSLTE_ERROR; return SRSRAN_ERROR;
} }
ue_db.erase(rnti); ue_db.erase(rnti);
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
uint32_t phy_ue_db::_count_nof_configured_scell(uint16_t rnti) uint32_t phy_ue_db::_count_nof_configured_scell(uint16_t rnti)
@ -362,7 +361,7 @@ int phy_ue_db::complete_config(uint16_t rnti)
// Makes sure the RNTI exists // Makes sure the RNTI exists
if (_assert_rnti(rnti) != SRSRAN_SUCCESS) { if (_assert_rnti(rnti) != SRSRAN_SUCCESS) {
return; return SRSRAN_ERROR;
} }
// Once the reconfiguration is complete, the temporary parameters become the new ones // Once the reconfiguration is complete, the temporary parameters become the new ones
@ -375,7 +374,7 @@ int phy_ue_db::complete_config(uint16_t rnti)
ue_db[rnti].cell_info[ue_cc_idx].phy_cfg.dl_cfg.pdsch.use_tbs_index_alt; ue_db[rnti].cell_info[ue_cc_idx].phy_cfg.dl_cfg.pdsch.use_tbs_index_alt;
} }
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
int phy_ue_db::activate_deactivate_scell(uint16_t rnti, uint32_t ue_cc_idx, bool activate) int phy_ue_db::activate_deactivate_scell(uint16_t rnti, uint32_t ue_cc_idx, bool activate)
@ -384,22 +383,20 @@ int phy_ue_db::activate_deactivate_scell(uint16_t rnti, uint32_t ue_cc_idx, bool
// Assert RNTI and SCell are valid // Assert RNTI and SCell are valid
if (_assert_ue_cc(rnti, ue_cc_idx) != SRSRAN_SUCCESS) { if (_assert_ue_cc(rnti, ue_cc_idx) != SRSRAN_SUCCESS) {
return; return SRSRAN_SUCCESS;
} }
cell_info_t& cell_info = ue_db[rnti].cell_info[ue_cc_idx]; cell_info_t& cell_info = ue_db[rnti].cell_info[ue_cc_idx];
// If scell is default only complain // If scell is default only complain
if (activate and cell_info.state == cell_state_none) { if (activate and cell_info.state == cell_state_none) {
return SRSLTE_ERROR; return SRSRAN_ERROR;
} }
// Set scell state // Set scell state
cell_info.state = (activate) ? cell_state_secondary_active : cell_state_secondary_inactive; cell_info.state = (activate) ? cell_state_secondary_active : cell_state_secondary_inactive;
bool phy_ue_db::ue_has_cell(uint16_t rnti, uint32_t enb_cc_idx) const return SRSRAN_SUCCESS;
{
return _assert_enb_cc(rnti, enb_cc_idx) == SRSRAN_SUCCESS;
} }
bool phy_ue_db::is_pcell(uint16_t rnti, uint32_t enb_cc_idx) const bool phy_ue_db::is_pcell(uint16_t rnti, uint32_t enb_cc_idx) const
@ -408,10 +405,15 @@ bool phy_ue_db::is_pcell(uint16_t rnti, uint32_t enb_cc_idx) const
return _assert_enb_pcell(rnti, enb_cc_idx) == SRSRAN_SUCCESS; return _assert_enb_pcell(rnti, enb_cc_idx) == SRSRAN_SUCCESS;
} }
srsran_dl_cfg_t phy_ue_db::get_dl_config(uint16_t rnti, uint32_t enb_cc_idx) const int phy_ue_db::get_dl_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_dl_cfg_t& dl_cfg) const
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
srsran_dl_cfg_t ret = _get_rnti_config(rnti, enb_cc_idx).dl_cfg; srsran::phy_cfg_t phy_cfg = {};
if (_get_rnti_config(rnti, enb_cc_idx, phy_cfg) < SRSRAN_SUCCESS) {
return SRSRAN_ERROR;
}
dl_cfg = phy_cfg.dl_cfg;
// The DL configuration must overwrite the use_tbs_index_alt value (for 256QAM) with the temporary value // The DL configuration must overwrite the use_tbs_index_alt value (for 256QAM) with the temporary value
// in case we are in the middle of a reconfiguration // in case we are in the middle of a reconfiguration
@ -421,49 +423,54 @@ srsran_dl_cfg_t phy_ue_db::get_dl_config(uint16_t rnti, uint32_t enb_cc_idx) con
dl_cfg.pdsch.use_tbs_index_alt = ue_db.at(rnti).cell_info[ue_cc_idx].stash_use_tbs_index_alt; dl_cfg.pdsch.use_tbs_index_alt = ue_db.at(rnti).cell_info[ue_cc_idx].stash_use_tbs_index_alt;
} }
} }
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
srsran_dci_cfg_t phy_ue_db::get_dci_dl_config(uint16_t rnti, uint32_t enb_cc_idx) const int phy_ue_db::get_dci_dl_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_dci_cfg_t& dci_cfg) const
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
srsran_dci_cfg_t ret = _get_rnti_config(rnti, enb_cc_idx).dl_cfg.dci; srsran::phy_cfg_t phy_cfg = {};
// The DCI configuration used for DL grants must overwrite the multiple_csi_request_enabled value with the temporary if (_get_rnti_config(rnti, enb_cc_idx, phy_cfg) < SRSRAN_SUCCESS) {
// value in case we are in the middle of a reconfiguration return SRSRAN_ERROR;
}
dci_cfg = phy_cfg.dl_cfg.dci;
// The DCI configuration used for DL grants must overwrite the multiple_csi_request_enabled value with the
// temporary value in case we are in the middle of a reconfiguration
if (ue_db.count(rnti) && SRSRAN_RNTI_ISUSER(rnti)) { if (ue_db.count(rnti) && SRSRAN_RNTI_ISUSER(rnti)) {
uint32_t ue_cc_idx = _get_ue_cc_idx(rnti, enb_cc_idx); uint32_t ue_cc_idx = _get_ue_cc_idx(rnti, enb_cc_idx);
if (ue_cc_idx == 0) { if (ue_cc_idx == 0) {
dci_cfg.multiple_csi_request_enabled = ue_db.at(rnti).stashed_multiple_csi_request_enabled; dci_cfg.multiple_csi_request_enabled = ue_db.at(rnti).stashed_multiple_csi_request_enabled;
} }
} }
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
srsran_ul_cfg_t phy_ue_db::get_ul_config(uint16_t rnti, uint32_t enb_cc_idx) const int phy_ue_db::get_ul_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_ul_cfg_t& ul_cfg) const
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
srslte::phy_cfg_t phy_cfg = {}; srsran::phy_cfg_t phy_cfg = {};
if (_get_rnti_config(rnti, enb_cc_idx, phy_cfg) < SRSLTE_SUCCESS) { if (_get_rnti_config(rnti, enb_cc_idx, phy_cfg) < SRSRAN_SUCCESS) {
return SRSLTE_ERROR; return SRSRAN_ERROR;
} }
ul_cfg = phy_cfg.ul_cfg; ul_cfg = phy_cfg.ul_cfg;
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
srsran_dci_cfg_t phy_ue_db::get_dci_ul_config(uint16_t rnti, uint32_t enb_cc_idx) const int phy_ue_db::get_dci_ul_config(uint16_t rnti, uint32_t enb_cc_idx, srsran_dci_cfg_t& dci_cfg) const
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
srslte::phy_cfg_t phy_cfg = {}; srsran::phy_cfg_t phy_cfg = {};
if (_get_rnti_config(rnti, enb_cc_idx, phy_cfg) < SRSLTE_SUCCESS) { if (_get_rnti_config(rnti, enb_cc_idx, phy_cfg) < SRSRAN_SUCCESS) {
return SRSLTE_ERROR; return SRSRAN_ERROR;
} }
dci_cfg = phy_cfg.dl_cfg.dci; dci_cfg = phy_cfg.dl_cfg.dci;
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
bool phy_ue_db::set_ack_pending(uint32_t tti, uint32_t enb_cc_idx, const srsran_dci_dl_t& dci) bool phy_ue_db::set_ack_pending(uint32_t tti, uint32_t enb_cc_idx, const srsran_dci_dl_t& dci)
@ -516,12 +523,12 @@ int phy_ue_db::fill_uci_cfg(uint32_t tti,
// Assert Cell List configuration // Assert Cell List configuration
if (_assert_cell_list_cfg() != SRSRAN_SUCCESS) { if (_assert_cell_list_cfg() != SRSRAN_SUCCESS) {
return -1; return SRSRAN_ERROR;
} }
// Assert eNb Cell/Carrier for the given RNTI // Assert eNb Cell/Carrier for the given RNTI
if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) { if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) {
return -1; return SRSRAN_ERROR;
} }
// Get the eNb cell/carrier index with lowest serving cell index (ue_cc_idx) that has an available grant. // Get the eNb cell/carrier index with lowest serving cell index (ue_cc_idx) that has an available grant.
@ -530,17 +537,17 @@ int phy_ue_db::fill_uci_cfg(uint32_t tti,
// There is a PUSCH grant available for the provided RNTI in at least one serving cell and this call is for PUCCH // There is a PUSCH grant available for the provided RNTI in at least one serving cell and this call is for PUCCH
if (pusch_grant_available and not is_pusch_available) { if (pusch_grant_available and not is_pusch_available) {
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
// There is a PUSCH grant and enb_cc_idx with lowest ue_cc_idx with a grant // There is a PUSCH grant and enb_cc_idx with lowest ue_cc_idx with a grant
if (pusch_grant_available and uci_enb_cc_id != enb_cc_idx) { if (pusch_grant_available and uci_enb_cc_id != enb_cc_idx) {
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
// No PUSCH grant for this TTI and cell and no enb_cc_idx is not the PCell // No PUSCH grant for this TTI and cell and no enb_cc_idx is not the PCell
if (not pusch_grant_available and _get_ue_cc_idx(rnti, enb_cc_idx) != 0) { if (not pusch_grant_available and _get_ue_cc_idx(rnti, enb_cc_idx) != 0) {
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
common_ue& ue = ue_db.at(rnti); common_ue& ue = ue_db.at(rnti);
@ -591,10 +598,10 @@ int phy_ue_db::fill_uci_cfg(uint32_t tti,
uci_required |= (srsran_uci_cfg_total_ack(&uci_cfg) > 0); uci_required |= (srsran_uci_cfg_total_ack(&uci_cfg) > 0);
// Return whether UCI needs to be decoded // Return whether UCI needs to be decoded
return uci_required ? 1 : SRSLTE_SUCCESS; return uci_required ? 1 : SRSRAN_SUCCESS;
} }
void phy_ue_db::send_uci_data(uint32_t tti, int phy_ue_db::send_uci_data(uint32_t tti,
uint16_t rnti, uint16_t rnti,
uint32_t enb_cc_idx, uint32_t enb_cc_idx,
const srsran_uci_cfg_t& uci_cfg, const srsran_uci_cfg_t& uci_cfg,
@ -604,12 +611,12 @@ void phy_ue_db::send_uci_data(uint32_t tti,
// Assert UE RNTI database entry and eNb cell/carrier must be active // Assert UE RNTI database entry and eNb cell/carrier must be active
if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) { if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) {
return; return SRSRAN_ERROR;
} }
// Assert Stack // Assert Stack
if (_assert_stack() != SRSRAN_SUCCESS) { if (_assert_stack() != SRSRAN_SUCCESS) {
return; return SRSRAN_ERROR;
} }
// Notify SR // Notify SR
@ -640,7 +647,7 @@ void phy_ue_db::send_uci_data(uint32_t tti,
// Assert the SCell exists and it is active // Assert the SCell exists and it is active
if (_assert_ue_cc(rnti, uci_cfg.cqi.scell_index) != SRSRAN_SUCCESS) { if (_assert_ue_cc(rnti, uci_cfg.cqi.scell_index) != SRSRAN_SUCCESS) {
return; return SRSRAN_ERROR;
} }
// Get CQI carrier index // Get CQI carrier index
@ -693,37 +700,37 @@ void phy_ue_db::send_uci_data(uint32_t tti,
cqi_scell_info.last_ri = uci_value.ri; cqi_scell_info.last_ri = uci_value.ri;
} }
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
void phy_ue_db::set_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid, srsran_ra_tb_t tb) int phy_ue_db::set_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid, srsran_ra_tb_t tb)
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
// Assert UE DB entry // Assert UE DB entry
if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) { if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) {
return; return SRSRAN_ERROR;
} }
// Save resource allocation // Save resource allocation
ue_db.at(rnti).cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].last_tb[pid] = tb; ue_db.at(rnti).cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].last_tb[pid] = tb;
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
srsran_ra_tb_t phy_ue_db::get_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid) const int phy_ue_db::get_last_ul_tb(uint16_t rnti, uint32_t enb_cc_idx, uint32_t pid, srsran_ra_tb_t& ra_tb) const
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
// Assert UE DB entry // Assert UE DB entry
if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) { if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) {
return {}; return SRSRAN_ERROR;
} }
// writes the latest stored UL transmission grant // writes the latest stored UL transmission grant
ra_tb = ue_db.at(rnti).cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].last_tb[pid]; ra_tb = ue_db.at(rnti).cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].last_tb[pid];
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }
int phy_ue_db::set_ul_grant_available(uint32_t tti, const stack_interface_phy_lte::ul_sched_list_t& ul_sched_list) int phy_ue_db::set_ul_grant_available(uint32_t tti, const stack_interface_phy_lte::ul_sched_list_t& ul_sched_list)
@ -744,14 +751,13 @@ int phy_ue_db::set_ul_grant_available(uint32_t tti, const stack_interface_phy_lt
const stack_interface_phy_lte::ul_sched_grant_t& ul_sched_grant = ul_sched.pusch[i]; const stack_interface_phy_lte::ul_sched_grant_t& ul_sched_grant = ul_sched.pusch[i];
uint16_t rnti = ul_sched_grant.dci.rnti; uint16_t rnti = ul_sched_grant.dci.rnti;
// Check that eNb Cell/Carrier is active for the given RNTI // Check that eNb Cell/Carrier is active for the given RNTI
if (_assert_active_enb_cc(rnti, enb_cc_idx) == SRSRAN_SUCCESS) { if (_assert_active_enb_cc(rnti, enb_cc_idx) != SRSRAN_SUCCESS) {
// Rise Grant available flag return SRSRAN_ERROR;
ue_db[rnti].cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].is_grant_available[tti] = true;
} }
// Rise Grant available flag // Rise Grant available flag
ue_db[rnti].cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].is_grant_available[tti] = true; ue_db[rnti].cell_info[_get_ue_cc_idx(rnti, enb_cc_idx)].is_grant_available[tti] = true;
} }
} }
return SRSLTE_SUCCESS; return SRSRAN_SUCCESS;
} }

Loading…
Cancel
Save