diff options
Diffstat (limited to 'src/osmo-bts-sysmo/sysmobts_vty.c')
-rw-r--r-- | src/osmo-bts-sysmo/sysmobts_vty.c | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c index 3199c8e2..2e853356 100644 --- a/src/osmo-bts-sysmo/sysmobts_vty.c +++ b/src/osmo-bts-sysmo/sysmobts_vty.c @@ -45,6 +45,7 @@ #include <osmo-bts/bts_model.h> #include <osmo-bts/vty.h> #include <osmo-bts/rsl.h> +#include <osmo-bts/bts.h> #include "femtobts.h" #include "l1_if.h" @@ -59,8 +60,6 @@ extern int lchan_activate(struct gsm_lchan *lchan); TRX_STR #define DSP_TRACE_F_STR "DSP Trace Flag\n" -static struct gsm_bts *vty_bts; - /* configuration */ DEFUN(cfg_phy_clkcal_eeprom, cfg_phy_clkcal_eeprom_cmd, @@ -153,9 +152,20 @@ DEFUN_DEPRECATED(cfg_trx_ul_power_target, cfg_trx_ul_power_target_cmd, "Obsolete alias for bts uplink-power-target\n" "Target uplink Rx level in dBm\n") { + struct gsm_power_ctrl_meas_params *mp; struct gsm_bts_trx *trx = vty->index; + int rxlev_dbm = atoi(argv[0]); + + mp = &trx->bts->ms_dpc_params.rxlev_meas; + mp->lower_thresh = mp->upper_thresh = dbm2rxlev(rxlev_dbm); - trx->bts->ul_power_target = atoi(argv[0]); + vty_out(vty, "%% Command '%s' has been deprecated.%s" + "%% MS/BS Power control parameters should be configured in osmo-bsc: " + "use 'rxlev-thresh lower %u upper %u'.%s", + self->string, VTY_NEWLINE, + mp->lower_thresh, + mp->upper_thresh, + VTY_NEWLINE); return CMD_SUCCESS; } @@ -178,7 +188,7 @@ DEFUN(cfg_phy_dsp_trace_f, cfg_phy_dsp_trace_f_cmd, struct phy_instance *pinst = vty->index; unsigned int flag; - flag = get_string_value(femtobts_tracef_names, argv[1]); + flag = get_string_value(femtobts_tracef_names, argv[0]); pinst->u.sysmobts.dsp_trace_f |= flag; return CMD_SUCCESS; @@ -190,7 +200,7 @@ DEFUN(cfg_phy_no_dsp_trace_f, cfg_phy_no_dsp_trace_f_cmd, struct phy_instance *pinst = vty->index; unsigned int flag; - flag = get_string_value(femtobts_tracef_names, argv[1]); + flag = get_string_value(femtobts_tracef_names, argv[0]); pinst->u.sysmobts.dsp_trace_f &= ~flag; return CMD_SUCCESS; @@ -216,11 +226,11 @@ DEFUN(show_phy_clksrc, show_trx_clksrc_cmd, } DEFUN(show_dsp_trace_f, show_dsp_trace_f_cmd, - "show trx <0-0> dsp-trace-flags", + "show dsp-trace-flags trx <0-0>", SHOW_TRX_STR "Display the current setting of the DSP trace flags") { int trx_nr = atoi(argv[0]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); struct femtol1_hdl *fl1h; int i; @@ -340,7 +350,7 @@ DEFUN(activate_lchan, activate_lchan_cmd, int trx_nr = atoi(argv[0]); int ts_nr = atoi(argv[1]); int lchan_nr = atoi(argv[3]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; struct gsm_lchan *lchan = &ts->lchan[lchan_nr]; @@ -360,9 +370,9 @@ DEFUN(set_tx_power, set_tx_power_cmd, { int trx_nr = atoi(argv[0]); int power = atoi(argv[1]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); - power_ramp_start(trx, to_mdB(power), 1); + power_ramp_start(trx, to_mdB(power), 1, NULL); return CMD_SUCCESS; } @@ -373,7 +383,7 @@ DEFUN(reset_rf_clock_ctr, reset_rf_clock_ctr_cmd, "RF Clock Information\n" "Reset the counter\n") { int trx_nr = atoi(argv[0]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx); l1if_rf_clock_info_reset(fl1h); @@ -386,7 +396,7 @@ DEFUN(correct_rf_clock_ctr, correct_rf_clock_ctr_cmd, "RF Clock Information\n" "Apply\n") { int trx_nr = atoi(argv[0]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx); l1if_rf_clock_info_correct(fl1h); @@ -403,7 +413,7 @@ DEFUN(loopback, loopback_cmd, int trx_nr = atoi(argv[0]); int ts_nr = atoi(argv[1]); int lchan_nr = atoi(argv[2]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; struct gsm_lchan *lchan = &ts->lchan[lchan_nr]; @@ -422,7 +432,7 @@ DEFUN(no_loopback, no_loopback_cmd, int trx_nr = atoi(argv[0]); int ts_nr = atoi(argv[1]); int lchan_nr = atoi(argv[2]); - struct gsm_bts_trx *trx = gsm_bts_trx_num(vty_bts, trx_nr); + struct gsm_bts_trx *trx = gsm_bts_trx_num(g_bts, trx_nr); struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; struct gsm_lchan *lchan = &ts->lchan[lchan_nr]; @@ -432,22 +442,22 @@ DEFUN(no_loopback, no_loopback_cmd, } -void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) +void bts_model_config_write_bts(struct vty *vty, const struct gsm_bts *bts) { } -void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) +void bts_model_config_write_trx(struct vty *vty, const struct gsm_bts_trx *trx) { if (trx->nominal_power != get_p_max_out_mdBm(trx)) vty_out(vty, " nominal-tx-power %d%s", trx->nominal_power, VTY_NEWLINE); } -void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink) +void bts_model_config_write_phy(struct vty *vty, const struct phy_link *plink) { } -void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst) +void bts_model_config_write_phy_inst(struct vty *vty, const struct phy_instance *pinst) { int i; @@ -474,39 +484,37 @@ void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst pinst->u.sysmobts.clk_src), VTY_NEWLINE); } -int bts_model_vty_init(struct gsm_bts *bts) +int bts_model_vty_init(void *ctx) { - vty_bts = bts; - /* runtime-patch the command strings with debug levels */ - dsp_trace_f_cmd.string = vty_cmd_string_from_valstr(bts, femtobts_tracef_names, + dsp_trace_f_cmd.string = vty_cmd_string_from_valstr(ctx, femtobts_tracef_names, "trx <0-0> dsp-trace-flag (", "|",")", VTY_DO_LOWER); - dsp_trace_f_cmd.doc = vty_cmd_string_from_valstr(bts, femtobts_tracef_docs, + dsp_trace_f_cmd.doc = vty_cmd_string_from_valstr(ctx, femtobts_tracef_docs, TRX_STR DSP_TRACE_F_STR, "\n", "", 0); - no_dsp_trace_f_cmd.string = vty_cmd_string_from_valstr(bts, femtobts_tracef_names, + no_dsp_trace_f_cmd.string = vty_cmd_string_from_valstr(ctx, femtobts_tracef_names, "no trx <0-0> dsp-trace-flag (", "|",")", VTY_DO_LOWER); - no_dsp_trace_f_cmd.doc = vty_cmd_string_from_valstr(bts, femtobts_tracef_docs, + no_dsp_trace_f_cmd.doc = vty_cmd_string_from_valstr(ctx, femtobts_tracef_docs, NO_STR TRX_STR DSP_TRACE_F_STR, "\n", "", 0); cfg_phy_dsp_trace_f_cmd.string = - vty_cmd_string_from_valstr(bts, femtobts_tracef_names, + vty_cmd_string_from_valstr(ctx, femtobts_tracef_names, "dsp-trace-flag (", "|", ")", VTY_DO_LOWER); cfg_phy_dsp_trace_f_cmd.doc = - vty_cmd_string_from_valstr(bts, femtobts_tracef_docs, + vty_cmd_string_from_valstr(ctx, femtobts_tracef_docs, DSP_TRACE_F_STR, "\n", "", 0); cfg_phy_no_dsp_trace_f_cmd.string = - vty_cmd_string_from_valstr(bts, femtobts_tracef_names, + vty_cmd_string_from_valstr(ctx, femtobts_tracef_names, "no dsp-trace-flag (", "|", ")", VTY_DO_LOWER); cfg_phy_no_dsp_trace_f_cmd.doc = - vty_cmd_string_from_valstr(bts, femtobts_tracef_docs, + vty_cmd_string_from_valstr(ctx, femtobts_tracef_docs, NO_STR DSP_TRACE_F_STR, "\n", "", 0); |