aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac')
-rw-r--r--target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac24
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
new file mode 100644
index 0000000000..59c58f9c67
--- /dev/null
+++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -0,0 +1,24 @@
+#!/bin/ash
+
+[ "$ACTION" == "add" ] || exit 0
+
+PHYNBR=${DEVPATH##*/phy}
+
+[ -n $PHYNBR ] || exit 0
+
+. /lib/functions.sh
+. /lib/functions/system.sh
+. /lib/functions/k2t.sh
+
+board=$(board_name)
+
+case "$board" in
+ phicomm,k2t)
+ # The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
+ [ "$PHYNBR" -eq 1 ] && \
+ echo $(k2t_get_mac "lan_mac") > /sys${DEVPATH}/macaddress
+ ;;
+ *)
+ ;;
+esac
+