laforge has submitted this change. (
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/osmo_bsc_main.c
M src/osmo-bsc/system_information.c
4 files changed, 93 insertions(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, approved
jolly: Looks good to me, but someone else must approve
Jenkins Builder: Verified
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..040f2ed 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -1107,6 +1107,46 @@
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\n"
+ "Number of blocks reserved for NCH\n"
+ "Number of blocks reserved for NCH\n"
+ "First block 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;
+ }
+
+ 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 +4445,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 +4897,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/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index b1a7631..f3f9cd2 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -393,6 +393,12 @@
bts->si_common.chan_desc.bs_ag_blks_res);
bts->si_common.chan_desc.bs_ag_blks_res = 2;
}
+
+ if (!(bts->nch.num_blocks == 1 && (bts->nch.first_block == 0 ||
bts->nch.first_block == 1)) &&
+ !(bts->nch.num_blocks == 2 && bts->nch.first_block == 0)) {
+ LOG_BTS(bts, DNM, LOGL_ERROR, "CCCH is combined with SDCCHs, but NCH
position/size is "
+ "incompatible with that. Please fix your config!\n");
+ }
} else { /* Non-combined TS0/C0 configuration */
/* There can be additional CCCHs on even timeslot numbers */
n += (bts->c0->ts[2].pchan_from_config == GSM_PCHAN_CCCH);
@@ -401,6 +407,13 @@
bts->si_common.chan_desc.ccch_conf = (n << 1);
}
+ if (bts->nch.first_block + bts->nch.num_blocks >
bts->si_common.chan_desc.bs_ag_blks_res) {
+ LOG_BTS(bts, DNM, LOGL_ERROR, "Position/Number of NCH blocks (%u..%u) exceeds AGCH
(%u)."
+ "Please fix your config!\n", bts->nch.first_block,
+ bts->nch.first_block + bts->nch.num_blocks - 1,
+ bts->si_common.chan_desc.bs_ag_blks_res);
+ }
+
bts_setup_ramp_init_bts(bts);
/* ACC ramping is initialized from vty/config */
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: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged