implement bts->cell_barred feature, configurable in VTY
This commit is contained in:
parent
69de397ff4
commit
5dececfa41
|
@ -301,6 +301,7 @@ struct gsm_bts {
|
|||
/* should the channel allocator allocate channels from high TRX to TRX0,
|
||||
* rather than starting from TRX0 and go upwards? */
|
||||
int chan_alloc_reverse;
|
||||
int cell_barred;
|
||||
|
||||
/* how do we talk OML with this TRX? */
|
||||
struct gsm_e1_subslot oml_e1_link;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue