Commit e155080e authored by Robert Schmidt's avatar Robert Schmidt

Assoc ID CU->DU

parent a377e523
......@@ -145,7 +145,7 @@ void *F1AP_CU_task(void *arg) {
while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg);
sctp_assoc_t assoc_id = getCxt(0) != NULL ? getCxt(0)->assoc_id : 0;
sctp_assoc_t assoc_id = ITTI_MSG_ORIGIN_INSTANCE(received_msg);
LOG_D(F1AP, "CU Task Received %s for instance %ld: sending SCTP message via assoc_id %d\n",
ITTI_MSG_NAME(received_msg), ITTI_MSG_DESTINATION_INSTANCE(received_msg), assoc_id);
switch (ITTI_MSG_ID(received_msg)) {
......
......@@ -25,16 +25,16 @@
#include "platform_types.h"
#include "f1ap_messages_types.h"
typedef void (*f1_setup_response_func_t)(const f1ap_setup_resp_t *resp);
typedef void (*f1_setup_failure_func_t)(const f1ap_setup_failure_t *fail);
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 (*ue_context_setup_request_func_t)(const f1ap_ue_context_setup_t *req);
typedef void (*ue_context_modification_request_func_t)(const f1ap_ue_context_modif_req_t *req);
typedef void (*ue_context_modification_confirm_func_t)(const f1ap_ue_context_modif_confirm_t *confirm);
typedef void (*ue_context_modification_refuse_func_t)(const f1ap_ue_context_modif_refuse_t *refuse);
typedef void (*ue_context_release_command_func_t)(const f1ap_ue_context_release_cmd_t *cmd);
typedef void (*ue_context_setup_request_func_t)(sctp_assoc_t assoc_id, const f1ap_ue_context_setup_t *req);
typedef void (*ue_context_modification_request_func_t)(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_req_t *req);
typedef void (*ue_context_modification_confirm_func_t)(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_confirm_t *confirm);
typedef void (*ue_context_modification_refuse_func_t)(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_refuse_t *refuse);
typedef void (*ue_context_release_command_func_t)(sctp_assoc_t assoc_id, const f1ap_ue_context_release_cmd_t *cmd);
typedef void (*dl_rrc_message_transfer_func_t)(const f1ap_dl_rrc_message_t *dl_rrc);
typedef void (*dl_rrc_message_transfer_func_t)(sctp_assoc_t assoc_id, const f1ap_dl_rrc_message_t *dl_rrc);
struct nr_mac_rrc_dl_if_s;
void mac_rrc_dl_direct_init(struct nr_mac_rrc_dl_if_s *mac_rrc);
......
......@@ -24,14 +24,62 @@
#include "mac_rrc_dl.h"
#include "openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.h"
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);
f1_setup_response(resp);
}
static void f1_setup_failure_direct(sctp_assoc_t assoc_id, const f1ap_setup_failure_t *fail)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
f1_setup_failure(fail);
}
static void ue_context_setup_request_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_setup_t *req)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
ue_context_setup_request(req);
}
static void ue_context_modification_request_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_req_t *req)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
ue_context_modification_request(req);
}
static void ue_context_modification_confirm_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_confirm_t *confirm)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
ue_context_modification_confirm(confirm);
}
static void ue_context_modification_refuse_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_refuse_t *refuse)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
ue_context_modification_refuse(refuse);
}
static void ue_context_release_command_direct(sctp_assoc_t assoc_id, const f1ap_ue_context_release_cmd_t *cmd)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
ue_context_release_command(cmd);
}
static void dl_rrc_message_transfer_direct(sctp_assoc_t assoc_id, const f1ap_dl_rrc_message_t *dl_rrc)
{
AssertFatal(assoc_id == -1, "illegal assoc_id %d\n", assoc_id);
dl_rrc_message_transfer(dl_rrc);
}
void mac_rrc_dl_direct_init(nr_mac_rrc_dl_if_t *mac_rrc)
{
mac_rrc->f1_setup_response = f1_setup_response;
mac_rrc->f1_setup_failure = f1_setup_failure;
mac_rrc->ue_context_setup_request = ue_context_setup_request;
mac_rrc->ue_context_modification_request = ue_context_modification_request;
mac_rrc->ue_context_modification_confirm = ue_context_modification_confirm;
mac_rrc->ue_context_modification_refuse = ue_context_modification_refuse;
mac_rrc->ue_context_release_command = ue_context_release_command;
mac_rrc->dl_rrc_message_transfer = dl_rrc_message_transfer;
mac_rrc->f1_setup_response = f1_setup_response_direct;
mac_rrc->f1_setup_failure = f1_setup_failure_direct;
mac_rrc->ue_context_setup_request = ue_context_setup_request_direct;
mac_rrc->ue_context_modification_request = ue_context_modification_request_direct;
mac_rrc->ue_context_modification_confirm = ue_context_modification_confirm_direct;
mac_rrc->ue_context_modification_refuse = ue_context_modification_refuse_direct;
mac_rrc->ue_context_release_command = ue_context_release_command_direct;
mac_rrc->dl_rrc_message_transfer = dl_rrc_message_transfer_direct;
}
......@@ -24,9 +24,10 @@
#include "mac_rrc_dl.h"
#include "nr_rrc_defs.h"
static void f1_setup_response_f1ap(const f1ap_setup_resp_t *resp)
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);
msg->ittiMsgHeader.originInstance = assoc_id;
f1ap_setup_resp_t *f1ap_msg = &F1AP_SETUP_RESP(msg);
*f1ap_msg = *resp;
if (resp->gNB_CU_name != NULL)
......@@ -34,17 +35,19 @@ static void f1_setup_response_f1ap(const f1ap_setup_resp_t *resp)
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
static void f1_setup_failure_f1ap(const f1ap_setup_failure_t *fail)
static void f1_setup_failure_f1ap(sctp_assoc_t assoc_id, const f1ap_setup_failure_t *fail)
{
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_SETUP_FAILURE);
msg->ittiMsgHeader.originInstance = assoc_id;
f1ap_setup_failure_t *f1ap_msg = &F1AP_SETUP_FAILURE(msg);
*f1ap_msg = *fail;
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
static void ue_context_setup_request_f1ap(const f1ap_ue_context_setup_t *req)
static void ue_context_setup_request_f1ap(sctp_assoc_t assoc_id, const f1ap_ue_context_setup_t *req)
{
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
msg->ittiMsgHeader.originInstance = assoc_id;
f1ap_ue_context_setup_t *f1ap_msg = &F1AP_UE_CONTEXT_SETUP_REQ(msg);
*f1ap_msg = *req;
AssertFatal(req->cu_to_du_rrc_information == NULL, "cu_to_du_rrc_information not supported yet\n");
......@@ -59,9 +62,10 @@ static void ue_context_setup_request_f1ap(const f1ap_ue_context_setup_t *req)
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
static void ue_context_modification_request_f1ap(const f1ap_ue_context_modif_req_t *req)
static void ue_context_modification_request_f1ap(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_req_t *req)
{
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_REQ);
msg->ittiMsgHeader.originInstance = assoc_id;
f1ap_ue_context_modif_req_t *f1ap_msg = &F1AP_UE_CONTEXT_MODIFICATION_REQ(msg);
*f1ap_msg = *req;
if (req->cu_to_du_rrc_information != NULL) {
......@@ -110,9 +114,10 @@ static void ue_context_modification_request_f1ap(const f1ap_ue_context_modif_req
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
static void ue_context_modification_confirm_f1ap(const f1ap_ue_context_modif_confirm_t *confirm)
static void ue_context_modification_confirm_f1ap(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_confirm_t *confirm)
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_CONFIRM);
msg->ittiMsgHeader.originInstance = assoc_id;
f1ap_ue_context_modif_confirm_t *f1ap_msg = &F1AP_UE_CONTEXT_MODIFICATION_CONFIRM(msg);
f1ap_msg->gNB_CU_ue_id = confirm->gNB_CU_ue_id;
f1ap_msg->gNB_DU_ue_id = confirm->gNB_DU_ue_id;
......@@ -127,17 +132,19 @@ static void ue_context_modification_confirm_f1ap(const f1ap_ue_context_modif_con
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
static void ue_context_modification_refuse_f1ap(const f1ap_ue_context_modif_refuse_t *refuse)
static void ue_context_modification_refuse_f1ap(sctp_assoc_t assoc_id, const f1ap_ue_context_modif_refuse_t *refuse)
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_REFUSE);
msg->ittiMsgHeader.originInstance = assoc_id;
f1ap_ue_context_modif_refuse_t *f1ap_msg = &F1AP_UE_CONTEXT_MODIFICATION_REFUSE(msg);
*f1ap_msg = *refuse;
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
static void ue_context_release_command_f1ap(const f1ap_ue_context_release_cmd_t *cmd)
static void ue_context_release_command_f1ap(sctp_assoc_t assoc_id, const f1ap_ue_context_release_cmd_t *cmd)
{
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_RELEASE_CMD);
message_p->ittiMsgHeader.originInstance = assoc_id;
f1ap_ue_context_release_cmd_t *msg = &F1AP_UE_CONTEXT_RELEASE_CMD(message_p);
*msg = *cmd;
if (cmd->rrc_container_length > 0) {
......@@ -149,11 +156,12 @@ static void ue_context_release_command_f1ap(const f1ap_ue_context_release_cmd_t
itti_send_msg_to_task (TASK_CU_F1, 0, message_p);
}
static void dl_rrc_message_transfer_f1ap(const f1ap_dl_rrc_message_t *dl_rrc)
static void dl_rrc_message_transfer_f1ap(sctp_assoc_t assoc_id, const f1ap_dl_rrc_message_t *dl_rrc)
{
/* TODO call F1AP function directly? no real-time constraint here */
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE);
message_p->ittiMsgHeader.originInstance = assoc_id;
f1ap_dl_rrc_message_t *msg = &F1AP_DL_RRC_MESSAGE(message_p);
*msg = *dl_rrc;
if (dl_rrc->old_gNB_DU_ue_id) {
......
This diff is collapsed.
......@@ -54,13 +54,13 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
const f1ap_setup_req_t *other = rrc->du->setup_req;
LOG_E(NR_RRC, "can only handle one DU, but already serving DU %ld (%s)\n", other->gNB_DU_id, other->gNB_DU_name);
f1ap_setup_failure_t fail = {.cause = F1AP_CauseRadioNetwork_gNB_CU_Cell_Capacity_Exceeded};
rrc->mac_rrc.f1_setup_failure(&fail);
rrc->mac_rrc.f1_setup_failure(assoc_id, &fail);
return;
}
if (req->num_cells_available != 1) {
LOG_E(NR_RRC, "can only handle on DU cell, but gNB_DU %ld has %d\n", req->gNB_DU_id, req->num_cells_available);
f1ap_setup_failure_t fail = {.cause = F1AP_CauseRadioNetwork_gNB_CU_Cell_Capacity_Exceeded};
rrc->mac_rrc.f1_setup_failure(&fail);
rrc->mac_rrc.f1_setup_failure(assoc_id, &fail);
return;
}
f1ap_served_cell_info_t *cell_info = &req->cell[0].info;
......@@ -74,7 +74,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
cell_info->plmn.mnc,
cell_info->nr_cellid);
f1ap_setup_failure_t fail = {.cause = F1AP_CauseRadioNetwork_plmn_not_served_by_the_gNB_CU};
rrc->mac_rrc.f1_setup_failure(&fail);
rrc->mac_rrc.f1_setup_failure(assoc_id, &fail);
return;
}
// if there is no system info or no SIB1 and we run in SA mode, we cannot handle it
......@@ -82,7 +82,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
if (sys_info == NULL || sys_info->mib == NULL || (sys_info->sib1 == NULL && get_softmodem_params()->sa)) {
LOG_E(NR_RRC, "no system information provided by DU, rejecting\n");
f1ap_setup_failure_t fail = {.cause = F1AP_CauseProtocol_semantic_error};
rrc->mac_rrc.f1_setup_failure(&fail);
rrc->mac_rrc.f1_setup_failure(assoc_id, &fail);
return;
}
......@@ -94,7 +94,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
|| mib->message.choice.messageClassExtension == NULL) {
LOG_E(RRC, "Failed to decode NR_BCCH_BCH_MESSAGE (%zu bits) of DU, rejecting DU\n", dec_rval.consumed);
f1ap_setup_failure_t fail = {.cause = F1AP_CauseProtocol_semantic_error};
rrc->mac_rrc.f1_setup_failure(&fail);
rrc->mac_rrc.f1_setup_failure(assoc_id, &fail);
ASN_STRUCT_FREE(asn_DEF_NR_BCCH_BCH_Message, mib);
return;
}
......@@ -105,7 +105,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
if (dec_rval.code != RC_OK) {
LOG_E(RRC, "Failed to decode NR_SIB1 (%zu bits) of DU, rejecting DU\n", dec_rval.consumed);
f1ap_setup_failure_t fail = {.cause = F1AP_CauseProtocol_semantic_error};
rrc->mac_rrc.f1_setup_failure(&fail);
rrc->mac_rrc.f1_setup_failure(assoc_id, &fail);
ASN_STRUCT_FREE(asn_DEF_NR_SIB1, sib1);
return;
}
......@@ -140,7 +140,7 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *req, sctp_assoc_t assoc_id)
f1ap_setup_resp_t resp = {.num_cells_to_activate = 1, .cells_to_activate[0] = cell};
if (rrc->node_name != NULL)
resp.gNB_CU_name = strdup(rrc->node_name);
rrc->mac_rrc.f1_setup_response(&resp);
rrc->mac_rrc.f1_setup_response(assoc_id, &resp);
/*
MessageDef *msg_p2 = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE);
......
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