fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31949 )
Change subject: rlcmac: fix handling of TIMESLOT_ALLOCATION in handle_pkt_dl_ass() ......................................................................
rlcmac: fix handling of TIMESLOT_ALLOCATION in handle_pkt_dl_ass()
The TIMESLOT_ALLOCATION is a timeslot mask with MSB=TS0 and LSB=TS7:
7 6 5 4 3 2 1 0 TS# in TIMESLOT_ALLOCATION 0 1 2 3 4 5 6 7 'i' value in the loop
The current logic checking state of each timeslot is wrong, we actually need to shift by (7 - N) to check state of timeslot N.
Change-Id: I36c52e282ee02c5136a645eb73a9631b95355c34 Related: OS#5500 --- M src/rlcmac/tbf_dl_ass_fsm.c 1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/49/31949/1
diff --git a/src/rlcmac/tbf_dl_ass_fsm.c b/src/rlcmac/tbf_dl_ass_fsm.c index 74e1853..365772a 100644 --- a/src/rlcmac/tbf_dl_ass_fsm.c +++ b/src/rlcmac/tbf_dl_ass_fsm.c @@ -110,7 +110,7 @@
ctx->alloc.num_ts = 0; for (unsigned int i = 0; i < ARRAY_SIZE(ctx->alloc.ts); i++) { - ctx->alloc.ts[i].allocated = (dlass->TIMESLOT_ALLOCATION >> i) & 0x01; + ctx->alloc.ts[i].allocated = (dlass->TIMESLOT_ALLOCATION >> (7 - i)) & 0x01; if (ctx->alloc.ts[i].allocated) ctx->alloc.num_ts++; }