<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11177">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">layer23/app_ccch_scan.c: omit dummy (fill) frames<br><br>In some conditions it's required to maintain continuous burst<br>transmission (e.g. on C0). If there is nothing to transmit at<br>a given moment, either a LAPDm func=UI fill frame,<br>or a "dummy" Paging Request is used.<br><br>In case of 'ccch_scan' application, they are useless.<br>Let's detect and omit them.<br><br>Change-Id: I6ccecb1a78bdac3e467bdc14b7a01afbe17aa53c<br>---<br>M src/host/layer23/src/misc/app_ccch_scan.c<br>1 file changed, 32 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c</span><br><span>index 3a55226..88a2bef 100644</span><br><span>--- a/src/host/layer23/src/misc/app_ccch_scan.c</span><br><span>+++ b/src/host/layer23/src/misc/app_ccch_scan.c</span><br><span>@@ -376,11 +376,43 @@</span><br><span>    return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Dummy Paging Request 1 with "no identity" */</span><br><span style="color: hsl(120, 100%, 40%);">+static const uint8_t paging_fill[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x15, 0x06, 0x21, 0x00, 0x01, 0xf0, 0x2b,</span><br><span style="color: hsl(120, 100%, 40%);">+     /* The rest part may be randomized */</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* LAPDm func=UI fill frame (for the BTS side) */</span><br><span style="color: hsl(120, 100%, 40%);">+static const uint8_t lapdm_fill[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+ 0x03, 0x03, 0x01, 0x2b,</span><br><span style="color: hsl(120, 100%, 40%);">+       /* The rest part may be randomized */</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* TODO: share / generalize this code */</span><br><span style="color: hsl(120, 100%, 40%);">+static bool is_fill_frame(struct msgb *msg)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ size_t l2_len = msgb_l3len(msg);</span><br><span style="color: hsl(120, 100%, 40%);">+      uint8_t *l2 = msgb_l3(msg);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ OSMO_ASSERT(l2_len == GSM_MACBLOCK_LEN);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    if (!memcmp(l2, paging_fill, sizeof(paging_fill)))</span><br><span style="color: hsl(120, 100%, 40%);">+            return true;</span><br><span style="color: hsl(120, 100%, 40%);">+  if (!memcmp(l2, lapdm_fill, sizeof(lapdm_fill)))</span><br><span style="color: hsl(120, 100%, 40%);">+              return true;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return false;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> int gsm48_rx_ccch(struct msgb *msg, struct osmocom_ms *ms)</span><br><span> {</span><br><span>        struct gsm48_system_information_type_header *sih = msgb_l3(msg);</span><br><span>     int rc = 0;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       /* Skip dummy (fill) frames */</span><br><span style="color: hsl(120, 100%, 40%);">+        if (is_fill_frame(msg))</span><br><span style="color: hsl(120, 100%, 40%);">+               return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  if (sih->rr_protocol_discriminator != GSM48_PDISC_RR)</span><br><span>             LOGP(DRR, LOGL_ERROR, "PCH pdisc (%s) != RR\n",</span><br><span>                    gsm48_pdisc_name(sih->rr_protocol_discriminator));</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11177">change 11177</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11177"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmocom-bb </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I6ccecb1a78bdac3e467bdc14b7a01afbe17aa53c </div>
<div style="display:none"> Gerrit-Change-Number: 11177 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>