diff options
author | Harald Welte (local) <laflocal@hanuman.gnumonks.org> | 2009-08-12 13:28:23 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-08-12 20:55:00 +0200 |
commit | 5dececfa4184021fd349a7ede5190e0ae67d31f0 (patch) | |
tree | afe5f04a4175d9d1d978e21f6804312c347ed71c /openbsc/src | |
parent | 69de397ff406acb8a6ea23811c50d3af3a53acb0 (diff) |
implement bts->cell_barred feature, configurable in VTY
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/bsc_hack.c | 16 | ||||
-rw-r--r-- | openbsc/src/vty_interface.c | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c index d08c145fe..7ff633330 100644 --- a/openbsc/src/bsc_hack.c +++ b/openbsc/src/bsc_hack.c @@ -872,6 +872,10 @@ static void patch_tables(struct gsm_bts *bts) u_int8_t arfcn_low = bts->c0->arfcn & 0xff; u_int8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; /* covert the raw packet to the struct */ + struct gsm48_system_information_type_1 *type_1 = + (struct gsm48_system_information_type_1*)&si1; + struct gsm48_system_information_type_2 *type_2 = + (struct gsm48_system_information_type_2*)&si2; struct gsm48_system_information_type_3 *type_3 = (struct gsm48_system_information_type_3*)&si3; struct gsm48_system_information_type_4 *type_4 = @@ -923,6 +927,18 @@ static void patch_tables(struct gsm_bts *bts) /* patch MS max power for CCH */ type_4->cell_sel_par.ms_txpwr_max_ccch = ms_pwr_ctl_lvl(bts->band, 20 /* dBm == 100mW */); + + if (bts->cell_barred) { + type_1->rach_control.cell_bar = 1; + type_2->rach_control.cell_bar = 1; + type_3->rach_control.cell_bar = 1; + type_4->rach_control.cell_bar = 1; + } else { + type_1->rach_control.cell_bar = 0; + type_2->rach_control.cell_bar = 0; + type_3->rach_control.cell_bar = 0; + type_4->rach_control.cell_bar = 0; + } } diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c index 9b35e6ba5..9c07ce9f2 100644 --- a/openbsc/src/vty_interface.c +++ b/openbsc/src/vty_interface.c @@ -129,6 +129,8 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) bts->nr, btstype2str(bts->type), gsm_band_name(bts->band), bts->location_area_code, bts->bsic, bts->tsc, bts->num_trx, VTY_NEWLINE); + if (bts->cell_barred) + vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE); if (is_ipaccess_bts(bts)) vty_out(vty, " Unit ID: %u/%u/0%s", bts->ip_access.site_id, bts->ip_access.bts_id, @@ -234,6 +236,8 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) vty_out(vty, " channel allocator %s%s", bts->chan_alloc_reverse ? "descending" : "ascending", VTY_NEWLINE); + if (bts->cell_barred) + vty_out(vty, " cell barred 1%s", VTY_NEWLINE); if (is_ipaccess_bts(bts)) vty_out(vty, " ip.access unit_id %u %u%s", bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE); @@ -960,6 +964,17 @@ DEFUN(cfg_bts_challoc, cfg_bts_challoc_cmd, return CMD_SUCCESS; } +DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd, + "cell barred (0|1)", + "Should this cell be barred from access?") +{ + struct gsm_bts *bts = vty->index; + + bts->cell_barred = atoi(argv[0]); + + return CMD_SUCCESS; +} + /* per TRX configuration */ DEFUN(cfg_trx, @@ -1349,6 +1364,7 @@ int bsc_vty_init(struct gsm_network *net) install_element(BTS_NODE, &cfg_bts_oml_e1_cmd); install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); install_element(BTS_NODE, &cfg_bts_challoc_cmd); + install_element(BTS_NODE, &cfg_bts_cell_barred_cmd); install_element(BTS_NODE, &cfg_trx_cmd); |