Commit 3a7f17eb authored by Sakthivel Velumani's avatar Sakthivel Velumani

Create functions for getting LCID

parent 5f78fa6e
...@@ -30,6 +30,16 @@ ...@@ -30,6 +30,16 @@
#include "uper_decoder.h" #include "uper_decoder.h"
#include "uper_encoder.h" #include "uper_encoder.h"
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) 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; return plmn->mcc == check_plmn->mcc && plmn->mnc_digit_length == check_plmn->mnc_digit_length && plmn->mnc == check_plmn->mnc;
...@@ -78,7 +88,7 @@ static NR_RLC_BearerConfig_t *get_bearerconfig_from_srb(const f1ap_srb_to_be_set ...@@ -78,7 +88,7 @@ static NR_RLC_BearerConfig_t *get_bearerconfig_from_srb(const f1ap_srb_to_be_set
long priority = srb->srb_id; // high priority for SRB long priority = srb->srb_id; // high priority for SRB
e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucket = e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucket =
NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms5; NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms5;
return get_SRB_RLC_BearerConfig(srb->srb_id, priority, bucket); return get_SRB_RLC_BearerConfig(get_lcid_from_srbid(srb->srb_id), priority, bucket);
} }
static int handle_ue_context_srbs_setup(int rnti, static int handle_ue_context_srbs_setup(int rnti,
...@@ -108,7 +118,7 @@ static NR_RLC_BearerConfig_t *get_bearerconfig_from_drb(const f1ap_drb_to_be_set ...@@ -108,7 +118,7 @@ static NR_RLC_BearerConfig_t *get_bearerconfig_from_drb(const f1ap_drb_to_be_set
{ {
const NR_RLC_Config_PR rlc_conf = drb->rlc_mode == RLC_MODE_UM ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am; const NR_RLC_Config_PR rlc_conf = drb->rlc_mode == RLC_MODE_UM ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am;
long priority = 13; // hardcoded for the moment long priority = 13; // hardcoded for the moment
return get_DRB_RLC_BearerConfig(3 + drb->drb_id, drb->drb_id, rlc_conf, priority); return get_DRB_RLC_BearerConfig(get_lcid_from_drbid(drb->drb_id), drb->drb_id, rlc_conf, priority);
} }
static int handle_ue_context_drbs_setup(int rnti, static int handle_ue_context_drbs_setup(int rnti,
...@@ -153,7 +163,7 @@ static int handle_ue_context_drbs_release(int rnti, ...@@ -153,7 +163,7 @@ static int handle_ue_context_drbs_release(int rnti,
for (int i = 0; i < drbs_len; i++) { for (int i = 0; i < drbs_len; i++) {
const f1ap_drb_to_be_released_t *drb = &req_drbs[i]; const f1ap_drb_to_be_released_t *drb = &req_drbs[i];
long lcid = drb->rb_id + 3; /* LCID is DRB + 3 */ long lcid = get_lcid_from_drbid(drb->rb_id);
int idx = 0; int idx = 0;
while (idx < cellGroupConfig->rlc_BearerToAddModList->list.count) { while (idx < cellGroupConfig->rlc_BearerToAddModList->list.count) {
const NR_RLC_BearerConfig_t *bc = cellGroupConfig->rlc_BearerToAddModList->list.array[idx]; const NR_RLC_BearerConfig_t *bc = cellGroupConfig->rlc_BearerToAddModList->list.array[idx];
...@@ -227,7 +237,7 @@ static void set_nssaiConfig(const int drb_len, const f1ap_drb_to_be_setup_t *req ...@@ -227,7 +237,7 @@ static void set_nssaiConfig(const int drb_len, const f1ap_drb_to_be_setup_t *req
for (int i = 0; i < drb_len; i++) { for (int i = 0; i < drb_len; i++) {
const f1ap_drb_to_be_setup_t *drb = &req_drbs[i]; const f1ap_drb_to_be_setup_t *drb = &req_drbs[i];
long lcid = drb->drb_id + 3; /* LCID is DRB + 3 */ long lcid = get_lcid_from_drbid(drb->drb_id);
sched_ctrl->dl_lc_nssai[lcid] = drb->nssai; sched_ctrl->dl_lc_nssai[lcid] = drb->nssai;
LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for DRB: %ld\n", drb->nssai.sst, drb->nssai.sd, drb->drb_id); LOG_I(NR_MAC, "Setting NSSAI sst: %d, sd: %d for DRB: %ld\n", drb->nssai.sst, drb->nssai.sd, drb->drb_id);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment