nr,ue,rrc: avoid configuring the CSI until NR RA is complete

master
Francisco 3 years ago committed by Francisco Paisana
parent 8118c368d9
commit b8976ca463

@ -108,6 +108,7 @@ public:
/// RRC
void rrc_ra_problem();
void rrc_ra_completed();
/// stack interface
void process_pdus();

@ -24,9 +24,9 @@ class mac_interface_proc_ra_nr
{
public:
// Functions for identity handling, e.g., contention id and c-rnti
virtual uint64_t get_contention_id() = 0;
virtual uint16_t get_crnti() = 0;
virtual bool set_crnti(uint16_t c_rnti) = 0;
virtual uint64_t get_contention_id() = 0;
virtual uint16_t get_crnti() = 0;
virtual bool set_crnti(uint16_t c_rnti) = 0;
// Functions for msg3 manipulation which shall be transparent to the procedure
virtual bool msg3_is_transmitted() = 0;
@ -35,7 +35,8 @@ public:
virtual bool msg3_is_empty() = 0;
// RRC functions
virtual void rrc_ra_problem() = 0;
virtual void rrc_ra_problem() = 0;
virtual void rrc_ra_completed() = 0;
};
/**

@ -35,8 +35,8 @@ public:
void set_config(const srsran::rach_nr_cfg_t& rach_cfg);
bool is_contention_resolution();
bool is_rar_opportunity(uint32_t tti);
bool has_rar_rnti();
bool is_rar_opportunity(uint32_t tti);
bool has_rar_rnti();
uint16_t get_rar_rnti();
bool has_temp_crnti();
uint16_t get_temp_crnti();
@ -61,9 +61,9 @@ private:
srsran::ext_task_sched_handle* task_sched = nullptr;
srsran::task_multiqueue::queue_handle task_queue;
int ra_window_length = -1, ra_window_start = -1;
uint16_t rar_rnti = SRSRAN_INVALID_RNTI;
uint16_t temp_crnti = SRSRAN_INVALID_RNTI;
int ra_window_length = -1, ra_window_start = -1;
uint16_t rar_rnti = SRSRAN_INVALID_RNTI;
uint16_t temp_crnti = SRSRAN_INVALID_RNTI;
std::mutex mutex;
srsran::rach_nr_cfg_t rach_cfg = {};
@ -90,18 +90,18 @@ private:
srsran::timer_handler::unique_timer backoff_timer;
// 38.321 5.1.1 Variables
uint32_t preamble_index = 0;
uint32_t preamble_transmission_counter = 0;
uint32_t preamble_index = 0;
uint32_t preamble_transmission_counter = 0;
uint32_t preamble_backoff = 0; // in ms
uint32_t preamble_power_ramping_step = 0;
int preamble_received_target_power = 0;
uint32_t scaling_factor_bi = 0;
uint32_t preamble_power_ramping_step = 0;
int preamble_received_target_power = 0;
uint32_t scaling_factor_bi = 0;
// uint32_t temporary_c_rnti;
uint32_t power_offset_2step_ra = 0;
// not explicty mentioned
uint32_t preambleTransMax = 0;
uint32_t prach_occasion = 0;
uint32_t prach_occasion = 0;
uint32_t current_ta = 0;
void timer_expired(uint32_t timer_id);

@ -506,6 +506,11 @@ void mac_nr::rrc_ra_problem()
rrc->ra_problem();
}
void mac_nr::rrc_ra_completed()
{
rrc->ra_completed();
}
/**
* Called from the main stack thread to process received PDUs
*/

@ -128,7 +128,7 @@ void proc_ra_nr::timer_expired(uint32_t timer_id)
{
if (prach_send_timer.id() == timer_id) {
logger.warning("PRACH Send timer expired. PRACH was not transmitted within %d ttis by phy. (TODO)",
prach_send_timer.duration());
prach_send_timer.duration());
ra_error();
} else if (rar_timeout_timer.id() == timer_id) {
logger.warning("RAR Timer expired. RA response not received within the response window");
@ -149,10 +149,10 @@ void proc_ra_nr::ra_procedure_initialization()
{
mac.msg3_flush();
preamble_transmission_counter = 1;
preamble_power_ramping_step = rach_cfg.powerRampingStep;
scaling_factor_bi = 1;
preamble_power_ramping_step = rach_cfg.powerRampingStep;
scaling_factor_bi = 1;
preamble_backoff = 0;
preambleTransMax = rach_cfg.preambleTransMax;
preambleTransMax = rach_cfg.preambleTransMax;
ra_resource_selection();
}
@ -278,6 +278,7 @@ void proc_ra_nr::ra_completion()
srsran::console("Random Access Complete. c-rnti=0x%x, ta=%d\n", mac.get_crnti(), current_ta);
logger.info("Random Access Complete. c-rnti=0x%x, ta=%d", mac.get_crnti(), current_ta);
temp_crnti = SRSRAN_INVALID_RNTI;
mac.rrc_ra_completed();
reset();
}
@ -293,9 +294,9 @@ void proc_ra_nr::ra_error()
if (preamble_transmission_counter >= rach_cfg.preambleTransMax + 1) {
logger.warning("Maximum number of transmissions reached (%d)", rach_cfg.preambleTransMax);
// if the Random Access Preamble is transmitted on the SpCell assumption (TODO)
mac.rrc_ra_problem(); // indicate a Random Access problem to upper layers;
mac.rrc_ra_problem(); // indicate a Random Access problem to upper layers;
if (started_by == initiators_t::MAC) { // if this Random Access procedure was triggered for SI request
ra_procedure_completed = true; // consider the Random Access procedure unsuccessfully completed.
ra_procedure_completed = true; // consider the Random Access procedure unsuccessfully completed.
reset();
}
} else {

@ -73,6 +73,7 @@ public:
void msga_flush(){};
// RRC RA problem
void rrc_ra_problem() { logger.warning("Dummy MAC RRC ra problem"); }
void rrc_ra_completed() { logger.info("Dummy MAC RRC ra completed"); }
private:
uint16_t crnti = SRSRAN_INVALID_RNTI;
@ -127,10 +128,10 @@ int proc_ra_normal_test()
mac_interface_phy_nr::mac_nr_grant_dl_t grant;
grant.rnti = 0x16;
grant.tti = rach_cfg.ra_responseWindow + tti_start + 3;
grant.pid = 0x0;
grant.pid = 0x0;
uint8_t mac_dl_rar_pdu[] = {0x40, 0x06, 0x68, 0x03, 0x21, 0x46, 0x46, 0x02, 0x00, 0x00, 0x00};
mac_interface_phy_nr::tb_action_dl_result_t result = {};
result.payload = srsran::make_byte_buffer();
mac_interface_phy_nr::tb_action_dl_result_t result = {};
result.payload = srsran::make_byte_buffer();
TESTASSERT(result.payload != nullptr);
result.payload.get()->append_bytes(mac_dl_rar_pdu, sizeof(mac_dl_rar_pdu));
proc_ra_nr.handle_rar_pdu(result);

@ -1143,6 +1143,7 @@ bool rrc_nr::apply_sp_cell_ded_ul_pusch(const asn1::rrc_nr::pusch_cfg_s& pusch_c
bool rrc_nr::apply_sp_cell_cfg(const sp_cell_cfg_s& sp_cell_cfg)
{
srsran_csi_hl_cfg_t prev_csi = phy_cfg.csi;
if (sp_cell_cfg.recfg_with_sync_present) {
const recfg_with_sync_s& recfg_with_sync = sp_cell_cfg.recfg_with_sync;
mac->set_crnti(recfg_with_sync.new_ue_id);
@ -1305,7 +1306,14 @@ bool rrc_nr::apply_sp_cell_cfg(const sp_cell_cfg_s& sp_cell_cfg)
logger.warning("Option sp_cell_cfg_ded not present");
return false;
}
phy->set_config(phy_cfg);
// Configure PHY
// Note: CSI config is deferred to when RA is complete. See TS 38.331, Section 5.3.5.3
srsran::phy_cfg_nr_t current_phycfg = phy_cfg;
current_phycfg.csi = prev_csi;
phy->set_config(current_phycfg);
// Start RA procedure
mac->start_ra_procedure();
return true;
}
@ -1501,7 +1509,11 @@ void rrc_nr::max_retx_attempted() {}
void rrc_nr::protocol_failure() {}
// MAC interface
void rrc_nr::ra_completed() {}
void rrc_nr::ra_completed()
{
logger.info("RA completed. Applying remaining CSI configuration.");
phy->set_config(phy_cfg);
}
void rrc_nr::ra_problem()
{
rrc_eutra->nr_scg_failure_information(scg_failure_cause_t::random_access_problem);

Loading…
Cancel
Save