<p>Max <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11423">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">VTY: add extended (11-bit) RACH detection toggle<br><br>Since I838c21db29c54f1924dd478c2b34b46b70aab2cd we have both TS1<br>and TS2 synch. sequences, in addition to "default" TS0. Let's<br>finally introduce the VTY configuration parameter, that can<br>be used to toggle optional detection of both TS1 and TS2.<br><br>Note: we keep this optional because of potentially bad impact on<br>performance. There's no point in paying the performance penalty<br>unless upper levels (BTS, PCU) actually make use of it.<br><br>Change-Id: I1aee998d83b06692d76a83f79748f9129a2547e8<br>Related: OS#3054<br>---<br>M CommonLibs/trx_vty.c<br>M CommonLibs/trx_vty.h<br>M Transceiver52M/Transceiver.cpp<br>M Transceiver52M/Transceiver.h<br>M Transceiver52M/osmo-trx.cpp<br>5 files changed, 36 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c</span><br><span>index 45b58eb..3b1b979 100644</span><br><span>--- a/CommonLibs/trx_vty.c</span><br><span>+++ b/CommonLibs/trx_vty.c</span><br><span>@@ -304,6 +304,21 @@</span><br><span>         return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+DEFUN(cfg_ext_rach, cfg_ext_rach_cmd,</span><br><span style="color: hsl(120, 100%, 40%);">+   "ext-rach (disable|enable)",</span><br><span style="color: hsl(120, 100%, 40%);">+        "Enable extended (11-bit) RACH (default=disable)\n")</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     struct trx_ctx *trx = trx_from_vty(vty);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    if (strcmp("disable", argv[0]) == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                trx->cfg.ext_rach = false;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       if (strcmp("enable", argv[0]) == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+         trx->cfg.ext_rach = true;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        return CMD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> DEFUN(cfg_rt_prio, cfg_rt_prio_cmd,</span><br><span>      "rt-prio <1-32>",</span><br><span>    "Set the SCHED_RR real-time priority\n"</span><br><span>@@ -417,6 +432,7 @@</span><br><span>              vty_out(vty, " rssi-offset %f%s", trx->cfg.rssi_offset, VTY_NEWLINE);</span><br><span>   vty_out(vty, " swap-channels %s%s", trx->cfg.swap_channels ? "enable" : "disable", VTY_NEWLINE);</span><br><span>    vty_out(vty, " egprs %s%s", trx->cfg.egprs ? "enable" : "disable", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+     vty_out(vty, " ext-rach %s%s", trx->cfg.ext_rach ? "enable" : "disable", VTY_NEWLINE);</span><br><span>      if (trx->cfg.sched_rr != 0)</span><br><span>               vty_out(vty, " rt-prio %u%s", trx->cfg.sched_rr, VTY_NEWLINE);</span><br><span> </span><br><span>@@ -454,6 +470,7 @@</span><br><span>        vty_out(vty, " RSSI to dBm offset: %f%s", trx->cfg.rssi_offset, VTY_NEWLINE);</span><br><span>   vty_out(vty, " Swap channels: %s%s", trx->cfg.swap_channels ? "Enabled" : "Disabled", VTY_NEWLINE);</span><br><span>         vty_out(vty, " EDGE support: %s%s", trx->cfg.egprs ? "Enabled" : "Disabled", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+   vty_out(vty, " Extended RACH support: %s%s", trx->cfg.ext_rach ? "Enabled" : "Disabled", VTY_NEWLINE);</span><br><span>      vty_out(vty, " Real Time Priority: %u (%s)%s", trx->cfg.sched_rr,</span><br><span>               trx->cfg.sched_rr ? "Enabled" : "Disabled", VTY_NEWLINE);</span><br><span>     vty_out(vty, " Channels: %u%s", trx->cfg.num_chans, VTY_NEWLINE);</span><br><span>@@ -564,6 +581,7 @@</span><br><span>         install_element(TRX_NODE, &cfg_rssi_offset_cmd);</span><br><span>         install_element(TRX_NODE, &cfg_swap_channels_cmd);</span><br><span>       install_element(TRX_NODE, &cfg_egprs_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+        install_element(TRX_NODE, &cfg_ext_rach_cmd);</span><br><span>    install_element(TRX_NODE, &cfg_rt_prio_cmd);</span><br><span>     install_element(TRX_NODE, &cfg_filler_cmd);</span><br><span> </span><br><span>diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h</span><br><span>index c921722..8d251ee 100644</span><br><span>--- a/CommonLibs/trx_vty.h</span><br><span>+++ b/CommonLibs/trx_vty.h</span><br><span>@@ -57,6 +57,7 @@</span><br><span>                 double offset;</span><br><span>               double rssi_offset;</span><br><span>          bool swap_channels;</span><br><span style="color: hsl(120, 100%, 40%);">+           bool ext_rach;</span><br><span>               bool egprs;</span><br><span>          unsigned int sched_rr;</span><br><span>               unsigned int num_chans;</span><br><span>diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp</span><br><span>index df1c0bd..cfb36c3 100644</span><br><span>--- a/Transceiver52M/Transceiver.cpp</span><br><span>+++ b/Transceiver52M/Transceiver.cpp</span><br><span>@@ -159,7 +159,8 @@</span><br><span>  * are still expected to report clock indications through control channel</span><br><span>  * activity.</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-bool Transceiver::init(FillerType filler, size_t rtsc, unsigned rach_delay, bool edge)</span><br><span style="color: hsl(120, 100%, 40%);">+bool Transceiver::init(FillerType filler, size_t rtsc, unsigned rach_delay,</span><br><span style="color: hsl(120, 100%, 40%);">+                       bool edge, bool ext_rach)</span><br><span> {</span><br><span>   int d_srcport, d_dstport, c_srcport, c_dstport;</span><br><span> </span><br><span>@@ -173,6 +174,7 @@</span><br><span>     return false;</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  mExtRACH = ext_rach;</span><br><span>   mEdge = edge;</span><br><span> </span><br><span>   mDataSockets.resize(mChans);</span><br><span>@@ -497,16 +499,16 @@</span><br><span>     break;</span><br><span>   case IV:</span><br><span>   case VI:</span><br><span style="color: hsl(0, 100%, 40%);">-    return RACH;</span><br><span style="color: hsl(120, 100%, 40%);">+    return mExtRACH ? EXT_RACH : RACH;</span><br><span>     break;</span><br><span>   case V: {</span><br><span>     int mod51 = burstFN % 51;</span><br><span>     if ((mod51 <= 36) && (mod51 >= 14))</span><br><span style="color: hsl(0, 100%, 40%);">-      return RACH;</span><br><span style="color: hsl(120, 100%, 40%);">+      return mExtRACH ? EXT_RACH : RACH;</span><br><span>     else if ((mod51 == 4) || (mod51 == 5))</span><br><span style="color: hsl(0, 100%, 40%);">-      return RACH;</span><br><span style="color: hsl(120, 100%, 40%);">+      return mExtRACH ? EXT_RACH : RACH;</span><br><span>     else if ((mod51 == 45) || (mod51 == 46))</span><br><span style="color: hsl(0, 100%, 40%);">-      return RACH;</span><br><span style="color: hsl(120, 100%, 40%);">+      return mExtRACH ? EXT_RACH : RACH;</span><br><span>     else if (mHandover[burstTN][sdcch4_subslot[burstFN % 102]])</span><br><span>       return RACH;</span><br><span>     else</span><br><span>@@ -524,7 +526,7 @@</span><br><span>   case XIII: {</span><br><span>     int mod52 = burstFN % 52;</span><br><span>     if ((mod52 == 12) || (mod52 == 38))</span><br><span style="color: hsl(0, 100%, 40%);">-      return RACH;</span><br><span style="color: hsl(120, 100%, 40%);">+      return mExtRACH ? EXT_RACH : RACH;</span><br><span>     else if ((mod52 == 25) || (mod52 == 51))</span><br><span>       return IDLE;</span><br><span>     else</span><br><span>@@ -635,9 +637,11 @@</span><br><span>     noise = 20.0 * log10(rxFullScale / state->mNoiseLev);</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  unsigned max_toa = (type == RACH || type == EXT_RACH) ?</span><br><span style="color: hsl(120, 100%, 40%);">+                      mMaxExpectedDelayAB : mMaxExpectedDelayNB;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   /* Detect normal or RACH bursts */</span><br><span style="color: hsl(0, 100%, 40%);">-  rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, amp, toa,</span><br><span style="color: hsl(0, 100%, 40%);">-                      (type==RACH)?mMaxExpectedDelayAB:mMaxExpectedDelayNB);</span><br><span style="color: hsl(120, 100%, 40%);">+  rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, amp, toa, max_toa);</span><br><span> </span><br><span>   if (rc > 0) {</span><br><span>     type = (CorrType) rc;</span><br><span>diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h</span><br><span>index e250adc..432e3b4 100644</span><br><span>--- a/Transceiver52M/Transceiver.h</span><br><span>+++ b/Transceiver52M/Transceiver.h</span><br><span>@@ -114,7 +114,8 @@</span><br><span>   ~Transceiver();</span><br><span> </span><br><span>   /** Start the control loop */</span><br><span style="color: hsl(0, 100%, 40%);">-  bool init(FillerType filler, size_t rtsc, unsigned rach_delay, bool edge);</span><br><span style="color: hsl(120, 100%, 40%);">+  bool init(FillerType filler, size_t rtsc, unsigned rach_delay,</span><br><span style="color: hsl(120, 100%, 40%);">+            bool edge, bool ext_rach);</span><br><span> </span><br><span>   /** attach the radioInterface receive FIFO */</span><br><span>   bool receiveFIFO(VectorFIFO *wFIFO, size_t chan)</span><br><span>@@ -210,6 +211,7 @@</span><br><span>   int mSPSRx;                          ///< number of samples per Rx symbol</span><br><span>   size_t mChans;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  bool mExtRACH;</span><br><span>   bool mEdge;</span><br><span>   bool mOn;                                   ///< flag to indicate that transceiver is powered on</span><br><span>   bool mForceClockInterface;           ///< flag to indicate whether IND CLOCK shall be sent unconditionally after transceiver is started</span><br><span>diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp</span><br><span>index 0e63020..1f35cd8 100644</span><br><span>--- a/Transceiver52M/osmo-trx.cpp</span><br><span>+++ b/Transceiver52M/osmo-trx.cpp</span><br><span>@@ -144,7 +144,7 @@</span><br><span>                          trx->cfg.rx_sps, trx->cfg.num_chans, GSM::Time(3,0),</span><br><span>                           radio, trx->cfg.rssi_offset);</span><br><span>       if (!transceiver->init(trx->cfg.filler, trx->cfg.rtsc,</span><br><span style="color: hsl(0, 100%, 40%);">-                trx->cfg.rach_delay, trx->cfg.egprs)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 trx->cfg.rach_delay, trx->cfg.egprs, trx->cfg.ext_rach)) {</span><br><span>           LOG(ALERT) << "Failed to initialize transceiver";</span><br><span>            return -1;</span><br><span>   }</span><br><span>@@ -408,6 +408,7 @@</span><br><span>      ost << "   Tx Samples-per-Symbol... " << trx->cfg.tx_sps << std::endl;</span><br><span>        ost << "   Rx Samples-per-Symbol... " << trx->cfg.rx_sps << std::endl;</span><br><span>        ost << "   EDGE support............ " << trx->cfg.egprs << std::endl;</span><br><span style="color: hsl(120, 100%, 40%);">+  ost << "   Extended RACH support... " << trx->cfg.ext_rach << std::endl;</span><br><span>      ost << "   Reference............... " << trx->cfg.clock_ref << std::endl;</span><br><span>     ost << "   C0 Filler Table......... " << trx->cfg.filler << std::endl;</span><br><span>        ost << "   Multi-Carrier........... " << trx->cfg.multi_arfcn << std::endl;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11423">change 11423</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/11423"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I1aee998d83b06692d76a83f79748f9129a2547e8 </div>
<div style="display:none"> Gerrit-Change-Number: 11423 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Assignee: Max <msuraev@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>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-CC: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Tom Tsou <tom@tsou.cc> </div>
<div style="display:none"> Gerrit-CC: tnt <tnt@246tNt.com> </div>