aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcommon/acc_ramp.c
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-06 17:45:50 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-02-06 17:45:50 +0100
commitb8f3ac43514ed047308e0bff352f377ecb205035 (patch)
treeac3e1dcb4a320febaa469ba161969a1260f5ad09 /src/libcommon/acc_ramp.c
parentdb271d3a5d708cfce04e78022bdb047b7969e855 (diff)
fix logging for ACC 8 and 9
Diffstat (limited to 'src/libcommon/acc_ramp.c')
-rw-r--r--src/libcommon/acc_ramp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libcommon/acc_ramp.c b/src/libcommon/acc_ramp.c
index 35e447e60..11e7166e2 100644
--- a/src/libcommon/acc_ramp.c
+++ b/src/libcommon/acc_ramp.c
@@ -17,6 +17,7 @@
*
*/
+#include <assert.h>
#include <strings.h>
#include <errno.h>
@@ -38,10 +39,14 @@ static void allow_all_accs(struct acc_ramp *acc_ramp)
acc_ramp->barred_t3 = 0x00; /* ACC0 - ACC7 allowed */
}
-static void allow_one_acc(uint8_t *barred, unsigned int acc, struct gsm_bts * bts)
+static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
{
- LOGP(DRLL, LOGL_DEBUG, "(bts=%d) ACC RAMP: allowing Access Control Class %u\n", bts->nr, acc);
- *barred &= ~(1 << (acc));
+ LOGP(DRLL, LOGL_DEBUG, "(bts=%d) ACC RAMP: allowing Access Control Class %u\n", acc_ramp->bts->nr, acc);
+ assert(acc >= 0 && acc <= 9);
+ if (acc == 8 || acc == 9)
+ acc_ramp->barred_t2 &= (1 << (acc - 8));
+ else
+ acc_ramp->barred_t3 &= (1 << acc);
}
static unsigned int get_next_step_interval(struct acc_ramp *acc_ramp)
@@ -85,11 +90,11 @@ static void do_ramp_step(void *data)
if (c <= 0) {
c = ffs(acc_ramp->barred_t2);
if (c == 1 || c == 2) /* ACC8 or ACC9 */
- allow_one_acc(&acc_ramp->barred_t2, c - 1, acc_ramp->bts);
+ allow_one_acc(acc_ramp, c - 1 + 8);
else
break; /* all ACCs are now allowed */
} else
- allow_one_acc(&acc_ramp->barred_t3, c - 1, acc_ramp->bts); /* ACC0-ACC7 */
+ allow_one_acc(acc_ramp, c - 1); /* ACC0-ACC7 */
}
/* If we have not allowed all ACCs yet, schedule another ramping step. */