aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-sysmo/utils.c')
-rw-r--r--src/osmo-bts-sysmo/utils.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/osmo-bts-sysmo/utils.c b/src/osmo-bts-sysmo/utils.c
index afca7730..a636ae15 100644
--- a/src/osmo-bts-sysmo/utils.c
+++ b/src/osmo-bts-sysmo/utils.c
@@ -137,88 +137,4 @@ int sysmobts_get_nominal_power(struct gsm_bts_trx *trx)
return -1;
}
-int sysmobts_get_target_power(struct gsm_bts_trx *trx)
-{
- int target_power = trx->nominal_power - trx->max_power_red;
- target_power -= trx->power_reduce;
-
- if (target_power < 0)
- target_power = 0;
-
- return target_power;
-}
-
-void sysmobts_pa_pwr_init(struct gsm_bts_trx *trx)
-{
- int target_power = sysmobts_get_target_power(trx);
-
- /* Cancel any pending request */
- osmo_timer_del(&trx->pa.step_timer);
-
- /* is this below our initial target */
- if (target_power <= trx->pa.max_initial_power) {
- LOGP(DL1C, LOGL_NOTICE,
- "PA target_power(%d) is below initial power.\n",
- target_power);
- trx->pa.current_power = target_power;
- return;
- }
-
- /* is this below our current value? */
- if (target_power <= trx->pa.current_power) {
- LOGP(DL1C, LOGL_NOTICE,
- "PA target_power(%d) is below current_power.\n",
- target_power);
- trx->pa.current_power = target_power;
- return;
- }
- if (trx->pa.current_power > trx->pa.max_initial_power) {
- LOGP(DL1C, LOGL_NOTICE,
- "PA target_power(%d) starting from current_power.\n",
- target_power);
- return;
- }
-
- /* We need to step it up. Start from the initial value */
- trx->pa.current_power = trx->pa.max_initial_power;
- LOGP(DL1C, LOGL_NOTICE,
- "PA target_power(%d) starting with %d dBm.\n",
- target_power, trx->pa.current_power);
-}
-
-static void pa_trx_cb(void *_trx)
-{
- struct gsm_bts_trx *trx = _trx;
-
- LOGP(DL1C, LOGL_NOTICE,
- "PA raising power to %d dBm.\n", trx->pa.current_power);
- l1if_set_txpower(trx_femtol1_hdl(trx), (float) trx->pa.current_power);
-}
-
-void sysmobts_pa_maybe_step(struct gsm_bts_trx *trx)
-{
- /* it can not have changed */
- int target_power = sysmobts_get_target_power(trx);
-
- /* We are done */
- if (trx->pa.current_power >= target_power) {
- LOGP(DL1C, LOGL_NOTICE,
- "PA have reached target power: %d dBm.\n",
- target_power);
- return;
- }
-
- /* Step up the current power but clamp it */
- trx->pa.current_power += trx->pa.step_size;
- if (trx->pa.current_power > target_power)
- trx->pa.current_power = target_power;
-
- LOGP(DL1C, LOGL_NOTICE,
- "PA scheduling to step to %d dBm.\n",
- trx->pa.current_power);
-
- trx->pa.step_timer.data = trx;
- trx->pa.step_timer.cb = pa_trx_cb;
- osmo_timer_schedule(&trx->pa.step_timer, trx->pa.step_interval, 0);
-}