summaryrefslogtreecommitdiff
path: root/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
blob: 1ae43526866c3b0adc5652c00de2f8036e3ac9f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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