aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-01-19 17:10:50 +0100
committerHarald Welte <laforge@gnumonks.org>2014-01-19 17:32:56 +0100
commit903aaea6689cc08c0e33fb05659c808a5e5f754f (patch)
tree6481e4cab3ef7dd62eccc037230c66f75aca6d44 /openbsc/src/libbsc/bsc_vty.c
parentcd4e74df95e0bbb18a46062d028f7e726f8916d4 (diff)
Do not expect all BTSs support TSC != BCC
We introduce a new feature indicating if the given BTS model supports a TSC that is different from the BCC (lower 3 bits of BSIC).
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r--openbsc/src/libbsc/bsc_vty.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 3b85892e0..b906c2ee3 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -491,8 +491,10 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE);
vty_out(vty, " location_area_code %u%s", bts->location_area_code,
VTY_NEWLINE);
- vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE);
vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE);
+ if (bts->tsc != (bts->bsic & 7))
+ vty_out(vty, " training_sequence_code %u%s", bts->tsc,
+ VTY_NEWLINE);
if (bts->tz.override != 0) {
if (bts->tz.dst)
vty_out(vty, " timezone %d %d %d%s",
@@ -1634,6 +1636,13 @@ DEFUN(cfg_bts_tsc,
struct gsm_bts *bts = vty->index;
int tsc = atoi(argv[0]);
+ if (!gsm_bts_has_feature(bts, BTS_FEAT_MULTI_TSC)) {
+ vty_out(vty, "%% This BTS does not support a TSC != BCC, "
+ "falling back to BCC%s", VTY_NEWLINE);
+ bts->tsc = bts->bsic & 7;
+ return CMD_WARNING;
+ }
+
bts->tsc = tsc;
return CMD_SUCCESS;
@@ -1655,6 +1664,11 @@ DEFUN(cfg_bts_bsic,
}
bts->bsic = bsic;
+ /* automatically re-configuer the TSC if we change the BCC
+ * which is the lower 3 bits of the BSIC */
+ if (!gsm_bts_has_feature(bts, BTS_FEAT_MULTI_TSC))
+ bts->tsc = bts->bsic & 7;
+
return CMD_SUCCESS;
}
@@ -2977,6 +2991,13 @@ DEFUN(cfg_ts_tsc,
{
struct gsm_bts_trx_ts *ts = vty->index;
+ if (!gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_MULTI_TSC)) {
+ vty_out(vty, "%% This BTS does not support a TSC != BCC, "
+ "falling back to BCC%s", VTY_NEWLINE);
+ ts->tsc = -1;
+ return CMD_WARNING;
+ }
+
ts->tsc = atoi(argv[0]);
return CMD_SUCCESS;