<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/17928">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">measurement: remove unecessary is_amr_sid_update parameter<br><br>The function ts45008_83_is_sub rougly decides if a frame is a SUB frame<br>or not. This works by checking the frame number against against lookup<br>tables. This works fine for codecs where the occurrence of SUB frames is<br>fixed. However for AMR this is not the case as the DTX periods are<br>dynamic. Here it is the responsibility of the lower layers (phy,<br>frame decoding) to tag SUB frames early since making the decision later<br>based on the frame number is not possible.<br><br>The parameter is_amr_sid_update was probably added as a placeholder. It<br>is set to falls by the callers of the function. Lets remove this<br>parameter as a late decision if an AMR frame is a SUB frame will never<br>work.<br><br>Change-Id: I125d5ff592218a9e98130a6a7b6bbc6378ce4132<br>Related: OS#2978<br>---<br>M include/osmo-bts/measurement.h<br>M src/common/measurement.c<br>M tests/meas/meas_test.c<br>3 files changed, 4 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/28/17928/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h</span><br><span>index 4f04ffa..8e91c33 100644</span><br><span>--- a/include/osmo-bts/measurement.h</span><br><span>+++ b/include/osmo-bts/measurement.h</span><br><span>@@ -12,7 +12,7 @@</span><br><span> </span><br><span> void lchan_meas_reset(struct gsm_lchan *lchan);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn, bool is_amr_sid_update);</span><br><span style="color: hsl(120, 100%, 40%);">+bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn);</span><br><span> </span><br><span> int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn);</span><br><span> </span><br><span>diff --git a/src/common/measurement.c b/src/common/measurement.c</span><br><span>index b883d51..c5cbbb0 100644</span><br><span>--- a/src/common/measurement.c</span><br><span>+++ b/src/common/measurement.c</span><br><span>@@ -45,7 +45,7 @@</span><br><span> </span><br><span> /* Decide if a given frame number is part of the "-SUB" measurements (true) or not (false)</span><br><span>  * (this function is only used internally, it is public to call it from unit-tests) */</span><br><span style="color: hsl(0, 100%, 40%);">-bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn, bool is_amr_sid_update)</span><br><span style="color: hsl(120, 100%, 40%);">+bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn)</span><br><span> {</span><br><span>       uint32_t fn104 = fn % 104;</span><br><span> </span><br><span>@@ -66,8 +66,6 @@</span><br><span>           case GSM48_CMODE_SPEECH_AMR:</span><br><span>                         if (trx_sched_is_sacch_fn(lchan->ts, fn, true))</span><br><span>                           return true;</span><br><span style="color: hsl(0, 100%, 40%);">-                    if (is_amr_sid_update)</span><br><span style="color: hsl(0, 100%, 40%);">-                          return true;</span><br><span>                         break;</span><br><span>               default:</span><br><span>                     LOGPFN(DMEAS, LOGL_ERROR, fn, "%s: Unsupported lchan->tch_mode %u\n",</span><br><span>@@ -96,8 +94,6 @@</span><br><span>               case GSM48_CMODE_SPEECH_AMR:</span><br><span>                         if (trx_sched_is_sacch_fn(lchan->ts, fn, true))</span><br><span>                           return true;</span><br><span style="color: hsl(0, 100%, 40%);">-                    if (is_amr_sid_update)</span><br><span style="color: hsl(0, 100%, 40%);">-                          return true;</span><br><span>                         break;</span><br><span>               case GSM48_CMODE_SIGN:</span><br><span>                       /* No DTX allowed; SUB=FULL, therefore measurements at all frame numbers are</span><br><span>@@ -343,7 +339,7 @@</span><br><span>   /* We expect the lower layers to mark AMR SID_UPDATE frames already as such.</span><br><span>          * In this function, we only deal with the common logic as per the TS 45.008 tables */</span><br><span>       if (!ulm->is_sub)</span><br><span style="color: hsl(0, 100%, 40%);">-            ulm->is_sub = ts45008_83_is_sub(lchan, fn, false);</span><br><span style="color: hsl(120, 100%, 40%);">+         ulm->is_sub = ts45008_83_is_sub(lchan, fn);</span><br><span> </span><br><span>   DEBUGPFN(DMEAS, fn, "%s adding measurement (is_sub=%u), num_ul_meas=%d, fn_mod=%u\n",</span><br><span>               gsm_lchan_name(lchan), ulm->is_sub, lchan->meas.num_ul_meas, fn_mod);</span><br><span>diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c</span><br><span>index c8f06b6..f414b60 100644</span><br><span>--- a/tests/meas/meas_test.c</span><br><span>+++ b/tests/meas/meas_test.c</span><br><span>@@ -469,7 +469,7 @@</span><br><span>      /* Walk trough the first 100 intervals and check for unexpected</span><br><span>       * results (false positive and false negative) */</span><br><span>    for (i = 0; i < 104 * 100; i++) {</span><br><span style="color: hsl(0, 100%, 40%);">-            rc = ts45008_83_is_sub(lchan, i, false);</span><br><span style="color: hsl(120, 100%, 40%);">+              rc = ts45008_83_is_sub(lchan, i);</span><br><span>            if (rc) {</span><br><span>                    if (!test_ts45008_83_is_sub_is_sacch(i)</span><br><span>                          && !test_ts45008_83_is_sub_is_sub(i, ss)) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/17928">change 17928</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/c/osmo-bts/+/17928"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I125d5ff592218a9e98130a6a7b6bbc6378ce4132 </div>
<div style="display:none"> Gerrit-Change-Number: 17928 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>