diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index fcbe873ad2..25d226f4b7 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -1959,12 +1959,29 @@ static void configure_maccellgroup(NR_UE_MAC_INST_t *mac, const NR_MAC_CellGroup } } if (mcg->tag_Config) { - // TODO TAG not handled - if(mcg->tag_Config->tag_ToAddModList) { + if (mcg->tag_Config->tag_ToReleaseList) { + for (int i = 0; i < mcg->tag_Config->tag_ToReleaseList->list.count; i++) { + for (int j = 0; j < mac->TAG_list.count; j++) { + if (*mcg->tag_Config->tag_ToReleaseList->list.array[i] == mac->TAG_list.array[j]->tag_Id) + asn_sequence_del(&mac->TAG_list, j, 1); + } + } + } + if (mcg->tag_Config->tag_ToAddModList) { for (int i = 0; i < mcg->tag_Config->tag_ToAddModList->list.count; i++) { - if (mcg->tag_Config->tag_ToAddModList->list.array[i]->timeAlignmentTimer != - NR_TimeAlignmentTimer_infinity) - LOG_E(NR_MAC, "TimeAlignmentTimer not handled\n"); + int j; + for (j = 0; j < mac->TAG_list.count; j++) { + if (mac->TAG_list.array[j]->tag_Id == mcg->tag_Config->tag_ToAddModList->list.array[i]->tag_Id) + break; + } + if (j < mac->TAG_list.count) { + UPDATE_IE(mac->TAG_list.array[j], mcg->tag_Config->tag_ToAddModList->list.array[i], NR_TAG_t); + } + else { + NR_TAG_t *local_tag = NULL; + UPDATE_IE(local_tag, mcg->tag_Config->tag_ToAddModList->list.array[i], NR_TAG_t); + ASN_SEQUENCE_ADD(&mac->TAG_list, local_tag); + } } } } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 1079e24b05..00743420a2 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -76,7 +76,6 @@ #define NR_INVALID_LCGID (NR_MAX_NUM_LCGID) #define MAX_NUM_BWP_UE 5 -#define NUM_SLOT_FRAME 10 #define NR_MAX_SR_ID 8 // SchedulingRequestId ::= INTEGER (0..7) /*!\brief value for indicating BSR Timer is not running */ @@ -595,6 +594,7 @@ typedef struct NR_UE_MAC_INST_s { NR_UL_HARQ_INFO_t ul_harq_info[NR_MAX_HARQ_PROCESSES]; NR_TAG_Id_t tag_Id; + A_SEQUENCE_OF(NR_TAG_t) TAG_list; nr_emulated_l1_t nr_ue_emul_l1; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index 506fc222a6..4de5024b8f 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -321,6 +321,8 @@ void release_mac_configuration(NR_UE_MAC_INST_t *mac, NR_UE_MAC_reset_cause_t ca memset(&mac->ssb_measurements, 0, sizeof(mac->ssb_measurements)); memset(&mac->csirs_measurements, 0, sizeof(mac->csirs_measurements)); memset(&mac->ul_time_alignment, 0, sizeof(mac->ul_time_alignment)); + for (int i = mac->TAG_list.count; i > 0 ; i--) + asn_sequence_del(&mac->TAG_list, i - 1, 1); } void free_rach_structures(NR_UE_MAC_INST_t *nr_mac, int bwp_id)