15_preinit_iface_atheros 956 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # reset button only supported on ar5315+ at the moment
  3. preinit_ip() {
  4. if [ -z "$pi_ifname" ]; then
  5. grep -q 'Atheros AR231[567]' /proc/cpuinfo && {
  6. if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
  7. -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
  8. vconfig set_name_type DEV_PLUS_VID_NO_PAD
  9. ifconfig eth0 up
  10. vconfig add eth0 1
  11. ifname=eth0.1
  12. else
  13. ifname=eth0
  14. fi
  15. pi_ifname=$ifname
  16. }
  17. fi
  18. [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && {
  19. ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up
  20. }
  21. }
  22. # reset button only supported on ar5315+ at the moment
  23. preinit_ip_deconfig() {
  24. if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \
  25. -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then
  26. vconfig rem eth0.1 2>/dev/null
  27. ifconfig $pi_ifname down
  28. elif [ -n "$pi_ifname" ]; then
  29. ifconfig $pi_ifname 0.0.0.0
  30. fi
  31. }