fixeria has submitted this change. (
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:
0 1 2 3 4 5 6 7 TS# in TIMESLOT_ALLOCATION
0 1 2 3 4 5 6 7 'i' value in the loop, current rshift
7 6 5 4 3 2 1 0 correct rshift in the loop (this patch)
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, 20 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
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++;
}
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-gprs/+/31949
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I36c52e282ee02c5136a645eb73a9631b95355c34
Gerrit-Change-Number: 31949
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged