Commit a47eab52 authored by Robert Schmidt's avatar Robert Schmidt

F1 UE Ctxt modification: forward multiple PDU sessions, including NSSAI

parent 2800203e
......@@ -1998,30 +1998,34 @@ 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, resp->pduSession[0].id, false);
f1ap_drb_to_be_setup_t drbs[32]; // maximum DRB can be 32
int nb_drb = 0;
for (int p = 0; p < resp->numPDUSessions; ++p) {
rrc_pdu_session_param_t *RRC_pduSession = find_pduSession(UE, resp->pduSession[p].id, false);
DevAssert(RRC_pduSession);
for (int i = 0; i < nb_drb; i++) {
DRB_nGRAN_setup_t *drb_config = &resp->pduSession[0].DRBnGRanList[i];
drbs[i].drb_id = resp->pduSession[0].DRBnGRanList[i].id;
drbs[i].rlc_mode = rrc->configuration.um_on_default_drb ? RLC_MODE_UM : RLC_MODE_AM;
drbs[i].up_ul_tnl[0].tl_address = drb_config->UpParamList[0].tlAddress;
drbs[i].up_ul_tnl[0].port = rrc->eth_params_s.my_portd;
drbs[i].up_ul_tnl[0].teid = drb_config->UpParamList[0].teId;
drbs[i].up_ul_tnl_length = 1;
for (int i = 0; i < resp->pduSession[p].numDRBSetup; i++) {
DRB_nGRAN_setup_t *drb_config = &resp->pduSession[p].DRBnGRanList[i];
f1ap_drb_to_be_setup_t *drb = &drbs[nb_drb];
drb->drb_id = resp->pduSession[p].DRBnGRanList[i].id;
drb->rlc_mode = rrc->configuration.um_on_default_drb ? RLC_MODE_UM : RLC_MODE_AM;
drb->up_ul_tnl[0].tl_address = drb_config->UpParamList[0].tlAddress;
drb->up_ul_tnl[0].port = rrc->eth_params_s.my_portd;
drb->up_ul_tnl[0].teid = drb_config->UpParamList[0].teId;
drb->up_ul_tnl_length = 1;
drb->nssai = RRC_pduSession->param.nssai;
/* pass QoS info to MAC */
int nb_qos_flows = drb_config->numQosFlowSetup;
AssertFatal(nb_qos_flows > 0, "must map at least one flow to a DRB\n");
drbs[i].drb_info.flows_to_be_setup_length = nb_qos_flows;
drbs[i].drb_info.flows_mapped_to_drb = (f1ap_flows_mapped_to_drb_t *)calloc(nb_qos_flows, sizeof(f1ap_flows_mapped_to_drb_t));
AssertFatal(drbs[i].drb_info.flows_mapped_to_drb, "could not allocate memory\n");
drb->drb_info.flows_to_be_setup_length = nb_qos_flows;
drb->drb_info.flows_mapped_to_drb = calloc(nb_qos_flows, sizeof(f1ap_flows_mapped_to_drb_t));
AssertFatal(drb->drb_info.flows_mapped_to_drb, "could not allocate memory\n");
for (int j = 0; j < nb_qos_flows; j++) {
drbs[i].drb_info.flows_mapped_to_drb[j].qfi = drb_config->qosFlows[j].qfi;
drb->drb_info.flows_mapped_to_drb[j].qfi = drb_config->qosFlows[j].qfi;
pdusession_level_qos_parameter_t *in_qos_char = get_qos_characteristics(drb_config->qosFlows[j].qfi, RRC_pduSession);
f1ap_qos_characteristics_t *qos_char = &drbs[i].drb_info.flows_mapped_to_drb[j].qos_params.qos_characteristics;
f1ap_qos_characteristics_t *qos_char = &drb->drb_info.flows_mapped_to_drb[j].qos_params.qos_characteristics;
if (in_qos_char->fiveQI_type == dynamic) {
qos_char->qos_type = dynamic;
qos_char->dynamic.fiveqi = in_qos_char->fiveQI;
......@@ -2033,10 +2037,13 @@ void rrc_gNB_process_e1_bearer_context_setup_resp(e1ap_bearer_setup_resp_t *resp
}
}
/* the DRB QoS parameters: we just reuse the ones from the first flow */
drbs[i].drb_info.drb_qos = drbs[i].drb_info.flows_mapped_to_drb[0].qos_params;
drb->drb_info.drb_qos = drb->drb_info.flows_mapped_to_drb[0].qos_params;
/* pass NSSAI info to MAC */
drbs[i].nssai = RRC_pduSession->param.nssai;
drb->nssai = RRC_pduSession->param.nssai;
nb_drb++;
}
}
/* Instruction towards the DU for SRB2 configuration */
......
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