MFC 1.28: use media type to recognize eth+802.11 network interfaces

instead of doing a regex on device names

Approved by:	re (scottl)
This commit is contained in:
sam 2005-09-03 22:49:22 +00:00
parent b9f7746f1f
commit 7a8285331c

View File

@ -17,11 +17,7 @@ options {
pid-file "/var/run/devd.pid";
# Setup some shorthand for regex that we use later in the file.
set ethernet-nic-regex
"(an|ar|ath|aue|awi|axe|bfe|bge|cdce|cm|cnw|cs|cue|dc|de|ed|el|em|\
ep|ex|fe|fxp|gem|hme|ie|kue|lge|lnc|my|nge|pcn|ray|re|rl|rue|\
sf|sis|sk|sn|snc|ste|ti|tl|tx|txp|udav|vge|vr|vx|wb|wi|xe|xl)\
[0-9]+";
#XXX Yes, these are gross -- imp
set scsi-controller-regex
"(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\
esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\
@ -36,12 +32,12 @@ options {
# a historical accident, this script is called pccard_ether.
#
attach 0 {
device-name "$ethernet-nic-regex";
media-type "ethernet";
action "/etc/pccard_ether $device-name start";
};
detach 0 {
device-name "$ethernet-nic-regex";
media-type "ethernet";
action "/etc/pccard_ether $device-name stop";
};
@ -53,8 +49,28 @@ detach 0 {
#
notify 0 {
match "system" "IFNET";
match "subsystem" "$ethernet-nic-regex";
match "type" "LINK_UP";
media-type "ethernet";
action "/etc/rc.d/dhclient start $subsystem";
};
#
# Like Ethernet devices, but separate because
# they have a different media type. We may want
# to exploit this later.
#
detach 0 {
media-type "802.11";
action "/etc/pccard_ether $device-name stop";
};
attach 0 {
media-type "802.11";
action "/etc/pccard_ether $device-name start";
};
notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "802.11";
action "/etc/rc.d/dhclient start $subsystem";
};
@ -88,7 +104,8 @@ attach 100 {
};
#
# Rescan scsi device-names on attach, but not detach.
# Rescan scsi device-names on attach, but not detach. However, it is
# disabled by default due to reports of problems.
#
attach 0 {
device-name "$scsi-controller-regex";