diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 1a6a72ac6..4bdca2ab7 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -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; diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index f107216c2..d54f2fd9f 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -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); diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c index 7bd036ab0..6de6fd2d9 100644 --- a/openbsc/src/bsc_hack.c +++ b/openbsc/src/bsc_hack.c @@ -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; diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c index 22e842280..7e8100dcb 100644 --- a/openbsc/src/gsm_data.c +++ b/openbsc/src/gsm_data.c @@ -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); diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c index 70c5e01a7..25aa5f185 100644 --- a/openbsc/src/vty_interface.c +++ b/openbsc/src/vty_interface.c @@ -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);