<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10761">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">measurement: send measurement reports for missed interval ends<br><br>When the end of the measurement interval can not be detected because the<br>SACCH block got lost, then the logic runs the measurement computation,<br>but there is no measurement report sent via RSL. This is due to the fact<br>that those reports are triggered when a SACCH frame from the MS is<br>received. The computed measurement result is then put into an RSL<br>message together with the DTAP message from the MS. However, it is legal<br>to leave the DTAP part out if it has not been received. Lets add a<br>function to rsl.c that we can call from measurement.c in order to force<br>an RSL measurement report when a missing interval end is detected.<br><br>- Add new function rsl_push_meas_res()<br>- Call rsl_push_meas_res() when an interval end has been missed.<br><br>Change-Id: Ia6d20136832714e3d439ddf9abaea0f66898bb61<br>Related: OS#3502<br>---<br>M include/osmo-bts/rsl.h<br>M src/common/measurement.c<br>M src/common/rsl.c<br>3 files changed, 32 insertions(+), 5 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/61/10761/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h</span><br><span>index 06d58a2..a7e2d58 100644</span><br><span>--- a/include/osmo-bts/rsl.h</span><br><span>+++ b/include/osmo-bts/rsl.h</span><br><span>@@ -42,6 +42,7 @@</span><br><span> void cb_ts_disconnected(struct gsm_bts_trx_ts *ts);</span><br><span> void cb_ts_connected(struct gsm_bts_trx_ts *ts);</span><br><span> void ipacc_dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc);</span><br><span style="color: hsl(120, 100%, 40%);">+void rsl_push_meas_res(struct gsm_lchan *lchan);</span><br><span> </span><br><span> #endif // _RSL_H */</span><br><span> </span><br><span>diff --git a/src/common/measurement.c b/src/common/measurement.c</span><br><span>index bfba11f..90af761 100644</span><br><span>--- a/src/common/measurement.c</span><br><span>+++ b/src/common/measurement.c</span><br><span>@@ -841,6 +841,7 @@</span><br><span>               * and add the uplink measurement we got as the first sample</span><br><span>                  * of a new interval */</span><br><span>              lchan_meas_check_compute(lchan, fn_missed_end);</span><br><span style="color: hsl(120, 100%, 40%);">+               rsl_push_meas_res(lchan);</span><br><span>            lchan_new_ul_meas(lchan, ulm, fn);</span><br><span> </span><br><span>               /* Report to the caller that we missed an inverval end</span><br><span>diff --git a/src/common/rsl.c b/src/common/rsl.c</span><br><span>index ff2d997..84106d8 100644</span><br><span>--- a/src/common/rsl.c</span><br><span>+++ b/src/common/rsl.c</span><br><span>@@ -2590,6 +2590,7 @@</span><br><span>  uint8_t chan_nr = gsm_lchan2chan_nr(lchan);</span><br><span>  int res_valid = lchan->meas.flags & LC_UL_M_F_RES_VALID;</span><br><span>      struct gsm_bts *bts = lchan->ts->trx->bts;</span><br><span style="color: hsl(120, 100%, 40%);">+   int timing_offset = -1;</span><br><span> </span><br><span>  LOGP(DRSL, LOGL_DEBUG,</span><br><span>            "%s chan_num:%u Tx MEAS RES valid(%d), flags(%02x)\n",</span><br><span>@@ -2602,8 +2603,10 @@</span><br><span>       if (!msg)</span><br><span>            return -ENOMEM;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   if (le)</span><br><span style="color: hsl(120, 100%, 40%);">+               timing_offset = ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE;</span><br><span>      LOGP(DRSL, LOGL_DEBUG,</span><br><span style="color: hsl(0, 100%, 40%);">-       "%s Send Meas RES: NUM:%u, RXLEV_FULL:%u, RXLEV_SUB:%u, RXQUAL_FULL:%u, RXQUAL_SUB:%u, MS_PWR:%u, UL_TA:%u, L3_LEN:%d, TimingOff:%u\n",</span><br><span style="color: hsl(120, 100%, 40%);">+             "%s Send Meas RES: NUM:%u, RXLEV_FULL:%u, RXLEV_SUB:%u, RXQUAL_FULL:%u, RXQUAL_SUB:%u, MS_PWR:%u, UL_TA:%u, L3_LEN:%d, TimingOff:%i\n",</span><br><span>            gsm_lchan_name(lchan),</span><br><span>       lchan->meas.res_nr,</span><br><span>       lchan->meas.ul_res.full.rx_lev,</span><br><span>@@ -2611,7 +2614,7 @@</span><br><span>           lchan->meas.ul_res.full.rx_qual,</span><br><span>          lchan->meas.ul_res.sub.rx_qual,</span><br><span>           lchan->meas.l1_info[0],</span><br><span style="color: hsl(0, 100%, 40%);">-      lchan->meas.l1_info[1], l3_len, ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE);</span><br><span style="color: hsl(120, 100%, 40%);">+           lchan->meas.l1_info[1], l3_len, timing_offset);</span><br><span> </span><br><span>  msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++);</span><br><span>       size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res,</span><br><span>@@ -2641,13 +2644,26 @@</span><br><span>                lchan->meas.flags &= ~LC_UL_M_F_RES_VALID;</span><br><span>    }</span><br><span>    msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* NOTE: In the following we will add measurement results that depend</span><br><span style="color: hsl(120, 100%, 40%);">+  * on valid L1 and L3 messages from the MS. If we lost the last SACCH</span><br><span style="color: hsl(120, 100%, 40%);">+  * block we do not have this info. For those cases we will leave out</span><br><span style="color: hsl(120, 100%, 40%);">+   * L1 info, L3 info and MS timing offset but we will still reset the</span><br><span style="color: hsl(120, 100%, 40%);">+   * related flags just to be sure. See also: 3GPP TS 08.58,</span><br><span style="color: hsl(120, 100%, 40%);">+     * chapter 8.4.8 MEASUREMENT RESULT */</span><br><span>       if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {</span><br><span style="color: hsl(0, 100%, 40%);">-            msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);</span><br><span style="color: hsl(120, 100%, 40%);">+            if (l3 && l3_len > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                      msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2,</span><br><span style="color: hsl(120, 100%, 40%);">+                                       lchan->meas.l1_info);</span><br><span>           lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;</span><br><span>     }</span><br><span style="color: hsl(0, 100%, 40%);">-       msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    if (l3 && l3_len > 0)</span><br><span style="color: hsl(120, 100%, 40%);">+              msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);</span><br><span>     if (ms_to_valid(lchan)) {</span><br><span style="color: hsl(0, 100%, 40%);">-               msgb_tv_put(msg, RSL_IE_MS_TIMING_OFFSET, ms_to2rsl(lchan, le));</span><br><span style="color: hsl(120, 100%, 40%);">+              if (l3 && l3_len > 0 && le)</span><br><span style="color: hsl(120, 100%, 40%);">+                        msgb_tv_put(msg, RSL_IE_MS_TIMING_OFFSET,</span><br><span style="color: hsl(120, 100%, 40%);">+                                 ms_to2rsl(lchan, le));</span><br><span>           lchan->ms_t_offs = -1;</span><br><span>            lchan->p_offs = -1;</span><br><span>       }</span><br><span>@@ -2658,6 +2674,15 @@</span><br><span>   return abis_bts_rsl_sendmsg(msg);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* forcefully push a measurement report to RSL. This is called by measurement.c,</span><br><span style="color: hsl(120, 100%, 40%);">+ * when it detects that a SACCH block was lost. The report will then only</span><br><span style="color: hsl(120, 100%, 40%);">+ * contain the measurement data from the BTS since the measurement data from</span><br><span style="color: hsl(120, 100%, 40%);">+ * the MS is lost in those cases */</span><br><span style="color: hsl(120, 100%, 40%);">+void rsl_push_meas_res(struct gsm_lchan *lchan)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        rsl_tx_meas_res(lchan, NULL, 0, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* call-back for LAPDm code, called when it wants to send msgs UP */</span><br><span> int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx)</span><br><span> {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10761">change 10761</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/10761"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia6d20136832714e3d439ddf9abaea0f66898bb61 </div>
<div style="display:none"> Gerrit-Change-Number: 10761 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>