aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-08 17:19:46 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-02-08 17:19:46 +0100
commitac3d8c94320216202c289c8bf00cc4a3d2dbb49c (patch)
tree75650d8b38fb75c967033ee121be01f5279ed2da /src/libbsc
parent2e4faf56ce71516fa8ae2880512df5377895f130 (diff)
remove default step interval; it doesn't make sense to have this
Diffstat (limited to 'src/libbsc')
-rw-r--r--src/libbsc/acc_ramp.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/libbsc/acc_ramp.c b/src/libbsc/acc_ramp.c
index f38b82d5c..d5614f566 100644
--- a/src/libbsc/acc_ramp.c
+++ b/src/libbsc/acc_ramp.c
@@ -78,21 +78,18 @@ static void allow_all_allowed_accs(struct acc_ramp *acc_ramp)
static unsigned int get_next_step_interval(struct acc_ramp *acc_ramp)
{
struct gsm_bts *bts = acc_ramp->bts;
+ uint64_t load;
if (acc_ramp->step_interval_is_fixed)
return acc_ramp->step_interval_sec;
- if (bts->chan_load_avg == 0) {
- acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_DEFAULT;
- } else {
- /* Scale the step interval to current channel load average. */
- uint64_t load = (bts->chan_load_avg << 8); /* convert to fixed-point */
- acc_ramp->step_interval_sec = ((load * ACC_RAMP_STEP_INTERVAL_MAX) / 100) >> 8;
- if (acc_ramp->step_interval_sec < ACC_RAMP_STEP_SIZE_MIN)
- acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MIN;
- else if (acc_ramp->step_interval_sec > ACC_RAMP_STEP_INTERVAL_MAX)
- acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MAX;
- }
+ /* Scale the step interval to current channel load average. */
+ load = (bts->chan_load_avg << 8); /* convert to fixed-point */
+ acc_ramp->step_interval_sec = ((load * ACC_RAMP_STEP_INTERVAL_MAX) / 100) >> 8;
+ if (acc_ramp->step_interval_sec < ACC_RAMP_STEP_SIZE_MIN)
+ acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MIN;
+ else if (acc_ramp->step_interval_sec > ACC_RAMP_STEP_INTERVAL_MAX)
+ acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MAX;
LOGP(DRLL, LOGL_DEBUG, "(bts=%d) ACC RAMP: step interval set to %u seconds based on %u%% channel load average\n",
bts->nr, acc_ramp->step_interval_sec, bts->chan_load_avg);
@@ -154,7 +151,7 @@ void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts)
{
acc_ramp->bts = bts;
acc_ramp->step_size = ACC_RAMP_STEP_SIZE_DEFAULT;
- acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_DEFAULT;
+ acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MIN;
acc_ramp->step_interval_is_fixed = false;
osmo_timer_setup(&acc_ramp->step_timer, do_ramping_step, acc_ramp);