From b7c6f1e83f8f79320011de2f79523f349d593e30 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 11 Sep 2020 18:03:56 +0700 Subject: radioDevice: fix set_antennas(): consider MULTI_ARFCN mode In the multi-ARFCN mode, if the Tx/Rx antenna names are explicitly set in 'chan N' sections of the configuration file: trx ... multi-arfcn disable chan 0 tx-path TX/RX rx-path RX2 chan 1 tx-path TX/RX rx-path RX2 chan 2 tx-path TX/RX rx-path RX2 osmo-trx would crash, because radioDevice::set_antennas() would attempt to configure antenna names for all N physical channels, while USRP devices usually have 2 or even 1 available. The easiest approach is to remove both 'tx-path'/'rx-path' from all 'chan N' sections excluding 'chan 0', so it would work fine. This makes sense, because in the multi-ARFCN mode we actually use only one physical channel. However, let's still make sure that explicit configuration of the Tx/Rx antenna names would not crash osmo-trx and skip N > 0 in radioDevice::set_antennas(). Change-Id: I09f316f181cbbc2214e8913b73f7c1fcea4e8c05 Related: OS#4636 --- Transceiver52M/device/common/radioDevice.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h index cfe65da..45fcdad 100644 --- a/Transceiver52M/device/common/radioDevice.h +++ b/Transceiver52M/device/common/radioDevice.h @@ -186,6 +186,13 @@ class RadioDevice { for (i = 0; i < tx_paths.size(); i++) { if (tx_paths[i] == "") continue; + if (iface == MULTI_ARFCN && i > 0) { + LOGCHAN(i, DDEV, NOTICE) << "Not setting Tx antenna " + << tx_paths[i] + << " for a logical channel"; + continue; + } + LOGCHAN(i, DDEV, DEBUG) << "Configuring Tx antenna " << tx_paths[i]; if (!setTxAntenna(tx_paths[i], i)) { LOGCHAN(i, DDEV, ALERT) << "Failed configuring Tx antenna " << tx_paths[i]; @@ -196,6 +203,13 @@ class RadioDevice { for (i = 0; i < rx_paths.size(); i++) { if (rx_paths[i] == "") continue; + if (iface == MULTI_ARFCN && i > 0) { + LOGCHAN(i, DDEV, NOTICE) << "Not setting Rx antenna " + << rx_paths[i] + << " for a logical channel"; + continue; + } + LOGCHAN(i, DDEV, DEBUG) << "Configuring Rx antenna " << rx_paths[i]; if (!setRxAntenna(rx_paths[i], i)) { LOGCHAN(i, DDEV, ALERT) << "Failed configuring Rx antenna " << rx_paths[i]; -- cgit v1.2.3