aboutsummaryrefslogtreecommitdiff
path: root/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac
blob: 5a933df501a7abad9528ce3ff775ef85944d82af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[ "$ACTION" = "add" ] || exit 0

PHYNBR=${DEVPATH##*/phy}

[ -n $PHYNBR ] || exit 0

. /lib/functions.sh
. /lib/functions/system.sh

board=$(board_name)

case $board in
	glinet,gl-e750)
		# Set mac address for 5g device
		[ "$PHYNBR" -eq 0 ] && \
			macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress
		;;
	zyxel,emg2926-q10a|\
	zyxel,nbg6716)
		ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
		[ "$PHYNBR" -eq 0 ] && \
			macaddr_add $ethaddr 1 > /sys${DEVPATH}/macaddress
		[ "$PHYNBR" -eq 1 ] && \
			echo -n $ethaddr > /sys${DEVPATH}/macaddress
		;;
esac