fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmocom-bb/+/32057 )
Change subject: trxcon: l1sched_prim_dequeue(): check TDMA Fn in PDCH prims
......................................................................
trxcon: l1sched_prim_dequeue(): check TDMA Fn in PDCH prims
We shall never be transmitting Uplink PDCH blocks if the current
TDMA Fn does not match the requested TDMA Fn, because Tx timing
is critical for PDCH timeslots. Drop and log an error message.
Change-Id: I6b2d9cc93ce266524f56a1b6a97beecfc0ad042d
Related: OS#5500
---
M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h
M src/host/trxcon/src/sched_prim.c
M src/host/trxcon/src/trxcon_fsm.c
3 files changed, 34 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/57/32057/1
diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h
b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h
index 84695fe..350294d 100644
--- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h
+++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h
@@ -354,6 +354,8 @@
enum l1sched_ts_prim_type type;
/*! Logical channel type */
enum l1sched_lchan_type chan;
+ /*! TDMA Fn for L1SCHED_{PDTCH,PTCCH} */
+ uint32_t fn;
/*! Payload length */
size_t payload_len;
/*! Payload */
diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c
index f97e505..99c4d82 100644
--- a/src/host/trxcon/src/sched_prim.c
+++ b/src/host/trxcon/src/sched_prim.c
@@ -421,6 +421,8 @@
struct l1sched_ts_prim *l1sched_prim_dequeue(struct llist_head *queue,
uint32_t fn, struct l1sched_lchan_state *lchan)
{
+ struct l1sched_ts_prim *prim;
+
/* SACCH is unorthodox, see 3GPP TS 04.08, section 3.4.1 */
if (L1SCHED_CHAN_IS_SACCH(lchan->type))
return prim_dequeue_sacch(queue, lchan);
@@ -439,6 +441,20 @@
case L1SCHED_TCHH_1:
return prim_dequeue_tch_h(queue, fn, lchan->type);
+ /* PDCH is timing critical, we need to check TDMA Fn */
+ case L1SCHED_PDTCH:
+ case L1SCHED_PTCCH:
+ prim = prim_dequeue_one(queue, lchan->type);
+ if (prim == NULL)
+ return NULL;
+ if (OSMO_LIKELY(prim->fn == fn))
+ return prim;
+ LOGP_LCHAND(lchan, LOGL_ERROR,
+ "%s(): dropping Tx primitive (current Fn=%u, prim Fn=%u)\n",
+ __func__, fn, prim->fn);
+ talloc_free(prim);
+ return NULL;
+
/* Other kinds of logical channels */
default:
return prim_dequeue_one(queue, lchan->type);
diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c
index 053ca2f..91c807a 100644
--- a/src/host/trxcon/src/trxcon_fsm.c
+++ b/src/host/trxcon/src/trxcon_fsm.c
@@ -560,6 +560,8 @@
LOGPFSML(fi, LOGL_ERROR, "Failed to enqueue a prim\n");
return;
}
+
+ prim->fn = block_req.hdr.fn;
break;
}
case TRXCON_EV_RX_DATA_IND:
--
To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/32057
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I6b2d9cc93ce266524f56a1b6a97beecfc0ad042d
Gerrit-Change-Number: 32057
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange