add 'ms max power' vty command to set the maximum MS power in dBm

This commit is contained in:
Harald Welte (local) 2009-08-13 10:14:26 +02:00
parent ccceef8fe9
commit 0e451d0f2e
5 changed files with 18 additions and 2 deletions

View File

@ -302,6 +302,8 @@ struct gsm_bts {
* rather than starting from TRX0 and go upwards? */
int chan_alloc_reverse;
int cell_barred;
/* maximum Tx power that the MS is permitted to use in this cell */
int ms_max_power;
/* how do we talk OML with this TRX? */
struct gsm_e1_subslot oml_e1_link;

View File

@ -1082,7 +1082,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
arfcn = lchan->ts->trx->arfcn;
subch = lchan->nr;
lchan->ms_power = ms_pwr_ctl_lvl(bts->band, 20 /* dBm == 100mW */);
lchan->ms_power = ms_pwr_ctl_lvl(bts->band, bts->ms_max_power);
lchan->bs_power = 0; /* 0dB reduction, output power = Pn */
lchan->rsl_cmode = RSL_CMOD_SPD_SIGN;
rsl_chan_activate_lchan(lchan, 0x00, rqd_ta);

View File

@ -956,7 +956,7 @@ static void patch_si_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 */);
ms_pwr_ctl_lvl(bts->band, bts->ms_max_power);
if (bts->cell_barred) {
type_1->rach_control.cell_bar = 1;

View File

@ -151,6 +151,7 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type,
bts->bsic = bsic;
bts->num_trx = 0;
INIT_LLIST_HEAD(&bts->trx_list);
bts->ms_max_power = 15; /* dBm */
/* create our primary TRX */
bts->c0 = gsm_bts_trx_alloc(bts);

View File

@ -233,6 +233,7 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
VTY_NEWLINE);
vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE);
vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE);
vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE);
vty_out(vty, " channel allocator %s%s",
bts->chan_alloc_reverse ? "descending" : "ascending",
VTY_NEWLINE);
@ -975,6 +976,17 @@ DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd,
return CMD_SUCCESS;
}
DEFUN(cfg_bts_ms_max_power, cfg_bts_ms_max_power_cmd,
"ms max power <0-40>",
"Maximum transmit power of the MS")
{
struct gsm_bts *bts = vty->index;
bts->ms_max_power = atoi(argv[0]);
return CMD_SUCCESS;
}
/* per TRX configuration */
DEFUN(cfg_trx,
@ -1374,6 +1386,7 @@ int bsc_vty_init(struct gsm_network *net)
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_bts_ms_max_power_cmd);
install_element(BTS_NODE, &cfg_trx_cmd);