fixeria has uploaded this change for review.

View Change

bts: f_TC_pcu_tx_ul_block_req(): target the block after the next one

trxcon sends the L1CTL DL BLOCK.ind after the last burst of a block
has been received, while the Uplink bursts are scheduled in advance
(see '--trx-advance', default 2). Thus it's already too late to
target the block following the received one: trxcon drops such
UL BLOCK.req as stale, and TC_pcu_data_ind_lqual_cb fails with
"Timeout waiting for PCUIF_DATA.ind".

Fix this by targeting the block after the next one. While at it,
use the existing f_next_pdtch_block() instead of open-coding the
TDMA Fn calculation.

Change-Id: Ie77761c472ba14ad17414c347e1aed140a3295e8
---
M bts/BTS_Tests.ttcn
1 file changed, 7 insertions(+), 9 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/64/43964/1
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 719d8e3..719a9fa 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5335,21 +5335,19 @@
T.start(1.0);
alt {
[] as_l1ctl_dl_block_ind(block_ind, tn := tn, usf := usf) {
- var integer fn := block_ind.hdr.fn;
+ var GsmFrameNumber fn := block_ind.hdr.fn;

/* Ignore PTCCH/D blocks, their Fn is too far away */
if (fn mod 104 == 12) {
repeat;
}

- /* Every fn % 13 == 12 we have either a PTCCH or an IDLE slot, thus
- * every fn % 13 == 8 we add 5 frames, or 4 frames othrwise. The
- * resulting value is first fn of the next block. */
- if (fn mod 13 == 8) {
- fn := (fn + 5) mod (2048 * 51 * 26);
- } else {
- fn := (fn + 4) mod (2048 * 51 * 26);
- }
+ /* Skip the next block, target the one after it.
+ * The DL BLOCK.ind is sent by trxcon after the last burst of a block
+ * has been received, while the Uplink bursts are scheduled in advance,
+ * so it's already too late to target the block following the received
+ * one. Hence the UL BLOCK.req targets the block after the next one. */
+ fn := f_next_pdtch_block(f_next_pdtch_block(fn));

L1CTL.send(ts_L1CTL_GPRS_UL_BLOCK_REQ(fn, block_ind.hdr.tn, data));
return {fn, block_ind.hdr.tn};

To view, visit change 43964. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie77761c472ba14ad17414c347e1aed140a3295e8
Gerrit-Change-Number: 43964
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>