ath79: add TP-Link TL-WR710N v1
[openwrt/staging/lynxis.git] / target / linux / ath79 / base-files / etc / hotplug.d / ieee80211 / 00-wmac-migration
1 #!/bin/sh
2
3 WMAC_PATH_CHANGED=0
4
5 . /lib/functions.sh
6
7 migrate_wmac_path() {
8 local section="$1"
9 local path
10
11 config_get path ${section} path
12 case ${path} in
13 "platform/qca955x_wmac")
14 path="platform/ahb/ahb:apb/18100000.wmac"
15 WMAC_PATH_CHANGED=1
16 ;;
17 "platform/ar933x_wmac")
18 path="platform/ahb/18100000.wmac"
19 WMAC_PATH_CHANGED=1
20 ;;
21 *)
22 return 0
23 ;;
24 esac
25
26 uci set wireless.${section}.path=${path}
27 }
28
29 [ "${ACTION}" = "add" ] && {
30 [ ! -e /etc/config/wireless ] && return 0
31
32 config_load wireless
33 config_foreach migrate_wmac_path wifi-device
34
35 [ "${WMAC_PATH_CHANGED}" = "1" ] && uci commit wireless
36 }