diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-06 20:30:52 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-02-05 23:02:42 +0100 |
commit | 35f49065f59053364b73f4343103d463ed6ec058 (patch) | |
tree | 6c62a503e3795049159662d785391cee61d65bc3 /src/common | |
parent | bc24955e91f050e904851f589400eac4c3443917 (diff) |
power/sysmobts: Add a manual ms power level control
Currently the DSP is instructed to achieve a given uplink
power target but there are circumstances (e.g. EMV testing)
where we need more control over it. The "manual/software/osmo"
power control can only be implemented per TRX and not per
lchan. Add a very very basic control that checks the MS Power
used by the phone, the actual receive level and then adjust
the power.
The code doesn't take the history into account, if the phone
can not reach the requested power level the code will be stuck
(e.g. no timeout based on multiframes). It has a mode for a
fixed power control but no way to set it yet.
The change of the mode requires a restart of the software.
Conflicts:
include/osmo-bts/bts_model.h
src/common/vty.c
src/osmo-bts-sysmo/l1_if.c
src/osmo-bts-sysmo/l1_if.h
src/osmo-bts-sysmo/oml.c
tests/sysmobts/sysmobts_test.c
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/bts.c | 5 | ||||
-rw-r--r-- | src/common/rsl.c | 10 | ||||
-rw-r--r-- | src/common/vty.c | 14 |
3 files changed, 28 insertions, 1 deletions
diff --git a/src/common/bts.c b/src/common/bts.c index 878770af..4c9d04a8 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -595,3 +595,8 @@ int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher) sup = (1 << (rsl_cipher - 2)) & bts->support.ciphers; return sup > 0; } + +int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx) +{ + return trx->ms_power_control == 1; +} diff --git a/src/common/rsl.c b/src/common/rsl.c index bc7fddb9..5082f2a8 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -709,6 +709,11 @@ static int rsl_rx_chan_activ(struct msgb *msg) return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL); } + /* Initialize channel defaults */ + lchan->ms_power = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0); + lchan->ms_power_ctrl.current = lchan->ms_power; + lchan->ms_power_ctrl.fixed = 0; + rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)); /* 9.3.3 Activation Type */ @@ -748,8 +753,11 @@ static int rsl_rx_chan_activ(struct msgb *msg) if (TLVP_PRESENT(&tp, RSL_IE_BS_POWER)) lchan->bs_power = *TLVP_VAL(&tp, RSL_IE_BS_POWER); /* 9.3.13 MS Power */ - if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER)) + if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER)) { lchan->ms_power = *TLVP_VAL(&tp, RSL_IE_MS_POWER); + lchan->ms_power_ctrl.current = lchan->ms_power; + lchan->ms_power_ctrl.fixed = 0; + } /* 9.3.24 Timing Advance */ if (TLVP_PRESENT(&tp, RSL_IE_TIMING_ADVANCE)) lchan->rqd_ta = *TLVP_VAL(&tp, RSL_IE_TIMING_ADVANCE); diff --git a/src/common/vty.c b/src/common/vty.c index 3af697c7..0056b1b7 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -202,6 +202,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) llist_for_each_entry(trx, &bts->trx_list, list) { vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE); + vty_out(vty, " ms-power-control %s%s", + trx->ms_power_control == 0 ? "dsp" : "osmo", + VTY_NEWLINE); bts_model_config_write_trx(vty, trx); } } @@ -399,6 +402,16 @@ DEFUN(cfg_bts_agch_queue_mgmt_default, return CMD_SUCCESS; } +DEFUN(cfg_trx_ms_power_control, cfg_trx_ms_power_control_cmd, + "ms-power-control (dsp|osmo)", + "Mobile Station Power Level Control (change requires restart)\n" + "Handled by DSP\n" "Handled by OsmoBTS\n") +{ + struct gsm_bts_trx *trx = vty->index; + + trx->ms_power_control = argv[0][0] == 'd' ? 0 : 1; + return CMD_SUCCESS; +} /* ====================================================================== * SHOW @@ -578,6 +591,7 @@ int bts_vty_init(const struct log_info *cat) install_node(&trx_node, config_write_dummy); install_default(TRX_NODE); + install_element(TRX_NODE, &cfg_trx_ms_power_control_cmd); install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd); return 0; |