openwrt/package/kernel
Bob Cantor bea9380149 mac80211: fix no_reload logic (FS#3902)
If drv_mac80211_setup is called twice with the same wifi configuration,
then the second call returns early with error HOSTAPD_START_FAILED.
(wifi works nevertheless, despite the fact that setup is incomplete.  But
"ubus call network.wireless status" erroneously reports that radio0 is down.)

The relevant part of drv_mac80211_setup is,

if [ "$no_reload" != "0" ]; then
        add_ap=1
        ubus wait_for hostapd
        local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
        ret="$?"
        [ "$ret" != 0 -o -z "$hostapd_res" ] && {
                wireless_setup_failed HOSTAPD_START_FAILED
                return
        }
        wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
fi

This commit sets no_reload = 0 during the second call of drv_mac80211_setup.

It is perhaps worth providing a way to reproduce the situation
where drv_mac80211_setup is called twice.

When /sbin/wifi is used to turn on wifi,
   uci set wireless.@wifi-iface[0].disabled=0
   uci set wireless.@wifi-device[0].disabled=0
   uci commit
   wifi

/sbin/wifi makes the following ubus calls,
   ubus call network reload
   ubus call network.wireless down
   ubus call network.wireless up

The first and third ubus calls both call drv_mac80211_setup,
while the second ubus call triggers wireless_device_setup_cancel.
So the call sequence becomes,

   drv_mac80211_setup
   wireless_device_setup_cancel
   drv_mac80211_setup

In contrast, when LuCI is used to turn on wifi only a single call
is made to drv_mac80211_setup.

branches affected: trunk, 21.02

Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
(cherry-picked from commit a29ab3b79a)
2021-06-30 19:24:55 +02:00
..
acx-mac80211 acx-mac80211: replace dead URLs with OpenWrt CDN 2021-02-07 11:26:36 -10:00
ath10k-ct build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel modules 2021-04-04 11:39:51 +02:00
bcm27xx-gpu-fw bcm27xx-gpu-fw: update to latest version 2021-02-19 07:18:23 +01:00
bcm63xx-cfe bcm63xx-cfe: update to the latest master 2021-03-17 21:23:45 +01:00
broadcom-wl treewide: unify OpenWrt hosted source via @OPENWRT 2021-02-05 12:00:24 -10:00
button-hotplug kernel: replace SUBDIRS with M in package recipes 2020-02-22 16:38:41 +01:00
cryptodev-linux cryptodev-linux: bump to 1.11, fix build against kernel 5.10. 2021-01-01 19:55:59 +01:00
dtc/patches package: kernel: dtc: Add DTO support 2017-11-06 16:39:41 +01:00
exfat exfat: update to 5.12.3 2021-06-22 23:52:09 +02:00
gpio-button-hotplug gpio-button-hotplug: remove duplicate logging text 2020-03-08 15:10:55 +01:00
gpio-nct5104d kernel: drop outdated kernel version switches for local code 2020-05-17 18:35:51 +02:00
gpio-nxp-74hc153 packages: kernel: add gpio-nxp-74hc153 2021-03-27 07:46:14 +01:00
hwmon-gsc cns3xxx: drop target 2020-09-14 00:19:27 +02:00
lantiq lantiq: enable G.INP retransmission counters 2021-04-19 23:24:36 +02:00
linux treewide: make AddDepends/usb-serial selective 2021-06-08 22:50:32 +02:00
mac80211 mac80211: fix no_reload logic (FS#3902) 2021-06-30 19:24:55 +02:00
mt76 mt76: update to the latest version 2021-06-17 12:44:58 +02:00
mt7621-qtn-rgmii mt7621-qtn-rgmii: enable RGMII connected Quantenna QV840 2020-07-08 16:07:05 +02:00
mwlwifi build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel modules 2021-04-04 11:39:51 +02:00
nat46 nat46: Fix PKG_MIRROR_HASH 2020-12-17 12:13:27 +01:00
om-watchdog ar71xx: drop target 2020-08-30 22:18:35 +02:00
rtc-rv5c386a kernel: drop outdated kernel version switches for local code 2020-05-17 18:35:51 +02:00
rtl8812au-ct build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel modules 2021-04-04 11:39:51 +02:00
trelay package: drop PKG_VERSION for purely local packages 2020-07-15 18:33:56 +02:00