Fix TSC/BSIC handling bug and remove bts->tsc

This fixes a bug in the following circumstances:
* BSIC is set to 0 in the config file
* No TSC is explicitly specified at the BST level in the config file

In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our
default initialization value.

The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3
bits of the BSIC.  Having configuration options for both the BSIC _and_
the TSC at the BTS level therefore makes no sense, as it only adds ways
in which users can configure non-oprational configurations.  So we
remove the bts->tsc member, and keep only the ts->tsc members that allow
us to configure a timeslot-specific TSC that's different from the BTS
TSC (= BCC).
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 24bae97..306fff0 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -253,10 +253,10 @@
 	struct pchan_load pl;
 
 	vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, "
-		"BSIC %u, TSC %u and %u TRX%s",
+		"BSIC %u and %u TRX%s",
 		bts->nr, btstype2str(bts->type), gsm_band_name(bts->band),
 		bts->cell_identity,
-		bts->location_area_code, bts->bsic, bts->tsc,
+		bts->location_area_code, bts->bsic,
 		bts->num_trx, VTY_NEWLINE);
 	vty_out(vty, "Description: %s%s",
 		bts->description ? bts->description : "(null)", VTY_NEWLINE);
@@ -374,7 +374,7 @@
 static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts)
 {
 	vty_out(vty, "    timeslot %u%s", ts->nr, VTY_NEWLINE);
-	if (ts->tsc != -1 && ts->tsc != ts->trx->bts->tsc)
+	if (ts->tsc != -1)
 		vty_out(vty, "     training_sequence_code %u%s", ts->tsc, VTY_NEWLINE);
 	if (ts->pchan != GSM_PCHAN_NONE)
 		vty_out(vty, "     phys_chan_config %s%s",
@@ -550,9 +550,6 @@
 	vty_out(vty, "  location_area_code %u%s", bts->location_area_code,
 		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",
@@ -1617,7 +1614,7 @@
 	} else if (bts_nr == gsmnet->num_bts) {
 		/* allocate a new one */
 		bts = gsm_bts_alloc_register(gsmnet, GSM_BTS_TYPE_UNKNOWN,
-					     HARDCODED_TSC, HARDCODED_BSIC);
+					     HARDCODED_BSIC);
 	} else
 		bts = gsm_bts_num(gsmnet, bts_nr);
 
@@ -1712,23 +1709,12 @@
 }
 
 
-DEFUN(cfg_bts_tsc,
+/* compatibility wrapper for old config files */
+DEFUN_HIDDEN(cfg_bts_tsc,
       cfg_bts_tsc_cmd,
       "training_sequence_code <0-7>",
       "Set the Training Sequence Code (TSC) of this BTS\n" "TSC\n")
 {
-	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;
 }
 
@@ -1748,11 +1734,6 @@
 	}
 	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;
 }