Use F1 gNB-CU Configuration Update Acknowledge lib in stack
This commit is contained in:
@@ -214,11 +214,29 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_cu_confi
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief gNB CU Configuration Update Acknowledge decoding (9.2.1.11 of 3GPP TS 38.473)
|
||||||
|
* and handling by CU
|
||||||
|
*/
|
||||||
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
|
||||||
sctp_assoc_t assoc_id,
|
sctp_assoc_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
F1AP_F1AP_PDU_t *pdu)
|
F1AP_F1AP_PDU_t *pdu)
|
||||||
{
|
{
|
||||||
LOG_I(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
|
DevAssert(pdu != NULL);
|
||||||
return(0);
|
if (stream != 0)
|
||||||
|
LOG_W(F1AP, "[SCTP %d] Received gNB CU Configuration Update Acknowledge on stream != 0 (%d)\n", assoc_id, stream);
|
||||||
|
// Decode
|
||||||
|
f1ap_gnb_cu_configuration_update_acknowledge_t msg = {0};
|
||||||
|
if (!decode_f1ap_cu_configuration_update_acknowledge(pdu, &msg)) {
|
||||||
|
LOG_E(F1AP, "Failed to decode gNB CU Configuration Update Acknowledge\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// Allocate ITTI message and send to RRC
|
||||||
|
MessageDef *message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
|
||||||
|
message_p->ittiMsgHeader.originInstance = assoc_id;
|
||||||
|
f1ap_gnb_cu_configuration_update_acknowledge_t *ack = &F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(message_p);
|
||||||
|
*ack = msg; // copy decoded message to ITTI, the RRC thread will free it
|
||||||
|
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,48 +251,22 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id,
|
|||||||
GNBCUConfigurationUpdateFailure->cause);
|
GNBCUConfigurationUpdateFailure->cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(
|
/**
|
||||||
sctp_assoc_t assoc_id,
|
* @brief Encode and transfer F1 GNB CU Configuration Update Acknowledge message
|
||||||
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge)
|
*/
|
||||||
|
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id, f1ap_gnb_cu_configuration_update_acknowledge_t *msg)
|
||||||
{
|
{
|
||||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0,
|
uint8_t *buffer = NULL;
|
||||||
"%d cells failed to activate\n",
|
uint32_t len = 0;
|
||||||
GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated);
|
/* encode F1 message */
|
||||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup == 0,
|
F1AP_F1AP_PDU_t *pdu = encode_f1ap_cu_configuration_update_acknowledge(msg);
|
||||||
"%d TNLAssociations to setup, handle this ...\n",
|
/* encode F1AP PDU */
|
||||||
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_to_setup);
|
if (!pdu || f1ap_encode_pdu(pdu, &buffer, &len) < 0) {
|
||||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed == 0,
|
LOG_E(F1AP, "Failed to encode GNB-CU-Configuration-Update-Acknowledge\n");
|
||||||
"%d TNLAssociations failed\n",
|
ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||||
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed);
|
|
||||||
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0,
|
|
||||||
"%d DedicatedSIDeliveryNeededUEs\n",
|
|
||||||
GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs);
|
|
||||||
F1AP_F1AP_PDU_t pdu= {0};
|
|
||||||
uint8_t *buffer=NULL;
|
|
||||||
uint32_t len=0;
|
|
||||||
/* Create */
|
|
||||||
/* 0. pdu Type */
|
|
||||||
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
|
|
||||||
asn1cCalloc(pdu.choice.successfulOutcome, tmp);
|
|
||||||
tmp->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
|
|
||||||
tmp->criticality = F1AP_Criticality_reject;
|
|
||||||
tmp->value.present = F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge;
|
|
||||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *out = &tmp->value.choice.GNBCUConfigurationUpdateAcknowledge;
|
|
||||||
/* mandatory */
|
|
||||||
/* c1. Transaction ID (integer value)*/
|
|
||||||
asn1cSequenceAdd(out->protocolIEs.list, F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t, ie);
|
|
||||||
ie->id = F1AP_ProtocolIE_ID_id_TransactionID;
|
|
||||||
ie->criticality = F1AP_Criticality_reject;
|
|
||||||
ie->value.present = F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID;
|
|
||||||
ie->value.choice.TransactionID = F1AP_get_next_transaction_identifier(0, 0);
|
|
||||||
|
|
||||||
/* encode */
|
|
||||||
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
|
|
||||||
LOG_E(F1AP, "Failed to encode GNB-DU-Configuration-Update-Acknowledge\n");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
ASN_STRUCT_FREE(asn_DEF_F1AP_F1AP_PDU, pdu);
|
||||||
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
|
|
||||||
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
|
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2387,6 +2387,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
|
|||||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
|
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
|
||||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
|
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
|
||||||
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
|
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
|
||||||
|
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).transaction_id = F1AP_get_next_transaction_identifier(0, 0);
|
||||||
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
|
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2512,6 +2512,12 @@ void *rrc_gnb_task(void *args_p) {
|
|||||||
rrc_gNB_process_f1_du_configuration_update(&F1AP_GNB_DU_CONFIGURATION_UPDATE(msg_p), msg_p->ittiMsgHeader.originInstance);
|
rrc_gNB_process_f1_du_configuration_update(&F1AP_GNB_DU_CONFIGURATION_UPDATE(msg_p), msg_p->ittiMsgHeader.originInstance);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
|
||||||
|
AssertFatal(!NODE_IS_DU(RC.nrrrc[instance]->node_type),
|
||||||
|
"should not receive F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE in DU!\n");
|
||||||
|
LOG_E(NR_RRC, "Handling of F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE not implemented\n");
|
||||||
|
break;
|
||||||
|
|
||||||
/* Messages from X2AP */
|
/* Messages from X2AP */
|
||||||
case X2AP_ENDC_SGNB_ADDITION_REQ:
|
case X2AP_ENDC_SGNB_ADDITION_REQ:
|
||||||
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
|
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
|
||||||
|
|||||||
Reference in New Issue
Block a user