<p>Harald Welte has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/14160">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">l1sap: Fix calculation of expired RACH slots in case of missing frame numbers<br><br>In case of a Combined CCCH (with SDCCH/4), the number of RACH slots<br>depends on the frame number.  So in case of lost/skipped frame numbers,<br>we cannot simply compute the value for the current fn and then multiply<br>it by the number of frame numbers expired.  Rather, we have to 'replay'<br>all missed frame numbers and individually determine how many RACH<br>slots happened in that frame.<br><br>Related: OS#3750<br>Change-Id: If4f8d2ea55fc722c64c330cde09e833b67ee98fe<br>---<br>M src/common/l1sap.c<br>1 file changed, 5 insertions(+), 2 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/60/14160/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/l1sap.c b/src/common/l1sap.c</span><br><span>index d9ffdb8..52f2b33 100644</span><br><span>--- a/src/common/l1sap.c</span><br><span>+++ b/src/common/l1sap.c</span><br><span>@@ -493,6 +493,7 @@</span><br><span>                               struct info_time_ind_param *info_time_ind)</span><br><span> {</span><br><span>       int frames_expired;</span><br><span style="color: hsl(120, 100%, 40%);">+   int i;</span><br><span> </span><br><span>   DEBUGPFN(DL1P, info_time_ind->fn, "Rx MPH_INFO time ind\n");</span><br><span> </span><br><span>@@ -513,8 +514,10 @@</span><br><span> </span><br><span>     /* increment number of RACH slots that have passed by since the</span><br><span>       * last time indication */</span><br><span style="color: hsl(0, 100%, 40%);">-      bts->load.rach.total +=</span><br><span style="color: hsl(0, 100%, 40%);">-          calc_exprd_rach_frames(bts, info_time_ind->fn) * frames_expired;</span><br><span style="color: hsl(120, 100%, 40%);">+       for (i = 0; i < frames_expired; i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+             uint32_t fn = (info_time_ind->fn + GSM_HYPERFRAME - i) % GSM_HYPERFRAME;</span><br><span style="color: hsl(120, 100%, 40%);">+           bts->load.rach.total += calc_exprd_rach_frames(bts, fn);</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span> </span><br><span>        return 0;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/14160">change 14160</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/14160"/><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: If4f8d2ea55fc722c64c330cde09e833b67ee98fe </div>
<div style="display:none"> Gerrit-Change-Number: 14160 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>