openwrt/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/00-wifi-migration
Alex Henrie fe1ecf1fcb ath79: add Zyxel EMG2926-Q10A
The Zyxel EMG2926-Q10A is 99% the Zyxel NBG6716, but the bootloader
expects a different product name when flashing over TFTP. Also, the
EMG2926-Q10A always has 128 MiB of NAND flash whereas the NBG6716
reportedly can have either 128 MiB or 256 MiB.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2022-02-26 13:36:30 +01:00

58 lines
1.0 KiB
Bash

#!/bin/sh
WIFI_PATH_CHANGED=0
. /lib/functions.sh
migrate_wifi_path() {
local section="$1"
local path
config_get path ${section} path
case ${path} in
"pci0000:01/0000:01:00.0")
board=$(board_name)
case "$board" in
tplink,archer-c7-v1|\
tplink,archer-c7-v2|\
zyxel,emg2926-q10a|\
zyxel,nbg6716)
path="pci0000:00/0000:00:00.0"
WIFI_PATH_CHANGED=1
;;
*)
return 0
;;
esac
;;
"platform/ahb/ahb:apb/18100000.wmac"|\
"platform/ar933x_wmac"|\
"platform/ar934x_wmac"|\
"platform/qca953x_wmac"|\
"platform/qca955x_wmac"|\
"platform/qca956x_wmac")
path="platform/ahb/18100000.wmac"
WIFI_PATH_CHANGED=1
;;
"platform/ath9k")
path="platform/ahb/180c0000.wmac"
WIFI_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_wifi_path wifi-device
[ "${WIFI_PATH_CHANGED}" = "1" ] && uci commit wireless
}