This patch switches the MINIX3 ethernet driver stack from a port-based
model to an instance-based model. Each ethernet driver instance is now responsible for exactly one network interface card. The port field in /etc/inet.conf now acts as an instance field instead. This patch also updates the data link protocol. This update: - eliminates the concept of ports entirely; - eliminates DL_GETNAME entirely; - standardizes on using m_source for IPC and DL_ENDPT for safecopies; - removes error codes from TASK/STAT replies, as they were unused; - removes a number of other old or unused fields; - names and renames a few other fields. All ethernet drivers have been changed to: - conform to the new protocol, and exactly that; - take on an instance number based on a given "instance" argument; - skip that number of PCI devices in probe iterations; - use config tables and environment variables based on that number; - no longer be limited to a predefined maximum of cards in any way; - get rid of any leftover non-safecopy support and other ancient junk; - have a correct banner protocol figure, or none at all. Other changes: * Inet.conf is now taken to be line-based, and supports #-comments. No existing installations are expected to be affected by this. * A new, select-based asynchio library replaces the old one. Kindly contributed by Kees J. Bot. * Inet now supports use of select() on IP devices. Combined, the last two changes together speed up dhcpd considerably in the presence of multiple interfaces. * A small bug has been fixed in nonamed.
This commit is contained in:
+16
-9
@@ -74,6 +74,14 @@ upopt()
|
||||
service $opt up /usr/sbin/$service "$@"
|
||||
}
|
||||
|
||||
get_eth_labels() {
|
||||
# Filter out the non-vlan ethernet entries from inet.conf.
|
||||
# Produce as output a list of "drivername_instancenr"-formatted labels.
|
||||
# The first sed is taken from /bin as older GNU sed versions don't know '\t'.
|
||||
/bin/sed 's/\t/ /g' /etc/inet.conf | \
|
||||
sed -n 's/^ *eth[0-9][0-9]* *\([^ ][^ ]*\) *\([0-9][0-9]*\).*$/\1_\2/p' | \
|
||||
grep -v '^vlan_'
|
||||
}
|
||||
|
||||
DAEMONS=/etc/rc.daemons
|
||||
|
||||
@@ -97,15 +105,14 @@ start)
|
||||
dd if=/dev/random of=$RANDOM_FILE bs=1024 count=1 2> /dev/null
|
||||
fi
|
||||
|
||||
# start only network drivers that are in use
|
||||
for driver in lance rtl8139 rtl8169 fxp e1000 dpeth dp8390 orinoco atl2 dec21140A
|
||||
do
|
||||
if grep " $driver " /etc/inet.conf > /dev/null 2>&1
|
||||
then
|
||||
eval arg=\$${driver}_arg
|
||||
if [ ! -z "$arg" ]; then arg="-args \"$arg\""; fi
|
||||
eval up $driver $arg -period 5HZ
|
||||
fi
|
||||
# start network driver instances for all configured ethernet devices
|
||||
for label in $(get_eth_labels); do
|
||||
driver=$(echo $label | sed 's/\(.*\)_.*/\1/')
|
||||
instance=$(echo $label | sed 's/.*_//')
|
||||
eval arg=\$${label}_arg
|
||||
if [ ! -z "$arg" ]; then arg=" $arg"; fi
|
||||
arg="-args \"instance=$instance$arg\""
|
||||
eval up $driver -label $label $arg -period 5HZ
|
||||
done
|
||||
up inet -script /etc/rs.inet -dev /dev/ip -devstyle STYLE_CLONE
|
||||
upopt -n printer -dev /dev/lp -period 10HZ
|
||||
|
||||
Reference in New Issue
Block a user