Commit 686f1816 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/impl_f1reset_and_fix_f1setup' into integration_2024_w30

parents f30e354b 52bd1ad7
......@@ -205,6 +205,7 @@ These modes of operation are supported:
- F1 UE Context modification required
- F1 UE Context release req/cmd/complete
- F1 gNB CU configuration update
- F1 Reset (handled at DU only, full reset only)
- Interface with RRC
- Interface with GTP-u (tunnel creation/handling for F1-U interface)
- One CU(-CP) can handle multiple DUs
......
......@@ -23,6 +23,10 @@
/* To setup F1 at DU */
MESSAGE_DEF(F1AP_DU_REGISTER_REQ, MESSAGE_PRIORITY_MED, f1ap_du_register_req_t, f1ap_du_register_req)
/* RESET */
MESSAGE_DEF(F1AP_RESET, MESSAGE_PRIORITY_MED, f1ap_reset_t, f1ap_reset)
MESSAGE_DEF(F1AP_RESET_ACK, MESSAGE_PRIORITY_MED, f1ap_reset_ack_t, f1ap_reset_ack)
/* eNB_DU application layer -> F1AP messages or CU F1AP -> RRC*/
MESSAGE_DEF(F1AP_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_setup_req_t , f1ap_setup_req)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_acknowledge_t , f1ap_gnb_cu_configuration_update_acknowledge)
......
......@@ -34,6 +34,9 @@
#define F1AP_DU_REGISTER_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_du_register_req
#define F1AP_RESET(mSGpTR) (mSGpTR)->ittiMsg.f1ap_reset
#define F1AP_RESET_ACK(mSGpTR) (mSGpTR)->ittiMsg.f1ap_reset_ack
#define F1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_req
#define F1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_resp
#define F1AP_GNB_CU_CONFIGURATION_UPDATE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update
......@@ -78,6 +81,8 @@
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
#define F1AP_MAX_NO_UE_ID 1024
#define F1AP_MAX_NO_OF_INDIVIDUAL_CONNECTIONS_TO_RESET 65536
typedef net_ip_address_t f1ap_net_ip_address_t;
typedef struct f1ap_net_config_t {
......@@ -534,4 +539,29 @@ typedef struct f1ap_lost_connection_t {
int dummy;
} f1ap_lost_connection_t;
typedef enum F1AP_ResetType_e {
F1AP_RESET_ALL,
F1AP_RESET_PART_OF_F1_INTERFACE
} f1ap_ResetType_t;
typedef struct f1ap_reset_t {
uint64_t transaction_id;
f1ap_Cause_t cause;
long cause_value;
f1ap_ResetType_t reset_type;
struct {
uint32_t gNB_CU_ue_id;
uint32_t gNB_DU_ue_id;
} ue_to_reset[F1AP_MAX_NO_OF_INDIVIDUAL_CONNECTIONS_TO_RESET];
} f1ap_reset_t;
typedef struct f1ap_reset_ack_t {
uint64_t transaction_id;
struct {
uint32_t gNB_CU_ue_id;
uint32_t gNB_DU_ue_id;
} ue_to_reset[F1AP_MAX_NO_OF_INDIVIDUAL_CONNECTIONS_TO_RESET];
uint16_t criticality_diagnostics;
} f1ap_reset_ack_t;
#endif /* F1AP_MESSAGES_TYPES_H_ */
......@@ -35,12 +35,12 @@
#include "f1ap_itti_messaging.h"
#include "f1ap_cu_interface_management.h"
int CU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset)
int CU_send_RESET(sctp_assoc_t assoc_id, const f1ap_reset_t *reset)
{
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu)
int CU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu)
{
AssertFatal(1==0,"Not implemented yet\n");
}
......@@ -50,7 +50,7 @@ int CU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream,
AssertFatal(1==0,"Not implemented yet\n");
}
int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge)
int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack)
{
AssertFatal(1==0,"Not implemented yet\n");
}
......
......@@ -36,10 +36,10 @@
/*
* Reset
*/
int CU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset);
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_RESET(sctp_assoc_t assoc_id, const f1ap_reset_t *reset);
int CU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge);
int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack);
/*
* Error Indication
......
......@@ -160,6 +160,10 @@ void *F1AP_CU_task(void *arg) {
&received_msg->ittiMsg.sctp_data_ind);
break;
case F1AP_RESET_ACK:
CU_send_RESET_ACKNOWLEDGE(assoc_id, &F1AP_RESET_ACK(received_msg));
break;
case F1AP_SETUP_RESP: // from rrc
CU_send_F1_SETUP_RESPONSE(assoc_id,
&F1AP_SETUP_RESP(received_msg));
......
......@@ -52,14 +52,115 @@ int to_NRNRB(int nrb) {
int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu)
{
AssertFatal(1==0,"Not implemented yet\n");
LOG_D(F1AP, "DU_handle_RESET\n");\
F1AP_Reset_t *container;
F1AP_ResetIEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage->value.choice.Reset;
/* Reset == Non UE-related procedure -> stream 0 */
if (stream != 0) {
LOG_W(F1AP, "[SCTP %d] Received Reset on stream != 0 (%d)\n",
assoc_id, stream);
}
MessageDef *msg_p = itti_alloc_new_message(TASK_DU_F1, 0, F1AP_RESET);
msg_p->ittiMsgHeader.originInstance = assoc_id;
f1ap_reset_t *f1ap_reset = &F1AP_RESET(msg_p);
/* Transaction ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ResetIEs_t, ie, container, F1AP_ProtocolIE_ID_id_TransactionID, true);
f1ap_reset->transaction_id = ie->value.choice.TransactionID;
LOG_D(F1AP, "req->transaction_id %lu \n", f1ap_reset->transaction_id);
/* Cause */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ResetIEs_t, ie, container, F1AP_ProtocolIE_ID_id_Cause, true);
switch(ie->value.choice.Cause.present)
{
case F1AP_Cause_PR_radioNetwork:
LOG_D(F1AP, "Cause: Radio Network\n");
f1ap_reset->cause = F1AP_CAUSE_RADIO_NETWORK;
f1ap_reset->cause_value = ie->value.choice.Cause.choice.radioNetwork;
break;
case F1AP_Cause_PR_transport:
LOG_D(F1AP, "Cause: Transport\n");
f1ap_reset->cause = F1AP_CAUSE_TRANSPORT;
f1ap_reset->cause_value = ie->value.choice.Cause.choice.transport;
break;
case F1AP_Cause_PR_protocol:
LOG_D(F1AP, "Cause: Protocol\n");
f1ap_reset->cause = F1AP_CAUSE_PROTOCOL;
f1ap_reset->cause_value = ie->value.choice.Cause.choice.protocol;
break;
case F1AP_Cause_PR_misc:
LOG_D(F1AP, "Cause: Misc\n");
f1ap_reset->cause = F1AP_CAUSE_MISC;
f1ap_reset->cause_value = ie->value.choice.Cause.choice.misc;
break;
default:
AssertFatal(1==0,"Unknown cause\n");
}
/* ResetType */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_ResetIEs_t, ie, container, F1AP_ProtocolIE_ID_id_ResetType, true);
switch(ie->value.choice.ResetType.present) {
case F1AP_ResetType_PR_f1_Interface:
LOG_D(F1AP, "ResetType: F1 Interface\n");
f1ap_reset->reset_type = F1AP_RESET_ALL;
break;
case F1AP_ResetType_PR_partOfF1_Interface:
LOG_D(F1AP, "ResetType: Part of F1 Interface\n");
f1ap_reset->reset_type = F1AP_RESET_PART_OF_F1_INTERFACE;
break;
default:
AssertFatal(1==0,"Unknown reset type\n");
}
/* Part of F1 Interface */
if (f1ap_reset->reset_type == F1AP_RESET_PART_OF_F1_INTERFACE) {
AssertFatal(1==0, "Not implemented yet\n");
}
f1_reset_cu_initiated(f1ap_reset);
return 0;
}
int DU_send_RESET_ACKKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n");
int DU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack)
{
F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer;
uint32_t len;
/* Create */
/* 0. pdu Type */
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
asn1cCalloc(pdu.choice.successfulOutcome, successMsg);
successMsg->procedureCode = F1AP_ProcedureCode_id_Reset;
successMsg->criticality = F1AP_Criticality_reject;
successMsg->value.present = F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge;
F1AP_ResetAcknowledge_t *f1ResetAcknowledge = &successMsg->value.choice.ResetAcknowledge;
/* mandatory */
/* c1. Transaction ID (integer value) */
asn1cSequenceAdd(f1ResetAcknowledge->protocolIEs.list, F1AP_ResetAcknowledgeIEs_t, ieC1);
ieC1->id = F1AP_ProtocolIE_ID_id_TransactionID;
ieC1->criticality = F1AP_Criticality_reject;
ieC1->value.present = F1AP_ResetAcknowledgeIEs__value_PR_TransactionID;
ieC1->value.choice.TransactionID = ack->transaction_id;
/* TODO: (Optional) partialF1Interface, criticality diagnostics */
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1ResetAcknowledge\n");
return -1;
}
/* send */
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0;
}
int DU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset)
int DU_send_RESET(sctp_assoc_t assoc_id, const f1ap_reset_t *reset)
{
AssertFatal(1==0,"Not implemented yet\n");
}
......@@ -223,6 +324,8 @@ static F1AP_GNB_DU_System_Information_t *encode_system_info(const f1ap_gnb_du_sy
// SETUP REQUEST
int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, const f1ap_setup_req_t *setup_req)
{
LOG_D(F1AP, "DU_send_F1_SETUP_REQUEST\n");
F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer;
uint32_t len;
......
......@@ -37,8 +37,8 @@
* Reset
*/
int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_RESET_ACKKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge);
int DU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset);
int DU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack);
int DU_send_RESET(sctp_assoc_t assoc_id, const f1ap_reset_t *reset);
int DU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
/*
......
......@@ -134,6 +134,10 @@ void *F1AP_DU_task(void *arg) {
DUuniqInstance = gtpInst;
} break;
case F1AP_RESET_ACK:
DU_send_RESET_ACKNOWLEDGE(assoc_id, &F1AP_RESET_ACK(msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(assoc_id,
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg));
......
......@@ -42,7 +42,10 @@
/* Handlers matrix. Only f1 related procedure present here */
static const f1ap_message_processing_t f1ap_messages_processing[][3] = {
{0, 0, 0}, /* Reset */
// TODO: How to handle RESET if CU/DU has their respective handlers?
// We need to check node type and call the right handler.
{DU_handle_RESET, CU_handle_RESET_ACKNOWLEDGE, 0}, /* Reset */
// {CU_handle_RESET, DU_handle_RESET_ACKNOWLEDGE, 0}, /* Reset */
{CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE}, /* F1Setup */
{0, 0, 0}, /* ErrorIndication */
{CU_handle_gNB_DU_CONFIGURATION_UPDATE, 0, 0}, /* gNBDUConfigurationUpdate */
......
......@@ -2190,6 +2190,7 @@ void nr_schedule_RA(module_id_t module_idP,
if (ra->contention_resolution_timer < 0) {
LOG_W(NR_MAC, "(%d.%d) RA Contention Resolution timer expired for UE 0x%04x, RA procedure failed...\n", frameP, slotP, ra->rnti);
nr_mac_release_ue(mac, ra->rnti);
nr_mac_trigger_release_complete(mac, ra->rnti);
nr_clear_ra_proc(ra);
continue;
}
......
......@@ -3013,32 +3013,36 @@ int nr_mac_enable_ue_rrc_processing_timer(gNB_MAC_INST *mac, NR_UE_info_t *UE, b
return 0;
}
void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti)
void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti)
{
NR_SCHED_ENSURE_LOCKED(&mac->sched_lock);
nr_rlc_remove_ue(rnti);
mac_remove_nr_ue(mac, rnti);
// the CU might not know such UE, e.g., because we never sent a message to
// it, so there might not be a corresponding entry for such UE in the look up
// table. This can happen, e.g., on Msg.3 with C-RNTI, where we create a UE
// MAC context, decode the PDU, find the C-RNTI MAC CE, and then throw the
// newly created context away. See also in _nr_rx_sdu() and commit 93f59a3c6e56f
if (du_exists_f1_ue_data(rnti)) {
// unlock the scheduler temporarily to prevent possible deadlocks with
// du_remove_f1_ue_data() (and also while sending the message to RRC)
NR_SCHED_UNLOCK(&mac->sched_lock);
f1_ue_data_t ue_data = du_get_f1_ue_data(rnti);
f1ap_ue_context_release_complete_t complete = {
.gNB_CU_ue_id = ue_data.secondary_ue,
.gNB_DU_ue_id = rnti,
};
mac->mac_rrc.ue_context_release_complete(&complete);
if (!du_exists_f1_ue_data(rnti))
return;
du_remove_f1_ue_data(rnti);
NR_SCHED_LOCK(&mac->sched_lock);
}
// unlock the scheduler temporarily to prevent possible deadlocks with
// du_remove_f1_ue_data() (and also while sending the message to RRC)
NR_SCHED_UNLOCK(&mac->sched_lock);
f1_ue_data_t ue_data = du_get_f1_ue_data(rnti);
f1ap_ue_context_release_complete_t complete = {
.gNB_CU_ue_id = ue_data.secondary_ue,
.gNB_DU_ue_id = rnti,
};
mac->mac_rrc.ue_context_release_complete(&complete);
du_remove_f1_ue_data(rnti);
NR_SCHED_LOCK(&mac->sched_lock);
}
void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti)
{
NR_SCHED_ENSURE_LOCKED(&mac->sched_lock);
nr_rlc_remove_ue(rnti);
mac_remove_nr_ue(mac, rnti);
}
void nr_mac_update_timers(module_id_t module_id,
......@@ -3055,6 +3059,8 @@ void nr_mac_update_timers(module_id_t module_id,
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
if (nr_mac_check_release(sched_ctrl, UE->rnti)) {
// trigger release first as nr_mac_release_ue() invalidates UE ptr
nr_mac_trigger_release_complete(mac, UE->rnti);
nr_mac_release_ue(mac, UE->rnti);
// go back to examine the next UE, which is at the position the
// current UE was
......
......@@ -438,6 +438,7 @@ void abort_nr_dl_harq(NR_UE_info_t* UE, int8_t harq_pid);
void nr_mac_trigger_release_timer(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing);
bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti);
void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti);
void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti);
void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing);
......
......@@ -29,6 +29,8 @@
#include "openair3/ocp-gtpu/gtp_itf.h"
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
#include "executables/softmodem-common.h"
#include "uper_decoder.h"
#include "uper_encoder.h"
......@@ -95,6 +97,52 @@ static bool check_plmn_identity(const f1ap_plmn_t *check_plmn, const f1ap_plmn_t
return plmn->mcc == check_plmn->mcc && plmn->mnc_digit_length == check_plmn->mnc_digit_length && plmn->mnc == check_plmn->mnc;
}
static void du_clear_all_ue_states()
{
gNB_MAC_INST *mac = RC.nrmac[0];
NR_SCHED_LOCK(&mac->sched_lock);
NR_UE_info_t *UE = *mac->UE_info.list;
instance_t f1inst = get_f1_gtp_instance();
while (UE != NULL) {
int rnti = UE->rnti;
nr_mac_release_ue(mac, rnti);
// free all F1 contexts
if (du_exists_f1_ue_data(rnti))
du_remove_f1_ue_data(rnti);
newGtpuDeleteAllTunnels(f1inst, rnti);
UE = *mac->UE_info.list;
}
NR_SCHED_UNLOCK(&mac->sched_lock);
}
void f1_reset_cu_initiated(const f1ap_reset_t *reset)
{
LOG_I(MAC, "F1 Reset initiated by CU\n");
f1ap_reset_ack_t ack = {0};
if(reset->reset_type == F1AP_RESET_ALL) {
du_clear_all_ue_states();
ack = (f1ap_reset_ack_t) {
.transaction_id = reset->transaction_id
};
} else {
// reset->reset_type == F1AP_RESET_PART_OF_F1_INTERFACE
AssertFatal(1==0, "Not implemented yet\n");
}
gNB_MAC_INST *mac = RC.nrmac[0];
mac->mac_rrc.f1_reset_acknowledge(&ack);
}
void f1_reset_acknowledge_du_initiated(const f1ap_reset_ack_t *ack)
{
(void) ack;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
void f1_setup_response(const f1ap_setup_resp_t *resp)
{
LOG_I(MAC, "received F1 Setup Response from CU %s\n", resp->gNB_CU_name);
......@@ -126,6 +174,24 @@ void f1_setup_response(const f1ap_setup_resp_t *resp)
mac->f1_config.setup_resp->gNB_CU_name = strdup(resp->gNB_CU_name);
NR_SCHED_UNLOCK(&mac->sched_lock);
// NOTE: Before accepting any UEs, we should initialize the UE states.
// This is to handle cases when DU loses the existing SCTP connection,
// and reestablishes a new connection to either a new CU or the same CU.
// This triggers a new F1 Setup Request from DU to CU as per the specs.
// Reinitializing the UE states is necessary to avoid any inconsistent states
// between DU and CU.
// NOTE2: do not reset in phy_test, because there is a pre-configured UE in
// this case. Once NSA/phy-test use F1, this might be lifted, because
// creation of a UE will be requested from higher layers.
// TS38.473 [Sec 8.2.3.1]: "This procedure also re-initialises the F1AP UE-related
// contexts (if any) and erases all related signalling connections
// in the two nodes like a Reset procedure would do."
if (!get_softmodem_params()->phy_test) {
LOG_I(MAC, "Clearing the DU's UE states before, if any.\n");
du_clear_all_ue_states();
}
}
void f1_setup_failure(const f1ap_setup_failure_t *failure)
......@@ -615,6 +681,7 @@ void ue_context_release_command(const f1ap_ue_context_release_cmd_t *cmd)
if (UE->UE_sched_ctrl.ul_failure || cmd->rrc_container_length == 0) {
/* The UE is already not connected anymore or we have nothing to forward*/
nr_mac_release_ue(mac, cmd->gNB_DU_ue_id);
nr_mac_trigger_release_complete(mac, cmd->gNB_DU_ue_id);
} else {
/* UE is in sync: forward release message and mark to be deleted
* after UL failure */
......
......@@ -26,6 +26,8 @@
#include "f1ap_messages_types.h"
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
void f1_reset_cu_initiated(const f1ap_reset_t *reset);
void f1_reset_acknowledge_du_initiated(const f1ap_reset_ack_t *ack);
void f1_setup_response(const f1ap_setup_resp_t *resp);
void f1_setup_failure(const f1ap_setup_failure_t *failure);
void gnb_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration_update_acknowledge_t *ack);
......
......@@ -25,6 +25,9 @@
#include "common/platform_types.h"
#include "f1ap_messages_types.h"
typedef void (*f1_reset_du_initiated_func_t)(const f1ap_reset_t *reset);
typedef void (*f1_reset_acknowledge_cu_initiated_func_t)(const f1ap_reset_ack_t *ack);
typedef void (*f1_setup_request_func_t)(const f1ap_setup_req_t* req);
typedef void (*gnb_du_configuration_update_t)(const f1ap_gnb_du_configuration_update_t *upd);
......
......@@ -24,6 +24,18 @@
#include "mac_rrc_ul.h"
static void f1_reset_du_initiated_direct(const f1ap_reset_t *reset)
{
(void) reset;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_reset_acknowledge_cu_initiated_direct(const f1ap_reset_ack_t *ack)
{
(void) ack;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_setup_request_direct(const f1ap_setup_req_t *req)
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_SETUP_REQ);
......@@ -284,6 +296,8 @@ static void initial_ul_rrc_message_transfer_direct(module_id_t module_id, const
void mac_rrc_ul_direct_init(struct nr_mac_rrc_ul_if_s *mac_rrc)
{
mac_rrc->f1_reset = f1_reset_du_initiated_direct;
mac_rrc->f1_reset_acknowledge = f1_reset_acknowledge_cu_initiated_direct;
mac_rrc->f1_setup_request = f1_setup_request_direct;
mac_rrc->gnb_du_configuration_update = gnb_du_configuration_update_direct;
mac_rrc->ue_context_setup_response = ue_context_setup_response_direct;
......
......@@ -53,6 +53,19 @@ static f1ap_net_config_t read_DU_IP_config(const eth_params_t* f1_params, const
return nc;
}
static void f1_reset_du_initiated_f1ap(const f1ap_reset_t *reset)
{
(void) reset;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_reset_acknowledge_cu_initiated_f1ap(const f1ap_reset_ack_t *ack)
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_RESET_ACK);
f1ap_reset_ack_t *f1ap_msg = &F1AP_RESET_ACK(msg);
*f1ap_msg = *ack;
itti_send_msg_to_task(TASK_DU_F1, 0, msg);
}
static void f1_setup_request_f1ap(const f1ap_setup_req_t *req)
{
......@@ -275,6 +288,8 @@ static void initial_ul_rrc_message_transfer_f1ap(module_id_t module_id, const f1
void mac_rrc_ul_f1ap_init(struct nr_mac_rrc_ul_if_s *mac_rrc)
{
mac_rrc->f1_reset = f1_reset_du_initiated_f1ap;
mac_rrc->f1_reset_acknowledge = f1_reset_acknowledge_cu_initiated_f1ap;
mac_rrc->f1_setup_request = f1_setup_request_f1ap;
mac_rrc->gnb_du_configuration_update = gnb_du_configuration_update_f1ap;
mac_rrc->ue_context_setup_response = ue_context_setup_response_f1ap;
......
......@@ -690,6 +690,8 @@ typedef struct NR_bler_options {
} NR_bler_options_t;
typedef struct nr_mac_rrc_ul_if_s {
f1_reset_du_initiated_func_t f1_reset;
f1_reset_acknowledge_cu_initiated_func_t f1_reset_acknowledge;
f1_setup_request_func_t f1_setup_request;
gnb_du_configuration_update_t gnb_du_configuration_update;
ue_context_setup_response_func_t ue_context_setup_response;
......
......@@ -25,6 +25,9 @@
#include "common/platform_types.h"
#include "f1ap_messages_types.h"
typedef void (*f1_reset_cu_initiated_func_t)(sctp_assoc_t assoc_id, const f1ap_reset_t *reset);
typedef void (*f1_reset_acknowledge_du_initiated_func_t)(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack);
typedef void (*f1_setup_response_func_t)(sctp_assoc_t assoc_id, const f1ap_setup_resp_t *resp);
typedef void (*f1_setup_failure_func_t)(sctp_assoc_t assoc_id, const f1ap_setup_failure_t *fail);
typedef void (*gnb_du_configuration_update_ack_func_t)(sctp_assoc_t assoc_id,
......
......@@ -24,6 +24,18 @@
#include "mac_rrc_dl.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h"
static void f1_reset_cu_initiated_direct(sctp_assoc_t assoc_id, const f1ap_reset_t *reset)
{
(void)reset;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_reset_acknowledge_du_initiated_direct(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack)
{
(void)ack;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_setup_response_direct(sctp_assoc_t assoc_id, const f1ap_setup_resp_t *resp)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
......@@ -80,6 +92,8 @@ static void dl_rrc_message_transfer_direct(sctp_assoc_t assoc_id, const f1ap_dl_
void mac_rrc_dl_direct_init(nr_mac_rrc_dl_if_t *mac_rrc)
{
mac_rrc->f1_reset = f1_reset_cu_initiated_direct;
mac_rrc->f1_reset_acknowledge = f1_reset_acknowledge_du_initiated_direct;
mac_rrc->f1_setup_response = f1_setup_response_direct;
mac_rrc->f1_setup_failure = f1_setup_failure_direct;
mac_rrc->gnb_du_configuration_update_acknowledge = gnb_du_configuration_update_ack_direct;
......
......@@ -24,6 +24,18 @@
#include "mac_rrc_dl.h"
#include "nr_rrc_defs.h"
static void f1_reset_cu_initiated_f1ap(sctp_assoc_t assoc_id, const f1ap_reset_t *reset)
{
(void)reset;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_reset_acknowledge_du_initiated_f1ap(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack)
{
(void)ack;
AssertFatal(false, "%s() not implemented yet\n", __func__);
}
static void f1_setup_response_f1ap(sctp_assoc_t assoc_id, const f1ap_setup_resp_t *resp)
{
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_SETUP_RESP);
......@@ -215,6 +227,8 @@ static void dl_rrc_message_transfer_f1ap(sctp_assoc_t assoc_id, const f1ap_dl_rr
void mac_rrc_dl_f1ap_init(nr_mac_rrc_dl_if_t *mac_rrc)
{
mac_rrc->f1_reset = f1_reset_cu_initiated_f1ap;
mac_rrc->f1_reset_acknowledge = f1_reset_acknowledge_du_initiated_f1ap;
mac_rrc->f1_setup_response = f1_setup_response_f1ap;
mac_rrc->f1_setup_failure = f1_setup_failure_f1ap;
mac_rrc->gnb_du_configuration_update_acknowledge = gnb_du_configuration_update_ack_f1ap;
......
......@@ -398,6 +398,8 @@ typedef struct neighbour_cell_configuration_s {
} neighbour_cell_configuration_t;
typedef struct nr_mac_rrc_dl_if_s {
f1_reset_cu_initiated_func_t f1_reset;
f1_reset_acknowledge_du_initiated_func_t f1_reset_acknowledge;
f1_setup_response_func_t f1_setup_response;
f1_setup_failure_func_t f1_setup_failure;
gnb_du_configuration_update_ack_func_t gnb_du_configuration_update_acknowledge;
......
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