aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2019-03-13 17:44:22 +0100
committerChristian Lamparter <chunkeey@gmail.com>2019-03-18 20:42:29 +0100
commit9fd2a3faa5c90975670f99ec0c06a682807d7fe9 (patch)
tree2dfb942cb988b4e08daa03ab52f9ef6738775547
parent50674ccadee3edd07c8f8501907d207df3767a4e (diff)
downloadupstream-9fd2a3faa5c90975670f99ec0c06a682807d7fe9.tar.gz
upstream-9fd2a3faa5c90975670f99ec0c06a682807d7fe9.tar.bz2
upstream-9fd2a3faa5c90975670f99ec0c06a682807d7fe9.zip
ath79: qca955x: add wmac migration hotplug event
When upgrading from ar71xx target images to ath79 based ones, the integrated wireless interface changes its sysfs path. Therefore the previous enabled wireless interface will be disabled, which can cause false complains about it not working. This commit adds hotplug event which migrates to new path and will keep the wrireless interface enabled after upgrade. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
-rw-r--r--target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration32
1 files changed, 32 insertions, 0 deletions
diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration
new file mode 100644
index 0000000000..b86db0dbcc
--- /dev/null
+++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wmac-migration
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+WMAC_PATH_CHANGED=0
+
+. /lib/functions.sh
+
+migrate_wmac_path() {
+ local section="$1"
+ local path
+
+ config_get path ${section} path
+ case ${path} in
+ "platform/qca955x_wmac")
+ path="platform/ahb/ahb:apb/18100000.wmac"
+ WMAC_PATH_CHANGED=1
+ ;;
+ *)
+ return 0
+ ;;
+ esac
+
+ uci set wireless.${section}.path=${path}
+}
+
+[ "${ACTION}" = "add" ] && {
+ [ ! -e /etc/config/wireless ] && return 0
+
+ config_load wireless
+ config_foreach migrate_wmac_path wifi-device
+
+ [ "${WMAC_PATH_CHANGED}" = "1" ] && uci commit wireless
+}