Commit f381e932 authored by Sakthivel Velumani's avatar Sakthivel Velumani

Set NSSAI config in MAC

Each active LCID at MAC is configured with NSSAI that is sent from AMF with PDU session setup request
parent 2bf40fbd
......@@ -222,6 +222,17 @@ static NR_CellGroupConfig_t *clone_CellGroupConfig(const NR_CellGroupConfig_t *o
return cloned;
}
static void set_nssaiConfig(const int drb_len, const f1ap_drb_to_be_setup_t *req_drbs, NR_UE_sched_ctrl_t *sched_ctrl)
{
for (int i = 0; i < drb_len; i++) {
const f1ap_drb_to_be_setup_t *drb = &req_drbs[i];
long lcid = drb->drb_id + 3; /* LCID is DRB + 3 */
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);
}
}
void ue_context_setup_request(const f1ap_ue_context_setup_t *req)
{
gNB_MAC_INST *mac = RC.nrmac[0];
......@@ -288,6 +299,9 @@ void ue_context_setup_request(const f1ap_ue_context_setup_t *req)
/* TODO: need to apply after UE context reconfiguration confirmed? */
nr_mac_prepare_cellgroup_update(mac, UE, new_CellGroup);
/* Set NSSAI config in MAC for each active DRB */
set_nssaiConfig(req->drbs_to_be_setup_length, req->drbs_to_be_setup, &UE->UE_sched_ctrl);
NR_SCHED_UNLOCK(&mac->sched_lock);
/* some sanity checks, since we use the same type for request and response */
......@@ -384,6 +398,9 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req)
resp.du_to_cu_rrc_information->cellGroupConfig_length = (enc_rval.encoded + 7) >> 3;
nr_mac_prepare_cellgroup_update(mac, UE, new_CellGroup);
/* Set NSSAI config in MAC for each active DRB */
set_nssaiConfig(req->drbs_to_be_setup_length, req->drbs_to_be_setup, &UE->UE_sched_ctrl);
} else {
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, new_CellGroup); // we actually don't need it
}
......
......@@ -639,6 +639,7 @@ typedef struct {
/// sri, ul_ri and tpmi based on SRS
nr_srs_feedback_t srs_feedback;
nssai_t dl_lc_nssai[NR_MAX_NUM_LCID];
} NR_UE_sched_ctrl_t;
typedef struct {
......
......@@ -2346,7 +2346,7 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp
/* Instruction towards the DU for DRB configuration and tunnel creation */
int nb_drb = resp->pduSession[0].numDRBSetup;
f1ap_drb_to_be_setup_t drbs[nb_drb];
rrc_pdu_session_param_t *RRC_pduSession = find_pduSession(UE, e1ap_resp->pduSession[0].id, false);
rrc_pdu_session_param_t *RRC_pduSession = find_pduSession(UE, resp->pduSession[0].id, false);
DevAssert(RRC_pduSession);
for (int i = 0; i < nb_drb; i++) {
drbs[i].drb_id = resp->pduSession[0].DRBnGRanList[i].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