summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-03-28 15:10:04 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-06 22:57:57 +0100
commit97af89c01a6e67988fb15d24e9e862610444c464 (patch)
tree1b97c5ab8c505c101ac740e4cfe507b69a563d68
parentec6e4f8b3d1f304ee1c6ca73ee47290642ac380a (diff)
bts: Implement setting the T200 for the BS11 and nanoBTS
Implement setting the specific parts of the T200 timer for the different kind of channels. This is implemented for the nanoBTS and the BS11. The nanoBTS values have been made default, the BS11 values are now inside the example configuration value. The order in the new t200 struct is coming from GSM 12.21 and it has been verified by setting the values to 1,2,3,4,5,6,7 and having a look in wireshark at the result. The index into the data has been found with: for (i = 0; i < ARRAY_SIZE(bs11_attr_bts); ++i) if (bs11_attr_bts[i] == NM_ATT_T200) printf("BS11 i %d\n", i); for (i = 0; i < ARRAY_SIZE(nanobts_attr_bts); ++i) if (nanobts_attr_bts[i] == NM_ATT_T200) printf("N i %d\n", i);
-rw-r--r--openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg7
-rw-r--r--openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg7
-rw-r--r--openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg14
-rw-r--r--openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg7
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h10
-rw-r--r--openbsc/src/libbsc/bsc_vty.c45
-rw-r--r--openbsc/src/libbsc/bts_ipaccess_nanobts.c14
-rw-r--r--openbsc/src/libbsc/bts_siemens_bs11.c15
-rw-r--r--openbsc/src/libcommon/gsm_data.c9
9 files changed, 128 insertions, 0 deletions
diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg
index 36065e254..f56df48f3 100644
--- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg
+++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg
@@ -53,6 +53,13 @@ network
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
gprs mode none
+ t200 sdcch 44
+ t200 facch fullrate 31
+ t200 facch halfrate 41
+ t200 sacch tch sapi0 90
+ t200 sacch sdcch 90
+ t200 sdcch sapi3 90
+ t200 sacch tch sapi3 135
trx 0
rf_locked 0
arfcn 121
diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg
index ebe6cc6cb..87e710f30 100644
--- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg
+++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg
@@ -22,6 +22,13 @@ network
location_area_code 1
training_sequence_code 7
base_station_id_code 63
+ t200 sdcch 44
+ t200 facch fullrate 31
+ t200 facch halfrate 41
+ t200 sacch tch sapi0 90
+ t200 sacch sdcch 90
+ t200 sdcch sapi3 90
+ t200 sacch tch sapi3 135
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
trx 0
diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg
index 9ae800342..fc3047b27 100644
--- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg
+++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg
@@ -22,6 +22,13 @@ network
base_station_id_code 63
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
+ t200 sdcch 44
+ t200 facch fullrate 31
+ t200 facch halfrate 41
+ t200 sacch tch sapi0 90
+ t200 sacch sdcch 90
+ t200 sdcch sapi3 90
+ t200 sacch tch sapi3 135
trx 0
arfcn 121
max_power_red 0
@@ -88,6 +95,13 @@ network
base_station_id_code 63
oml e1 line 1 timeslot 6 sub-slot full
oml e1 tei 25
+ t200 sdcch 44
+ t200 facch fullrate 31
+ t200 facch halfrate 41
+ t200 sacch tch sapi0 90
+ t200 sacch sdcch 90
+ t200 sdcch sapi3 90
+ t200 sacch tch sapi3 135
trx 0
arfcn 122
max_power_red 0
diff --git a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg
index 542edd6ad..61baaeefd 100644
--- a/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg
+++ b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg
@@ -24,6 +24,13 @@ network
base_station_id_code 63
oml e1 line 0 timeslot 1 sub-slot full
oml e1 tei 25
+ t200 sdcch 44
+ t200 facch fullrate 31
+ t200 facch halfrate 41
+ t200 sacch tch sapi0 90
+ t200 sacch sdcch 90
+ t200 sdcch sapi3 90
+ t200 sacch tch sapi3 135
trx 0
arfcn 121
max_power_red 0
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index 2b405a007..8d03ed523 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -720,6 +720,16 @@ struct gsm_bts {
/* supported codecs beside FR */
struct bts_codec_conf codec;
+
+ struct {
+ uint8_t sdcch;
+ uint8_t facch_fullrate;
+ uint8_t facch_halfrate;
+ uint8_t sacch_with_tch_sapi0;
+ uint8_t sacch_with_sdcch;
+ uint8_t sdcch_with_sapi3;
+ uint8_t sacch_with_tch_sapi3;
+ } t200;
#endif /* ROLE_BSC */
void *role;
};
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 2a4d0b3fb..75297cb2b 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -577,6 +577,18 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
for (i = 0; i < 8; i++)
if ((i != 2) && (bts->si_common.rach_control.t2 & (0x1 << i)))
vty_out(vty, " rach access-control-class %d barred%s", i+8, VTY_NEWLINE);
+
+#define T200_OUT(vty, bts, name, var) \
+ vty_out(vty, " t200 %s %u%s", name, bts->t200.var, VTY_NEWLINE);
+ T200_OUT(vty, bts, "sdcch", sdcch);
+ T200_OUT(vty, bts, "facch fullrate", facch_fullrate);
+ T200_OUT(vty, bts, "facch halfrate", facch_halfrate);
+ T200_OUT(vty, bts, "sacch tch sapi0", sacch_with_tch_sapi0);
+ T200_OUT(vty, bts, "sacch sdcch", sacch_with_sdcch);
+ T200_OUT(vty, bts, "sdcch sapi3", sdcch_with_sapi3);
+ T200_OUT(vty, bts, "sacch tch sapi3", sacch_with_tch_sapi3);
+#undef T200_OUT
+
for (i = SYSINFO_TYPE_1; i < _MAX_SYSINFO_TYPE; i++) {
if (bts->si_mode_static & (1 << i)) {
vty_out(vty, " system-information %s mode static%s",
@@ -2235,6 +2247,32 @@ DEFUN(cfg_bts_no_per_loc_upd, cfg_bts_no_per_loc_upd_cmd,
return CMD_SUCCESS;
}
+#define T200_TEXT "T200 LAPDm timeouts\n"
+#define FACCH_TEXT "FACCH\n"
+#define SDCCH_TEXT "SDCCH\n"
+#define SACCH_TEXT "SACCH\n"
+
+#define DECLARE_T200(name, var, doc, unit) \
+ DEFUN(cfg_bts_t200_##var, \
+ cfg_bts_t200_##var##_cmd, \
+ "t200 " name " <0-255>", \
+ T200_TEXT doc "T200 value in units\n") \
+{ \
+ struct gsm_bts *bts = vty->index; \
+ bts->t200.var = atoi(argv[0]); \
+ return CMD_SUCCESS; \
+}
+
+DECLARE_T200("sdcch", sdcch, SDCCH_TEXT, 5)
+DECLARE_T200("facch fullrate", facch_fullrate, FACCH_TEXT "fullrate\n", 5)
+DECLARE_T200("facch halfrate", facch_halfrate, FACCH_TEXT "halfrate\n", 5)
+DECLARE_T200("sacch tch sapi0", sacch_with_tch_sapi0, SACCH_TEXT "tch\n" "SAPI0\n", 10)
+DECLARE_T200("sacch sdcch", sacch_with_sdcch, SACCH_TEXT "sdcch\n", 10)
+DECLARE_T200("sdcch sapi3", sdcch_with_sapi3, SDCCH_TEXT "SAPI3\n", 5)
+DECLARE_T200("sacch tch sapi3", sacch_with_tch_sapi3, SACCH_TEXT "tch\n" "SAPI3\n", 10)
+#undef DECLARE_T200
+
+
#define GPRS_TEXT "GPRS Packet Network\n"
DEFUN(cfg_bts_prs_bvci, cfg_bts_gprs_bvci_cmd,
@@ -3383,6 +3421,13 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_codec2_cmd);
install_element(BTS_NODE, &cfg_bts_codec3_cmd);
install_element(BTS_NODE, &cfg_bts_codec4_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_sdcch_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_facch_fullrate_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_facch_halfrate_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_sacch_with_tch_sapi0_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_sacch_with_sdcch_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_sdcch_with_sapi3_cmd);
+ install_element(BTS_NODE, &cfg_bts_t200_sacch_with_tch_sapi3_cmd);
install_element(BTS_NODE, &cfg_trx_cmd);
install_node(&trx_node, dummy_config_write);
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
index c2541273a..c4ca7e087 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
@@ -263,6 +263,20 @@ static void patch_nm_tables(struct gsm_bts *bts)
nanobts_attr_cell[29] = 0x8f;
nanobts_attr_cell[30] = 0xff;
}
+
+ if (nanobts_attr_bts[14] != NM_ATT_T200) {
+ LOGP(DNM, LOGL_ERROR,
+ "Patching T200 at the wrong place! Got %u\n\n",
+ nanobts_attr_bts[14]);
+ } else {
+ nanobts_attr_bts[14 + 1] = bts->t200.sdcch;
+ nanobts_attr_bts[14 + 2] = bts->t200.facch_fullrate;
+ nanobts_attr_bts[14 + 3] = bts->t200.facch_halfrate;
+ nanobts_attr_bts[14 + 4] = bts->t200.sacch_with_tch_sapi0;
+ nanobts_attr_bts[14 + 5] = bts->t200.sacch_with_sdcch;
+ nanobts_attr_bts[14 + 6] = bts->t200.sdcch_with_sapi3;
+ nanobts_attr_bts[14 + 7] = bts->t200.sacch_with_tch_sapi3;
+ }
}
static uint8_t *nanobts_attr_bts_get(struct gsm_bts *bts, size_t *data_len)
diff --git a/openbsc/src/libbsc/bts_siemens_bs11.c b/openbsc/src/libbsc/bts_siemens_bs11.c
index 160563b0f..d3ad926ba 100644
--- a/openbsc/src/libbsc/bts_siemens_bs11.c
+++ b/openbsc/src/libbsc/bts_siemens_bs11.c
@@ -387,6 +387,21 @@ static void patch_nm_tables(struct gsm_bts *bts)
/* patch the power reduction */
bs11_attr_radio[5] = bts->c0->max_power_red / 2;
+
+ /* patch the T200 */
+ if (bs11_attr_bts[39] != NM_ATT_T200) {
+ LOGP(DNM, LOGL_ERROR,
+ "Patching T200 at the wrong place! Got %u\n\n",
+ bs11_attr_bts[39]);
+ } else {
+ bs11_attr_bts[39 + 1] = bts->t200.sdcch;
+ bs11_attr_bts[39 + 2] = bts->t200.facch_fullrate;
+ bs11_attr_bts[39 + 3] = bts->t200.facch_halfrate;
+ bs11_attr_bts[39 + 4] = bts->t200.sacch_with_tch_sapi0;
+ bs11_attr_bts[39 + 5] = bts->t200.sacch_with_sdcch;
+ bs11_attr_bts[39 + 6] = bts->t200.sdcch_with_sapi3;
+ bs11_attr_bts[39 + 7] = bts->t200.sacch_with_tch_sapi3;
+ }
}
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index 5f7e32e73..45abc271d 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -408,6 +408,15 @@ struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_typ
bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */
bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */
+ /* initialize T200 default values */
+ bts->t200.sdcch = 0x1e;
+ bts->t200.facch_fullrate = 0x24;
+ bts->t200.facch_halfrate = 0x24;
+ bts->t200.sacch_with_tch_sapi0 = 0xa8;
+ bts->t200.sacch_with_sdcch = 0x34;
+ bts->t200.sdcch_with_sapi3 = 0x21;
+ bts->t200.sacch_with_tch_sapi3 = 0xa8;
+
llist_add_tail(&bts->list, &net->bts_list);
INIT_LLIST_HEAD(&bts->abis_queue);