-adding temp crnti removal for NR carrier attach

master
yagoda 3 years ago committed by Andre Puschmann
parent 1c44546c0b
commit bc4388a78c

@ -27,6 +27,8 @@ public:
virtual uint16_t reserve_rnti(uint32_t enb_cc_idx) = 0;
virtual int ue_cfg(uint16_t rnti, const sched_nr_interface::ue_cfg_t& ue_cfg) = 0;
virtual int remove_ue(uint16_t rnti) = 0;
};
// NR interface is identical to EUTRA interface

@ -54,6 +54,7 @@ public:
uint16_t reserve_rnti(uint32_t enb_cc_idx) override;
int read_pdu_bcch_bch(uint8_t* payload);
int ue_cfg(uint16_t rnti, const sched_nr_interface::ue_cfg_t& ue_cfg) override;
int remove_ue(uint16_t rnti) override;
// MAC interface for RLC
// TODO:
@ -71,7 +72,6 @@ public:
private:
uint16_t add_ue_(uint32_t enb_cc_idx);
uint16_t alloc_ue(uint32_t enb_cc_idx);
int remove_ue(uint16_t rnti);
// internal misc helpers
bool is_rnti_valid_unsafe(uint16_t rnti);

@ -63,6 +63,7 @@ public:
rrc_nr_cfg_t update_default_cfg(const rrc_nr_cfg_t& rrc_cfg);
int add_user(uint16_t rnti);
void rem_user(uint16_t rnti);
int update_user(uint16_t new_rnti, uint16_t old_rnti);
void config_phy();
void config_mac();

@ -169,6 +169,7 @@ void mac_nr::rach_detected(const rach_info_t& rach_info)
rar_info.prach_slot = slot_point{NUMEROLOGY_IDX, rach_info.slot_index};
// TODO: fill remaining fields as required
sched.dl_rach_info(enb_cc_idx, rar_info);
rrc->add_user(rnti);
logger.info("RACH: slot=%d, cc=%d, preamble=%d, offset=%d, temp_crnti=0x%x",
rach_info.slot_index,

@ -158,6 +158,24 @@ int rrc_nr::add_user(uint16_t rnti)
}
}
void rrc_nr::rem_user(uint16_t rnti)
{
auto user_it = users.find(rnti);
if (user_it != users.end()) {
printf("Disconnecting rnti=0x%x.\n", rnti);
logger.info("Disconnecting rnti=0x%x.", rnti);
/* First remove MAC and GTPU to stop processing DL/UL traffic for this user
*/
mac->remove_ue(rnti); // MAC handles PHY
rlc->rem_user(rnti);
pdcp->rem_user(rnti);
users.erase(rnti);
logger.info("Removed user rnti=0x%x", rnti);
} else {
logger.error("Removing user rnti=0x%x (does not exist)", rnti);
}
}
/* Function called by MAC after the reception of a C-RNTI CE indicating that the UE still has a
* valid RNTI.
*/
@ -166,8 +184,7 @@ int rrc_nr::update_user(uint16_t new_rnti, uint16_t old_rnti)
// Remove new_rnti
auto new_ue_it = users.find(new_rnti);
if (new_ue_it != users.end()) {
// TODO: cleanup new user?
return SRSRAN_ERROR;
task_sched.defer_task([this, new_rnti]() { rem_user(new_rnti); });
}
// Send Reconfiguration to old_rnti if is RRC_CONNECT or RRC Release if already released here

@ -43,6 +43,8 @@ public:
int ue_cfg(uint16_t rnti, const sched_nr_interface::ue_cfg_t& ue_cfg) override { return SRSRAN_SUCCESS; }
int remove_ue(uint16_t rnti) override { return SRSRAN_SUCCESS; }
srsenb::sched_interface::cell_cfg_t cellcfgobj;
};

Loading…
Cancel
Save