aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Panella <ianchi74@outlook.com>2016-06-23 19:00:25 +0200
committerZoltan HERPAI <wigyori@uid0.hu>2016-06-23 19:00:25 +0200
commit527aa5f3b2b98ed9136edbaca7e48317c6111b3c (patch)
tree68b5107b17ae290e9eded633d602608ccb159c4c
parentcfe551285f02f5a9fd4fc458dcca3d60430abf47 (diff)
downloadmaster-187ad058-527aa5f3b2b98ed9136edbaca7e48317c6111b3c.tar.gz
master-187ad058-527aa5f3b2b98ed9136edbaca7e48317c6111b3c.tar.bz2
master-187ad058-527aa5f3b2b98ed9136edbaca7e48317c6111b3c.zip
ipq806x: enable ieee80211 phy hotplug and patch macaddress
Calibration data for QCA99x0 in this device has bogus macaddress. The data cannot be modified directly, as it breaks checksum control. Instead change the macaddress from phy add hotplug event. Signed-off-by: Adrian Panella <ianchi74@outlook.com>
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac23
1 files changed, 23 insertions, 0 deletions
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
new file mode 100644
index 0000000000..1ae4352686
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -0,0 +1,23 @@
+#!/bin/ash
+
+[ "$ACTION" == "add" ] || exit 0
+
+PHYNBR=${DEVPATH##*/phy}
+
+[ -n $PHYNBR ] || exit 0
+
+. /lib/ipq806x.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+ c2600)
+ echo $(macaddr_add $(mtd_get_mac_binary default-mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
+ ;;
+ ea8500)
+ echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
+ ;;
+ *)
+ ;;
+esac