<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10554">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;">measurement: make sure state is reset on chan act.<br><br>At the moment only lchan_meas_reset is reset on channel activation.<br>All other states are not reset. This may lead to irretations in the<br>first measurement interval if there are still leftover messages from<br>a previous connection. Lets ensure everything is reset to zero by<br>zeroing out the whole .meas struct in struct lchan.<br><br>- Add a centralized function that does the reset<br>- Call that function from rsl_tx_chan_act_ack() in rsl.c<br><br>Change-Id: I880ae3030df6dcd60c32b7144c3430528429bdea<br>Related: OS#2975<br>Related: OS#2987<br>---<br>M include/osmo-bts/measurement.h<br>M src/common/measurement.c<br>M src/common/rsl.c<br>3 files changed, 11 insertions(+), 1 deletion(-)<br><br></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 283b0ff..d98e9f0 100644</span><br><span>--- a/include/osmo-bts/measurement.h</span><br><span>+++ b/include/osmo-bts/measurement.h</span><br><span>@@ -10,4 +10,6 @@</span><br><span> </span><br><span> void lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+void lchan_meas_reset(struct gsm_lchan *lchan);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #endif</span><br><span>diff --git a/src/common/measurement.c b/src/common/measurement.c</span><br><span>index a75b54d..bd2c0b7 100644</span><br><span>--- a/src/common/measurement.c</span><br><span>+++ b/src/common/measurement.c</span><br><span>@@ -490,3 +490,11 @@</span><br><span>     * measurment report at Meas period End */</span><br><span>   lchan_meas_check_compute(lchan, fn);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Reset all measurement related struct members to their initial values. This</span><br><span style="color: hsl(120, 100%, 40%);">+ * function will be called every time an lchan is activated to ensure the</span><br><span style="color: hsl(120, 100%, 40%);">+ * measurement process starts with a defined state. */</span><br><span style="color: hsl(120, 100%, 40%);">+void lchan_meas_reset(struct gsm_lchan *lchan)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+      memset(&lchan->meas, 0, sizeof(lchan->meas));</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/src/common/rsl.c b/src/common/rsl.c</span><br><span>index a24c444..ff2d997 100644</span><br><span>--- a/src/common/rsl.c</span><br><span>+++ b/src/common/rsl.c</span><br><span>@@ -750,7 +750,7 @@</span><br><span>        msg->trx = lchan->ts->trx;</span><br><span> </span><br><span>      /* since activation was successful, do some lchan initialization */</span><br><span style="color: hsl(0, 100%, 40%);">-     lchan->meas.res_nr = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+    lchan_meas_reset(lchan);</span><br><span> </span><br><span>         return abis_bts_rsl_sendmsg(msg);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10554">change 10554</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/10554"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I880ae3030df6dcd60c32b7144c3430528429bdea </div>
<div style="display:none"> Gerrit-Change-Number: 10554 </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-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>