aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-11 18:03:56 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-09-12 14:47:21 +0700
commitb7c6f1e83f8f79320011de2f79523f349d593e30 (patch)
treec7266118e9fd3bdc5afb86ea78168567aae0c6a8
parent4d4368419427b04bb689f45840bab79e3dc04328 (diff)
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
-rw-r--r--Transceiver52M/device/common/radioDevice.h14
1 files changed, 14 insertions, 0 deletions
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];