laforge submitted this change.

View Change


Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved
prevent bogus NCH related error message if no NCH is configured

Back in Change-Id Iefde0af44a663f22462a54d68a58caa560eceb2f I
introduced indication of the NCH position in the SI1 rest octets.

However, a related ERROR messages is accidentially also printed in
case no NCH is configured at all.

Let's split the already overly-complex if clause into a separate
function which then also handles the "bts->nch.num_blocks == 0"
case as permitted.

Change-Id: Iab2120a343cb0f6553f13a821b44b3c312587579
Related: OS#5781
---
M src/osmo-bsc/osmo_bsc_main.c
1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index c4b5780..0757da0 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -375,6 +375,28 @@
osmo_timer_schedule(&update_connection_stats_timer, 1, 0);
}

+static bool nch_position_compatible_with_combined_ccch(const struct gsm_bts *bts)
+{
+ switch (bts->nch.num_blocks) {
+ case 0:
+ /* no NCH enabled, so we are fine */
+ return true;
+ case 1:
+ if (bts->nch.first_block == 0 || bts->nch.first_block == 1)
+ return true;
+ break;
+ case 2:
+ if (bts->nch.first_block == 0)
+ return true;
+ break;
+ default:
+ break;
+ }
+
+ /* anything else is not permitted */
+ return false;
+}
+
static void bootstrap_bts(struct gsm_bts *bts)
{
unsigned int n = 0;
@@ -394,8 +416,7 @@
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)) {
+ if (!nch_position_compatible_with_combined_ccch(bts)) {
LOG_BTS(bts, DNM, LOGL_ERROR, "CCCH is combined with SDCCHs, but NCH position/size is "
"incompatible with that. Please fix your config!\n");
}

To view, visit change 33382. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iab2120a343cb0f6553f13a821b44b3c312587579
Gerrit-Change-Number: 33382
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged