fixeria has uploaded this change for review.

View Change

l1gprs: properly handle (forward) PTCCH/D blocks

Unconditionally forward PTCCH/D blocks towards the upper layers.
Calling l1gprs_pdch_filter_dl_block() on them makes no sense.

Change-Id: Ifcc53d442426c8bfdacd3d179e20bb45c43f4644
Fixes: BTS_Tests.TC_pcu_ptcch (DL part)
Related: OS#5500
---
M src/shared/l1gprs.c
1 file changed, 24 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/00/33100/1
diff --git a/src/shared/l1gprs.c b/src/shared/l1gprs.c
index 5874b48..fd18e4e 100644
--- a/src/shared/l1gprs.c
+++ b/src/shared/l1gprs.c
@@ -383,6 +383,10 @@
return 0;
}

+/* Check if a Downlink block is a PTCCH/D (see 3GPP TS 45.002, table 6) */
+#define BLOCK_IND_IS_PTCCH(ind) \
+ (((ind)->hdr.fn % 104) == 12)
+
struct msgb *l1gprs_handle_dl_block_ind(struct l1gprs_state *gprs,
const struct l1gprs_prim_dl_block_ind *ind)
{
@@ -401,7 +405,8 @@
pdch = &gprs->pdch[ind->hdr.tn];

LOGP_PDCH(pdch, LOGL_DEBUG,
- "Rx DL BLOCK.ind (fn=%u, len=%zu): %s\n",
+ "Rx DL BLOCK.ind (%s, fn=%u, len=%zu): %s\n",
+ BLOCK_IND_IS_PTCCH(ind) ? "PTCCH" : "PDTCH",
ind->hdr.fn, ind->data_len, osmo_hexdump(ind->data, ind->data_len));

if ((pdch->ul_tbf_count == 0) && (pdch->dl_tbf_count == 0)) {
@@ -432,6 +437,10 @@

if (ind->data_len == 0)
return msg;
+ if (BLOCK_IND_IS_PTCCH(ind)) {
+ memcpy(msgb_put(msg, ind->data_len), ind->data, ind->data_len);
+ return msg;
+ }

cs = osmo_gprs_dl_cs_by_block_bytes(ind->data_len);
switch (cs) {

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ifcc53d442426c8bfdacd3d179e20bb45c43f4644
Gerrit-Change-Number: 33100
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange