aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/base-files/etc
diff options
context:
space:
mode:
authorAdrian Panella <ianchi74@outlook.com>2016-06-21 11:12:26 -0500
committerJohn Crispin <john@phrozen.org>2016-06-22 19:32:06 +0200
commit184087f4f16357c539df106e3f5971e7daabbdc9 (patch)
treedff3febda1f3d71354df0cd7c7d2316ba70c721b /target/linux/ipq806x/base-files/etc
parentf97ad870e11ebe5f3dcf833dda6c83b9165b37cb (diff)
downloadupstream-184087f4f16357c539df106e3f5971e7daabbdc9.tar.gz
upstream-184087f4f16357c539df106e3f5971e7daabbdc9.tar.bz2
upstream-184087f4f16357c539df106e3f5971e7daabbdc9.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>
Diffstat (limited to 'target/linux/ipq806x/base-files/etc')
-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