ipq806x: add ath10k calibration data MAC addresses patching
[openwrt/staging/chunkeey.git] / target / linux / ipq806x / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
1 #!/bin/ash
2
3 [ "$ACTION" == "add" ] || exit 0
4
5 PHYNBR=${DEVPATH##*/phy}
6
7 [ -n $PHYNBR ] || exit 0
8
9 . /lib/functions.sh
10 . /lib/functions/system.sh
11
12 OPATH=${DEVPATH##/devices/platform/}
13 OPATH=${OPATH%%/ieee*}
14
15 # 10 radios is enough for anyone!
16 for i in `seq 0 9`;
17 do
18 BUS=`uci get wireless.@wifi-device[$i].path`
19 if [ "$BUS " == "$OPATH " ]
20 then
21 PHYNAME=${DEVPATH##*ieee80211/}
22 NPHYNAME=`uci get wireless.@wifi-device[$i].phyname`
23 if [ "$NPHYNAME " != " " ]
24 then
25 if [ "$PHYNAME " != "$NPHYNAME " ]
26 then
27 iw $PHYNAME set name $NPHYNAME
28 fi
29 fi
30 fi
31 done