There are certain situations we do not want to set the ifname on a
wifi-ifae, e.g. when navigating bugs related to
hard-setting the `ifname` as we see on DBDC-capable mt76 devices.
Change our wifi-iface setup so that we do not search for devices by
ifname, but instead, by section name (e.g. `labb5` in `config
wifi-iface 'labb5'`).
Also, add an `force_ifnameless` variable to our wifi-iface YAML so
that we can optionally force-empty the ifname field in settings where
we would like to do so. By default (with `force_ifnameless` unset or
false), we will use the same value for the `ifname` option and for the
section name.
Impacts
- You will need to migrate manually by naming your wifi-iface sections
Before this commit, we do not add a `type` to the wifi-device(s) we
create from scratch; we hope that they'd be available and already set
to `mac80211`.
For example, if we do not have a section in `/etc/config/wireless` for
the phy at sysfs path `ffe09000.pcie...`, creating one with Ansible
with this inventory variable:
```yaml
- name: radio1
path: ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0
template: ath9k_2
channel: 6
```
would give us
```/etc/config/wireless
config wifi-device 'radio1'
option htmode 'HT20'
option band '2g'
option channel '6'
option country 'US'
option disabled '0'
option path 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
```
... and not:
```/etc/config/wireless
config wifi-device 'radio1'
option type 'mac80211'
option htmode 'HT20'
option band '2g'
option channel '6'
option country 'US'
option disabled '0'
option path 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
```
Force the section as mac80211. This has no support for non-mac80211,
cfg80211-only drivers -- that's fine, as we only see (in practice)
ath9k, ath10k, ath11k and mt76 among the routers we're configuring
with ansible-labb-wifi.
(cherry picked from commit a4b505a4e6c218de4ec02f06f3eb58e97bdb517c)
Before this commit, we do not add an uci section name to wifi-device(s).
For example, if we do not have a section in `/etc/config/wireless` for
the phy at sysfs path `ffe09000.pcie...`, creating one with Ansible
with this inventory variable:
```yaml
- name: radio1
path: ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0
template: ath9k_2
channel: 6
```
would give us
```/etc/config/wireless
config wifi-device
option type 'mac80211'
option htmode 'HT20'
option band '2g'
option channel '6'
option country 'US'
option disabled '0'
option path 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
```
... and not:
```/etc/config/wireless
config wifi-device 'radio1'
option type 'mac80211'
option htmode 'HT20'
option band '2g'
option channel '6'
option country 'US'
option disabled '0'
option path 'ffe09000.pcie/pci9000:00/9000:00:00.0/9000:01:00.0'
```
We must name the wifi-device section, since wifi-iface sections point
to the name of their wifi-device exclusively.
(cherry picked from commit 0c8452b9a6d408b1669e273feb6a9161d0a56da6)
There appears to be a bug in hostapd where this[1]:
```hostapd.conf
interface=vgo5
:
skip_inactivity_poll=1
:
interface=labb5
:
skip_inactivity_poll=0
:
```
... still results in inactivity polling on the vgo5 interface:
Tue Aug 9 04:54:20 2022 daemon.info hostapd: vgo5: STA 3a:0e:52:a1:43:ea IEEE 802.11: disassociated due to inactivity
Tue Aug 9 04:54:21 2022 daemon.info hostapd: vgo5: STA 3a:0e:52:a1:43:ea IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Tue Aug 9 05:18:05 2022 daemon.info hostapd: vgo5: STA 3a:0e:52:a1:43:ea IEEE 802.11: disassociated due to inactivity
Tue Aug 9 05:18:06 2022 daemon.info hostapd: vgo5: STA 3a:0e:52:a1:43:ea IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Not sure what's going on there. I will have to verify this fix works
in production.
[1]: https://paste.c-net.org/MulanMaybe
Note that this also drops the package setup at the beginning of the
original wireless-setup.yml.
We no longer need to specify -e @default_vars.yml since it is included
in the role.