From 84e1d8205ebde7e7b6c21df71ec89df52dd43eae Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 4 Apr 2024 15:35:34 +0200 Subject: [PATCH] add new state for UE detachement --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 1 + openair2/LAYER2/NR_MAC_UE/mac_defs.h | 3 ++- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 4dcbbcffc1..a83d2a20ec 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1438,6 +1438,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id, reset_mac_inst(mac); nr_ue_reset_sync_state(mac); release_mac_configuration(mac, cause); + mac->state = UE_DETACHING; break; case T300_EXPIRY: reset_ra(mac, cause); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 4a79b6e38d..0bc197f5f9 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -168,7 +168,8 @@ typedef enum { UE_NOT_SYNC = 0, UE_SYNC, UE_PERFORMING_RA, - UE_CONNECTED + UE_CONNECTED, + UE_DETACHING } NR_UE_L2_STATE_t; typedef enum { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index cc66b2ca97..bd95a922c0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1085,7 +1085,7 @@ void nr_ue_dl_scheduler(NR_UE_MAC_INST_t *mac, nr_downlink_indication_t *dl_info dl_config->slot = rx_slot; dl_config->number_pdus = 0; - if (mac->state == UE_NOT_SYNC) + if (mac->state == UE_NOT_SYNC || mac->state == UE_DETACHING) return; ue_dci_configuration(mac, dl_config, rx_frame, rx_slot); @@ -1316,7 +1316,7 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info) } } - if(mac->state >= UE_PERFORMING_RA) + if(mac->state >= UE_PERFORMING_RA && mac->state < UE_DETACHING) nr_ue_pucch_scheduler(mac, frame_tx, slot_tx, ul_info->phy_data); }