Change in osmocom-bb[master]: layer23: Avoid sending downlink AGCH/PCH fill frames over GSMTAP

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/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Dec 31 17:05:51 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/16664 )

Change subject: layer23: Avoid sending downlink AGCH/PCH fill frames over GSMTAP
......................................................................

layer23: Avoid sending downlink AGCH/PCH fill frames over GSMTAP

Some bits are taken from osmo-bts l1sap.c.

Change-Id: Id21e9334b620b8ab3ad404708bfd5358e3555ab6
---
M src/host/layer23/src/common/l1ctl.c
1 file changed, 36 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index d1385e5..de66972 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -95,6 +95,34 @@
 	return GSMTAP_CHANNEL_AGCH;
 }
 
+static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
+        0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
+        0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
+        0x2B, 0x2B, 0x2B
+};
+
+/* Paging Request 1 with "no identity" content, i.e. empty/dummy paging */
+static const uint8_t paging_fill[GSM_MACBLOCK_LEN] = {
+	0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b, 0x2b, 0x2b, 0x2b,
+	0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+	0x2b, 0x2b, 0x2b };
+
+static bool is_fill_frame(uint8_t chan_type, const uint8_t *data)
+{
+	switch (chan_type) {
+	case GSMTAP_CHANNEL_AGCH:
+		if (!memcmp(data, fill_frame, GSM_MACBLOCK_LEN))
+			return true;
+		break;
+	case GSMTAP_CHANNEL_PCH:
+		if (!memcmp(data, paging_fill, GSM_MACBLOCK_LEN))
+			return true;
+		break;
+	/* don't use 'default' case here as the above only conditionally return true */
+	}
+	return false;
+}
+
 static struct msgb *osmo_l1_alloc(uint8_t msg_type)
 {
 	struct l1ctl_hdr *l1h;
@@ -274,11 +302,15 @@
 		return 0;
 	}
 
-	/* send CCCH data via GSMTAP */
 	gsmtap_chan_type = chantype_rsl2gsmtap_ext(chan_type, dl->link_id, tm.fn, ms->cellsel.si->bs_ag_blks_res);
-	gsmtap_send(gsmtap_inst, ntohs(dl->band_arfcn), chan_ts,
-		    gsmtap_chan_type, chan_ss, tm.fn, dl->rx_level-110,
-		    dl->snr, ccch->data, sizeof(ccch->data));
+	/* don't log fill frames via GSMTAP; they serve no purpose other than
+	 * to clog up your logs */
+	if (!is_fill_frame(gsmtap_chan_type, ccch->data)) {
+		/* send CCCH data via GSMTAP */
+		gsmtap_send(gsmtap_inst, ntohs(dl->band_arfcn), chan_ts,
+			    gsmtap_chan_type, chan_ss, tm.fn, dl->rx_level-110,
+			    dl->snr, ccch->data, sizeof(ccch->data));
+	}
 
 	/* determine LAPDm entity based on SACCH or not */
 	if (dl->link_id & 0x40)

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Id21e9334b620b8ab3ad404708bfd5358e3555ab6
Gerrit-Change-Number: 16664
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191231/7fb3e06a/attachment.htm>


More information about the gerrit-log mailing list