now the rrc enb is using a common function for rr_cfg reconf for the first reconf message

master
Francisco Paisana 4 years ago
parent ce78fa82ce
commit 890113fd32

@ -37,8 +37,8 @@ public:
bool is_idle();
typedef enum {
MSG3_RX_TIMEOUT = 0, ///< Msg3 has its own timeout to quickly remove fake UEs from random PRACHs
UE_INACTIVITY_TIMEOUT, ///< UE inactivity timeout
MSG3_RX_TIMEOUT = 0, ///< Msg3 has its own timeout to quickly remove fake UEs from random PRACHs
UE_INACTIVITY_TIMEOUT, ///< UE inactivity timeout
nulltype
} activity_timeout_type_t;
std::string to_string(const activity_timeout_type_t& type);
@ -108,6 +108,7 @@ private:
// cached for ease of context transfer
asn1::rrc::rrc_conn_recfg_s last_rrc_conn_recfg;
asn1::rrc::rr_cfg_ded_s current_rr_cfg;
asn1::rrc::establishment_cause_e establishment_cause;

@ -30,12 +30,26 @@ namespace srsenb {
struct rrc_cfg_t;
class cell_ctxt_dedicated_list;
class bearer_cfg_handler;
/// Fill RadioResourceConfigDedicated with RRCSetup/Reestablishment data
void fill_rr_cfg_ded_setup(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list);
/// Fill RadioResourceConfigDedicated with RRCReconf data
enum class reconf_cause { init, reest, crnti_ce, handover, other };
void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const asn1::rrc::rr_cfg_ded_s& current_rr_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list,
const bearer_cfg_handler& bearers,
const srslte::rrc_ue_capabilities_t& ue_caps,
reconf_cause cause);
void apply_rr_cfg_ded_diff(asn1::rrc::rr_cfg_ded_s& current_rr_cfg_ded,
const asn1::rrc::rr_cfg_ded_s& pending_rr_cfg_ded);
} // namespace srsenb
#endif // SRSENB_UE_RR_CFG_H

@ -275,6 +275,8 @@ void rrc::ue::send_connection_setup()
apply_setup_phy_config_dedicated(rr_cfg.phys_cfg_ded); // It assumes SCell has not been set before
send_dl_ccch(&dl_ccch_msg);
apply_rr_cfg_ded_diff(current_rr_cfg, rr_cfg);
}
void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srslte::unique_byte_buffer_t pdu)
@ -420,6 +422,8 @@ void rrc::ue::send_connection_reest(uint8_t ncc)
apply_setup_phy_config_dedicated(rr_cfg.phys_cfg_ded); // It assumes SCell has not been set before
send_dl_ccch(&dl_ccch_msg);
apply_rr_cfg_ded_diff(current_rr_cfg, rr_cfg);
}
void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srslte::unique_byte_buffer_t pdu)
@ -474,77 +478,32 @@ void rrc::ue::send_connection_reest_rej()
*/
void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
{
parent->rrc_log->debug("RRC state %d\n", state);
// Setup SRB2
bearer_list.add_srb(2);
// Add re-establish DRBs
parent->rrc_log->debug("RRC state %d\n", state);
dl_dcch_msg_s dl_dcch_msg;
dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg().crit_exts.set_c1().set_rrc_conn_recfg_r8();
dl_dcch_msg.msg.c1().rrc_conn_recfg().rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
rrc_conn_recfg_r8_ies_s* conn_reconf = &dl_dcch_msg.msg.c1().rrc_conn_recfg().crit_exts.c1().rrc_conn_recfg_r8();
// Add DRBs/SRBs
conn_reconf->rr_cfg_ded_present = bearer_list.fill_rr_cfg_ded(conn_reconf->rr_cfg_ded);
conn_reconf->rr_cfg_ded.phys_cfg_ded_present = true;
phys_cfg_ded_s* phy_cfg = &conn_reconf->rr_cfg_ded.phys_cfg_ded;
// Configure PHY layer
phy_cfg->ant_info_present = true;
phy_cfg->ant_info.set_explicit_value() = parent->cfg.antenna_info;
phy_cfg->cqi_report_cfg_present = true;
if (parent->cfg.cqi_cfg.mode == RRC_CFG_CQI_MODE_APERIODIC) {
phy_cfg->cqi_report_cfg.cqi_report_mode_aperiodic_present = true;
if (phy_cfg->ant_info_present and
phy_cfg->ant_info.explicit_value().tx_mode.value == ant_info_ded_s::tx_mode_e_::tm4) {
phy_cfg->cqi_report_cfg.cqi_report_mode_aperiodic = cqi_report_mode_aperiodic_e::rm31;
} else {
phy_cfg->cqi_report_cfg.cqi_report_mode_aperiodic = cqi_report_mode_aperiodic_e::rm30;
}
} else {
phy_cfg->cqi_report_cfg.cqi_report_periodic_present = true;
auto& cqi_rep = phy_cfg->cqi_report_cfg.cqi_report_periodic.set_setup();
get_cqi(&cqi_rep.cqi_pmi_cfg_idx, &cqi_rep.cqi_pucch_res_idx, UE_PCELL_CC_IDX);
cqi_rep.cqi_format_ind_periodic.set(
cqi_report_periodic_c::setup_s_::cqi_format_ind_periodic_c_::types::wideband_cqi);
cqi_rep.simul_ack_nack_and_cqi = parent->cfg.cqi_cfg.simultaneousAckCQI;
if (phy_cfg->ant_info_present and
((phy_cfg->ant_info.explicit_value().tx_mode == ant_info_ded_s::tx_mode_e_::tm3) ||
(phy_cfg->ant_info.explicit_value().tx_mode == ant_info_ded_s::tx_mode_e_::tm4))) {
uint16_t ri_idx = 0;
if (get_ri(parent->cfg.cqi_cfg.m_ri, &ri_idx) == SRSLTE_SUCCESS) {
phy_cfg->cqi_report_cfg.cqi_report_periodic.set_setup();
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx_present = true;
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx = ri_idx;
} else {
srslte::console("\nWarning: Configured wrong M_ri parameter.\n\n");
}
} else {
phy_cfg->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx_present = false;
}
}
phy_cfg->cqi_report_cfg.nom_pdsch_rs_epre_offset = 0;
// PDSCH
phy_cfg->pdsch_cfg_ded_present = true;
phy_cfg->pdsch_cfg_ded.p_a = parent->cfg.pdsch_cfg;
// 256-QAM
if (ue_capabilities.support_dl_256qam) {
phy_cfg->ext = true;
phy_cfg->cqi_report_cfg_pcell_v1250.set_present(true);
phy_cfg->cqi_report_cfg_pcell_v1250->alt_cqi_table_r12_present = true;
phy_cfg->cqi_report_cfg_pcell_v1250->alt_cqi_table_r12.value =
cqi_report_cfg_v1250_s::alt_cqi_table_r12_opts::all_sfs;
}
dl_dcch_msg_s dl_dcch_msg;
rrc_conn_recfg_s& recfg = dl_dcch_msg.msg.set_c1().set_rrc_conn_recfg();
recfg.rrc_transaction_id = (uint8_t)((transaction_id++) % 4);
rrc_conn_recfg_r8_ies_s& recfg_r8 = recfg.crit_exts.set_c1().set_rrc_conn_recfg_r8();
// Fill RR Config Ded
fill_rr_cfg_ded_reconf(recfg_r8.rr_cfg_ded,
current_rr_cfg,
parent->cfg,
cell_ded_list,
bearer_list,
ue_capabilities,
reconf_cause::init);
recfg_r8.rr_cfg_ded_present = true;
// Add SCells
if (fill_scell_to_addmod_list(conn_reconf) != SRSLTE_SUCCESS) {
if (fill_scell_to_addmod_list(&recfg_r8) != SRSLTE_SUCCESS) {
parent->rrc_log->warning("Could not create configuration for Scell\n");
return;
}
apply_reconf_phy_config(*conn_reconf, true);
apply_reconf_phy_config(recfg_r8, true);
// setup SRB2/DRBs in PDCP and RLC
apply_pdcp_srb_updates();
@ -552,15 +511,15 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
apply_rlc_rb_updates();
// Add pending NAS info
bearer_list.fill_pending_nas_info(conn_reconf);
bearer_list.fill_pending_nas_info(&recfg_r8);
if (mobility_handler != nullptr) {
mobility_handler->fill_conn_recfg_no_ho_cmd(conn_reconf);
mobility_handler->fill_conn_recfg_no_ho_cmd(&recfg_r8);
}
last_rrc_conn_recfg = dl_dcch_msg.msg.c1().rrc_conn_recfg();
// Apply Reconf Msg configuration to MAC scheduler
mac_ctrl->handle_con_reconf(*conn_reconf);
mac_ctrl->handle_con_reconf(recfg_r8);
// If reconf due to reestablishment, recover PDCP state
if (state == RRC_STATE_REESTABLISHMENT_COMPLETE) {
@ -587,6 +546,8 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
send_dl_dcch(&dl_dcch_msg, std::move(pdu));
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE;
apply_rr_cfg_ded_diff(current_rr_cfg, recfg_r8.rr_cfg_ded);
}
void rrc::ue::send_connection_reconf_upd(srslte::unique_byte_buffer_t pdu)

@ -238,20 +238,44 @@ void fill_phy_cfg_ded_enb_cfg(phys_cfg_ded_s& phy_cfg, const rrc_cfg_t& enb_cfg)
fill_cqi_report_enb_cfg(phy_cfg.cqi_report_cfg, enb_cfg);
}
/// Fills ASN1 PhysicalConfigurationDedicated struct with eNB config params at RRCReconf
void fill_phy_cfg_ded_enb_cfg_reconf(phys_cfg_ded_s& phy_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list)
void fill_phy_cfg_ded_setup(phys_cfg_ded_s& phy_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list)
{
// Set PHYConfigDedicated base
fill_phy_cfg_ded_enb_cfg(phy_cfg, enb_cfg);
// Setup SR PUCCH config
fill_sr_cfg_setup(phy_cfg.sched_request_cfg, ue_cell_list);
// Setup CQI PUCCH config
fill_cqi_report_setup(phy_cfg.cqi_report_cfg, enb_cfg, ue_cell_list);
}
/// Fills ASN1 PhysicalConfigurationDedicated struct with eNB config params at RRCReconf
void fill_phy_cfg_ded_reconf(phys_cfg_ded_s& phy_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list,
const srslte::rrc_ue_capabilities_t& ue_caps)
{
// Use RRCSetup as starting point
fill_phy_cfg_ded_setup(phy_cfg, enb_cfg, ue_cell_list);
// Antenna Configuration
ant_info_ded_s& ant_info = phy_cfg.ant_info.explicit_value();
ant_info = enb_cfg.antenna_info;
// CQI Report Config
fill_cqi_report_reconf(phy_cfg.cqi_report_cfg, enb_cfg, ue_cell_list);
// DL 256-QAM
if (ue_caps.support_dl_256qam) {
phy_cfg.ext = true;
phy_cfg.cqi_report_cfg_pcell_v1250.set_present(true);
phy_cfg.cqi_report_cfg_pcell_v1250->alt_cqi_table_r12_present = true;
phy_cfg.cqi_report_cfg_pcell_v1250->alt_cqi_table_r12.value =
cqi_report_cfg_v1250_s::alt_cqi_table_r12_opts::all_sfs;
}
}
/***********************************
@ -292,23 +316,20 @@ void fill_rr_cfg_ded_setup(asn1::rrc::rr_cfg_ded_s& rr_cfg,
rr_cfg.srb_to_add_mod_list_present = true;
add_srb(rr_cfg.srb_to_add_mod_list, 1);
// Setup SR PUCCH config
fill_sr_cfg_setup(rr_cfg.phys_cfg_ded.sched_request_cfg, ue_cell_list);
// Setup CQI PUCCH config
fill_cqi_report_setup(rr_cfg.phys_cfg_ded.cqi_report_cfg, enb_cfg, ue_cell_list);
// Setup SR/CQI configs
rr_cfg.phys_cfg_ded_present = true;
fill_phy_cfg_ded_setup(rr_cfg.phys_cfg_ded, enb_cfg, ue_cell_list);
}
enum class reconf_cause { setup, reest, crnti_ce, handover, other };
void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const rr_cfg_ded_s& current_rr_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list,
const bearer_cfg_handler& bearers,
reconf_cause cause)
void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
const rr_cfg_ded_s& current_rr_cfg,
const rrc_cfg_t& enb_cfg,
const cell_ctxt_dedicated_list& ue_cell_list,
const bearer_cfg_handler& bearers,
const srslte::rrc_ue_capabilities_t& ue_caps,
reconf_cause cause)
{
// Establish SRBs if required
// (Re)establish SRBs
fill_srbs_reconf(rr_cfg.srb_to_add_mod_list, current_rr_cfg.srb_to_add_mod_list);
rr_cfg.srb_to_add_mod_list_present = rr_cfg.srb_to_add_mod_list.size() > 0;
@ -323,7 +344,7 @@ void fill_rr_cfg_ded_reconf(asn1::rrc::rr_cfg_ded_s& rr_cfg,
// PhysCfgDed update needed
if (cause != reconf_cause::other) {
rr_cfg.phys_cfg_ded_present = true;
fill_phy_cfg_ded_enb_cfg_reconf(rr_cfg.phys_cfg_ded, enb_cfg, ue_cell_list);
fill_phy_cfg_ded_reconf(rr_cfg.phys_cfg_ded, enb_cfg, ue_cell_list, ue_caps);
}
}

Loading…
Cancel
Save