preinit_ip() {
	if [ -z "$pi_ifname" ]; then
		grep -q 'Atheros AR231[567]' /proc/cpuinfo && {
			if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
			     -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
				ip link set eth0 up
				ip link add link eth0 name eth0.1 type vlan id 1
				ifname=eth0.1
			else
				ifname=eth0
			fi
			pi_ifname=$ifname
		}
	fi
	[ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
		ip addr add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $pi_ifname
		ip link set $pi_ifname up
	}
}

preinit_ip_deconfig() {
	if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
	     -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
		ip link del eth0.1 2>/dev/null
		ip link set $pi_ifname down
	elif [ -n "$pi_ifname" ]; then
		ip -4 addr flush dev $pi_ifname
	fi
}
