aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-05-30 12:09:13 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-03 14:03:27 +0200
commit135a648ad7545d7d0603256a7b7825dc4e495e10 (patch)
treea9655415d52c4f91199b120210c1d5fe207e9ae0
parentd64c0bca17d412a5d0aaea705ec799728d045932 (diff)
Introduce per-ts TSC
This allows us to configure a TSC for each timeslot, not just one globally for the entire BTS.
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h1
-rw-r--r--openbsc/src/libbsc/abis_nm.c5
-rw-r--r--openbsc/src/libbsc/bsc_vty.c19
-rw-r--r--openbsc/src/libcommon/gsm_data.c1
4 files changed, 23 insertions, 3 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 3a6f95f1..ea4240d6 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -195,6 +195,7 @@ struct gsm_bts_trx_ts {
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
uint8_t nm_chan_comb;
+ int tsc; /* -1 == use BTS TSC */
struct {
/* Parameters below are configured by VTY */
diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 0c3fff56..e6111f58 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -1712,7 +1712,10 @@ int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb)
}
}
}
- msgb_tv_put(msg, NM_ATT_TSC, bts->tsc); /* training sequence */
+ if (ts->tsc == -1)
+ msgb_tv_put(msg, NM_ATT_TSC, bts->tsc); /* training sequence */
+ else
+ msgb_tv_put(msg, NM_ATT_TSC, ts->tsc); /* training sequence */
if (bts->type == GSM_BTS_TYPE_BS11)
msgb_tlv_put(msg, 0x59, 1, &zero);
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index b667b921..37a1e2f1 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -333,6 +333,8 @@ static void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link
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)
+ 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",
gsm_pchan_name(ts->pchan), VTY_NEWLINE);
@@ -685,9 +687,9 @@ DEFUN(show_trx,
static void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts)
{
- vty_out(vty, "BTS %u, TRX %u, Timeslot %u, phys cfg %s",
+ vty_out(vty, "BTS %u, TRX %u, Timeslot %u, phys cfg %s, TSC %u",
ts->trx->bts->nr, ts->trx->nr, ts->nr,
- gsm_pchan_name(ts->pchan));
+ gsm_pchan_name(ts->pchan), ts->tsc);
if (ts->pchan == GSM_PCHAN_TCH_F_PDCH)
vty_out(vty, " (%s mode)",
ts->flags & TS_F_PDCH_MODE ? "PDCH" : "TCH/F");
@@ -2428,6 +2430,18 @@ DEFUN(cfg_ts_pchan,
return CMD_SUCCESS;
}
+DEFUN(cfg_ts_tsc,
+ cfg_ts_tsc_cmd,
+ "training_sequence_code <0-7>",
+ "Training Sequence Code")
+{
+ struct gsm_bts_trx_ts *ts = vty->index;
+
+ ts->tsc = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
#define HOPPING_STR "Configure frequency hopping\n"
DEFUN(cfg_ts_hopping,
@@ -2780,6 +2794,7 @@ int bsc_vty_init(const struct log_info *cat)
install_element(TS_NODE, &ournode_exit_cmd);
install_element(TS_NODE, &ournode_end_cmd);
install_element(TS_NODE, &cfg_ts_pchan_cmd);
+ install_element(TS_NODE, &cfg_ts_tsc_cmd);
install_element(TS_NODE, &cfg_ts_hopping_cmd);
install_element(TS_NODE, &cfg_ts_hsn_cmd);
install_element(TS_NODE, &cfg_ts_maio_cmd);
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index b1fb4dbc..a85eb846 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -156,6 +156,7 @@ struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts)
ts->trx = trx;
ts->nr = k;
ts->pchan = GSM_PCHAN_NONE;
+ ts->tsc = -1;
ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data);
ts->hopping.arfcns.data = ts->hopping.arfcns_data;