From 5d193970bc491acc2461d320f5238e7df8117d62 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sun, 11 Dec 2022 15:52:46 -0500 Subject: [PATCH] fix: Specify the `wireless.wifi-device.type` as mac80211 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) --- roles/netconfig/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/netconfig/tasks/main.yml b/roles/netconfig/tasks/main.yml index 3eb4e67..c789eac 100644 --- a/roles/netconfig/tasks/main.yml +++ b/roles/netconfig/tasks/main.yml @@ -38,6 +38,7 @@ path: "{{ item.path }}" name: "{{ item.name }}" value: + type: "mac80211" # they'd BETTER be. band: "{{ item.band | default(wifi_device[item.template].band) | default() }}" channel: "{{ item.channel | default(wifi_device[item.template].channel) }}" country: "{{ item.country | default(wifi_device[item.template].country) }}"