From 850f26fc5c620c9dbf5ec3c5f43677763212a341 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 16 May 2024 09:36:46 +0200 Subject: [PATCH] Move get_lcid_from_srbid/drbid() to central gNB MAC primitives In later commits, we will call these functions from multiple places in the scheduler, so move them to a central place. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 10 ++++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 ++ openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 10 ---------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 06429b61d3..ee0aee0718 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -3210,3 +3210,13 @@ void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_ }; nrmac->mac_rrc.ue_context_modification_required(&required); } + +long get_lcid_from_drbid(int drb_id) +{ + return drb_id + 3; /* LCID is DRB + 3 */ +} + +long get_lcid_from_srbid(int srb_id) +{ + return srb_id; +} diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 639d126220..a4adfd4b08 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -425,6 +425,8 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP); size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset_rsrp); void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_info_t *UE); +long get_lcid_from_drbid(int drb_id); +long get_lcid_from_srbid(int srb_id); void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE); void send_initial_ul_rrc_message(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index 69994d5ffe..a7d1a921eb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -90,16 +90,6 @@ bool DURecvCb(protocol_ctxt_t *ctxt_pP, return true; } -static long get_lcid_from_drbid(int drb_id) -{ - return drb_id + 3; /* LCID is DRB + 3 */ -} - -static long get_lcid_from_srbid(int srb_id) -{ - return srb_id; -} - static bool check_plmn_identity(const f1ap_plmn_t *check_plmn, const f1ap_plmn_t *plmn) { return plmn->mcc == check_plmn->mcc && plmn->mnc_digit_length == check_plmn->mnc_digit_length && plmn->mnc == check_plmn->mnc;