2006-06-27 08:36:13 +08:00
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
|
2006-09-24 21:32:18 +08:00
|
|
|
include /lib/network
|
2006-04-13 19:39:20 +08:00
|
|
|
|
2006-07-30 11:09:09 +08:00
|
|
|
addif() {
|
2007-02-25 21:45:45 +08:00
|
|
|
# PPP devices are configured by pppd, no need to run setup_interface here
|
|
|
|
case "$INTERFACE" in
|
|
|
|
ppp*) return 0;;
|
|
|
|
esac
|
|
|
|
|
2006-07-30 11:09:09 +08:00
|
|
|
scan_interfaces
|
2006-11-04 05:57:35 +08:00
|
|
|
local cfg="$(find_config "$INTERFACE")"
|
|
|
|
|
|
|
|
# check the autoload setting
|
|
|
|
config_get auto "$cfg" auto
|
|
|
|
case "$auto" in
|
|
|
|
1|on|enabled) setup_interface "$INTERFACE";;
|
|
|
|
esac
|
|
|
|
|
2006-08-24 20:20:02 +08:00
|
|
|
|
2006-07-30 11:09:09 +08:00
|
|
|
# find all vlan configurations for this interface and set them up as well
|
|
|
|
for ifc in $interfaces; do
|
2006-07-30 21:21:18 +08:00
|
|
|
config_get iftype "$ifc" type
|
2006-10-09 20:35:31 +08:00
|
|
|
config_get ifs "$ifc" device
|
2006-07-30 11:09:09 +08:00
|
|
|
for dev in $ifs; do
|
|
|
|
[ "${dev%%\.*}" = "$INTERFACE" -a "$dev" != "$INTERFACE" ] && {
|
|
|
|
add_vlan "$dev"
|
2005-11-19 11:17:20 +08:00
|
|
|
}
|
2006-07-30 11:09:09 +08:00
|
|
|
done
|
|
|
|
done
|
2005-11-19 11:17:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$ACTION" in
|
2006-07-30 11:09:09 +08:00
|
|
|
add|register)
|
2006-10-09 12:01:36 +08:00
|
|
|
case "$PHYSDEVDRIVER" in
|
|
|
|
natsemi) sleep 1;;
|
|
|
|
esac
|
2006-07-30 11:09:09 +08:00
|
|
|
addif
|
|
|
|
;;
|
2005-11-19 11:17:20 +08:00
|
|
|
esac
|