Commit 8d08ab56 authored by Robert Schmidt's avatar Robert Schmidt

also send sys_info

parent 5b5fa7fa
...@@ -594,6 +594,7 @@ int stop_L1L2(module_id_t gnb_id) ...@@ -594,6 +594,7 @@ int stop_L1L2(module_id_t gnb_id)
} }
extern f1ap_tdd_info_t read_tdd_config(const NR_ServingCellConfigCommon_t *scc); extern f1ap_tdd_info_t read_tdd_config(const NR_ServingCellConfigCommon_t *scc);
extern f1ap_gnb_du_system_info_t *get_sys_info(NR_BCCH_BCH_Message_t *mib, const NR_BCCH_DL_SCH_Message_t *sib1);
/* /*
* Restart the nr-softmodem after it has been soft-stopped with stop_L1L2() * Restart the nr-softmodem after it has been soft-stopped with stop_L1L2()
*/ */
...@@ -627,6 +628,9 @@ int start_L1L2(module_id_t gnb_id) ...@@ -627,6 +628,9 @@ int start_L1L2(module_id_t gnb_id)
NR_ServingCellConfigCommon_t *scc = mac->common_channels[0].ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = mac->common_channels[0].ServingCellConfigCommon;
nr_mac_config_scc(mac, scc, &mac->radio_config); nr_mac_config_scc(mac, scc, &mac->radio_config);
NR_BCCH_BCH_Message_t *mib = mac->common_channels[0].mib;
const NR_BCCH_DL_SCH_Message_t *sib1 = mac->common_channels[0].sib1;
/* update existing config in F1 Setup request structures */ /* update existing config in F1 Setup request structures */
f1ap_setup_req_t *sr = mac->f1_config.setup_req; f1ap_setup_req_t *sr = mac->f1_config.setup_req;
DevAssert(sr->num_cells_available == 1); DevAssert(sr->num_cells_available == 1);
...@@ -642,9 +646,10 @@ int start_L1L2(module_id_t gnb_id) ...@@ -642,9 +646,10 @@ int start_L1L2(module_id_t gnb_id)
}; };
update.cell_to_modify[0].old_nr_cellid = info->nr_cellid; update.cell_to_modify[0].old_nr_cellid = info->nr_cellid;
update.cell_to_modify[0].info = *info; update.cell_to_modify[0].info = *info;
update.cell_to_modify[0].sys_info = get_sys_info(mib, sib1);
mac->mac_rrc.gnb_du_configuration_update(&update); mac->mac_rrc.gnb_du_configuration_update(&update);
sleep(2); //sleep(2);
init_NR_RU(config_get_if(), NULL); init_NR_RU(config_get_if(), NULL);
......
...@@ -1142,6 +1142,28 @@ static f1ap_fdd_info_t read_fdd_config(const NR_ServingCellConfigCommon_t *scc) ...@@ -1142,6 +1142,28 @@ static f1ap_fdd_info_t read_fdd_config(const NR_ServingCellConfigCommon_t *scc)
return fdd; return fdd;
} }
f1ap_gnb_du_system_info_t *get_sys_info(NR_BCCH_BCH_Message_t *mib, const NR_BCCH_DL_SCH_Message_t *sib1)
{
int buf_len = 3;
f1ap_gnb_du_system_info_t *sys_info = calloc(1, sizeof(*sys_info));
AssertFatal(sys_info != NULL, "out of memory\n");
sys_info->mib = calloc(buf_len, sizeof(*sys_info->mib));
DevAssert(sys_info->mib != NULL);
DevAssert(mib != NULL);
sys_info->mib_length = encode_MIB_NR(mib, 0, sys_info->mib, buf_len);
DevAssert(sys_info->mib_length == buf_len);
DevAssert(sib1 != NULL);
NR_SIB1_t *bcch_SIB1 = sib1->message.choice.c1->choice.systemInformationBlockType1;
sys_info->sib1 = calloc(NR_MAX_SIB_LENGTH / 8, sizeof(*sys_info->sib1));
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_SIB1, NULL, (void *)bcch_SIB1, sys_info->sib1, NR_MAX_SIB_LENGTH / 8);
AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded);
sys_info->sib1_length = (enc_rval.encoded + 7) / 8;
return sys_info;
}
f1ap_setup_req_t *RC_read_F1Setup(uint64_t id, f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
const char *name, const char *name,
const f1ap_served_cell_info_t *info, const f1ap_served_cell_info_t *info,
...@@ -1183,22 +1205,7 @@ f1ap_setup_req_t *RC_read_F1Setup(uint64_t id, ...@@ -1183,22 +1205,7 @@ f1ap_setup_req_t *RC_read_F1Setup(uint64_t id,
// in NSA we don't transmit SIB1, so cannot fill DU system information // in NSA we don't transmit SIB1, so cannot fill DU system information
// so cannot send MIB either // so cannot send MIB either
int buf_len = 3; // this is what we assume in monolithic req->cell[0].sys_info = get_sys_info(mib, sib1);
req->cell[0].sys_info = calloc(1, sizeof(*req->cell[0].sys_info));
AssertFatal(req->cell[0].sys_info != NULL, "out of memory\n");
f1ap_gnb_du_system_info_t *sys_info = req->cell[0].sys_info;
sys_info->mib = calloc(buf_len, sizeof(*sys_info->mib));
DevAssert(sys_info->mib != NULL);
DevAssert(mib != NULL);
sys_info->mib_length = encode_MIB_NR(mib, 0, sys_info->mib, buf_len);
DevAssert(sys_info->mib_length == buf_len);
DevAssert(sib1 != NULL);
NR_SIB1_t *bcch_SIB1 = sib1->message.choice.c1->choice.systemInformationBlockType1;
sys_info->sib1 = calloc(NR_MAX_SIB_LENGTH / 8, sizeof(*sys_info->sib1));
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_SIB1, NULL, (void *)bcch_SIB1, sys_info->sib1, NR_MAX_SIB_LENGTH / 8);
AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded);
sys_info->sib1_length = (enc_rval.encoded + 7) / 8;
} }
int num = read_version(TO_STRING(NR_RRC_VERSION), &req->rrc_ver[0], &req->rrc_ver[1], &req->rrc_ver[2]); int num = read_version(TO_STRING(NR_RRC_VERSION), &req->rrc_ver[0], &req->rrc_ver[1], &req->rrc_ver[2]);
......
...@@ -279,10 +279,13 @@ void rrc_gNB_process_f1_du_configuration_update(f1ap_gnb_du_configuration_update ...@@ -279,10 +279,13 @@ void rrc_gNB_process_f1_du_configuration_update(f1ap_gnb_du_configuration_update
// MIB is mandatory, so will be overwritten. SIB1 is optional, so will // MIB is mandatory, so will be overwritten. SIB1 is optional, so will
// only be overwritten if present in sys_info // only be overwritten if present in sys_info
ASN_STRUCT_FREE(asn_DEF_NR_MIB, du->mib); ASN_STRUCT_FREE(asn_DEF_NR_MIB, du->mib);
if (sys_info->sib1 != NULL) if (sys_info->sib1 != NULL) {
ASN_STRUCT_FREE(asn_DEF_NR_SIB1, du->sib1); ASN_STRUCT_FREE(asn_DEF_NR_SIB1, du->sib1);
du->sib1 = NULL;
}
NR_BCCH_BCH_Message_t *mib = NULL; NR_BCCH_BCH_Message_t *mib = NULL;
if (!extract_sys_info(sys_info, &mib, &du->sib1)) { if (!extract_sys_info(sys_info, &mib, &du->sib1)) {
LOG_W(RRC, "cannot update sys_info for DU %ld\n", du->setup_req->gNB_DU_id); LOG_W(RRC, "cannot update sys_info for DU %ld\n", du->setup_req->gNB_DU_id);
} else { } else {
......
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