|
|
@ -165,7 +165,7 @@ void mac::phy_config_enabled(uint16_t rnti, bool enabled)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Update UE configuration
|
|
|
|
// Update UE configuration
|
|
|
|
int mac::ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg)
|
|
|
|
int mac::ue_cfg(uint16_t rnti, const sched_interface::ue_cfg_t* cfg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srsran::rwlock_read_guard lock(rwlock);
|
|
|
|
srsran::rwlock_read_guard lock(rwlock);
|
|
|
|
if (not check_ue_active(rnti)) {
|
|
|
|
if (not check_ue_active(rnti)) {
|
|
|
@ -177,10 +177,12 @@ int mac::ue_cfg(uint16_t rnti, sched_interface::ue_cfg_t* cfg)
|
|
|
|
ue_ptr->start_ta();
|
|
|
|
ue_ptr->start_ta();
|
|
|
|
|
|
|
|
|
|
|
|
// Update Scheduler configuration
|
|
|
|
// Update Scheduler configuration
|
|
|
|
if (cfg != nullptr and scheduler.ue_cfg(rnti, *cfg) == SRSRAN_ERROR) {
|
|
|
|
if (scheduler.ue_cfg(rnti, *cfg) == SRSRAN_ERROR) {
|
|
|
|
logger.error("Registering new UE rnti=0x%x to SCHED", rnti);
|
|
|
|
logger.error("Registering UE rnti=0x%x to SCHED", rnti);
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ue_ptr->ue_cfg(*cfg);
|
|
|
|
|
|
|
|
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|
return SRSRAN_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -211,7 +213,7 @@ int mac::ue_rem(uint16_t rnti)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Called after Msg3
|
|
|
|
// Called after Msg3
|
|
|
|
int mac::ue_set_crnti(uint16_t temp_crnti, uint16_t crnti, sched_interface::ue_cfg_t* cfg)
|
|
|
|
int mac::ue_set_crnti(uint16_t temp_crnti, uint16_t crnti, const sched_interface::ue_cfg_t& cfg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srsran::rwlock_read_guard lock(rwlock);
|
|
|
|
srsran::rwlock_read_guard lock(rwlock);
|
|
|
|
if (temp_crnti != crnti) {
|
|
|
|
if (temp_crnti != crnti) {
|
|
|
@ -221,7 +223,7 @@ int mac::ue_set_crnti(uint16_t temp_crnti, uint16_t crnti, sched_interface::ue_c
|
|
|
|
// Schedule ConRes Msg4
|
|
|
|
// Schedule ConRes Msg4
|
|
|
|
scheduler.dl_mac_buffer_state(crnti, (uint32_t)srsran::dl_sch_lcid::CON_RES_ID);
|
|
|
|
scheduler.dl_mac_buffer_state(crnti, (uint32_t)srsran::dl_sch_lcid::CON_RES_ID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ue_cfg(crnti, cfg);
|
|
|
|
return ue_cfg(crnti, &cfg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int mac::cell_cfg(const std::vector<sched_interface::cell_cfg_t>& cell_cfg_)
|
|
|
|
int mac::cell_cfg(const std::vector<sched_interface::cell_cfg_t>& cell_cfg_)
|
|
|
@ -493,19 +495,17 @@ uint16_t mac::allocate_ue(uint32_t enb_cc_idx)
|
|
|
|
return rnti;
|
|
|
|
return rnti;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t mac::reserve_new_crnti(const sched_interface::ue_cfg_t& ue_cfg)
|
|
|
|
uint16_t mac::reserve_new_crnti(const sched_interface::ue_cfg_t& uecfg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint16_t rnti = allocate_ue(ue_cfg.supported_cc_list[0].enb_cc_idx);
|
|
|
|
uint16_t rnti = allocate_ue(uecfg.supported_cc_list[0].enb_cc_idx);
|
|
|
|
if (rnti == SRSRAN_INVALID_RNTI) {
|
|
|
|
if (rnti == SRSRAN_INVALID_RNTI) {
|
|
|
|
return rnti;
|
|
|
|
return rnti;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add new user to the scheduler so that it can RX/TX SRB0
|
|
|
|
// Add new user to the scheduler so that it can RX/TX SRB0
|
|
|
|
if (scheduler.ue_cfg(rnti, ue_cfg) != SRSRAN_SUCCESS) {
|
|
|
|
if (ue_cfg(rnti, &uecfg) != SRSRAN_SUCCESS) {
|
|
|
|
logger.error("Registering new user rnti=0x%x to SCHED", rnti);
|
|
|
|
|
|
|
|
return SRSRAN_INVALID_RNTI;
|
|
|
|
return SRSRAN_INVALID_RNTI;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rnti;
|
|
|
|
return rnti;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -534,20 +534,18 @@ void mac::rach_detected(uint32_t tti, uint32_t enb_cc_idx, uint32_t preamble_idx
|
|
|
|
++detected_rachs[enb_cc_idx];
|
|
|
|
++detected_rachs[enb_cc_idx];
|
|
|
|
|
|
|
|
|
|
|
|
// Add new user to the scheduler so that it can RX/TX SRB0
|
|
|
|
// Add new user to the scheduler so that it can RX/TX SRB0
|
|
|
|
sched_interface::ue_cfg_t ue_cfg = {};
|
|
|
|
sched_interface::ue_cfg_t uecfg = {};
|
|
|
|
ue_cfg.supported_cc_list.emplace_back();
|
|
|
|
uecfg.supported_cc_list.emplace_back();
|
|
|
|
ue_cfg.supported_cc_list.back().active = true;
|
|
|
|
uecfg.supported_cc_list.back().active = true;
|
|
|
|
ue_cfg.supported_cc_list.back().enb_cc_idx = enb_cc_idx;
|
|
|
|
uecfg.supported_cc_list.back().enb_cc_idx = enb_cc_idx;
|
|
|
|
ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
|
|
|
|
uecfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH;
|
|
|
|
ue_cfg.supported_cc_list[0].dl_cfg.tm = SRSRAN_TM1;
|
|
|
|
uecfg.supported_cc_list[0].dl_cfg.tm = SRSRAN_TM1;
|
|
|
|
if (scheduler.ue_cfg(rnti, ue_cfg) != SRSRAN_SUCCESS) {
|
|
|
|
if (ue_cfg(rnti, &uecfg) != SRSRAN_SUCCESS) {
|
|
|
|
logger.error("Registering new user rnti=0x%x to SCHED", rnti);
|
|
|
|
|
|
|
|
ue_rem(rnti);
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Register new user in RRC
|
|
|
|
// Register new user in RRC
|
|
|
|
if (rrc_h->add_user(rnti, ue_cfg) == SRSRAN_ERROR) {
|
|
|
|
if (rrc_h->add_user(rnti, uecfg) == SRSRAN_ERROR) {
|
|
|
|
ue_rem(rnti);
|
|
|
|
ue_rem(rnti);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -924,6 +922,7 @@ int mac::get_ul_sched(uint32_t tti_tx_ul, ul_sched_list_t& ul_sched_res_list)
|
|
|
|
|
|
|
|
|
|
|
|
// If the Rx soft-buffer is not given, abort reception
|
|
|
|
// If the Rx soft-buffer is not given, abort reception
|
|
|
|
if (phy_ul_sched_res->pusch[n].softbuffer_rx == nullptr) {
|
|
|
|
if (phy_ul_sched_res->pusch[n].softbuffer_rx == nullptr) {
|
|
|
|
|
|
|
|
logger.warning("Failed to retrieve UL softbuffer for tti=%d, cc=%d", tti_tx_ul, enb_cc_idx);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|