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

PHYNBR=${DEVPATH##*/phy}

[ -n $PHYNBR ] || exit 0

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

board=$(board_name)

case "$board" in
	hiwifi,hc5611|\
	hiwifi,hc5661a|\
	hiwifi,hc5761a|\
	hiwifi,hc5861b)
		label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
		[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
		echo -n "$label_mac" > /sys${DEVPATH}/macaddress
		[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
		macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
		;;
esac