diff options
Diffstat (limited to 'include/osmo-bts/tx_power.h')
-rw-r--r-- | include/osmo-bts/tx_power.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/include/osmo-bts/tx_power.h b/include/osmo-bts/tx_power.h index 21887c7c..73134c8b 100644 --- a/include/osmo-bts/tx_power.h +++ b/include/osmo-bts/tx_power.h @@ -20,6 +20,8 @@ struct power_amp { struct pa_calibration calib; }; +typedef void (*ramp_compl_cb_t)(struct gsm_bts_trx *trx); + /* Transmit power related parameters of a transceiver */ struct trx_power_params { /* specified maximum output of TRX at full power, has to be @@ -55,24 +57,34 @@ struct trx_power_params { unsigned int step_size_mdB; unsigned int step_interval_sec; struct osmo_timer_list step_timer; + /* call-back called when target is reached */ + ramp_compl_cb_t compl_cb; } ramp; }; -int get_p_max_out_mdBm(struct gsm_bts_trx *trx); +int get_p_max_out_mdBm(const struct gsm_bts_trx *trx); + +int get_p_nominal_mdBm(const struct gsm_bts_trx *trx); + +int get_p_target_mdBm(const struct gsm_bts_trx *trx, uint8_t bs_power_red); +int get_p_target_mdBm_lchan(const struct gsm_lchan *lchan); -int get_p_nominal_mdBm(struct gsm_bts_trx *trx); +int get_p_actual_mdBm(const struct gsm_bts_trx *trx, int p_target_mdBm); -int get_p_target_mdBm(struct gsm_bts_trx *trx, uint8_t bs_power_ie); -int get_p_target_mdBm_lchan(struct gsm_lchan *lchan); +int get_p_trxout_target_mdBm(const struct gsm_bts_trx *trx, uint8_t bs_power_red); +int get_p_trxout_target_mdBm_lchan(const struct gsm_lchan *lchan); -int get_p_trxout_target_mdBm(struct gsm_bts_trx *trx, uint8_t bs_power_ie); -int get_p_trxout_target_mdBm_lchan(struct gsm_lchan *lchan); +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 get_p_trxout_actual_mdBm(struct gsm_bts_trx *trx, uint8_t bs_power_ie); -int get_p_trxout_actual_mdBm_lchan(struct gsm_lchan *lchan); +int _power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass_max_power, ramp_compl_cb_t ramp_compl_cb, bool skip_ramping); +#define power_ramp_start(trx, p_total_tgt_mdBm, bypass_max_power, ramp_compl_cb) \ + _power_ramp_start(trx, p_total_tgt_mdBm, bypass_max_power, ramp_compl_cb, false) +#define power_ramp_force(trx, p_total_tgt_mdBm, bypass_max_power, ramp_compl_cb) \ + _power_ramp_start(trx, p_total_tgt_mdBm, bypass_max_power, ramp_compl_cb, true) -int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass); +void power_ramp_abort(struct gsm_bts_trx *trx); void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm); -int power_ramp_initial_power_mdBm(struct gsm_bts_trx *trx); +int power_ramp_initial_power_mdBm(const struct gsm_bts_trx *trx); |