ath25: add back target support
[openwrt/staging/rmilecki.git] / target / linux / ath25 / base-files / lib / preinit / 15_preinit_iface_atheros
1 # reset button only supported on ar5315+ at the moment
2 preinit_ip() {
3 if [ -z "$pi_ifname" ]; then
4 grep -q 'Atheros AR231[567]' /proc/cpuinfo && {
5 if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
6 -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
7 vconfig set_name_type DEV_PLUS_VID_NO_PAD
8 ip link set eth0 up
9 vconfig add eth0 1
10 ifname=eth0.1
11 else
12 ifname=eth0
13 fi
14 pi_ifname=$ifname
15 }
16 fi
17 [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
18 ip addr add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $pi_ifname
19 ip link set $pi_ifname up
20 }
21 }
22
23
24 # reset button only supported on ar5315+ at the moment
25
26 preinit_ip_deconfig() {
27 if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
28 -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
29 vconfig rem eth0.1 2>/dev/null
30 ip link set $pi_ifname down
31 elif [ -n "$pi_ifname" ]; then
32 ip -4 addr flush dev $pi_ifname
33 fi
34 }