laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc/+/32655 )
Change subject: Support (optional) indication of NCH position in SI1 rest octets
......................................................................
Support (optional) indication of NCH position in SI1 rest octets
This adds the vty commands and respective logic to allow the user to
specify the NCH (notification channel) position in the SI1 rests octets.
Change-Id: Iefde0af44a663f22462a54d68a58caa560eceb2f
Related: OS#5781
Requires: libosmocore.git I24a0095ac6eee0197f9d9ef9895c7795df6cdc49
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/system_information.c
3 files changed, 81 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/55/32655/1
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index d6bf758..a2b84c6 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -568,6 +568,11 @@
uint16_t scramble_list[MAX_EARFCN_LIST];
} data;
} si_common;
+ /* NCH (Notification Channel) related parameters */
+ struct {
+ uint8_t num_blocks; /* NCH number of CCCH blocks (0 = no NCH) */
+ uint8_t first_block; /* NCH first block number */
+ } nch;
bool early_classmark_allowed;
bool early_classmark_allowed_3g;
/* for testing only: Have an infinitely long radio link timeout */
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index e37cfd4..547e7ef 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -1107,6 +1107,47 @@
return CMD_SUCCESS;
}
+DEFUN_USRATTR(cfg_bts_nch_position,
+ cfg_bts_nch_position_cmd,
+ X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK),
+ "nch-position num-blocks <1-7> first-block <0-6>",
+ "NCH (Notification Channel) position within CCCH"
+ "Number of blocks reserved for NCH\n"
+ "First block reserved for NCH\n")
+{
+ struct gsm_bts *bts = vty->index;
+ int num_blocks = atoi(argv[0]);
+ int first_block = atoi(argv[1]);
+
+ if (osmo_gsm48_si1ro_nch_pos_encode(num_blocks, first_block)) {
+ vty_out(vty, "num-blocks %u first-block %u is not permitted by 3GPP TS 44.010
Table 10.5.2.32.1b%s",
+ num_blocks, first_block, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ /* TODO: when to check MAX_AG_BLKS_RES must be >= NUM_BLOCKS here? */
+ /* TODO: when to check for combined CCCH constraints? */
+
+ bts->nch.num_blocks = num_blocks;
+ bts->nch.first_block = first_block;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN_USRATTR(cfg_bts_no_nch_position,
+ cfg_bts_no_nch_position_cmd,
+ X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK),
+ "no nch-position",
+ NO_STR "Disable NCH in this BTS\n")
+{
+ struct gsm_bts *bts = vty->index;
+
+ bts->nch.num_blocks = 0;
+ bts->nch.first_block = 0;
+
+ return CMD_SUCCESS;
+}
+
DEFUN_USRATTR(cfg_bts_cell_barred,
cfg_bts_cell_barred_cmd,
X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK),
@@ -4405,6 +4446,12 @@
bts->si_common.chan_desc.bs_pa_mfrms + 2, VTY_NEWLINE);
vty_out(vty, " channel-description bs-ag-blks-res %u%s",
bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE);
+ if (bts->nch.num_blocks) {
+ vty_out(vty, " nch-position num-blocks %u first-block %u%s",
+ bts->nch.num_blocks, bts->nch.first_block, VTY_NEWLINE);
+ } else {
+ vty_out(vty, " no nch-position%s", VTY_NEWLINE);
+ }
if (bts->ccch_load_ind_thresh != 10)
vty_out(vty, " ccch load-indication-threshold %u%s",
@@ -4851,6 +4898,8 @@
install_element(BTS_NODE, &cfg_bts_interf_meas_level_bounds_cmd);
install_element(BTS_NODE, &cfg_bts_srvcc_fast_return_cmd);
install_element(BTS_NODE, &cfg_bts_immediate_assignment_cmd);
+ install_element(BTS_NODE, &cfg_bts_nch_position_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_nch_position_cmd);
neighbor_ident_vty_init();
/* See also handover commands added on bts level from handover_vty.c */
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c
index 6e82c56..35fce68 100644
--- a/src/osmo-bsc/system_information.c
+++ b/src/osmo-bsc/system_information.c
@@ -771,7 +771,19 @@
* SI1 Rest Octets (10.5.2.32), contains NCH position and band
* indicator but that is not in the 04.08.
*/
- rc = osmo_gsm48_rest_octets_si1_encode(si1->rest_octets, NULL, is_dcs_net(bts));
+ if (bts->nch.num_blocks) {
+ rc = osmo_gsm48_si1ro_nch_pos_encode(bts->nch.num_blocks, bts->nch.first_block);
+ if (rc < 0) {
+ LOGP(DRR, LOGL_ERROR, "Unable to encode NCH position (num_blocks=%u,
first_block=%u)\n",
+ bts->nch.num_blocks, bts->nch.first_block);
+ rc = osmo_gsm48_rest_octets_si1_encode(si1->rest_octets, NULL, is_dcs_net(bts));
+ } else {
+ uint8_t nch_pos = rc;
+ rc = osmo_gsm48_rest_octets_si1_encode(si1->rest_octets, &nch_pos,
is_dcs_net(bts));
+ }
+ } else {
+ rc = osmo_gsm48_rest_octets_si1_encode(si1->rest_octets, NULL, is_dcs_net(bts));
+ }
return sizeof(*si1) + rc;
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/32655
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iefde0af44a663f22462a54d68a58caa560eceb2f
Gerrit-Change-Number: 32655
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange