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

pespin gerrit-no-reply at lists.osmocom.org
Fri Dec 20 15:48:41 UTC 2019


pespin has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/64/16664/1

diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index 014e4f8..aece3bf 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: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191220/f8ab6507/attachment.htm>


More information about the gerrit-log mailing list