summaryrefslogtreecommitdiff
path: root/package/kernel/mac80211
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2016-10-17 15:59:14 +0200
committerFelix Fietkau <nbd@nbd.name>2016-11-03 11:08:01 +0100
commit5f8f8a366136a07df661e31decce2458357c167a (patch)
treea352879baffc80269aefbb6eae44694c668f7bd9 /package/kernel/mac80211
parent5e35b4562fb73aaa1c75a3404fed2efb6afe03f8 (diff)
downloadmtk-20170518-5f8f8a366136a07df661e31decce2458357c167a.zip
mtk-20170518-5f8f8a366136a07df661e31decce2458357c167a.tar.gz
mtk-20170518-5f8f8a366136a07df661e31decce2458357c167a.tar.bz2
base-files, mac80211, broadcom-wl: wifi detection and configuration
Currently, the wifi detection script is executed as part of the (early) boot process. Pluggable wifi USB devices, which are inserted at a later time are not automatically detected and therefore they don't show up in LuCI. A user has to deal with wifi detection manually, or restart the router. However, the current "sleep 1" window - which the boot process waits for wifi devices to "settle down" - is too short to detect wifi devices for some routers anyway. For example, this can happen with USB WLAN devices on the WNDR4700. This is because the usb controller needs to load its firmware from UBI and initialize, before it can operate. The issue can be seen on a BT HomeHub 5A as well as soon as the caldata are on an ubi volume. This is because the ath9k card has to be initialized by owl-loader first. Which has to wait for the firmware extraction script to retrieve the pci initialization values inside the caldata. This patch moves the wifi configuration to hotplug scripts. For mac80211, the wifi configuration will now automatically run any time a "ieee80211" device is added. Likewise broadcom-wl's script checks for new "net" devices which have the "wl$NUMBER" moniker. Issues with spawning multiple interface configuration - in case the detection script is run concurrently - have been resolved by using a named section for the initial configuration. Concurrent configuration scripts will now simply overwrite the same existing configuration. A workaround which preserves the "sleep 1" window for just the first boot has been added. This allows the existing brcm47xx boot and mvebu uci-default scripts to correctly setup the initial mac addresses and regulatory domain. And finally, the patch renames the "wifi detect" into "wifi config". As the script no longer produces any output that has to be redirected or appended to the configuration file. Thanks to Martin Blumenstingl for helping with the implementation and testing of the patch. Acked-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Mathias Kresin <dev@kresin.me> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211')
-rw-r--r--package/kernel/mac80211/Makefile2
-rw-r--r--package/kernel/mac80211/files/mac80211.hotplug5
2 files changed, 7 insertions, 0 deletions
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index f9f5093..25adbfb 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -1732,6 +1732,8 @@ define KernelPackage/cfg80211/install
$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
+ $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/00-wifi-detect
endef
define KernelPackage/ipw2100/install
diff --git a/package/kernel/mac80211/files/mac80211.hotplug b/package/kernel/mac80211/files/mac80211.hotplug
new file mode 100644
index 0000000..b865552
--- /dev/null
+++ b/package/kernel/mac80211/files/mac80211.hotplug
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ "${ACTION}" = "add" ] && {
+ /sbin/wifi config
+}