Commit 653e6659 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/f1ap-msg-correction' into integration_2023_w40

parents 4ff2c4e7 c3df9c27
...@@ -957,9 +957,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -957,9 +957,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
F1AP_UEContextModificationRequest_t *out; F1AP_UEContextModificationRequest_t *out;
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
uint32_t len=0; uint32_t len=0;
// for test
LOG_W(F1AP, "UE Context Modification Request PLMN is hardcoded!\n");
f1ap_served_cell_info_t hardCoded= { .plmn.mcc=208, .plmn.mnc=93, .plmn.mnc_digit_length=2};
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
...@@ -985,13 +983,18 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -985,13 +983,18 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
/* optional */ /* optional */
/* c3. NRCGI */ /* c3. NRCGI */
if (0) { if (true) {
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie3); asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie3);
ie3->id = F1AP_ProtocolIE_ID_id_SpCell_ID; ie3->id = F1AP_ProtocolIE_ID_id_SpCell_ID;
ie3->criticality = F1AP_Criticality_ignore; ie3->criticality = F1AP_Criticality_ignore;
ie3->value.present = F1AP_UEContextModificationRequestIEs__value_PR_NRCGI; ie3->value.present = F1AP_UEContextModificationRequestIEs__value_PR_NRCGI;
/* - nRCGI */ /* - nRCGI */
addnRCGI(ie3->value.choice.NRCGI, &hardCoded);
f1ap_served_cell_info_t nrcgi = {
.plmn = f1ap_ue_context_modification_req->plmn,
.nr_cellid = f1ap_ue_context_modification_req->nr_cellid,
};
addnRCGI(ie3->value.choice.NRCGI, &nrcgi);
} }
/* optional */ /* optional */
...@@ -1113,6 +1116,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -1113,6 +1116,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
F1AP_SCell_ToBeSetupMod_Item_t *scell_toBeSetupMod_item= F1AP_SCell_ToBeSetupMod_Item_t *scell_toBeSetupMod_item=
&scell_toBeSetupMod_item_ies->value.choice.SCell_ToBeSetupMod_Item; &scell_toBeSetupMod_item_ies->value.choice.SCell_ToBeSetupMod_Item;
// /* - sCell_ID */ // /* - sCell_ID */
f1ap_served_cell_info_t hardCoded = {0};
addnRCGI(scell_toBeSetupMod_item->sCell_ID, &hardCoded); addnRCGI(scell_toBeSetupMod_item->sCell_ID, &hardCoded);
/* sCellIndex */ /* sCellIndex */
scell_toBeSetupMod_item->sCellIndex = 6; // issue here scell_toBeSetupMod_item->sCellIndex = 6; // issue here
...@@ -1140,6 +1144,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -1140,6 +1144,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
F1AP_SCell_ToBeRemoved_Item_t *scell_toBeRemoved_item= F1AP_SCell_ToBeRemoved_Item_t *scell_toBeRemoved_item=
&scell_toBeRemoved_item_ies->value.choice.SCell_ToBeRemoved_Item; &scell_toBeRemoved_item_ies->value.choice.SCell_ToBeRemoved_Item;
/* - sCell_ID */ /* - sCell_ID */
f1ap_served_cell_info_t hardCoded = {0};
addnRCGI(scell_toBeRemoved_item->sCell_ID, &hardCoded); addnRCGI(scell_toBeRemoved_item->sCell_ID, &hardCoded);
} }
} }
......
...@@ -927,16 +927,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t ...@@ -927,16 +927,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t
f1ap_ue_context_modification_req->rrc_container = malloc(ieRRC->value.choice.RRCContainer.size); f1ap_ue_context_modification_req->rrc_container = malloc(ieRRC->value.choice.RRCContainer.size);
memcpy(f1ap_ue_context_modification_req->rrc_container, memcpy(f1ap_ue_context_modification_req->rrc_container,
ieRRC->value.choice.RRCContainer.buf, ieRRC->value.choice.RRCContainer.size); ieRRC->value.choice.RRCContainer.buf, ieRRC->value.choice.RRCContainer.size);
protocol_ctxt_t ctxt; f1ap_ue_context_modification_req->rrc_container_length = ieRRC->value.choice.RRCContainer.size;
// decode RRC Container and act on the message type
ctxt.rntiMaybeUEid = f1ap_ue_context_modification_req->gNB_DU_ue_id;
ctxt.instance = instance;
ctxt.module_id = instance;
ctxt.enb_flag = 1;
ctxt.eNB_index = instance;
mem_block_t *pdcp_pdu_p = get_free_mem_block(ieRRC->value.choice.RRCContainer.size, __func__);
memcpy(&pdcp_pdu_p->data[0], ieRRC->value.choice.RRCContainer.buf, ieRRC->value.choice.RRCContainer.size);
du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ieRRC->value.choice.RRCContainer.size, pdcp_pdu_p);
} else { } else {
LOG_E(F1AP, " RRCContainer in UEContextModificationRequestIEs size id 0\n"); LOG_E(F1AP, " RRCContainer in UEContextModificationRequestIEs size id 0\n");
} }
...@@ -944,6 +935,32 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t ...@@ -944,6 +935,32 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t
LOG_D(F1AP, "can't find RRCContainer in UEContextModificationRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer); LOG_D(F1AP, "can't find RRCContainer in UEContextModificationRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
} }
/* CU2DU Information */
F1AP_UEContextModificationRequestIEs_t *ieCU2DU = NULL;
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextModificationRequestIEs_t,
ieCU2DU,
container,
F1AP_ProtocolIE_ID_id_CUtoDURRCInformation,
false);
if (ieCU2DU != NULL) {
f1ap_ue_context_modification_req->cu_to_du_rrc_information =
calloc(1, sizeof(*f1ap_ue_context_modification_req->cu_to_du_rrc_information));
AssertFatal(f1ap_ue_context_modification_req->cu_to_du_rrc_information != NULL, "out of memory\n");
cu_to_du_rrc_information_t *cu2du = f1ap_ue_context_modification_req->cu_to_du_rrc_information;
const F1AP_CUtoDURRCInformation_t *cu2duie = &ieCU2DU->value.choice.CUtoDURRCInformation;
if (cu2duie->cG_ConfigInfo != NULL)
LOG_W(F1AP, "UE RNTI %04x: ignoring cg_ConfigInfo, not implemented\n", f1ap_ue_context_modification_req->gNB_DU_ue_id);
if (cu2duie->measConfig != NULL)
LOG_W(F1AP, "UE RNTI %04x: ignoring measConfig, not implemented\n", f1ap_ue_context_modification_req->gNB_DU_ue_id);
if (cu2duie->uE_CapabilityRAT_ContainerList != NULL) {
F1AP_UE_CapabilityRAT_ContainerList_t *uecap = cu2duie->uE_CapabilityRAT_ContainerList;
cu2du->uE_CapabilityRAT_ContainerList = calloc(uecap->size, sizeof(*cu2du->uE_CapabilityRAT_ContainerList));
AssertFatal(cu2du->uE_CapabilityRAT_ContainerList != NULL, "out of memory\n");
cu2du->uE_CapabilityRAT_ContainerList_length = uecap->size;
memcpy(cu2du->uE_CapabilityRAT_ContainerList, uecap->buf, uecap->size);
}
}
ue_context_modification_request(f1ap_ue_context_modification_req); ue_context_modification_request(f1ap_ue_context_modification_req);
return 0; return 0;
} }
......
...@@ -2917,8 +2917,11 @@ void send_initial_ul_rrc_message(gNB_MAC_INST *mac, int rnti, const uint8_t *sdu ...@@ -2917,8 +2917,11 @@ void send_initial_ul_rrc_message(gNB_MAC_INST *mac, int rnti, const uint8_t *sdu
uint8_t du2cu[1024]; uint8_t du2cu[1024];
int encoded = encode_cellGroupConfig(UE->CellGroup, du2cu, sizeof(du2cu)); int encoded = encode_cellGroupConfig(UE->CellGroup, du2cu, sizeof(du2cu));
DevAssert(mac->f1_config.setup_req != NULL);
AssertFatal(mac->f1_config.setup_req->num_cells_available == 1, "can handle only one cell\n");
const f1ap_initial_ul_rrc_message_t ul_rrc_msg = { const f1ap_initial_ul_rrc_message_t ul_rrc_msg = {
/* TODO: add mcc, mnc, cell_id, ..., is not available at MAC yet */ .plmn = mac->f1_config.setup_req->cell[0].info.plmn,
.nr_cellid = mac->f1_config.setup_req->cell[0].info.nr_cellid,
.gNB_DU_ue_id = rnti, .gNB_DU_ue_id = rnti,
.crnti = rnti, .crnti = rnti,
.rrc_container = (uint8_t *) sdu, .rrc_container = (uint8_t *) sdu,
......
...@@ -369,7 +369,8 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req) ...@@ -369,7 +369,8 @@ void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req)
update_cellGroupConfig(new_CellGroup, UE->uid, UE->capability, &mac->radio_config, scc); update_cellGroupConfig(new_CellGroup, UE->uid, UE->capability, &mac->radio_config, scc);
} }
if (req->srbs_to_be_setup_length > 0 || req->drbs_to_be_setup_length > 0 || req->drbs_to_be_released_length > 0) { if (req->srbs_to_be_setup_length > 0 || req->drbs_to_be_setup_length > 0 || req->drbs_to_be_released_length > 0
|| ue_cap != NULL) {
resp.du_to_cu_rrc_information = calloc(1, sizeof(du_to_cu_rrc_information_t)); resp.du_to_cu_rrc_information = calloc(1, sizeof(du_to_cu_rrc_information_t));
AssertFatal(resp.du_to_cu_rrc_information != NULL, "out of memory\n"); AssertFatal(resp.du_to_cu_rrc_information != NULL, "out of memory\n");
resp.du_to_cu_rrc_information->cellGroupConfig = calloc(1, 1024); resp.du_to_cu_rrc_information->cellGroupConfig = calloc(1, 1024);
......
...@@ -2077,7 +2077,6 @@ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, i ...@@ -2077,7 +2077,6 @@ static void rrc_CU_process_ue_context_modification_response(MessageDef *msg_p, i
} }
if (resp->du_to_cu_rrc_information != NULL && resp->du_to_cu_rrc_information->cellGroupConfig != NULL) { if (resp->du_to_cu_rrc_information != NULL && resp->du_to_cu_rrc_information->cellGroupConfig != NULL) {
LOG_W(RRC, "UE context modification response contains new CellGroupConfig for UE %04x, triggering reconfiguration\n", UE->rnti);
NR_CellGroupConfig_t *cellGroupConfig = NULL; NR_CellGroupConfig_t *cellGroupConfig = NULL;
asn_dec_rval_t dec_rval = uper_decode_complete(NULL, asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
&asn_DEF_NR_CellGroupConfig, &asn_DEF_NR_CellGroupConfig,
......
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