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
This commit is contained in:
Vadim Yanitskiy 2020-09-11 18:03:56 +07:00
parent 4d43684194
commit b7c6f1e83f
1 changed files with 14 additions and 0 deletions

View File

@ -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];