openwrt/package/kernel
Bob Cantor a29ab3b79a 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>
2021-06-28 17:24:11 +02:00
..
acx-mac80211 acx-mac80211: replace dead URLs with OpenWrt CDN 2021-02-07 11:26:36 -10:00
ath10k-ct ath10k-ct: fix typo in Makefile 2021-06-21 08:34:39 -10:00
bcm27xx-gpu-fw bcm27xx-gpu-fw: update to latest version 2021-02-18 23:42:46 +01:00
bcm63xx-cfe bcm63xx-cfe: update to the latest master 2021-06-22 13:27:41 +02:00
broadcom-wl treewide: unify OpenWrt hosted source via @OPENWRT 2021-02-05 12:00:24 -10:00
button-hotplug
cryptodev-linux cryptodev-linux: bump to 1.11, fix build against kernel 5.10. 2021-01-01 19:55:59 +01:00
dtc/patches
gpio-button-hotplug
gpio-nct5104d
gpio-nxp-74hc153 packages: kernel: add gpio-nxp-74hc153 2021-03-22 09:23:10 +01:00
hwmon-gsc cns3xxx: drop target 2020-09-14 00:19:27 +02:00
lantiq lantiq: kernel 5.10: disable ltq-deu 2021-04-12 23:23:09 +02:00
linux kernel: crypto: limit crypto-hw-hifn-795x to devices with pci support 2021-06-22 23:23:00 +02:00
mac80211 mac80211: fix no_reload logic (FS#3902) 2021-06-28 17:24:11 +02:00
mt76 package: fix cmake packages build with ninja 2021-06-12 10:46:39 +02:00
mt7621-qtn-rgmii
mwlwifi mwlwifi: add PKG_FLAGS:=nonshared 2021-03-24 15:26:31 +00:00
nat46 nat46: fix memory leak 2021-05-24 13:02:41 +02:00
om-watchdog
rtc-rv5c386a
rtl8812au-ct build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel modules 2021-03-18 10:53:26 +01:00
trelay