Commit 666aee7f authored by Raymond Knopp's avatar Raymond Knopp

addition of GNB-CU-Configuration-Update/Update-Acknowledge/Update-Failure

parent 1e8a23f5
......@@ -24,10 +24,13 @@ MESSAGE_DEF(F1AP_CU_SCTP_REQ , MESSAGE_PRIORITY_MED, f1ap_cu_setup_req_t
/* 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)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_failure_t , f1ap_gnb_cu_configuration_update_failure)
/* F1AP -> eNB_DU or eNB_CU_RRC -> F1AP application layer messages */
MESSAGE_DEF(F1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, f1ap_setup_resp_t , f1ap_setup_resp)
MESSAGE_DEF(F1AP_SETUP_FAILURE , MESSAGE_PRIORITY_MED, f1ap_setup_failure_t , f1ap_setup_failure)
MESSAGE_DEF(F1AP_GNB_CU_CONFIGURATION_UPDATE , MESSAGE_PRIORITY_MED, f1ap_gnb_cu_configuration_update_t , f1ap_gnb_cu_configuration_update)
/* MAC -> F1AP messages */
MESSAGE_DEF(F1AP_INITIAL_UL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_initial_ul_rrc_message_t , f1ap_initial_ul_rrc_message)
......
......@@ -31,6 +31,9 @@
#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
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_acknowledge
#define F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_gnb_cu_configuration_update_failure
#define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
......@@ -55,6 +58,8 @@
// Note this should be 512 from maxval in 38.473
#define F1AP_MAX_NB_CELLS 2
#define F1AP_MAX_NO_OF_TNL_ASSOCIATIONS 32
#define F1AP_MAX_NO_UE_ID 1024
typedef struct f1ap_net_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
......@@ -174,6 +179,24 @@ typedef struct f1ap_setup_req_s {
} f1ap_setup_req_t;
typedef struct served_cells_to_activate_s {
/// mcc of DU cells
uint16_t mcc;
/// mnc of DU cells
uint16_t mnc;
/// mnc digit length of DU cells
uint8_t mnc_digit_length;
// NR Global Cell Id
uint64_t nr_cellid;
/// NRPCI
uint16_t nrpci;
/// num SI messages per DU cell
uint8_t num_SI;
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[21];
int SI_container_length[21];
} served_cells_to_activate_t;
typedef struct f1ap_setup_resp_s {
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
......@@ -189,29 +212,62 @@ typedef struct f1ap_setup_resp_s {
char *gNB_CU_name;
/// number of DU cells to activate
uint16_t num_cells_to_activate; //0< num_cells_to_activate <= 512;
/// mcc of DU cells
uint16_t mcc[F1AP_MAX_NB_CELLS];
/// mnc of DU cells
uint16_t mnc[F1AP_MAX_NB_CELLS];
/// mnc digit length of DU cells
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
// NR Global Cell Id
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
/// NRPCI
uint16_t nrpci[F1AP_MAX_NB_CELLS];
/// num SI messages per DU cell
uint8_t num_SI[F1AP_MAX_NB_CELLS];
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[F1AP_MAX_NB_CELLS][21];
int SI_container_length[F1AP_MAX_NB_CELLS][21];
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
} f1ap_setup_resp_t;
typedef struct f1ap_gnb_cu_configuration_update_s {
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
/* SCTP association id */
int32_t assoc_id;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
/// string holding gNB_CU_name
char *gNB_CU_name;
/// number of DU cells to activate
uint16_t num_cells_to_activate; //0< num_cells_to_activate/mod <= 512;
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
} f1ap_gnb_cu_configuration_update_t;
typedef struct f1ap_setup_failure_s {
uint16_t cause;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
} f1ap_setup_failure_t;
typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
uint16_t num_cells_failed_to_be_activated;
uint16_t mcc[F1AP_MAX_NB_CELLS];
uint16_t mnc[F1AP_MAX_NB_CELLS];
uint8_t mnc_digit_length[F1AP_MAX_NB_CELLS];
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
uint16_t cause[F1AP_MAX_NB_CELLS];
int have_criticality;
uint16_t criticality_diagnostics;
uint16_t noofTNLAssociations_to_setup;
uint16_t have_port[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
in_addr_t tl_address[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
uint16_t noofTNLAssociations_failed;
in_addr_t tl_address_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
uint16_t cause_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
uint16_t noofDedicatedSIDeliveryNeededUEs;
uint32_t gNB_CU_ue_id[F1AP_MAX_NO_UE_ID];
uint16_t ue_mcc[F1AP_MAX_NO_UE_ID];
uint16_t ue_mnc[F1AP_MAX_NO_UE_ID];
uint8_t ue_mnc_digit_length[F1AP_MAX_NO_UE_ID];
uint64_t ue_nr_cellid[F1AP_MAX_NO_UE_ID];
} f1ap_gnb_cu_configuration_update_acknowledge_t;
typedef struct f1ap_gnb_cu_configuration_update_failure_s {
uint16_t cause;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
} f1ap_gnb_cu_configuration_update_failure_t;
typedef struct f1ap_dl_rrc_message_s {
uint32_t gNB_CU_ue_id;
......
......@@ -3083,21 +3083,21 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
rrc_eNB_carrier_data_t *carrier = &RC.rrc[i]->carrier[0];
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
LOG_I(ENB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n",
j,i,RC.rrc[i]->nr_cellid,resp->nr_cellid[j]);
j,i,RC.rrc[i]->nr_cellid,resp->cells_to_activate[j].nr_cellid);
if (RC.rrc[i]->nr_cellid == resp->nr_cellid[j] &&
(check_plmn_identity(carrier, resp->mcc[j], resp->mnc[j], resp->mnc_digit_length[j])>0 &&
resp->nrpci[j] == carrier->physCellId)) {
if (RC.rrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
(check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
for (si_ind=0; si_ind<resp->num_SI[j]; si_ind++) {
for (si_ind=0; si_ind<resp->cells_to_activate[j].num_SI; si_ind++) {
//printf("SI %d size %d: ", si_ind, resp->SI_container_length[j][si_ind]);
//for (int n=0;n<resp->SI_container_length[j][si_ind];n++)
// printf("%02x ",resp->SI_container[j][si_ind][n]);
//printf("\n");
extract_and_decode_SI(i,
si_ind,
resp->SI_container[j][si_ind],
resp->SI_container_length[j][si_ind]);
resp->cells_to_activate[j].SI_container[si_ind],
resp->cells_to_activate[j].SI_container_length[si_ind]);
}
// perform MAC/L1 common configuration
......
......@@ -85,8 +85,7 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
/*
* gNB-CU Configuration Update
*/
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_idP);
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
......
......@@ -172,6 +172,14 @@ void *F1AP_CU_task(void *arg) {
&F1AP_SETUP_RESP(received_msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_GNB_CU_CONFIGURAITON_UPDATE\n");
// CU_send_f1setup_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
// &F1AP_SETUP_RESP(received_msg));
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
break;
case F1AP_DL_RRC_MESSAGE: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_DL_RRC_MESSAGE\n");
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
......
......@@ -49,6 +49,11 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu)
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_F1Setup\n", __func__);
break;
case F1AP_ProcedureCode_id_gNBCUConfigurationUpdate:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_gNBCUConfigurationUpdate\n", __func__);
break;
case F1AP_ProcedureCode_id_InitialULRRCMessageTransfer:
//res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_InitialULRRCMessageTransfer\n", __func__);
......@@ -152,7 +157,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
0,
0);
if (asn1_decoder_xer_print) {
if (1 /*asn1_decoder_xer_print*/) {
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
......@@ -160,7 +165,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
//LOG_I(F1AP, "f1ap_decode_pdu.dec_ret.code = %d\n", dec_ret.code);
if (dec_ret.code != RC_OK) {
LOG_E(F1AP, "Failed to decode pdu\n");
AssertFatal(1==0,"Failed to decode pdu\n");
return -1;
}
......
......@@ -98,10 +98,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
F1AP_GNBCUConfigurationUpdateFailure_t *GNBCUConfigurationUpdateFailure);
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
F1AP_GNBCUConfigurationUpdateAcknowledge_t *GNBCUConfigurationUpdateAcknowledge);
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
/*
......
......@@ -159,6 +159,14 @@ void *F1AP_DU_task(void *arg) {
du_task_send_sctp_association_req(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_SETUP_REQ(received_msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
break;
case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon
......
......@@ -50,7 +50,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE }, /* F1Setup */
{ 0, 0, 0 }, /* ErrorIndication */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */
{ DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE }, /* gNBCUConfigurationUpdate */
{ DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0 }, /* UEContextRelease */
{ 0, 0, 0 }, /* UEContextModification */
......
......@@ -146,9 +146,10 @@ void *gNB_app_task(void *args_p)
uint32_t registered_gnb = 0;
uint32_t register_gnb_pending;
long gnb_register_retry_timer_id;
int ret=0;
uint32_t gnb_id;
MessageDef *msg_p = NULL;
MessageDef *msg_ack_p = NULL;
const char *msg_name = NULL;
instance_t instance;
int result;
......@@ -254,7 +255,8 @@ void *gNB_app_task(void *args_p)
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_SETUP_RESP(msg_p).gNB_CU_name,F1AP_SETUP_RESP(msg_p).num_cells_to_activate);
gNB_app_handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
if (F1AP_SETUP_RESP(msg_p).num_cells_to_activate > 0)
ret=gNB_app_handle_f1ap_setup_resp(&F1AP_SETUP_RESP(msg_p));
DevAssert(register_gnb_pending > 0);
register_gnb_pending--;
......@@ -291,7 +293,53 @@ void *gNB_app_task(void *args_p)
}
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE:
AssertFatal(NODE_IS_DU(RC.nrrrc[0]->node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n");
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).gNB_CU_name,F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate);
gNB_app_handle_f1ap_gnb_cu_configuration_update(&F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p));
DevAssert(register_gnb_pending > 0);
/* Check if at least gNB is registered with one AMF */
if (registered_gnb == 0 && F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate > 0) {
register_gnb_pending--;
registered_gnb++;
}
else {
AssertFatal(1==0,"Received F1AP_GNB_CU_CONFIGURATION_UPDATE with at least one cell already configured, help !\n");
}
/* Check if all register gNB requests have been processed */
if (register_gnb_pending == 0) {
if (registered_gnb == gnb_nb) {
/* If all gNB cells are registered, start L2L1 task */
MessageDef *msg_init_p;
msg_init_p = itti_alloc_new_message (TASK_GNB_APP, 0, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
} else {
LOG_W(GNB_APP, " %d gNB not associated with a AMF, retrying registration in %d seconds ...\n",
gnb_nb - registered_gnb, GNB_REGISTER_RETRY_DELAY);
/* Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds */
if (timer_setup (GNB_REGISTER_RETRY_DELAY, 0, TASK_GNB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
NULL, &gnb_register_retry_timer_id) < 0) {
LOG_E(GNB_APP, " Can not start gNB register retry timer, use \"sleep\" instead!\n");
sleep(GNB_REGISTER_RETRY_DELAY);
/* Restart the registration process */
registered_gnb = 0;
register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
}
}
}
break;
case NGAP_DEREGISTERED_GNB_IND:
LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
......
......@@ -42,6 +42,7 @@
#include "ngap_gNB.h"
#include "sctp_eNB_task.h"
#include "sctp_default_values.h"
#include "F1AP_CauseRadioNetwork.h"
// #include "SystemInformationBlockType2.h"
// #include "LAYER2/MAC/extern.h"
// #include "LAYER2/MAC/proto.h"
......@@ -1698,9 +1699,11 @@ void configure_gnb_du_mac(int inst) {
);
}
void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
int i, j, si_ind;
LOG_I(GNB_APP, "cells_to_activated %d, RRC instances %d\n",
int ret=0;
LOG_I(GNB_APP, "cells_to_activate %d, RRC instances %d\n",
resp->num_cells_to_activate, RC.nb_nr_inst);
for (j = 0; j < resp->num_cells_to_activate; j++) {
......@@ -1708,27 +1711,85 @@ void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier;
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, resp->nr_cellid %lx\n",
j, i, RC.nrrrc[i]->nr_cellid, resp->nr_cellid[j]);
j, i, RC.nrrrc[i]->nr_cellid, resp->cells_to_activate[j].nr_cellid);
if (RC.nrrrc[i]->nr_cellid == resp->nr_cellid[j] &&
(du_check_plmn_identity(carrier, resp->mcc[j], resp->mnc[j], resp->mnc_digit_length[j])>0 &&
resp->nrpci[j] == carrier->physCellId)) {
if (RC.nrrrc[i]->nr_cellid == resp->cells_to_activate[j].nr_cellid &&
(du_check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
for (si_ind=0; si_ind<resp->num_SI[j]; si_ind++) {
for (si_ind=0; si_ind<resp->cells_to_activate[j].num_SI; si_ind++) {
du_extract_and_decode_SI(i,
si_ind,
resp->SI_container[j][si_ind],
resp->SI_container_length[j][si_ind]);
resp->cells_to_activate[j].SI_container[si_ind],
resp->cells_to_activate[j].SI_container_length[si_ind]);
}
// perform MAC/L1 common configuration
configure_gnb_du_mac(i);
ret++;
} else {
LOG_E(GNB_APP, "F1 Setup Response not matching\n");
}
}
}
return(ret);
}
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update) {
int i, j, si_ind, ret=0;
LOG_I(GNB_APP, "cells_to_activate %d, RRC instances %d\n",
gnb_cu_cfg_update->num_cells_to_activate, RC.nb_nr_inst);
for (j = 0; j < gnb_cu_cfg_update->num_cells_to_activate; j++) {
for (i = 0; i < RC.nb_nr_inst; i++) {
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[i]->carrier;
// identify local index of cell j by nr_cellid, plmn identity and physical cell ID
LOG_I(GNB_APP, "Checking cell %d, rrc inst %d : rrc->nr_cellid %lx, gnb_cu_cfg_updatenr_cellid %lx\n",
j, i, RC.nrrrc[i]->nr_cellid, gnb_cu_cfg_update->cells_to_activate[j].nr_cellid);
if (RC.nrrrc[i]->nr_cellid == gnb_cu_cfg_update->cells_to_activate[j].nr_cellid &&
(du_check_plmn_identity(carrier, gnb_cu_cfg_update->cells_to_activate[j].mcc, gnb_cu_cfg_update->cells_to_activate[j].mnc, gnb_cu_cfg_update->cells_to_activate[j].mnc_digit_length)>0 &&
gnb_cu_cfg_update->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
for (si_ind=0; si_ind<gnb_cu_cfg_update->cells_to_activate[j].num_SI; si_ind++) {
du_extract_and_decode_SI(i,
si_ind,
gnb_cu_cfg_update->cells_to_activate[j].SI_container[si_ind],
gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[si_ind]);
}
// perform MAC/L1 common configuration
configure_gnb_du_mac(i);
ret++;
} else {
LOG_E(GNB_APP, "GNB_CU_CONFIGURATION_UPDATE not matching\n");
}
}
}
MessageDef *msg_ack_p = NULL;
if (ret > 0) {
// generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE);
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).num_cells_failed_to_be_activated = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 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).noofDedicatedSIDeliveryNeededUEs = 0;
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
}
else {
// generate gNB_CU_CONFIGURATION_UPDATE_FAILURE
msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE);
F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(msg_ack_p).cause = F1AP_CauseRadioNetwork_cell_not_available;
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
}
return(ret);
}
void set_node_type(void) {
......
......@@ -107,7 +107,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i);
void gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update);
void nr_read_config_and_init(void);
#endif /* GNB_CONFIG_H_ */
......
......@@ -8563,16 +8563,16 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
}
F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name;
F1AP_SETUP_RESP (msg_p).mcc[cu_cell_ind] = rrc->configuration.mcc[0];
F1AP_SETUP_RESP (msg_p).mnc[cu_cell_ind] = rrc->configuration.mnc[0];
F1AP_SETUP_RESP (msg_p).mnc_digit_length[cu_cell_ind] = rrc->configuration.mnc_digit_length[0];
F1AP_SETUP_RESP (msg_p).nr_cellid[cu_cell_ind] = rrc->nr_cellid;
F1AP_SETUP_RESP (msg_p).nrpci[cu_cell_ind] = f1_setup_req->nr_pci[i];
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mcc = rrc->configuration.mcc[0];
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mnc = rrc->configuration.mnc[0];
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].mnc_digit_length = rrc->configuration.mnc_digit_length[0];
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nr_cellid = rrc->nr_cellid;
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->nr_pci[i];
int num_SI= 0;
if (rrc->carrier[0].SIB23) {
F1AP_SETUP_RESP (msg_p).SI_container[cu_cell_ind][num_SI] = rrc->carrier[0].SIB23;
F1AP_SETUP_RESP (msg_p).SI_container_length[cu_cell_ind][num_SI] = rrc->carrier[0].sizeof_SIB23;
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container[num_SI] = rrc->carrier[0].SIB23;
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].SI_container_length[num_SI] = rrc->carrier[0].sizeof_SIB23;
//printf("SI %d size %d: ", 0, F1AP_SETUP_RESP(msg_p).SI_container_length[j][num_SI]);
//for (int n = 0; n < F1AP_SETUP_RESP(msg_p).SI_container_length[j][num_SI]; n++)
// printf("%02x ", F1AP_SETUP_RESP(msg_p).SI_container[0][num_SI][n]);
......@@ -8580,7 +8580,7 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
num_SI++;
}
F1AP_SETUP_RESP (msg_p).num_SI[cu_cell_ind] = num_SI;
F1AP_SETUP_RESP (msg_p).cells_to_activate[cu_cell_ind].num_SI = num_SI;
cu_cell_ind++;
found_cell=1;
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = cu_cell_ind;
......
......@@ -2353,7 +2353,7 @@ rrc_gNB_decode_dcch(
void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
LOG_I(NR_RRC,"Received F1 Setup Request from gNB_DU %llu (%s)\n",(unsigned long long int)f1_setup_req->gNB_DU_id,f1_setup_req->gNB_DU_name);
int cu_cell_ind = 0;
MessageDef *msg_p = NULL;
MessageDef *msg_p = NULL,*msg_p2=NULL;
for (int i = 0; i < f1_setup_req->num_cells_available; i++) {
int found_cell=0;
......@@ -2406,32 +2406,39 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
"bcch_message->message.choice.c1->present != NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1\n");
rrc->carrier.sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
rrc->carrier.physCellId = f1_setup_req->nr_pci[i];
// prepare F1_SETUP_RESPONSE
if (msg_p == NULL) {
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_SETUP_RESP);
}
F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name;
F1AP_SETUP_RESP (msg_p).mcc[cu_cell_ind] = rrc->configuration.mcc[0];
F1AP_SETUP_RESP (msg_p).mnc[cu_cell_ind] = rrc->configuration.mnc[0];
F1AP_SETUP_RESP (msg_p).mnc_digit_length[cu_cell_ind] = rrc->configuration.mnc_digit_length[0];
F1AP_SETUP_RESP (msg_p).nr_cellid[cu_cell_ind] = rrc->nr_cellid;
F1AP_SETUP_RESP (msg_p).nrpci[cu_cell_ind] = f1_setup_req->nr_pci[i];
if (cu_cell_ind == 0) {
// prepare F1_SETUP_RESPONSE + GNB_CU_CONFIGURATION_UPDATE
if (msg_p == NULL) {
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_SETUP_RESP);
}
if (msg_p2 == NULL) {
msg_p2 = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE);
}
F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name;
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = 0;
}
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).gNB_CU_name = rrc->node_name;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mcc = rrc->configuration.mcc[0];
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mnc = rrc->configuration.mnc[0];
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].mnc_digit_length = rrc->configuration.mnc_digit_length[0];
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nr_cellid = rrc->nr_cellid;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].nrpci = f1_setup_req->nr_pci[i];
int num_SI= 0;
if (rrc->carrier.SIB23) {
F1AP_SETUP_RESP (msg_p).SI_container[cu_cell_ind][2] = rrc->carrier.SIB23;
F1AP_SETUP_RESP (msg_p).SI_container_length[cu_cell_ind][2] = rrc->carrier.sizeof_SIB23;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].SI_container[2] = rrc->carrier.SIB23;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].SI_container_length[2] = rrc->carrier.sizeof_SIB23;
num_SI++;
}
F1AP_SETUP_RESP (msg_p).num_SI[cu_cell_ind] = num_SI;
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).cells_to_activate[cu_cell_ind].num_SI = num_SI;
cu_cell_ind++;
found_cell=1;
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = cu_cell_ind;
// send ITTI message to F1AP-CU task
itti_send_msg_to_task (TASK_CU_F1, GNB_MODULE_ID_TO_INSTANCE(j), msg_p);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p2).num_cells_to_activate = cu_cell_ind;
// send
break;
} else {// setup_req mcc/mnc match rrc internal list element
LOG_W(NR_RRC,"[Inst %d] No matching MCC/MNC: rrc->mcc/f1_setup_req->mcc %d/%d rrc->mnc/f1_setup_req->mnc %d/%d rrc->nr_cellid/f1_setup_req->nr_cellid %ld/%ld \n",
......@@ -2444,6 +2451,13 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
if (found_cell == 0) {
AssertFatal(1 == 0, "No cell found\n");
}
else {
// send ITTI message to F1AP-CU task
itti_send_msg_to_task (TASK_CU_F1, 0, msg_p);
itti_send_msg_to_task (TASK_CU_F1, 0, msg_p2);
}
// handle other failure cases
}//for (int i=0;i<f1_setup_req->num_cells_available;i++)
......
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