aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2015-12-10 12:13:16 +0000
committerImre Kaloz <kaloz@openwrt.org>2015-12-10 12:13:16 +0000
commit0376f0c74705887bac8e605ebc31a1f23820ed0f (patch)
tree53b8ca85ae4bb33be624470b0f5e299fcd70846b
parent618fae4a7f899ff52e8d7961f938eab9504c095d (diff)
downloadmaster-187ad058-0376f0c74705887bac8e605ebc31a1f23820ed0f.tar.gz
master-187ad058-0376f0c74705887bac8e605ebc31a1f23820ed0f.tar.bz2
master-187ad058-0376f0c74705887bac8e605ebc31a1f23820ed0f.zip
mvebu: fixup wifi macs for Linksys boards
Signed-off-by: Imre Kaloz <kaloz@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47820 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/mvebu/base-files/etc/uci-defaults/03_wireless17
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/mvebu/base-files/etc/uci-defaults/03_wireless b/target/linux/mvebu/base-files/etc/uci-defaults/03_wireless
index fcf43ee1f3..b20d9fd302 100644
--- a/target/linux/mvebu/base-files/etc/uci-defaults/03_wireless
+++ b/target/linux/mvebu/base-files/etc/uci-defaults/03_wireless
@@ -5,6 +5,7 @@
[ ! -e /etc/config/wireless ] && exit 0
+. /lib/functions/system.sh
. /lib/mvebu.sh
board=$(mvebu_board_name)
@@ -12,6 +13,8 @@ board=$(mvebu_board_name)
case "$board" in
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
SKU=$(strings /dev/mtd3|sed -ne 's/^cert_region=//p')
+ WIFIMAC2G=$(macaddr_add $(cat /sys/class/net/eth0/address) +1)
+ WIFIMAC5G=$(macaddr_add $WIFIMAC2G +1)
case "$SKU" in
AP)
REGD=CN
@@ -29,8 +32,22 @@ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|arm
REGD=US
;;
esac
+
+ case "$board" in
+ armada-xp-linksys-mamba)
+ WIFIMAC0=$WIFIMAC2G
+ WIFIMAC1=$WIFIMAC5G
+ ;;
+ *)
+ WIFIMAC0=$WIFIMAC5G
+ WIFIMAC1=$WIFIMAC2G
+ ;;
+ esac
+
uci get wireless.radio0.country || uci set wireless.radio0.country=$REGD
+ uci get wireless.@wifi-iface[0].macaddr || uci set wireless.@wifi-iface[0].macaddr=$WIFIMAC0
uci get wireless.radio1.country || uci set wireless.radio1.country=$REGD
+ uci get wireless.@wifi-iface[1].macaddr || uci set wireless.@wifi-iface[1].macaddr=$WIFIMAC1
;;
esac