SRSUE: Refactored MAC/RRC SCell Activation/Deactivation

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent ff5f215df9
commit f64c268a69

@ -552,7 +552,7 @@ public:
virtual void set_timeadv(uint32_t ta_cmd) = 0; virtual void set_timeadv(uint32_t ta_cmd) = 0;
/* Activate / Disactivate SCell*/ /* Activate / Disactivate SCell*/
virtual void set_activation_deactivation_scell(uint32_t cmd) = 0; virtual void set_activation_deactivation_scell(uint32_t cmd, uint32_t tti) = 0;
/* Sets RAR dci payload */ /* Sets RAR dci payload */
virtual void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rnti) = 0; virtual void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rnti) = 0;
@ -595,7 +595,7 @@ public:
virtual void set_config_mbsfn_sib13(const srslte::sib13_t& sib13) = 0; virtual void set_config_mbsfn_sib13(const srslte::sib13_t& sib13) = 0;
virtual void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) = 0; virtual void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) = 0;
virtual void set_activation_deactivation_scell(uint32_t cmd) = 0; virtual void deactivate_scells() = 0;
/* Measurements interface */ /* Measurements interface */
virtual void set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci) = 0; virtual void set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci) = 0;

@ -73,7 +73,7 @@ class phy_dummy_interface : public phy_interface_rrc_lte
void set_config_mbsfn_sib2(srslte::mbsfn_sf_cfg_t* cfg_list, uint32_t nof_cfgs) override {} void set_config_mbsfn_sib2(srslte::mbsfn_sf_cfg_t* cfg_list, uint32_t nof_cfgs) override {}
void set_config_mbsfn_sib13(const srslte::sib13_t& sib13) override {} void set_config_mbsfn_sib13(const srslte::sib13_t& sib13) override {}
void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) override {} void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) override {}
void set_activation_deactivation_scell(uint32_t cmd) override {} void deactivate_scells() override {}
/* Measurements interface */ /* Measurements interface */
void set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci) override {} void set_cells_to_meas(uint32_t earfcn, const std::set<uint32_t>& pci) override {}

@ -145,7 +145,8 @@ public:
void set_timeadv(uint32_t ta_cmd) final; void set_timeadv(uint32_t ta_cmd) final;
/* Activate / Disactivate SCell*/ /* Activate / Disactivate SCell*/
void set_activation_deactivation_scell(uint32_t ta_cmd) final; void deactivate_scells() final;
void set_activation_deactivation_scell(uint32_t cmd, uint32_t tti) final;
/* Sets RAR dci payload */ /* Sets RAR dci payload */
void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rnti) final; void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rnti) final;

@ -54,7 +54,7 @@ public:
uint8_t* request_buffer_bcch(uint32_t len); uint8_t* request_buffer_bcch(uint32_t len);
void deallocate(uint8_t* payload_buffer_ptr); void deallocate(uint8_t* payload_buffer_ptr);
void push_pdu(uint8_t* buff, uint32_t nof_bytes); void push_pdu(uint8_t* buff, uint32_t nof_bytes, uint32_t tti);
void push_pdu_bcch(uint8_t* buff, uint32_t nof_bytes); void push_pdu_bcch(uint8_t* buff, uint32_t nof_bytes);
void push_pdu_mch(uint8_t* buff, uint32_t nof_bytes); void push_pdu_mch(uint8_t* buff, uint32_t nof_bytes);
void push_pdu_temp_crnti(uint8_t* buff, uint32_t nof_bytes); void push_pdu_temp_crnti(uint8_t* buff, uint32_t nof_bytes);
@ -79,10 +79,10 @@ private:
srslte::mch_pdu mch_mac_msg; srslte::mch_pdu mch_mac_msg;
srslte::sch_pdu pending_mac_msg; srslte::sch_pdu pending_mac_msg;
uint8_t mch_lcids[SRSLTE_N_MCH_LCIDS] = {}; uint8_t mch_lcids[SRSLTE_N_MCH_LCIDS] = {};
void process_sch_pdu_rt(uint8_t* buff, uint32_t nof_bytes); void process_sch_pdu_rt(uint8_t* buff, uint32_t nof_bytes, uint32_t tti);
void process_sch_pdu(srslte::sch_pdu* pdu); void process_sch_pdu(srslte::sch_pdu* pdu);
void process_mch_pdu(srslte::mch_pdu* pdu); void process_mch_pdu(srslte::mch_pdu* pdu);
bool process_ce(srslte::sch_subh* subheader); bool process_ce(srslte::sch_subh* subheader, uint32_t tti);
void parse_ta_cmd(srslte::sch_subh* subh); void parse_ta_cmd(srslte::sch_subh* subh);
bool is_uecrid_successful = false; bool is_uecrid_successful = false;

@ -267,7 +267,14 @@ void phy::set_timeadv(uint32_t ta_cmd)
common.ta.add_ta_cmd_new(ta_cmd); common.ta.add_ta_cmd_new(ta_cmd);
} }
void phy::set_activation_deactivation_scell(uint32_t cmd) void phy::deactivate_scells()
{
for (uint32_t i = 1; i < SRSLTE_MAX_CARRIERS; i++) {
common.enable_scell(i, false);
}
}
void phy::set_activation_deactivation_scell(uint32_t cmd, uint32_t tti)
{ {
/* Implements 3GPP 36.321 section 6.1.3.8. Activation/Deactivation MAC Control Element*/ /* Implements 3GPP 36.321 section 6.1.3.8. Activation/Deactivation MAC Control Element*/
for (uint32_t i = 1; i < SRSLTE_MAX_CARRIERS; i++) { for (uint32_t i = 1; i < SRSLTE_MAX_CARRIERS; i++) {

@ -125,11 +125,11 @@ void demux::push_pdu_temp_crnti(uint8_t* buff, uint32_t nof_bytes)
* This function enqueues the packet and returns quickly because ACK * This function enqueues the packet and returns quickly because ACK
* deadline is important here. * deadline is important here.
*/ */
void demux::push_pdu(uint8_t* buff, uint32_t nof_bytes) void demux::push_pdu(uint8_t* buff, uint32_t nof_bytes, uint32_t tti)
{ {
// Process Real-Time PDUs // Process Real-Time PDUs
process_sch_pdu_rt(buff, nof_bytes); process_sch_pdu_rt(buff, nof_bytes, tti);
return pdus.push(buff, nof_bytes, srslte::pdu_queue::DCH); return pdus.push(buff, nof_bytes, srslte::pdu_queue::DCH);
} }
@ -180,7 +180,7 @@ void demux::process_pdu(uint8_t* mac_pdu, uint32_t nof_bytes, srslte::pdu_queue:
} }
} }
void demux::process_sch_pdu_rt(uint8_t* buff, uint32_t nof_bytes) void demux::process_sch_pdu_rt(uint8_t* buff, uint32_t nof_bytes, uint32_t tti)
{ {
srslte::sch_pdu mac_msg_rt(20, log_h); srslte::sch_pdu mac_msg_rt(20, log_h);
@ -192,7 +192,7 @@ void demux::process_sch_pdu_rt(uint8_t* buff, uint32_t nof_bytes)
// Ignore SDU // Ignore SDU
} else { } else {
// Process MAC Control Element // Process MAC Control Element
if (!process_ce(mac_msg_rt.get())) { if (!process_ce(mac_msg_rt.get(), tti)) {
Warning("Received Subheader with invalid or unknown LCID\n"); Warning("Received Subheader with invalid or unknown LCID\n");
} }
} }
@ -274,7 +274,7 @@ void demux::mch_start_rx(uint32_t lcid)
} }
} }
bool demux::process_ce(srslte::sch_subh* subh) bool demux::process_ce(srslte::sch_subh* subh, uint32_t tti)
{ {
switch (subh->dl_sch_ce_type()) { switch (subh->dl_sch_ce_type()) {
case srslte::dl_sch_lcid::CON_RES_ID: case srslte::dl_sch_lcid::CON_RES_ID:
@ -287,7 +287,7 @@ bool demux::process_ce(srslte::sch_subh* subh)
uint32_t cmd = (uint32_t)subh->get_activation_deactivation_cmd(); uint32_t cmd = (uint32_t)subh->get_activation_deactivation_cmd();
srslte::console("SCELL Activation / Deactivation CMD: %x\n", cmd); srslte::console("SCELL Activation / Deactivation CMD: %x\n", cmd);
log_h->info("SCELL Activation / Deactivation CMD: %x\n", cmd); log_h->info("SCELL Activation / Deactivation CMD: %x\n", cmd);
phy_h->set_activation_deactivation_scell(cmd); phy_h->set_activation_deactivation_scell(cmd, tti);
break; break;
} }
case srslte::dl_sch_lcid::PADDING: case srslte::dl_sch_lcid::PADDING:

@ -341,7 +341,7 @@ void dl_harq_entity::dl_harq_process::dl_tb_process::tb_decoded(mac_interface_ph
} else { } else {
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.tb[tid].tbs); Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit\n", cur_grant.tb[tid].tbs);
harq_entity->demux_unit->push_pdu(payload_buffer_ptr, cur_grant.tb[tid].tbs); harq_entity->demux_unit->push_pdu(payload_buffer_ptr, cur_grant.tb[tid].tbs, grant.tti);
// Compute average number of retransmissions per packet // Compute average number of retransmissions per packet
harq_entity->average_retx = SRSLTE_VEC_CMA((float)n_retx, harq_entity->average_retx, harq_entity->nof_pkts++); harq_entity->average_retx = SRSLTE_VEC_CMA((float)n_retx, harq_entity->average_retx, harq_entity->nof_pkts++);

@ -1332,7 +1332,7 @@ proc_outcome_t rrc::connection_reest_proc::init(asn1::rrc::reest_cause_e cause)
// configure lower layers to consider the SCell(s), if configured, to be in deactivated state; // configure lower layers to consider the SCell(s), if configured, to be in deactivated state;
if (nof_scells_active > 0) { if (nof_scells_active > 0) {
rrc_ptr->phy->set_activation_deactivation_scell(0); rrc_ptr->phy->deactivate_scells();
} }
// 1> apply the default physical channel configuration as specified in 9.2.4; // 1> apply the default physical channel configuration as specified in 9.2.4;
@ -1596,7 +1596,7 @@ srslte::proc_outcome_t rrc::ho_proc::init(const asn1::rrc::rrc_conn_recfg_s& rrc
// configure lower layers to consider the SCell(s), if configured, to be in deactivated state; // configure lower layers to consider the SCell(s), if configured, to be in deactivated state;
if (nof_scells_active > 0) { if (nof_scells_active > 0) {
rrc_ptr->phy->set_activation_deactivation_scell(0); rrc_ptr->phy->deactivate_scells();
} }
// apply the value of the newUE-Identity as the C-RNTI; // apply the value of the newUE-Identity as the C-RNTI;

@ -163,7 +163,7 @@ public:
void set_crnti(uint16_t rnti) { last_crnti = rnti; } void set_crnti(uint16_t rnti) { last_crnti = rnti; }
void set_timeadv_rar(uint32_t ta_cmd) { rar_time_adv = ta_cmd; } void set_timeadv_rar(uint32_t ta_cmd) { rar_time_adv = ta_cmd; }
void set_timeadv(uint32_t ta_cmd){}; void set_timeadv(uint32_t ta_cmd){};
void set_activation_deactivation_scell(uint32_t cmd) { scell_cmd = cmd; }; void set_activation_deactivation_scell(uint32_t cmd, uint32_t tti) override { scell_cmd = cmd; };
void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rnti) void set_rar_grant(uint8_t grant_payload[SRSLTE_RAR_GRANT_LEN], uint16_t rnti)
{ {
memcpy(rar_payload, grant_payload, SRSLTE_RAR_GRANT_LEN); memcpy(rar_payload, grant_payload, SRSLTE_RAR_GRANT_LEN);

@ -64,7 +64,8 @@ public:
// phy_interface_rrc_lte // phy_interface_rrc_lte
void enable_pregen_signals(bool enable) override; void enable_pregen_signals(bool enable) override;
void set_activation_deactivation_scell(uint32_t cmd) override; void deactivate_scells() override;
void set_activation_deactivation_scell(uint32_t cmd, uint32_t tti) override;
bool set_config(srslte::phy_cfg_t config, uint32_t cc_idx = 0) override; bool set_config(srslte::phy_cfg_t config, uint32_t cc_idx = 0) override;
bool set_scell(srslte_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn) override; bool set_scell(srslte_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn) override;
void set_config_tdd(srslte_tdd_config_t& tdd_config) override; void set_config_tdd(srslte_tdd_config_t& tdd_config) override;

@ -75,7 +75,12 @@ void lte_ttcn3_phy::enable_pregen_signals(bool enable)
log.debug("%s not implemented.\n", __FUNCTION__); log.debug("%s not implemented.\n", __FUNCTION__);
} }
void lte_ttcn3_phy::set_activation_deactivation_scell(uint32_t cmd) void lte_ttcn3_phy::deactivate_scells()
{
log.debug("%s not implemented.\n", __FUNCTION__);
}
void lte_ttcn3_phy::set_activation_deactivation_scell(uint32_t cmd, uint32_t tti)
{ {
log.debug("%s not implemented.\n", __FUNCTION__); log.debug("%s not implemented.\n", __FUNCTION__);
} }

@ -51,7 +51,7 @@ public:
void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) override {} void set_config_mbsfn_mcch(const srslte::mcch_msg_t& mcch) override {}
bool cell_search() override { return true; } bool cell_search() override { return true; }
bool cell_is_camping() override { return true; } bool cell_is_camping() override { return true; }
void set_activation_deactivation_scell(uint32_t cmd) override {} void deactivate_scells() override {}
bool cell_select(phy_cell_t cell) override bool cell_select(phy_cell_t cell) override
{ {
last_selected_cell = cell; last_selected_cell = cell;

Loading…
Cancel
Save