aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/gsm_data.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-11-12 16:30:30 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2019-11-20 15:35:05 +0100
commitf8d0389c70ed97cbb0488c0b7e5ac594d566fdb5 (patch)
tree80ade7bb419c27e2b6557c9e31e6ec38aa9ed6fa /src/osmo-bsc/gsm_data.c
parent26adddf1bfa37dbeff8e60594141e9fb3afdd46e (diff)
bsc: Send MS Power Control msg upon max MS power change
Lots of times, the MS power class is unknown until after the first channel has been activated, at which point the MS power class is received in messages such as LU update or CM Service Requet. Since the MS Power level is sent upon CHAN ACT, the only way to communicate the change of maximum MS Power (based on MS power class) after CHAN ACT is to send a MS Power Control msg. Let's do that. Related: OS#4244 Change-Id: I3d6b75578e5cb9b2ad474a0ad01362d846ebe135
Diffstat (limited to 'src/osmo-bsc/gsm_data.c')
-rw-r--r--src/osmo-bsc/gsm_data.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 2a7783762..90172dd7c 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -39,6 +39,7 @@
#include <osmocom/bsc/gsm_data.h>
#include <osmocom/bsc/osmo_bsc_lcls.h>
+#include <osmocom/bsc/abis_rsl.h>
#include <osmocom/bsc/abis_nm.h>
#include <osmocom/bsc/handover_cfg.h>
#include <osmocom/bsc/timeslot_fsm.h>
@@ -1705,6 +1706,7 @@ void lchan_update_ms_power_ctrl_level(struct gsm_lchan *lchan, int ms_power_dbm)
struct gsm_bts *bts = lchan->ts->trx->bts;
struct gsm_subscriber_connection *conn = lchan->conn;
int max_pwr_dbm_pwclass, new_pwr;
+ bool send_pwr_ctrl_msg = false;
LOG_LCHAN(lchan, LOGL_DEBUG,
"MS Power level update requested: %d dBm\n", ms_power_dbm);
@@ -1741,10 +1743,15 @@ ms_power_default:
"MS Power level update (power class %" PRIu8 "): %" PRIu8 " -> %d\n",
conn ? conn->ms_power_class : 0, lchan->ms_power, new_pwr);
+ /* If chan was already activated and max ms_power changes (due to power
+ classmark received), send an MS Power Control message */
+ if (lchan->activate.activ_ack && new_pwr != lchan->ms_power)
+ send_pwr_ctrl_msg = true;
+
lchan->ms_power = new_pwr;
- /* FIXME: if chan is active and lchan->ms_power != new_pwr, consider
- sending an MS Power Control message (RSL) towards BTS to announce the
- new max ms power lvl, see rsl_chan_ms_power_ctrl() */
+
+ if (send_pwr_ctrl_msg)
+ rsl_chan_ms_power_ctrl(lchan);
}
const struct value_string lchan_activate_mode_names[] = {