#!/bin/ash

[ "$ACTION" = "add" ] || exit 0

PHYNBR=${DEVPATH##*/phy}

[ -n "$PHYNBR" ] || exit 0

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

board=$(board_name)

case "$board" in
netgear,wndap620|\
netgear,wndap660)
	macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress
	;;
esac
