Commit 23a865db authored by Xin Zhe Khooi's avatar Xin Zhe Khooi Committed by Robert Schmidt

Implement DU F1 Reset handlers

parent a92ab368
......@@ -95,10 +95,44 @@ 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)
{
(void) reset;
AssertFatal(false, "%s() not implemented yet\n", __func__);
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)
......
......@@ -61,8 +61,10 @@ static void f1_reset_du_initiated_f1ap(const f1ap_reset_t *reset)
static void f1_reset_acknowledge_cu_initiated_f1ap(const f1ap_reset_ack_t *ack)
{
(void) ack;
AssertFatal(false, "%s() not implemented yet\n", __func__);
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)
......
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