changed mechanism for conres ce scheduling to be controlled by rrc

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent 66a38f53f5
commit ec94819f08

@ -144,6 +144,7 @@ public:
std::vector<cc_cfg_t> supported_cc_list; ///< list of UE supported CCs. First index for PCell
ant_info_ded_t dl_ant_info;
bool use_tbs_index_alt = false;
enum conn_state_t { none, ue_id_rx } conn_state = none;
};
typedef struct {

@ -126,7 +126,6 @@ public:
std::pair<bool, uint32_t> get_cell_index(uint32_t enb_cc_idx) const;
const sched_interface::ue_cfg_t& get_ue_cfg() const { return cfg; }
uint32_t get_aggr_level(uint32_t ue_cc_idx, uint32_t nof_bits);
void sched_conres_ce(uint32_t msg3_tti_tx_ul);
/*******************************************************
* Functions used by scheduler metric objects
@ -268,8 +267,6 @@ private:
conres_sched_pending,
conres_sent
} conres_state = ra_state_t::msg3_sched_pending;
uint32_t msg3_pid = 0;
int next_tpc_pusch = 0;
int next_tpc_pucch = 0;

@ -139,8 +139,7 @@ ra_sched::ra_sched(const sched_cell_params_t& cfg_, std::map<uint16_t, sched_ue>
cc_cfg(&cfg_),
log_h(srslte::logmap::get("MAC")),
ue_db(&ue_db_)
{
}
{}
// Schedules RAR
// On every call to this function, we schedule the oldest RAR which is still within the window. If outside the window we
@ -242,7 +241,6 @@ void ra_sched::ul_sched(sf_sched* sf_dl_sched, sf_sched* sf_msg3_sched)
auto user_it = ue_db->find(crnti);
if (user_it != ue_db->end() and sf_msg3_sched->alloc_msg3(&user_it->second, msg3grant)) {
log_h->debug("SCHED: Queueing Msg3 for rnti=0x%x at tti=%d\n", crnti, sf_msg3_sched->get_tti_tx_ul());
user_it->second.sched_conres_ce(sf_msg3_sched->get_tti_tx_ul());
} else {
log_h->error("SCHED: Failed to allocate Msg3 for rnti=0x%x at tti=%d\n", crnti, sf_msg3_sched->get_tti_tx_ul());
}

@ -107,7 +107,6 @@ void sched_ue::init(uint16_t rnti_, const std::vector<sched_cell_params_t>& cell
void sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_)
{
{
// for the first configured cc, set it as primary cc
if (cfg.supported_cc_list.empty()) {
uint32_t primary_cc_idx = 0;
@ -124,8 +123,16 @@ void sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_)
// update configuration
std::vector<sched::ue_cfg_t::cc_cfg_t> prev_supported_cc_list = std::move(cfg.supported_cc_list);
sched::ue_cfg_t::conn_state_t prev_state = cfg.conn_state;
cfg = cfg_;
// update in connection state detected
if (prev_state != cfg.conn_state) {
if (cfg.conn_state == sched_interface::ue_cfg_t::ue_id_rx) {
conres_state = ra_state_t::conres_sched_pending;
}
}
// update bearer cfgs
for (uint32_t i = 0; i < sched_interface::MAX_LC; ++i) {
set_bearer_cfg_unlocked(i, cfg.ue_bearers[i]);
@ -145,7 +152,7 @@ void sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_)
if (ue_idx == 0) {
// PCell was changed possibly due to handover. Schedule a new ConRes CE to be transmitted after the Msg3
conres_state = ra_state_t::conres_sched_pending;
log_h->info("SCHED: PCell has changed. ConRes CE scheduled\n");
log_h->info("SCHED: PCell has changed for rnti=0x%x. ConRes CE scheduled\n", rnti);
}
} else {
// The SCell internal configuration may have changed
@ -157,7 +164,6 @@ void sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_)
pending_ces.emplace_back(srslte::sch_subh::SCELL_ACTIVATION);
log_h->info("SCHED: Enqueueing SCell Activation CMD for rnti=0x%x\n", rnti);
}
}
}
void sched_ue::reset()
@ -308,10 +314,6 @@ void sched_ue::set_ul_crc(srslte::tti_point tti_rx, uint32_t enb_cc_idx, bool cr
auto ret = carriers[p.second].harq_ent.set_ul_crc(tti_rx, 0, crc_res);
if (not ret.first) {
log_h->warning("Received UL CRC for invalid tti_rx=%d\n", (int)tti_rx.to_uint());
} else {
if (conres_state == ra_state_t::wait_msg3_ack and ret.second == msg3_pid and crc_res) {
conres_state = ra_state_t::conres_sched_pending;
}
}
} else {
log_h->warning("Received UL CRC for invalid cell index %d\n", enb_cc_idx);
@ -1097,12 +1099,6 @@ uint32_t sched_ue::get_aggr_level(uint32_t ue_cc_idx, uint32_t nof_bits)
return carriers[ue_cc_idx].get_aggr_level(nof_bits);
}
void sched_ue::sched_conres_ce(uint32_t msg3_tti_tx_ul)
{
msg3_pid = carriers[0].harq_ent.get_ul_harq(msg3_tti_tx_ul)->get_id();
conres_state = ra_state_t::wait_msg3_ack;
}
void sched_ue::finish_tti(const tti_params_t& tti_params, uint32_t enb_cc_idx)
{
auto p = get_cell_index(enb_cc_idx);

@ -1639,6 +1639,7 @@ void rrc::ue::send_connection_setup(bool is_setup)
current_sched_ue_cfg.pucch_cfg.n_rb_2 = sib2.rr_cfg_common.pucch_cfg_common.nrb_cqi;
current_sched_ue_cfg.pucch_cfg.N_pucch_1 = sib2.rr_cfg_common.pucch_cfg_common.n1_pucch_an;
current_sched_ue_cfg.dl_ant_info = srslte::make_ant_info_ded(phy_cfg->ant_info.explicit_value());
current_sched_ue_cfg.conn_state = sched_interface::ue_cfg_t::ue_id_rx;
// Configure MAC
parent->mac->ue_cfg(rnti, &current_sched_ue_cfg);

@ -871,7 +871,7 @@ int common_sched_tester::process_tti_events(const tti_ev& tti_ev)
rem_user(ue_ev.rnti);
}
// configure carriers
// configure bearers
if (ue_ev.bearer_cfg != nullptr) {
CONDERROR(not ue_tester->user_exists(ue_ev.rnti), "User rnti=0x%x does not exist\n", ue_ev.rnti);
// TODO: Instantiate more bearers
@ -886,6 +886,10 @@ int common_sched_tester::process_tti_events(const tti_ev& tti_ev)
if (pending_dl_new_data == 0) {
uint32_t lcid = 0; // Use SRB0 to schedule Msg4
dl_rlc_buffer_state(ue_ev.rnti, lcid, 50, 0);
auto current_ue_cfg = *get_current_ue_cfg(ue_ev.rnti);
current_ue_cfg.conn_state = ue_cfg_t::ue_id_rx;
TESTASSERT(ue_cfg(ue_ev.rnti, current_ue_cfg) == SRSLTE_SUCCESS);
ue_tester->user_reconf(ue_ev.rnti, current_ue_cfg);
} else {
// Let SRB0 Msg4 get fully transmitted
}

Loading…
Cancel
Save