Skip to content

Commit

Permalink
F1 setup response fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nplrkn committed Jul 27, 2023
1 parent 82cc514 commit 03f7cd6
Showing 1 changed file with 50 additions and 37 deletions.
87 changes: 50 additions & 37 deletions gnb-cu-cp/src/workflows/f1_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ use bitvec::prelude::*;
use f1ap::*;
use net::{RequestError, ResponseAction};
use rrc::{
CellReselectionInfoCommon, CellReselectionPriority, CellReselectionServingFreqInfo,
IntraFreqCellReselectionInfo, QHyst, QRxLevMin,
BcchDlSchMessage, BcchDlSchMessageType, CellReselectionInfoCommon, CellReselectionPriority,
CellReselectionServingFreqInfo, CriticalExtensions30, IntraFreqCellReselectionInfo, QHyst,
QRxLevMin, SystemInformation, SystemInformationIEs, C1,
};
use slog::info;

Expand All @@ -31,9 +32,13 @@ impl<'a, G: GnbCuCp> Workflow<'a, G> {

// Activate all served cells in the setup response.
// TODO: store information about served cells for use later.
let sib2 = build_sib2().into_bytes()?;
let system_info_block = build_system_information().into_bytes()?;
let cells_to_be_activated_list = r.gnb_du_served_cells_list.map(|cells| {
CellsToBeActivatedList(cells.0.map(|x| served_cell_to_activated(x, sib2.clone())))
CellsToBeActivatedList(
cells
.0
.map(|x| served_cell_to_activated(x, system_info_block.clone())),
)
});

self.log_message("<< F1SetupResponse");
Expand All @@ -57,38 +62,45 @@ impl<'a, G: GnbCuCp> Workflow<'a, G> {
}
}

fn build_sib2() -> rrc::Sib2 {
rrc::Sib2 {
cell_reselection_info_common: CellReselectionInfoCommon {
nrof_ss_blocks_to_average: None,
abs_thresh_ss_blocks_consolidation: None,
range_to_best_cell: None,
q_hyst: QHyst::Db1,
speed_state_reselection_pars: None,
},
cell_reselection_serving_freq_info: CellReselectionServingFreqInfo {
s_non_intra_search_p: None,
s_non_intra_search_q: None,
thresh_serving_low_p: rrc::ReselectionThreshold(2),
thresh_serving_low_q: None,
cell_reselection_priority: CellReselectionPriority(2),
cell_reselection_sub_priority: None,
},
intra_freq_cell_reselection_info: IntraFreqCellReselectionInfo {
q_rx_lev_min: QRxLevMin(-50),
q_rx_lev_min_sul: None,
q_qual_min: None,
s_intra_search_p: rrc::ReselectionThreshold(2),
s_intra_search_q: None,
t_reselection_nr: rrc::TReselection(2),
frequency_band_list: None,
frequency_band_list_sul: None,
p_max: None,
smtc: None,
ss_rssi_measurement: None,
ssb_to_measure: None,
derive_ssb_index_from_cell: true,
},
fn build_system_information() -> BcchDlSchMessage {
BcchDlSchMessage {
message: BcchDlSchMessageType::C1(C1::SystemInformation(SystemInformation {
critical_extensions: CriticalExtensions30::SystemInformation(SystemInformationIEs {
sib_type_and_info: nonempty![rrc::SibTypeAndInfo::Sib2(rrc::Sib2 {
cell_reselection_info_common: CellReselectionInfoCommon {
nrof_ss_blocks_to_average: None,
abs_thresh_ss_blocks_consolidation: None,
range_to_best_cell: None,
q_hyst: QHyst::Db1,
speed_state_reselection_pars: None,
},
cell_reselection_serving_freq_info: CellReselectionServingFreqInfo {
s_non_intra_search_p: None,
s_non_intra_search_q: None,
thresh_serving_low_p: rrc::ReselectionThreshold(2),
thresh_serving_low_q: None,
cell_reselection_priority: CellReselectionPriority(2),
cell_reselection_sub_priority: None,
},
intra_freq_cell_reselection_info: IntraFreqCellReselectionInfo {
q_rx_lev_min: QRxLevMin(-50),
q_rx_lev_min_sul: None,
q_qual_min: None,
s_intra_search_p: rrc::ReselectionThreshold(2),
s_intra_search_q: None,
t_reselection_nr: rrc::TReselection(2),
frequency_band_list: None,
frequency_band_list_sul: None,
p_max: None,
smtc: None,
ss_rssi_measurement: None,
ssb_to_measure: None,
derive_ssb_index_from_cell: true,
},
})],
late_non_critical_extension: None,
}),
})),
}
}

Expand All @@ -97,10 +109,11 @@ fn served_cell_to_activated(
sib_2: Vec<u8>,
) -> CellsToBeActivatedListItem {
let served_cell_information = &served_cell.served_cell_information;
let nr_pci = Some(served_cell_information.nr_pci);

CellsToBeActivatedListItem {
nr_cgi: served_cell_information.nr_cgi.clone(),
nr_pci: Some(NrPci(4)),
nr_pci,
gnb_cu_system_information: Some(GnbCuSystemInformation {
sib_type_to_be_updated_list: nonempty![SibTypeToBeUpdatedListItem {
sib_type: 2,
Expand Down

0 comments on commit 03f7cd6

Please sign in to comment.