tx_power: Take into account max-initial when ramping up bigger power lvl intervals

Until now, power-ramp max-initial was only taken into account in order
to skip ramping if the desired target level was below it, in order to
forbid growin too quickly or applying directly to much power given power
amplifier requirements.
However, in the event that a higher tx power level is desired,
max-initial was not taking into account and ramping simply started from
current tx power level, which could be a lot lower than max-initial.
Allow shortcutting the ramping in that case so that max-initial is
applied directly, and ramping continues from there, in order to have a
more expected behavior (max-initial applied the same).

Since max-initial can since a few commits before handle a negative
value, this means One can for instance set max-initial to -10 and still
keep the old behavior of ramping step by step from -10 (rf-locked in
osmo-bts-trx) to 0 or 7 or whatever is the nominal power
(max_power_red).

Change-Id: I4e5742ecdbf66d77ff9445999f6fff43bbf4856a
This commit is contained in:
Pau Espin 2020-07-27 17:34:29 +02:00
parent eef420d1ca
commit 57fc9fa782
1 changed files with 3 additions and 1 deletions

View File

@ -276,8 +276,10 @@ int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass,
tpp->ramp.attenuation_mdB = 0;
power_ramp_timer_cb(trx);
} else {
/* We need to step it up. Start from the current value */
/* We need to step it up. Start from the current value, shortcutting to max-initial. */
/* Set attenuation to cause no power change right now */
if (tpp->p_total_cur_mdBm + tpp->ramp.step_size_mdB < tpp->ramp.max_initial_pout_mdBm)
tpp->p_total_cur_mdBm = tpp->ramp.max_initial_pout_mdBm - tpp->ramp.step_size_mdB;
tpp->ramp.attenuation_mdB = tpp->p_total_tgt_mdBm - tpp->p_total_cur_mdBm;
/* start with the first step */