This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/15932 )
Change subject: osmo_bsc_main.c: verify the physical channel mapping at startup
......................................................................
osmo_bsc_main.c: verify the physical channel mapping at startup
Change-Id: I758ef80f7884ba35cdf59d671ee30222ffb9d68b
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/osmo_bsc_main.c
3 files changed, 62 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/15932/1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index ca9d294..23aacd6 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1749,4 +1749,6 @@
int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan);
+bool trx_has_valid_pchan_config(const struct gsm_bts_trx *trx);
+
#endif /* _GSM_DATA_H */
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 88981c0..e7fe065 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1693,3 +1693,54 @@
OSMO_VALUE_STRING(FOR_VTY),
{}
};
+
+bool trx_has_valid_pchan_config(const struct gsm_bts_trx *trx)
+{
+ bool combined = false;
+ bool result = true;
+ unsigned int i;
+
+ /* Iterate over all timeslots */
+ for (i = 0; i < 8; i++) {
+ const struct gsm_bts_trx_ts *ts = &trx->ts[i];
+
+ switch (ts->pchan_from_config) {
+ case GSM_PCHAN_CCCH_SDCCH4_CBCH:
+ case GSM_PCHAN_CCCH_SDCCH4:
+ /* CCCH+SDCCH4 can only be configured on TS0 */
+ if (i > 0) {
+ LOGP(DNM, LOGL_ERROR, "Combined CCCH is not allowed "
+ "on TS%u > 0\n", i);
+ result = false;
+ }
+ if (i == 0)
+ combined = true;
+ /* fall-through */
+ case GSM_PCHAN_CCCH:
+ /* 3GPP TS 45.002, Table 3, CCCH: TS (0, 2, 4, 6) */
+ if (i % 2 != 0) {
+ LOGP(DNM, LOGL_ERROR, "%s is not allowed on odd TS%u\n",
+ gsm_pchan_name(ts->pchan_from_config), i);
+ result = false;
+ }
+
+ /* There can be no more CCCHs if TS0/C0 is combined */
+ if (i > 0 && combined) {
+ LOGP(DNM, LOGL_ERROR, "%s is not allowed on TS%u, "
+ "because TS0 is using combined channel configuration\n",
+ gsm_pchan_name(ts->pchan_from_config), i);
+ result = false;
+ }
+ break;
+
+ default:
+ /* CCCH on TS0 is mandatory for C0 */
+ if (trx->bts->c0 == trx && i == 0) {
+ LOGP(DNM, LOGL_ERROR, "TS0 on C0 must be CCCH/BCCH\n");
+ result = false;
+ }
+ }
+ }
+
+ return result;
+}
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index dacd61a..bf9358f 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -401,6 +401,7 @@
static int bootstrap_bts(struct gsm_bts *bts)
{
+ struct gsm_bts_trx *trx;
int i, n;
if (!bts->model)
@@ -447,6 +448,14 @@
return -EINVAL;
}
+ /* Verify the physical channel mapping */
+ llist_for_each_entry(trx, &bts->trx_list, list) {
+ if (!trx_has_valid_pchan_config(trx)) {
+ LOGP(DNM, LOGL_ERROR, "TRX %u has invalid phan config\n", trx->nr);
+ return -EINVAL;
+ }
+ }
+
/* Control Channel Description is set from vty/config */
/* Set ccch config by looking at ts config */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/15932
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I758ef80f7884ba35cdf59d671ee30222ffb9d68b
Gerrit-Change-Number: 15932
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191101/f1138b7a/attachment.htm>