Commit 14dcc97a authored by Robert Schmidt's avatar Robert Schmidt

gNB-DU config update in DU

parent ef11cac4
...@@ -88,6 +88,12 @@ void f1_setup_failure(const f1ap_setup_failure_t *failure) ...@@ -88,6 +88,12 @@ void f1_setup_failure(const f1ap_setup_failure_t *failure)
exit(1); exit(1);
} }
void gnb_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration_update_acknowledge_t *ack)
{
(void) ack;
LOG_I(MAC, "received gNB-DU configuration update acknowledge\n");
}
static NR_RLC_BearerConfig_t *get_bearerconfig_from_srb(const f1ap_srb_to_be_setup_t *srb) static NR_RLC_BearerConfig_t *get_bearerconfig_from_srb(const f1ap_srb_to_be_setup_t *srb)
{ {
long priority = srb->srb_id; // high priority for SRB long priority = srb->srb_id; // high priority for SRB
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
void f1_setup_response(const f1ap_setup_resp_t *resp); void f1_setup_response(const f1ap_setup_resp_t *resp);
void f1_setup_failure(const f1ap_setup_failure_t *failure); 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);
NR_CellGroupConfig_t *clone_CellGroupConfig(const NR_CellGroupConfig_t *orig); NR_CellGroupConfig_t *clone_CellGroupConfig(const NR_CellGroupConfig_t *orig);
void ue_context_setup_request(const f1ap_ue_context_setup_t *req); void ue_context_setup_request(const f1ap_ue_context_setup_t *req);
void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req); void ue_context_modification_request(const f1ap_ue_context_modif_req_t *req);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "f1ap_messages_types.h" #include "f1ap_messages_types.h"
typedef void (*f1_setup_request_func_t)(const f1ap_setup_req_t* req); 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);
typedef void (*ue_context_setup_response_func_t)(const f1ap_ue_context_setup_t* req, const f1ap_ue_context_setup_t *resp); typedef void (*ue_context_setup_response_func_t)(const f1ap_ue_context_setup_t* req, const f1ap_ue_context_setup_t *resp);
typedef void (*ue_context_modification_response_func_t)(const f1ap_ue_context_modif_req_t *req, typedef void (*ue_context_modification_response_func_t)(const f1ap_ue_context_modif_req_t *req,
......
...@@ -66,6 +66,51 @@ static void f1_setup_request_direct(const f1ap_setup_req_t *req) ...@@ -66,6 +66,51 @@ static void f1_setup_request_direct(const f1ap_setup_req_t *req)
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg); itti_send_msg_to_task(TASK_RRC_GNB, 0, msg);
} }
static void gnb_du_configuration_update_direct(const f1ap_gnb_du_configuration_update_t *upd)
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_GNB_DU_CONFIGURATION_UPDATE);
msg->ittiMsgHeader.originInstance = -1; // means monolithic
f1ap_gnb_du_configuration_update_t *f1ap_msg = &F1AP_GNB_DU_CONFIGURATION_UPDATE(msg);
DevAssert(upd->gNB_DU_ID == NULL);
f1ap_msg->transaction_id = upd->transaction_id;
DevAssert(upd->num_cells_to_add == 0);
DevAssert(upd->num_cells_to_delete == 0);
f1ap_msg->num_cells_to_modify = upd->num_cells_to_modify;
for (int n = 0; n < upd->num_cells_to_modify; ++n) {
f1ap_msg->cell_to_modify[n].old_nr_cellid = upd->cell_to_modify[n].old_nr_cellid;
f1ap_msg->cell_to_modify[n].info = upd->cell_to_modify[n].info; // copy most fields
if (upd->cell_to_modify[n].info.tac) {
f1ap_msg->cell_to_modify[n].info.tac = malloc(sizeof(*f1ap_msg->cell_to_modify[n].info.tac));
AssertFatal(f1ap_msg->cell_to_modify[n].info.tac != NULL, "out of memory\n");
*f1ap_msg->cell_to_modify[n].info.tac = *upd->cell_to_modify[n].info.tac;
}
if (upd->cell_to_modify[n].info.measurement_timing_information)
f1ap_msg->cell_to_modify[n].info.measurement_timing_information = strdup(upd->cell_to_modify[n].info.measurement_timing_information);
if (upd->cell_to_modify[n].sys_info) {
f1ap_gnb_du_system_info_t *orig_sys_info = upd->cell_to_modify[n].sys_info;
f1ap_gnb_du_system_info_t *copy_sys_info = calloc(1, sizeof(*copy_sys_info));
AssertFatal(copy_sys_info != NULL, "out of memory\n");
f1ap_msg->cell_to_modify[n].sys_info = copy_sys_info;
copy_sys_info->mib = calloc(orig_sys_info->mib_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->mib != NULL, "out of memory\n");
memcpy(copy_sys_info->mib, orig_sys_info->mib, orig_sys_info->mib_length);
copy_sys_info->mib_length = orig_sys_info->mib_length;
if (orig_sys_info->sib1_length > 0) {
copy_sys_info->sib1 = calloc(orig_sys_info->sib1_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->sib1 != NULL, "out of memory\n");
memcpy(copy_sys_info->sib1, orig_sys_info->sib1, orig_sys_info->sib1_length);
copy_sys_info->sib1_length = orig_sys_info->sib1_length;
}
}
}
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg);
}
static void ue_context_setup_response_direct(const f1ap_ue_context_setup_t *req, const f1ap_ue_context_setup_t *resp) static void ue_context_setup_response_direct(const f1ap_ue_context_setup_t *req, const f1ap_ue_context_setup_t *resp)
{ {
DevAssert(req->drbs_to_be_setup_length == resp->drbs_to_be_setup_length); DevAssert(req->drbs_to_be_setup_length == resp->drbs_to_be_setup_length);
...@@ -227,6 +272,7 @@ static void initial_ul_rrc_message_transfer_direct(module_id_t module_id, const ...@@ -227,6 +272,7 @@ 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) void mac_rrc_ul_direct_init(struct nr_mac_rrc_ul_if_s *mac_rrc)
{ {
mac_rrc->f1_setup_request = f1_setup_request_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; mac_rrc->ue_context_setup_response = ue_context_setup_response_direct;
mac_rrc->ue_context_modification_response = ue_context_modification_response_direct; mac_rrc->ue_context_modification_response = ue_context_modification_response_direct;
mac_rrc->ue_context_modification_required = ue_context_modification_required_direct; mac_rrc->ue_context_modification_required = ue_context_modification_required_direct;
......
...@@ -100,6 +100,11 @@ static void f1_setup_request_f1ap(const f1ap_setup_req_t *req) ...@@ -100,6 +100,11 @@ static void f1_setup_request_f1ap(const f1ap_setup_req_t *req)
itti_send_msg_to_task(TASK_DU_F1, 0, msg); itti_send_msg_to_task(TASK_DU_F1, 0, msg);
} }
static void gnb_du_configuration_update_f1ap(const f1ap_gnb_du_configuration_update_t *upd)
{
AssertFatal(false, "%s() not implemented\n", __func__);
}
static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, const f1ap_ue_context_setup_t *resp) static void ue_context_setup_response_f1ap(const f1ap_ue_context_setup_t *req, const f1ap_ue_context_setup_t *resp)
{ {
DevAssert(req->drbs_to_be_setup_length == resp->drbs_to_be_setup_length); DevAssert(req->drbs_to_be_setup_length == resp->drbs_to_be_setup_length);
...@@ -239,6 +244,7 @@ static void initial_ul_rrc_message_transfer_f1ap(module_id_t module_id, const f1 ...@@ -239,6 +244,7 @@ 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) void mac_rrc_ul_f1ap_init(struct nr_mac_rrc_ul_if_s *mac_rrc)
{ {
mac_rrc->f1_setup_request = f1_setup_request_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; mac_rrc->ue_context_setup_response = ue_context_setup_response_f1ap;
mac_rrc->ue_context_modification_response = ue_context_modification_response_f1ap; mac_rrc->ue_context_modification_response = ue_context_modification_response_f1ap;
mac_rrc->ue_context_modification_required = ue_context_modification_required_f1ap; mac_rrc->ue_context_modification_required = ue_context_modification_required_f1ap;
......
...@@ -684,6 +684,7 @@ typedef struct NR_bler_options { ...@@ -684,6 +684,7 @@ typedef struct NR_bler_options {
typedef struct nr_mac_rrc_ul_if_s { typedef struct nr_mac_rrc_ul_if_s {
f1_setup_request_func_t f1_setup_request; 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; ue_context_setup_response_func_t ue_context_setup_response;
ue_context_modification_response_func_t ue_context_modification_response; ue_context_modification_response_func_t ue_context_modification_response;
ue_context_modification_required_func_t ue_context_modification_required; ue_context_modification_required_func_t ue_context_modification_required;
......
...@@ -39,7 +39,7 @@ static void f1_setup_failure_direct(sctp_assoc_t assoc_id, const f1ap_setup_fail ...@@ -39,7 +39,7 @@ static void f1_setup_failure_direct(sctp_assoc_t assoc_id, const f1ap_setup_fail
static void gnb_du_configuration_update_ack_direct(sctp_assoc_t assoc_id, const f1ap_gnb_du_configuration_update_acknowledge_t *ack) static void gnb_du_configuration_update_ack_direct(sctp_assoc_t assoc_id, const f1ap_gnb_du_configuration_update_acknowledge_t *ack)
{ {
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id); AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
AssertFatal(false, "%s() not implemented\n", __func__); gnb_du_configuration_update_acknowledge(ack);
} }
static void ue_context_setup_request_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_setup_t *req) static void ue_context_setup_request_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_setup_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