Change in osmocom-bb[master]: layer23/app_ccch_scan.c: omit dummy (fill) frames

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Oct 1 19:01:00 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11177


Change subject: layer23/app_ccch_scan.c: omit dummy (fill) frames
......................................................................

layer23/app_ccch_scan.c: omit dummy (fill) frames

In some conditions it's required to maintain continuous burst
transmission (e.g. on C0). If there is nothing to transmit at
a given moment, either a LAPDm func=UI fill frame,
or a "dummy" Paging Request is used.

In case of 'ccch_scan' application, they are useless.
Let's detect and omit them.

Change-Id: I6ccecb1a78bdac3e467bdc14b7a01afbe17aa53c
---
M src/host/layer23/src/misc/app_ccch_scan.c
1 file changed, 32 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/77/11177/1

diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c
index 3a55226..88a2bef 100644
--- a/src/host/layer23/src/misc/app_ccch_scan.c
+++ b/src/host/layer23/src/misc/app_ccch_scan.c
@@ -376,11 +376,43 @@
 	return 0;
 }
 
+/* Dummy Paging Request 1 with "no identity" */
+static const uint8_t paging_fill[] = {
+	0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b,
+	/* The rest part may be randomized */
+};
+
+/* LAPDm func=UI fill frame (for the BTS side) */
+static const uint8_t lapdm_fill[] = {
+	0x03, 0x03, 0x01, 0x2b,
+	/* The rest part may be randomized */
+};
+
+/* TODO: share / generalize this code */
+static bool is_fill_frame(struct msgb *msg)
+{
+	size_t l2_len = msgb_l3len(msg);
+	uint8_t *l2 = msgb_l3(msg);
+
+	OSMO_ASSERT(l2_len == GSM_MACBLOCK_LEN);
+
+	if (!memcmp(l2, paging_fill, sizeof(paging_fill)))
+		return true;
+	if (!memcmp(l2, lapdm_fill, sizeof(lapdm_fill)))
+		return true;
+
+	return false;
+}
+
 int gsm48_rx_ccch(struct msgb *msg, struct osmocom_ms *ms)
 {
 	struct gsm48_system_information_type_header *sih = msgb_l3(msg);
 	int rc = 0;
 
+	/* Skip dummy (fill) frames */
+	if (is_fill_frame(msg))
+		return 0;
+
 	if (sih->rr_protocol_discriminator != GSM48_PDISC_RR)
 		LOGP(DRR, LOGL_ERROR, "PCH pdisc (%s) != RR\n",
 			gsm48_pdisc_name(sih->rr_protocol_discriminator));

-- 
To view, visit https://gerrit.osmocom.org/11177
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ccecb1a78bdac3e467bdc14b7a01afbe17aa53c
Gerrit-Change-Number: 11177
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181001/f34b0231/attachment.htm>


More information about the gerrit-log mailing list