diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-03-28 15:10:04 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-03-06 22:57:57 +0100 |
commit | 97af89c01a6e67988fb15d24e9e862610444c464 (patch) | |
tree | 1b97c5ab8c505c101ac740e4cfe507b69a563d68 /openbsc/src | |
parent | ec6e4f8b3d1f304ee1c6ca73ee47290642ac380a (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);
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/libbsc/bsc_vty.c | 45 | ||||
-rw-r--r-- | openbsc/src/libbsc/bts_ipaccess_nanobts.c | 14 | ||||
-rw-r--r-- | openbsc/src/libbsc/bts_siemens_bs11.c | 15 | ||||
-rw-r--r-- | openbsc/src/libcommon/gsm_data.c | 9 |
4 files changed, 83 insertions, 0 deletions
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); |