Refactor F1 Setup Req/DU config update: transport slices via F1 and read config
In the DU, read slice information from the DU config file. Handle multiple slices within the F1 Setup Request structure representation, and forward it via F1 to CU. The DU slice information is stored in the setup request structure.
This commit is contained in:
@@ -76,6 +76,32 @@ static uint8_t *cp_octet_string(const OCTET_STRING_t *os, int *len)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int read_slice_info(const F1AP_ServedPLMNs_Item_t *plmn, nssai_t *nssai, int max_nssai)
|
||||
{
|
||||
if (plmn->iE_Extensions == NULL)
|
||||
return 0;
|
||||
|
||||
const F1AP_ProtocolExtensionContainer_10696P34_t *p = (F1AP_ProtocolExtensionContainer_10696P34_t *)plmn->iE_Extensions;
|
||||
if (p->list.count == 0)
|
||||
return 0;
|
||||
|
||||
const F1AP_ServedPLMNs_ItemExtIEs_t *splmn = p->list.array[0];
|
||||
DevAssert(splmn->id == F1AP_ProtocolIE_ID_id_TAISliceSupportList);
|
||||
DevAssert(splmn->extensionValue.present == F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList);
|
||||
const F1AP_SliceSupportList_t *ssl = &splmn->extensionValue.choice.SliceSupportList;
|
||||
AssertFatal(ssl->list.count <= max_nssai, "cannot handle more than 16 slices\n");
|
||||
for (int s = 0; s < ssl->list.count; ++s) {
|
||||
const F1AP_SliceSupportItem_t *sl = ssl->list.array[s];
|
||||
nssai_t *n = &nssai[s];
|
||||
OCTET_STRING_TO_INT8(&sl->sNSSAI.sST, n->sst);
|
||||
n->sd = 0xffffff;
|
||||
if (sl->sNSSAI.sD != NULL)
|
||||
OCTET_STRING_TO_INT24(sl->sNSSAI.sD, n->sd);
|
||||
}
|
||||
|
||||
return ssl->list.count;
|
||||
}
|
||||
|
||||
/*
|
||||
F1 Setup
|
||||
*/
|
||||
@@ -152,6 +178,9 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3
|
||||
req->cell[i].info.nr_pci = servedCellInformation->nRPCI;
|
||||
LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell[i].info.nr_pci);
|
||||
|
||||
AssertFatal(servedCellInformation->servedPLMNs.list.count == 1, "only one PLMN handled\n");
|
||||
req->cell[i].info.num_ssi = read_slice_info(servedCellInformation->servedPLMNs.list.array[0], req->cell[i].info.nssai, 16);
|
||||
|
||||
// FDD Cells
|
||||
if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_fDD) {
|
||||
req->cell[i].info.mode = F1AP_MODE_FDD;
|
||||
@@ -507,6 +536,10 @@ int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso
|
||||
req->cell_to_add[i].info.nr_pci = servedCellInformation->nRPCI;
|
||||
LOG_D(F1AP, "req->nr_pci[%d] %d \n", i, req->cell_to_add[i].info.nr_pci);
|
||||
|
||||
AssertFatal(servedCellInformation->servedPLMNs.list.count == 1, "only one PLMN handled\n");
|
||||
req->cell_to_add[i].info.num_ssi =
|
||||
read_slice_info(servedCellInformation->servedPLMNs.list.array[0], req->cell_to_add[i].info.nssai, 16);
|
||||
|
||||
// FDD Cells
|
||||
if (servedCellInformation->nR_Mode_Info.present == F1AP_NR_Mode_Info_PR_fDD) {
|
||||
req->cell_to_add[i].info.mode = F1AP_MODE_FDD;
|
||||
|
||||
@@ -119,13 +119,13 @@ static F1AP_Served_Cell_Information_t encode_served_cell_info(const f1ap_served_
|
||||
served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
|
||||
F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList;
|
||||
|
||||
AssertFatal(c->num_ssi == 1, "can only encode one slice\n");
|
||||
for (int s = 0; s < c->num_ssi; s++) {
|
||||
asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, slice);
|
||||
INT8_TO_OCTET_STRING(c->sst, &slice->sNSSAI.sST);
|
||||
if (c->sd != 0xffffff) {
|
||||
const nssai_t *nssai = &c->nssai[s];
|
||||
INT8_TO_OCTET_STRING(nssai->sst, &slice->sNSSAI.sST);
|
||||
if (nssai->sd != 0xffffff) {
|
||||
asn1cCalloc(slice->sNSSAI.sD, tmp);
|
||||
INT24_TO_OCTET_STRING(c->sd, tmp);
|
||||
INT24_TO_OCTET_STRING(nssai->sd, tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user