<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/20076">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">radioDevice: fix set_antennas(): consider MULTI_ARFCN mode<br><br>In the multi-ARFCN mode, if the Tx/Rx antenna names are explicitly<br>set in 'chan N' sections of the configuration file:<br><br>  trx<br>   ...<br>   multi-arfcn disable<br>   chan 0<br>    tx-path TX/RX<br>    rx-path RX2<br>   chan 1<br>    tx-path TX/RX<br>    rx-path RX2<br>   chan 2<br>    tx-path TX/RX<br>    rx-path RX2<br><br>osmo-trx would crash, because radioDevice::set_antennas() would<br>attempt to configure antenna names for all N physical channels,<br>while USRP devices usually have 2 or even 1 available.<br><br>The easiest approach is to remove both 'tx-path'/'rx-path' from<br>all 'chan N' sections excluding 'chan 0', so it would work fine.<br>This makes sense, because in the multi-ARFCN mode we actually<br>use only one physical channel.<br><br>However, let's still make sure that explicit configuration of the<br>Tx/Rx antenna names would not crash osmo-trx and skip N > 0 in<br>radioDevice::set_antennas().<br><br>Change-Id: I09f316f181cbbc2214e8913b73f7c1fcea4e8c05<br>Related: OS#4636<br>---<br>M Transceiver52M/device/common/radioDevice.h<br>1 file changed, 6 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/76/20076/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h</span><br><span>index cfe65da..56b6aa9 100644</span><br><span>--- a/Transceiver52M/device/common/radioDevice.h</span><br><span>+++ b/Transceiver52M/device/common/radioDevice.h</span><br><span>@@ -181,9 +181,12 @@</span><br><span>   }</span><br><span> </span><br><span>   bool set_antennas() {</span><br><span style="color: hsl(120, 100%, 40%);">+      unsigned int tx_paths_len;</span><br><span style="color: hsl(120, 100%, 40%);">+    unsigned int rx_paths_len;</span><br><span>   unsigned int i;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     for (i = 0; i < tx_paths.size(); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+    tx_paths_len = (iface == MULTI_ARFCN) ? 1 : tx_paths.size();</span><br><span style="color: hsl(120, 100%, 40%);">+  for (i = 0; i < tx_paths_len; i++) {</span><br><span>              if (tx_paths[i] == "")</span><br><span>                     continue;</span><br><span>            LOGCHAN(i, DDEV, DEBUG) << "Configuring Tx antenna " << tx_paths[i];</span><br><span>@@ -193,7 +196,8 @@</span><br><span>             }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   for (i = 0; i < rx_paths.size(); i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+    rx_paths_len = (iface == MULTI_ARFCN) ? 1 : rx_paths.size();</span><br><span style="color: hsl(120, 100%, 40%);">+  for (i = 0; i < rx_paths_len; i++) {</span><br><span>              if (rx_paths[i] == "")</span><br><span>                     continue;</span><br><span>            LOGCHAN(i, DDEV, DEBUG) << "Configuring Rx antenna " << rx_paths[i];</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/20076">change 20076</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-trx/+/20076"/><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-Change-Id: I09f316f181cbbc2214e8913b73f7c1fcea4e8c05 </div>
<div style="display:none"> Gerrit-Change-Number: 20076 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>