aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/tx_power.h1
-rw-r--r--src/common/bts_shutdown_fsm.c9
-rw-r--r--src/common/tx_power.c8
3 files changed, 16 insertions, 2 deletions
diff --git a/include/osmo-bts/tx_power.h b/include/osmo-bts/tx_power.h
index 8f68d8a5..a7f846e8 100644
--- a/include/osmo-bts/tx_power.h
+++ b/include/osmo-bts/tx_power.h
@@ -78,6 +78,7 @@ int get_p_trxout_actual_mdBm(const struct gsm_bts_trx *trx, uint8_t bs_power_red
int get_p_trxout_actual_mdBm_lchan(const struct gsm_lchan *lchan);
int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass, ramp_compl_cb_t ramp_compl_cb);
+void power_ramp_abort(struct gsm_bts_trx *trx);
void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm);
diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c
index a663f5bf..0c6d80c1 100644
--- a/src/common/bts_shutdown_fsm.c
+++ b/src/common/bts_shutdown_fsm.c
@@ -112,8 +112,15 @@ static void st_wait_ramp_down_compl(struct osmo_fsm_inst *fi, uint32_t event, vo
LOGPFSML(fi, LOGL_INFO, "%s Ramping down complete, %u TRX remaining\n",
gsm_trx_name(src_trx), remaining);
- if (remaining == 0)
+ if (remaining == 0) {
+ /* Make sure we end up any remaining ongoing power ramp
+ * down under target shutdown tx power level, then
+ * finally transit to next state:
+ */
+ llist_for_each_entry(trx, &bts->trx_list, list)
+ power_ramp_abort(trx);
bts_shutdown_fsm_state_chg(fi, BTS_SHUTDOWN_ST_WAIT_TRX_CLOSED);
+ }
break;
}
}
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index 348aba5c..03074221 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -259,7 +259,7 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass,
}
/* Cancel any pending request */
- osmo_timer_del(&tpp->ramp.step_timer);
+ power_ramp_abort(trx);
/* set the new target */
tpp->p_total_tgt_mdBm = p_total_tgt_mdBm;
@@ -297,6 +297,12 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass,
return 0;
}
+/* Cancel any pending request */
+void power_ramp_abort(struct gsm_bts_trx *trx)
+{
+ osmo_timer_del(&trx->power_params.ramp.step_timer);
+}
+
/* determine the initial transceiver output power at start-up time */
int power_ramp_initial_power_mdBm(const struct gsm_bts_trx *trx)
{