<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/14323">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts-trx/scheduler: fix handover RACH handling<br><br>Change-Id: I78fa77799f5184cc96a28856eead8b296529c5d8<br>---<br>M src/common/scheduler.c<br>M src/osmo-bts-trx/scheduler_trx.c<br>2 files changed, 12 insertions(+), 14 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/23/14323/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/scheduler.c b/src/common/scheduler.c</span><br><span>index 6ad2e1f..caccda2 100644</span><br><span>--- a/src/common/scheduler.c</span><br><span>+++ b/src/common/scheduler.c</span><br><span>@@ -1338,8 +1338,17 @@</span><br><span>   func = trx_chan_desc[chan].ul_fn;</span><br><span> </span><br><span>        /* check if channel is active */</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!TRX_CHAN_IS_ACTIVE(l1cs, chan))</span><br><span style="color: hsl(0, 100%, 40%);">-            return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!TRX_CHAN_IS_ACTIVE(l1cs, chan)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* do we expect handover RACH? */</span><br><span style="color: hsl(120, 100%, 40%);">+             if (!l1cs->ho_rach_detect)</span><br><span style="color: hsl(120, 100%, 40%);">+                 return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Handover RACH can be initiated on any multi-frame slot (excluding TRXC_IDLE)</span><br><span style="color: hsl(120, 100%, 40%);">+                * regardless of the current logical channel type and the associated handler.</span><br><span style="color: hsl(120, 100%, 40%);">+          * TODO: it would be good to know whether it's an Access Burst or not. */</span><br><span style="color: hsl(120, 100%, 40%);">+         func = trx_chan_desc[TRXC_RACH].ul_fn;</span><br><span style="color: hsl(120, 100%, 40%);">+                goto proc_burst;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span> </span><br><span>        /* omit bursts which have no handler, like IDLE bursts */</span><br><span>    if (!func)</span><br><span>@@ -1366,6 +1375,7 @@</span><br><span>           }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+proc_burst:</span><br><span>   /* put burst to function */</span><br><span>  func(l1t, tn, fn, chan, bid, bits, nbits, rssi, toa256);</span><br><span> </span><br><span>diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c</span><br><span>index ade3cff..95292a5 100644</span><br><span>--- a/src/osmo-bts-trx/scheduler_trx.c</span><br><span>+++ b/src/osmo-bts-trx/scheduler_trx.c</span><br><span>@@ -881,10 +881,6 @@</span><br><span>     uint16_t ber10k;</span><br><span>     int rc;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     /* handle RACH, if handover RACH detection is turned on */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (chan_state->ho_rach_detect == 1)</span><br><span style="color: hsl(0, 100%, 40%);">-         return rx_rach_fn(l1t, tn, fn, chan, bid, bits, GSM_BURST_LEN, rssi, toa256);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>        LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received Data, bid=%u\n", bid);</span><br><span> </span><br><span>   /* allocate burst memory, if not already */</span><br><span>@@ -1079,10 +1075,6 @@</span><br><span>         struct gsm_lchan *lchan =</span><br><span>            get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        /* handle rach, if handover rach detection is turned on */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (chan_state->ho_rach_detect == 1)</span><br><span style="color: hsl(0, 100%, 40%);">-         return rx_rach_fn(l1t, tn, fn, chan, bid, bits, GSM_BURST_LEN, rssi, toa256);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>        LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received TCH/F, bid=%u\n", bid);</span><br><span> </span><br><span>  /* allocate burst memory, if not already */</span><br><span>@@ -1260,10 +1252,6 @@</span><br><span>          */</span><br><span>  int fn_is_odd = (((fn + 26 - 10) % 26) >> 2) & 1;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- /* handle RACH, if handover RACH detection is turned on */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (chan_state->ho_rach_detect == 1)</span><br><span style="color: hsl(0, 100%, 40%);">-         return rx_rach_fn(l1t, tn, fn, chan, bid, bits, GSM_BURST_LEN, rssi, toa256);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>        LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received TCH/H, bid=%u\n", bid);</span><br><span> </span><br><span>  /* allocate burst memory, if not already */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/14323">change 14323</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/+/14323"/><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: I78fa77799f5184cc96a28856eead8b296529c5d8 </div>
<div style="display:none"> Gerrit-Change-Number: 14323 </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-MessageType: newchange </div>