You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
857 B
Plaintext
51 lines
857 B
Plaintext
5 years ago
|
#!/bin/sh
|
||
|
|
||
5 years ago
|
WIFI_PATH_CHANGED=0
|
||
5 years ago
|
|
||
|
. /lib/functions.sh
|
||
|
|
||
5 years ago
|
migrate_wifi_path() {
|
||
5 years ago
|
local section="$1"
|
||
|
local path
|
||
|
|
||
|
config_get path ${section} path
|
||
|
case ${path} in
|
||
5 years ago
|
"pci0000:01/0000:01:00.0")
|
||
|
board=$(board_name)
|
||
|
|
||
|
case "$board" in
|
||
|
tplink,archer-c7-v1|\
|
||
|
tplink,archer-c7-v2)
|
||
|
path="pci0000:00/0000:00:00.0"
|
||
|
WIFI_PATH_CHANGED=1
|
||
|
;;
|
||
|
*)
|
||
|
return 0
|
||
|
;;
|
||
|
esac
|
||
|
;;
|
||
5 years ago
|
"platform/qca955x_wmac")
|
||
|
path="platform/ahb/ahb:apb/18100000.wmac"
|
||
5 years ago
|
WIFI_PATH_CHANGED=1
|
||
5 years ago
|
;;
|
||
6 years ago
|
"platform/ar933x_wmac")
|
||
|
path="platform/ahb/18100000.wmac"
|
||
5 years ago
|
WIFI_PATH_CHANGED=1
|
||
6 years ago
|
;;
|
||
5 years ago
|
*)
|
||
|
return 0
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
uci set wireless.${section}.path=${path}
|
||
|
}
|
||
|
|
||
|
[ "${ACTION}" = "add" ] && {
|
||
|
[ ! -e /etc/config/wireless ] && return 0
|
||
|
|
||
|
config_load wireless
|
||
5 years ago
|
config_foreach migrate_wifi_path wifi-device
|
||
5 years ago
|
|
||
5 years ago
|
[ "${WIFI_PATH_CHANGED}" = "1" ] && uci commit wireless
|
||
5 years ago
|
}
|