From: Sascha Wildner Date: Wed, 12 Mar 2014 20:09:03 +0000 (+0100) Subject: devd(8): Sync with FreeBSD and turn it on by default. X-Git-Tag: v3.9.0~348 X-Git-Url: https://gitweb.dragonflybsd.org/~nant/dragonfly.git/commitdiff_plain/e348c2adc1626446936f2907dced94b10052dbfb devd(8): Sync with FreeBSD and turn it on by default. Most important of all, it cares about knowing which USB modules support which device/vendor IDs and it will load the associated module upon USB device plugging if it is not already loaded or in the kernel config. Taken-from: FreeBSD --- diff --git a/etc/Makefile b/etc/Makefile index d73c67de0d..a7ca12ce7f 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -161,6 +161,7 @@ upgrade_etc: preupgrade remove-obsolete-files cd ${UPGRADE_SRCDIR}/periodic; ${MAKE} install mkdir -p ${DESTDIR}/etc/rc.d cd ${UPGRADE_SRCDIR}/rc.d; ${MAKE} install + cd ${UPGRADE_SRCDIR}/devd; ${MAKE} install # "../share/termcap/make etc-termcap" expanded inline here: ${LN} -fs /usr/share/misc/termcap ${DESTDIR}/etc/termcap # "../usr.sbin/rmt/make etc-rmt" expanded inline here: @@ -271,6 +272,7 @@ distribution: cd ${.CURDIR}/bluetooth; ${MAKE} install cd ${.CURDIR}/periodic; ${MAKE} install cd ${.CURDIR}/rc.d; ${MAKE} install + cd ${.CURDIR}/devd; ${MAKE} install cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt cd ${.CURDIR}; \ diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 38fcdbc27d..0ce39e3f8d 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -364,8 +364,8 @@ lpd_flags="" # Flags to lpd (if enabled). nscd_enable="NO" # Run the nsswitch caching daemon. usbd_enable="NO" # Run the usbd daemon. usbd_flags="" # Flags to usbd (if enabled). -devd_enable="NO" # Runs devd(8) daemon. -devd_flags="" # Flags to devd(8) (if enabled). +devd_enable="YES" # Run devd, to trigger programs on device tree changes. +devd_flags="" # Additional flags for devd(8). dumpdev="NO" # Device name to crashdump to (or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored savecore_flags="" # Used if dumpdev is enabled above, and present. diff --git a/etc/devd.conf b/etc/devd.conf index 327f37e638..725c32430c 100644 --- a/etc/devd.conf +++ b/etc/devd.conf @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/devd.conf,v 1.42 2008/06/27 12:04:36 rpaulo Exp $ +# $FreeBSD: head/etc/devd.conf 261894 2014-02-14 15:31:48Z avg $ # # Refer to devd.conf(5) and devd(8) man pages for the details on how to # run and configure devd. @@ -8,17 +8,18 @@ # NB: device-name is shorthand for 'match device-name' options { - # Each directory directive adds a directory the list of directories - # that we scan for files. Files are read-in in the order that they - # are returned from readdir(3). The rule-sets are combined to - # create a DFA that's used to match events to actions. + # Each "directory" directive adds a directory to the list of + # directories that we scan for files. Files are loaded in the order + # that they are returned from readdir(3). The rule-sets are combined + # to create a DFA that's used to match events to actions. directory "/etc/devd"; directory "/usr/local/etc/devd"; + pid-file "/var/run/devd.pid"; # Setup some shorthand for regex that we use later in the file. #XXX Yes, these are gross -- imp set scsi-controller-regex - "(aac|adv|adw|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ + "(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)\ [0-9]+"; }; @@ -30,231 +31,259 @@ options { # Configure the interface on attach. Due to a historical accident, this # script is called pccard_ether. # -# notify 0 { -# match "system" "IFNET"; -# match "type" "ATTACH"; -# action "/etc/pccard_ether $subsystem start"; -# }; +# NB: DETACH events are ignored; the kernel should handle all cleanup +# (routes, arp cache). Beware of races against immediate create +# of a device with the same name; e.g. +# ifconfig bridge0 destroy; ifconfig bridge0 create # -# notify 0 { -# match "system" "IFNET"; -# match "type" "DETACH"; -# action "/etc/pccard_ether $subsystem stop"; -# }; +notify 0 { + match "system" "IFNET"; + match "subsystem" "!usbus[0-9]+"; + match "type" "ATTACH"; + action "/etc/pccard_ether $subsystem start"; +}; # -# Try to start dhclient on Ethernet like interfaces when the link comes +# Try to start dhclient on Ethernet-like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually -# run it. No link down rule exists because dhclient automaticly exits +# run it. No link down rule exists because dhclient automatically exits # when the link goes down. # -# notify 0 { -# match "system" "IFNET"; -# match "type" "LINK_UP"; -# media-type "ethernet"; -# action "/etc/rc.d/dhclient start $subsystem"; -# }; +notify 0 { + match "system" "IFNET"; + match "type" "LINK_UP"; + media-type "ethernet"; + action "/etc/rc.d/dhclient quietstart $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"; -# }; +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 quietstart $subsystem"; +}; -# # An entry like this might be in a different file, but is included here # as an example of how to override things. Normally 'ed50' would match # the above attach/detach stuff, but the value of 100 makes it # hard wired to 1.2.3.4. -# attach 100 { -# device-name "ed50"; -# action "ifconfig $device-name inet 1.2.3.4 netmask 0xffff0000"; -# }; -# detach 100 { -# device-name "ed50"; -# }; +attach 100 { + device-name "ed50"; + action "ifconfig $device-name inet 1.2.3.4 netmask 0xffff0000"; +}; +detach 100 { + device-name "ed50"; +}; -# -# When a USB Bluetooth dongle appears activate it. -# XXX FIX for DragonFly XXX -# attach 100 { -# device-name "ubt[0-9]+"; -# action "/etc/rc.d/bluetooth start $device-name"; -# }; -# detach 100 { -# device-name "ubt[0-9]+"; -# action "/etc/rc.d/bluetooth stop $device-name"; -# }; +# When a USB Bluetooth dongle appears, activate it +attach 100 { + device-name "ubt[0-9]+"; + action "/etc/rc.d/bluetooth quietstart $device-name"; +}; +detach 100 { + device-name "ubt[0-9]+"; + action "/etc/rc.d/bluetooth quietstop $device-name"; +}; + +# Firmware downloader for Atheros AR3011 based USB Bluetooth devices +#attach 100 { +# match "vendor" "0x0cf3"; +# match "product" "0x3000"; +# action "sleep 2 && /usr/sbin/ath3kfw -d $device-name -f /usr/local/etc/ath3k-1.fw"; +#}; -# # When a USB keyboard arrives, attach it as the console keyboard. -# XXX Fix for DragonFly XXX -# attach 100 { -# device-name "ukbd0"; -# action "/etc/rc.d/syscons setkeyboard /dev/ukbd0"; -# }; -# detach 100 { -# device-name "ukbd0"; -# action "/etc/rc.d/syscons setkeyboard /dev/kbd0"; -# }; -# -# attach 100 { -# device-name "ums[0-9]+"; -# action "/etc/rc.d/moused start $device-name"; -# }; -# -# detach 100 { -# device-name "ums[0-9]+"; -# action "/etc/rc.d/moused stop $device-name"; -# }; +attach 100 { + device-name "ukbd0"; + action "/etc/rc.d/syscons setkeyboard /dev/ukbd0"; +}; +detach 100 { + device-name "ukbd0"; + action "/etc/rc.d/syscons setkeyboard /dev/kbd0"; +}; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "atp[0-9]+"; + + action "/etc/rc.d/moused quietstart $cdev"; +}; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "ums[0-9]+"; + + action "/etc/rc.d/moused quietstart $cdev"; +}; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "wsp[0-9]+"; + + action "/etc/rc.d/moused quietstart $cdev"; +}; + +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "DESTROY"; + match "cdev" "ums[0-9]+"; + + action "/etc/rc.d/moused stop $cdev"; +}; + +# Firmware download into the ActiveWire board. After the firmware download is +# done, the device detaches and reappears as something new and shiny +# automatically. +attach 100 { + match "vendor" "0x0854"; + match "product" "0x0100"; + match "release" "0x0000"; + action "/usr/local/bin/ezdownload -f /usr/local/share/usb/firmware/0854.0100.0_01.hex $device-name"; +}; + +# Firmware download for Entrega Serial DB25 adapter. +attach 100 { + match "vendor" "0x1645"; + match "product" "0x8001"; + match "release" "0x0101"; + action "if ! kldstat -n usio > /dev/null 2>&1 ; then kldload usio; fi; /usr/sbin/ezdownload -v -f /usr/share/usb/firmware/1645.8001.0101 /dev/$device-name"; +}; + +# This entry starts the ColdSync tool in daemon mode. Make sure you have an up +# to date /usr/local/etc/palms. We override the 'listen' settings for port and +# type in /usr/local/etc/coldsync.conf. +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x082d"; + match "product" "0x0100"; + match "release" "0x0100"; + action "/usr/local/bin/coldsync -md -p /dev/$cdev -t usb"; +}; # -# Rescan scsi device-names on attach, but not detach. However, it is +# 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"; -# action "camcontrol rescan all"; -# }; -# +attach 0 { + device-name "$scsi-controller-regex"; +// action "camcontrol rescan all"; +}; + # Don't even try to second guess what to do about drivers that don't # match here. Instead, pass it off to syslog. Commented out for the # moment, as the pnpinfo variable isn't set in devd yet. Individual # variables within the bus supplied pnpinfo are set. -# nomatch 0 { +nomatch 0 { # action "logger Unknown device: $pnpinfo $location $bus"; -#}; +}; -# # Various logging of unknown devices. -# nomatch 10 { -# match "bus" "uhub[0-9]+"; -# action "logger Unknown USB device: vendor $vendor product $product \ -# bus $bus"; -# }; +nomatch 10 { + match "bus" "uhub[0-9]+"; + action "logger Unknown USB device: vendor $vendor product $product \ + bus $bus"; +}; -# # Some PC-CARDs don't offer numerical manufacturer/product IDs, just # show the CIS info there. -# nomatch 20 { -# match "bus" "pccard[0-9]+"; -# match "manufacturer" "0xffffffff"; -# match "product" "0xffffffff"; -# action "logger Unknown PCCARD device: CISproduct $cisproduct \ -# CIS-vendor $cisvendor bus $bus"; -# }; -# -# nomatch 10 { -# match "bus" "pccard[0-9]+"; -# action "logger Unknown PCCARD device: manufacturer $manufacturer \ -# product $product CISproduct $cisproduct CIS-vendor \ -# $cisvendor bus $bus"; -# }; -# -# nomatch 10 { -# match "bus" "cardbus[0-9]+"; -# action "logger Unknown Cardbus device: device $device class $class \ -# vendor $vendor bus $bus"; -# }; +nomatch 20 { + match "bus" "pccard[0-9]+"; + match "manufacturer" "0xffffffff"; + match "product" "0xffffffff"; + action "logger Unknown PCCARD device: CISproduct $cisproduct \ + CIS-vendor $cisvendor bus $bus"; +}; + +nomatch 10 { + match "bus" "pccard[0-9]+"; + action "logger Unknown PCCARD device: manufacturer $manufacturer \ + product $product CISproduct $cisproduct CIS-vendor \ + $cisvendor bus $bus"; +}; + +nomatch 10 { + match "bus" "cardbus[0-9]+"; + action "logger Unknown Cardbus device: device $device class $class \ + vendor $vendor bus $bus"; +}; -# # Switch power profiles when the AC line state changes. -# notify 10 { -# match "system" "ACPI"; -# match "subsystem" "ACAD"; -# action "/etc/rc.d/power_profile $notify"; -# }; +notify 10 { + match "system" "ACPI"; + match "subsystem" "ACAD"; + action "/etc/rc.d/power_profile $notify"; +}; -# # Notify all users before beginning emergency shutdown when we get # a _CRT or _HOT thermal event and we're going to power down the system # very soon. -# notify 10 { -# match "system" "ACPI"; -# match "subsystem" "Thermal"; -# match "notify" "0xcc"; -# action "logger -p kern.emerg \ -# 'WARNING: system temperature too high, shutting down soon!'"; -#}; +notify 10 { + match "system" "ACPI"; + match "subsystem" "Thermal"; + match "notify" "0xcc"; + action "logger -p kern.emerg 'WARNING: system temperature too high, shutting down soon!'"; +}; -# # User requested suspend, so perform preparation steps and then execute # the actual suspend process. -# notify 10 { -# match "system" "ACPI"; -# match "subsystem" "Suspend"; -# action "/etc/rc.suspend acpi $notify"; -# }; -# notify 10 { -# match "system" "ACPI"; -# match "subsystem" "Resume"; -# action "/etc/rc.resume acpi $notify"; -# }; +notify 10 { + match "system" "ACPI"; + match "subsystem" "Suspend"; + action "/etc/rc.suspend acpi $notify"; +}; +notify 10 { + match "system" "ACPI"; + match "subsystem" "Resume"; + action "/etc/rc.resume acpi $notify"; +}; -# -# The next blocks enable volume hotkeys that can be found on the Asus EeePC -# XXX ASUS-Eee subsystem isn't available in DragonFly -# notify 0 { -# match "system" "ACPI"; -# match "subsystem" "ASUS-Eee"; -# match "notify" "0x13"; -# action "mixer 0"; -# }; -# -# notify 0 { -# match "system" "ACPI"; -# match "subsystem" "ASUS-Eee"; -# match "notify" "0x14"; -# action "mixer vol -10"; -# }; -# -# notify 0 { -# match "system" "ACPI"; -# match "subsystem" "ASUS-Eee"; -# match "notify" "0x15"; -# action "mixer vol +10"; -# }; - -# -# The following might be an example of something that a vendor might -# install if you were to add their device. This might reside in -# /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical -# example, a pccard ethernet-like device. Students of history may -# know other devices by this name, and will get the in-jokes in this -# entry. -# nomatch 10 { -# match "bus" "pccard[0-9]+"; -# match "manufacturer" "0x1234"; -# match "product" "0x2323"; -# action "kldload if_deqna"; -# }; -# attach 10 { -# device-name "deqna[0-9]+"; -# action "/etc/pccard_ether $device-name start"; -# }; -# detach 10 { -# device-name "deqna[0-9]+"; -# action "/etc/pccard_ether $device-name stop"; -# }; +/* EXAMPLES TO END OF FILE + +# An example of something that a vendor might install if you were to +# add their device. This might reside in /usr/local/etc/devd/deqna.conf. +# A deqna is, in this hypothetical example, a pccard ethernet-like device. +# Students of history may know other devices by this name, and will get +# the in-jokes in this entry. +nomatch 10 { + match "bus" "pccard[0-9]+"; + match "manufacturer" "0x1234"; + match "product" "0x2323"; + action "kldload if_deqna"; +}; +attach 10 { + device-name "deqna[0-9]+"; + action "/etc/pccard_ether $device-name start"; +}; +detach 10 { + device-name "deqna[0-9]+"; + action "/etc/pccard_ether $device-name stop"; +}; -# # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. -# + # Here are some examples of ACPI notify handlers. ACPI subsystems that # generate notifies include the AC adapter, power/sleep buttons, # control method batteries, lid switch, and thermal zones. @@ -263,19 +292,30 @@ options { # events. See the ACPI specification for more information about # notifies. Here is the information returned for each subsystem: # -# ACAD: AC line state (0 is offline, 1 is online) -# Button: Button pressed (0 for power, 1 for sleep) -# CMBAT: ACPI battery events -# Lid: Lid state (0 is closed, 1 is open) +# ACAD: AC line state (0 is offline, 1 is online) +# Button: Button pressed (0 for power, 1 for sleep) +# CMBAT: ACPI battery events +# Lid: Lid state (0 is closed, 1 is open) +# RCTL: Resource limits # Suspend, Resume: Suspend and resume notification -# Thermal: ACPI thermal zone events +# Thermal: ACPI thermal zone events # # This example calls a script when the AC state changes, passing the # notify value as the first argument. If the state is 0x00, it might # call some sysctls to implement economy mode. If 0x01, it might set # the mode to performance. -# notify 10 { -# match "system" "ACPI"; -# match "subsystem" "ACAD"; -# action "/etc/acpi_ac $notify"; -# }; +notify 10 { + match "system" "ACPI"; + match "subsystem" "ACAD"; + action "/etc/acpi_ac $notify"; +}; + +# This example works around a memory leak in PostgreSQL, restarting +# it when the "user:pgsql:swap:devctl=1G" rctl(8) rule gets triggered. +notify 0 { + match "system" "RCTL"; + match "rule" "user:70:swap:.*"; + action "/usr/local/etc/rc.d/postgresql restart"; +}; + +*/ diff --git a/etc/devd/Makefile b/etc/devd/Makefile new file mode 100644 index 0000000000..ed26dca3ea --- /dev/null +++ b/etc/devd/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD: head/etc/devd/Makefile 261894 2014-02-14 15:31:48Z avg $ + +FILES= uath.conf usb.conf + +.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" +FILES+= asus.conf +.endif + +NO_OBJ= +FILESDIR= /etc/devd +FILESMODE= 644 + +.include diff --git a/etc/devd/asus.conf b/etc/devd/asus.conf new file mode 100644 index 0000000000..858623d95e --- /dev/null +++ b/etc/devd/asus.conf @@ -0,0 +1,74 @@ +# $FreeBSD: head/etc/devd/asus.conf 186432 2008-12-23 15:47:31Z thompsa $ +# +# ASUS specific devd events + +# The next blocks enable volume hotkeys that can be found on the Asus laptops +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS"; + match "notify" "0x32"; + action "mixer 0"; +}; + +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS"; + match "notify" "0x31"; + action "mixer vol -10"; +}; + +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS"; + match "notify" "0x30"; + action "mixer vol +10"; +}; + +# The next blocks enable volume hotkeys that can be found on the Asus EeePC +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS-Eee"; + match "notify" "0x13"; + action "mixer 0"; +}; + +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS-Eee"; + match "notify" "0x14"; + action "mixer vol -10"; +}; + +notify 0 { + match "system" "ACPI"; + match "subsystem" "ASUS-Eee"; + match "notify" "0x15"; + action "mixer vol +10"; +}; + +# Enable user hotkeys that can be found on the Asus EeePC +# The four keys above the keyboard notify 0x1a through to 0x1d respectively +#notify 0 { +# match "system" "ACPI"; +# match "subsystem" "ASUS-Eee"; +# match "notify" "0x1a"; +# action ""; +#}; +#notify 0 { +# match "system" "ACPI"; +# match "subsystem" "ASUS-Eee"; +# match "notify" "0x1b"; +# action ""; +#}; +#notify 0 { +# match "system" "ACPI"; +# match "subsystem" "ASUS-Eee"; +# match "notify" "0x1c"; +# action ""; +#}; +#notify 0 { +# match "system" "ACPI"; +# match "subsystem" "ASUS-Eee"; +# match "notify" "0x1d"; +# action ""; +#}; diff --git a/etc/devd/uath.conf b/etc/devd/uath.conf new file mode 100644 index 0000000000..b2a9afaf96 --- /dev/null +++ b/etc/devd/uath.conf @@ -0,0 +1,146 @@ +# $FreeBSD: head/etc/devd/uath.conf 223566 2011-06-26 11:37:24Z gavin $ +# +# Atheros USB wireless network device specific devd events + +# Accton +# SMCWUSBT-G2 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x083a"; + match "product" "0x4507"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Atheros Communications +# AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x168c"; + match "product" "0x0002"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Atheros Communications +# AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0cf3"; + match "product" "(0x0002|0x0004|0x0006)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Conceptronic +# AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0d8e"; + match "product" "(0x7802|0x7812)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# D-Link +# DWL-AG132, DWL-G132 and DWL-AG122 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x2001"; + match "product" "(0x3a01|0x3a03|0x3a05)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# D-Link +# DWA-120 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x07d1"; + match "product" "0x3a0c"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Gigaset +# SMCWUSBT-G +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1690"; + match "product" "(0x0711|0x0713)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Global Sun Technology +# AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x16ab"; + match "product" "(0x7802|0x7812)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# BayNETGEAR +# WG111U +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0846"; + match "product" "0x4301"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Netgear +# WG111T and WPN111 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1385"; + match "product" "(0x4251|0x5f01)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# U-MEDIA Communications +# TEW-444UB and AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x157e"; + match "product" "(0x3007|0x3206)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Wistron NeWeb +# AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x1435"; + match "product" "(0x0827|0x0829)"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; + +# Z-Com +# AR5523 +notify 100 { + match "system" "USB"; + match "subsystem" "DEVICE"; + match "type" "ATTACH"; + match "vendor" "0x0cde"; + match "product" "0x0013"; + action "/usr/sbin/uathload -d /dev/$cdev"; +}; diff --git a/etc/devd/usb.conf b/etc/devd/usb.conf new file mode 100644 index 0000000000..f3c28f4aaa --- /dev/null +++ b/etc/devd/usb.conf @@ -0,0 +1,2791 @@ +# +# $FreeBSD$ +# +# This file was automatically generated by "tools/tools/bus_autoconf/bus_autoconf.sh". +# Please do not edit! +# + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0104"; + match "product" "0x00be"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0123"; + match "product" "0x0001"; + action "kldload -n uep"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03eb"; + match "product" "0x2109"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x0121"; + action "kldload -n ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x1016|0x1116|0x1216)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x1b1d|0x1e1d)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x3524"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x4016|0x4116|0x4216|0x5016|0x5116|0x5216)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0403"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "0x0304"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "(0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x003d|0x006e)"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00b3"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x00d8|0x00d9)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00e8"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x00f4|0x0116|0x0119)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x012e"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x0137"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2|0x01ee)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0413"; + match "product" "0x2101"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x043e"; + match "product" "0x9c01"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045b"; + match "product" "0x0053"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "0x0079"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "(0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x066a"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x200f"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0482"; + match "product" "0x0203"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0489"; + match "product" "(0xe000|0xe003)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x049f"; + match "product" "(0x0003|0x0032)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a4"; + match "product" "0x0014"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "0x4027"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "0x4068"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04ad"; + match "product" "(0x0301|0x0302|0x0303|0x0306)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b7"; + match "product" "0x0531"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b8"; + match "product" "(0x0521|0x0522)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "0x0930"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0944|0x0945|0x0947|0x0948)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0a03|0x0a0e)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bf"; + match "product" "(0x0115|0x0117)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04c5"; + match "product" "(0x1058|0x1079)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "0x2500"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "0x3900"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04dd"; + match "product" "(0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x2018"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x6601"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x8001"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "0x3008"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "(0x3011|0x3012)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f2"; + match "product" "(0xaff7|0xaff8|0xaff9|0xaffa|0xaffa)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0502"; + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0103"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0109"; + action "kldload -n umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0257"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0409"; + action "kldload -n umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x1102"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x1203"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x2102|0x2103)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x5055"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705a"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x8053|0x805c|0x815c|0x825a|0x825b)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x905b"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x935a"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0536"; + match "product" "0x01a0"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0543"; + match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0547"; + match "product" "0x2008"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169)"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "0x0437"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2008"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2009"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x055d"; + match "product" "0x2018"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0565"; + match "product" "0x0001"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056c"; + match "product" "0x8007"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x5003|0x5004)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "0xb000"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "0xb020"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x3416|0x341a)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "0x341f"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x058f"; + match "product" "0x9720"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05a6"; + match "product" "0x0101"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1402"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ad"; + match "product" "0x0fba"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05c6"; + match "product" "(0x1000|0x6000|0x6613)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05db"; + match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)"; + action "kldload -n uvscom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e0"; + match "product" "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x200a)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067b"; + match "product" "(0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x331a|0xaaa0|0xaaa2)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067e"; + match "product" "0x1001"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "(0xe010|0xe020)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "0xe030"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "0xe033"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0711"; + match "product" "(0x0200|0x0210|0x0230)"; + action "kldload -n umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0731"; + match "product" "(0x0528|0x2003)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0745"; + match "product" "0x0001"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0745"; + match "product" "0x1000"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0769"; + match "product" "0x31f3"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x077b"; + match "product" "0x2226"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0789"; + match "product" "0x0160"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0789"; + match "product" "(0x0162|0x0163|0x0164|0x0166|0x0168|0x0169)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x078b"; + match "product" "0x1234"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x079b"; + match "product" "0x0027"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x0017"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x002a"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x002d|0x002e)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x002f|0x003c|0x003f|0x0041|0x0042)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x0056"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x9601"; + action "kldload -n if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "0x420a"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0x8178|0x8188|0x8189)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07cf"; + match "product" "(0x2001|0x2002|0x2003)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x081e"; + match "product" "0xdf00"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x082d"; + match "product" "(0x0100|0x0200|0x0300)"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0830"; + match "product" "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0833"; + match "product" "(0x012e|0x039f)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "(0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x1040"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "(0x9021|0x9041)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0856"; + match "product" "0xac01"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x086e"; + match "product" "0x1920"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08dd"; + match "product" "0x90ff"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08e6"; + match "product" "0x5501"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08fd"; + match "product" "0x000a"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x091e"; + match "product" "0x0004"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0921"; + match "product" "(0x1001|0x1200)"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "0x0a07"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "(0x0d45|0x1302)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x093c"; + match "product" "(0x0601|0x0701)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x094b"; + match "product" "0x0001"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0960"; + match "product" "(0x0065|0x0066|0x0067)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0961"; + match "product" "0x0010"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x099e"; + match "product" "(0x0052|0x4000)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x09d7"; + match "product" "0x0100"; + action "kldload -n ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0a46"; + match "product" "(0x0268|0x8515|0x9601)"; + action "kldload -n if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901|0x6971|0x7001|0x7021|0x7041|0x7061|0x7100|0x7201|0x7211|0x7601|0xd033)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x1723|0x1724)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790|0x179d)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "0x17ab"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b39"; + match "product" "0x0421"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b41"; + match "product" "0x0011"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b63"; + match "product" "0x6530"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b8c"; + match "product" "0x2303"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b95"; + match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b|0x7e2b)"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bb4"; + match "product" "(0x00ce|0x00cf|0x00cf|0x0a01|0x0a02|0x0a03|0x0a04|0x0a05|0x0a06|0x0a07|0x0a08|0x0a09|0x0a0a|0x0a0b|0x0a0c|0x0a0d|0x0a0e|0x0a0f|0x0a10|0x0a11|0x0a12|0x0a13|0x0a14|0x0a15|0x0a16|0x0a17|0x0a18|0x0a19|0x0a1a|0x0a1b|0x0a1c|0x0a1d|0x0a1e|0x0a1f|0x0a20|0x0a21|0x0a22|0x0a23|0x0a24|0x0a25|0x0a26|0x0a27|0x0a28|0x0a29|0x0a2a|0x0a2b|0x0a2c|0x0a2d|0x0a2e|0x0a2f|0x0a30|0x0a31|0x0a32|0x0a33|0x0a34|0x0a35|0x0a36|0x0a37|0x0a38|0x0a39|0x0a3a|0x0a3b|0x0a3c|0x0a3d|0x0a3e|0x0a3f|0x0a40|0x0a41|0x0a42|0x0a43|0x0a44|0x0a45|0x0a46|0x0a47|0x0a48|0x0a49|0x0a4a|0x0a4b|0x0a4c|0x0a4d|0x0a4e|0x0a4f|0x0a50|0x0a51|0x0a52|0x0a53|0x0a54|0x0a55|0x0a56|0x0a57|0x0a58|0x0a59|0x0a5a|0x0a5b|0x0a5c|0x0a5d|0x0a5e|0x0a5f|0x0a60|0x0a61|0x0a62|0x0a63|0x0a64|0x0a65|0x0a66|0x0a67|0x0a68|0x0a69|0x0a6a|0x0a6b|0x0a6c|0x0a6d|0x0a6e|0x0a6f|0x0a70|0x0a71|0x0a72|0x0a73|0x0a74|0x0a75|0x0a76|0x0a77|0x0a78|0x0a79|0x0a7a|0x0a7b|0x0a7c|0x0a7d|0x0a7e|0x0a7f|0x0a80|0x0a81|0x0a82|0x0a83|0x0a84|0x0a85|0x0a86|0x0a87|0x0a88|0x0a89|0x0a8a|0x0a8b|0x0a8c|0x0a8d|0x0a8e|0x0a8f|0x0a90|0x0a91|0x0a92|0x0a93|0x0a94|0x0a95|0x0a96|0x0a97|0x0a98|0x0a99|0x0a9a|0x0a9b|0x0a9c|0x0a9d|0x0a9e|0x0a9f|0x0bce)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bda"; + match "product" "(0x018a|0x317f|0x8170|0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e|0x818a|0x8754)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bed"; + match "product" "(0x1100|0x1101)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bf8"; + match "product" "0x1001"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c44"; + match "product" "0x03a2"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c88"; + match "product" "0x17da"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c88"; + match "product" "0x17da"; + action "kldload -n ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c88"; + match "product" "0x180a"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c8e"; + match "product" "0x6000"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cad"; + match "product" "0x9001"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "(0x0022|0x0025)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x3820|0x3821|0x3822|0x3870|0x3871)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x6874|0x6877)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x6899|0x821a|0x822a|0x870a|0x871a|0x899a)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0xa861|0xa874)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x0017|0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042|0x0047|0x0048|0x004a|0x004d)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x0052|0x005c|0x0061)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x061c"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x90ac|0x9712)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df7"; + match "product" "0x0620"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e0b"; + match "product" "(0x9031|0x9041)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e55"; + match "product" "0x110b"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e66"; + match "product" "(0x0001|0x0003|0x0009|0x000b)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e66"; + match "product" "0x0019"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e67"; + match "product" "0x0002"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0ea0"; + match "product" "0x6858"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eab"; + match "product" "0xc893"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eb0"; + match "product" "0x9021"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eb0"; + match "product" "0x9071"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eba"; + match "product" "(0x1080|0x2080)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eef"; + match "product" "(0x0001|0x0002)"; + action "kldload -n uep"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f3d"; + match "product" "0x0112"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f3d"; + match "product" "0x0112"; + action "kldload -n ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f4e"; + match "product" "0x0200"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f94"; + match "product" "0x0001"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f98"; + match "product" "0x0201"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0fb8"; + match "product" "(0x3001|0x3002|0x3003|0x4001)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0fcf"; + match "product" "(0x1003|0x1004|0x1006)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0fe6"; + match "product" "(0x8101|0x9700)"; + action "kldload -n if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x100d"; + match "product" "(0x9031|0x9032)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1011"; + match "product" "0x3198"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x103c"; + match "product" "0x1629"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "(0x8008|0x800a)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "(0x800b|0x800c|0x800d)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1066"; + match "product" "(0x00ce|0x0300|0x0500|0x0600|0x0700)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x106c"; + match "product" "0x3701"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10a6"; + match "product" "0xaa26"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10ab"; + match "product" "0x10c5"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10b5"; + match "product" "0xac70"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10b5"; + match "product" "0xac70"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c4"; + match "product" "(0x0f91|0x1101|0x1601|0x800a|0x803b|0x8043|0x8044)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c4"; + match "product" "0x8053"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c4"; + match "product" "(0x8066|0x806f|0x807a|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x818b|0x819f|0x81a6|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x8411|0x846e|0x8477|0xea60|0xea61|0xea71|0xf001|0xf002|0xf003|0xf004)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c5"; + match "product" "0xea61"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10ce"; + match "product" "0xea61"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1114"; + match "product" "(0x0001|0x0004|0x0006)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1163"; + match "product" "0x0100"; + action "kldload -n ucycom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1182"; + match "product" "0x1388"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1186"; + match "product" "0x3e04"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1189"; + match "product" "0x0893"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1199"; + match "product" "(0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0112|0x0120|0x0218)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1199"; + match "product" "0x0218"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1199"; + match "product" "(0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3|0x68aa)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11ad"; + match "product" "0x0701"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11d9"; + match "product" "(0x1002|0x1003)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11f5"; + match "product" "(0x0001|0x0003|0x0004|0x0005)"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11f6"; + match "product" "0x2001"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11f7"; + match "product" "0x02df"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1231"; + match "product" "(0xce01|0xce02)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x129b"; + match "product" "0x1828"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520|0x1c05|0x1c0b)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12ef"; + match "product" "0x0100"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1371"; + match "product" "(0x9022|0x9032)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13ad"; + match "product" "0x9999"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "0x0018"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "(0x0020|0x0023)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "0x002f"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13d3"; + match "product" "(0x3247|0x3262|0x3273|0x3284|0x3305)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13d3"; + match "product" "(0x3357|0x3358|0x3359)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1410"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5100|0x6000|0x6002|0x7042)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1416"; + match "product" "0x1110"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1453"; + match "product" "0x4026"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1472"; + match "product" "0x0009"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1482"; + match "product" "0x3c09"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "0x2070"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "(0x2573|0x2671)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "0x9021"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "(0x3c06|0x3c07|0x3c08|0x3c09|0x3c11|0x3c12)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "0x3c22"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "(0x3c23|0x3c25|0x3c25|0x3c27|0x3c28)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14ea"; + match "product" "0xab11"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1555"; + match "product" "0x0004"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1557"; + match "product" "0x7720"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x157e"; + match "product" "0x300e"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15a9"; + match "product" "0x0004"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15a9"; + match "product" "(0x0006|0x0010)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15c5"; + match "product" "0x0008"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1614"; + match "product" "(0x0800|0x0802|0x7002)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1631"; + match "product" "0x6200"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1631"; + match "product" "0xc019"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x166a"; + match "product" "0x0303"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x167b"; + match "product" "0x4001"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "0x0601"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "0x0722"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "(0x0740|0x0744)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "(0x6202|0x6501)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "0x6501"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "0x6502"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "0x6502"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d6"; + match "product" "(0x0001|0x0001)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d8"; + match "product" "(0x6006|0x6280)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d8"; + match "product" "0x6280"; + action "kldload -n ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16dc"; + match "product" "(0x0010|0x0011|0x0012|0x0015)"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1726"; + match "product" "0x1000"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1726"; + match "product" "0x1000"; + action "kldload -n ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1737"; + match "product" "0x0039"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1737"; + match "product" "(0x0070|0x0071|0x0077|0x0078|0x0079)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1740"; + match "product" "(0x0605|0x0615|0x9701|0x9702|0x9703|0x9705|0x9706|0x9707|0x9708|0x9709|0x9801)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1761"; + match "product" "0x0b05"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x177f"; + match "product" "(0x0153|0x0302|0x0313)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x7203"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17f4"; + match "product" "0xaaaa"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1843"; + match "product" "0x0200"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18c5"; + match "product" "0x0002"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18c5"; + match "product" "(0x0008|0x0012)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18e8"; + match "product" "(0x6196|0x6229|0x6238)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18e8"; + match "product" "0x6259"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18ef"; + match "product" "0xe00f"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x19d2"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1a86"; + match "product" "0x7523"; + action "kldload -n uchcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1a8d"; + match "product" "(0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100b|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1b3d"; + match "product" "0x0153"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1b75"; + match "product" "0x3072"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1bbb"; + match "product" "(0x0000|0xf000)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1bc7"; + match "product" "(0x1003|0x1004)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1be3"; + match "product" "0x07a6"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1c9e"; + match "product" "(0x6061|0x9603|0x9605|0xf000)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1cf1"; + match "product" "(0x0001|0x0004)"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1d09"; + match "product" "0x4000"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1d4d"; + match "product" "(0x0002|0x000c|0x000e|0x0010)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1da5"; + match "product" "(0x4512|0x4515|0x4519|0x4523)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1e0e"; + match "product" "(0x9000|0x9200|0xce16)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1eda"; + match "product" "0x2310"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x1a00|0x1a02)"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x3307|0x3308|0x3309|0x330a|0x330d)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "0x3c05"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x3c09|0x3c0a)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0x1201|0x4902)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "0xab01"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xab24|0xab25)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xab2a|0xab2b|0xab2e)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xab50|0xed02)"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xed06|0xed14)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "0xed17"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x203d"; + match "product" "(0x1480|0x14a1|0x14a9)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20b8"; + match "product" "0x8888"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20b9"; + match "product" "0x1682"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20f4"; + match "product" "(0x624d|0x648b)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x22b8"; + match "product" "(0x4204|0x4214|0x4224|0x4234|0x4244)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2478"; + match "product" "0x2008"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x3340"; + match "product" "(0x011c|0x0326|0x0426|0x043a|0x051c|0x053a|0x071c|0x0b1c|0x0e3a|0x0f1c|0x0f3a|0x1326|0x191c|0x2326|0x3326)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x3708"; + match "product" "(0x20ce|0x21ce)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4113"; + match "product" "(0x0210|0x0211|0x0400|0x0410)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "(0x4001|0x4002|0x4003|0x4004|0x4005|0x4006|0x4007|0x4008|0x4009)"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "(0x8114|0x8115|0x8116|0x8117|0x8118|0x8128|0x8129|0x8133|0x8134|0x8135|0x8136|0x8137|0x8138|0x8180|0x8181|0x8182)"; + action "kldload -n u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "0x9500"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4348"; + match "product" "0x5523"; + action "kldload -n uchcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4505"; + match "product" "0x0010"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4766"; + match "product" "0x0001"; + action "kldload -n uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4855"; + match "product" "(0x0090|0x0091)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5372"; + match "product" "0x2303"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5a57"; + match "product" "(0x0280|0x0282|0x0283|0x0284|0x5257)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5e04"; + match "product" "0xce00"; + action "kldload -n uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6189"; + match "product" "0x182d"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6189"; + match "product" "0x2068"; + action "kldload -n uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6547"; + match "product" "0x0232"; + action "kldload -n uark"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x7392"; + match "product" "0x7318"; + action "kldload -n if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x7392"; + match "product" "(0x7711|0x7717|0x7718)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x7392"; + match "product" "(0x7811|0x7822)"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x8516"; + match "product" "(0x2070|0x2770|0x2870|0x3070|0x3071|0x3072|0x3572)"; + action "kldload -n if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "0x7703"; + action "kldload -n umoscom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "(0x7820|0x7840)"; + action "kldload -n umcs"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9846"; + match "product" "0x9041"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9e88"; + match "product" "0x9e8f"; + action "kldload -n uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0xdaae"; + match "product" "0xead6"; + action "kldload -n uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0x01"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload -n umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n ukbd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + match "intsubclass" "0x01"; + match "intprotocol" "0x02"; + action "kldload -n ums"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x07"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload -n ulpt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x07"; + match "intsubclass" "0x01"; + match "intprotocol" "0x02"; + action "kldload -n ulpt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x07"; + match "intsubclass" "0x01"; + match "intprotocol" "0x03"; + action "kldload -n ulpt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0xff"; + match "intsubclass" "0x5d"; + match "intprotocol" "0x01"; + action "kldload -n uhid"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x88"; + action "kldload -n ufoma"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + action "kldload -n uhid"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x08"; + action "kldload -n umass"; +}; + +# 1400 USB entries processed + diff --git a/etc/mtree/BSD.root.dist b/etc/mtree/BSD.root.dist index b43e334925..c918a5c625 100644 --- a/etc/mtree/BSD.root.dist +++ b/etc/mtree/BSD.root.dist @@ -24,6 +24,8 @@ .. defaults .. + devd + .. dma .. mail diff --git a/etc/rc.d/devd b/etc/rc.d/devd index abecadd829..7e76c0bece 100644 --- a/etc/rc.d/devd +++ b/etc/rc.d/devd @@ -1,7 +1,7 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/devd,v 1.11 2008/07/16 19:50:29 dougb Exp $ -# $DragonFly: src/etc/rc.d/devd,v 1.1 2008/10/03 00:26:21 hasso Exp $ +# $FreeBSD: head/etc/rc.d/devd 238416 2012-07-13 06:46:09Z kevlo $ +# # PROVIDE: devd # REQUIRE: netif network_ipv6 @@ -11,13 +11,30 @@ . /etc/rc.subr name="devd" -rcvar=`set_rcvar` +rcvar="devd_enable" command="/sbin/${name}" +start_precmd=${name}_prestart +stop_precmd=find_pidfile + +find_pidfile() +{ + if get_pidfile_from_conf pid-file /etc/devd.conf; then + pidfile="$_pidfile_from_conf" + else + pidfile="/var/run/${name}.pid" + fi +} + +devd_prestart() +{ + find_pidfile + + # If devd is disabled, turn it off in the kernel to avoid memory leaks. + if ! checkyesno ${rcvar}; then + $SYSCTL hw.bus.devctl_disable=1 + fi +} + load_rc_config $name run_rc_command "$1" - -# If devd is disabled, turn it off in the kernel to avoid memory leaks. -if ! checkyesno ${rcvar}; then - sysctl hw.bus.devctl_disable=1 -fi diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile index 4fcb9a0e56..9f5348dc43 100644 --- a/sbin/devd/Makefile +++ b/sbin/devd/Makefile @@ -1,5 +1,4 @@ -# $FreeBSD: src/sbin/devd/Makefile,v 1.9 2007/11/19 00:19:01 jb Exp $ -# $DragonFly: src/sbin/devd/Makefile,v 1.2 2008/10/28 16:56:56 swildner Exp $ +# $FreeBSD: head/sbin/devd/Makefile 203916 2010-02-15 14:07:40Z uqs $ PROG_CXX=devd SRCS= devd.cc token.l parse.y y.tab.h diff --git a/sbin/devd/devd.8 b/sbin/devd/devd.8 index e54d05c0ef..08a5d04d78 100644 --- a/sbin/devd/devd.8 +++ b/sbin/devd/devd.8 @@ -23,10 +23,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sbin/devd/devd.8,v 1.17 2006/09/17 22:49:26 ru Exp $ -.\" $DragonFly: src/sbin/devd/devd.8,v 1.2 2008/10/03 10:30:43 swildner Exp $ +.\" $FreeBSD: head/sbin/devd/devd.8 262914 2014-03-07 23:30:48Z asomers $ .\" -.Dd October 2, 2008 +.Dd January 30, 2013 .Dt DEVD 8 .Os .Sh NAME @@ -34,8 +33,9 @@ .Nd "device state change daemon" .Sh SYNOPSIS .Nm -.Op Fl Ddn +.Op Fl dnq .Op Fl f Ar file +.Op Fl l Ar num .Sh DESCRIPTION The .Nm @@ -44,10 +44,8 @@ kernel events happen. .Pp The following options are accepted. .Bl -tag -width ".Fl f Ar file" -.It Fl D -Enable debugging messages. .It Fl d -Run in the foreground instead of becoming a daemon. +Run in the foreground instead of becoming a daemon and log additional information for debugging. .It Fl f Ar file Use configuration file .Ar file @@ -56,9 +54,17 @@ instead of the default If option .Fl f is specified more than once, the last file specified is used. +.It Fl l Ar num +Limit concurrent +.Pa /var/run/devd.pipe +connections to +.Ar num . +The default connection limit is 10. .It Fl n Do not process all pending events before becoming a daemon. Instead, call daemon right away. +.It Fl q +Quiet mode. Only log messages at priority LOG_WARNING or above. .El .Sh IMPLEMENTATION NOTES The diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index d61dd2f604..908803cd74 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -23,8 +23,36 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/devd/devd.cc,v 1.33 2006/09/17 22:49:26 ru Exp $ - + * my_system is a variation on lib/libc/stdlib/system.c: + * + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: head/sbin/devd/devd.cc 262914 2014-03-07 23:30:48Z asomers $ */ /* @@ -41,20 +69,25 @@ #include #include #include +#include #include #include #include -#include #include #include +#include #include +#include #include #include #include #include +#include +#include #include +#include #include #include @@ -70,6 +103,19 @@ #define CF "/etc/devd.conf" #define SYSCTL "hw.bus.devctl_disable" +/* + * Since the client socket is nonblocking, we must increase its send buffer to + * handle brief event storms. On FreeBSD, AF_UNIX sockets don't have a receive + * buffer, so the client can't increate the buffersize by itself. + * + * For example, when creating a ZFS pool, devd emits one 165 character + * resource.fs.zfs.statechange message for each vdev in the pool. A 64k + * buffer has enough space for almost 400 drives, which would be very large but + * not impossibly large pool. A 128k buffer has enough space for 794 drives, + * which is more than can fit in a rack with modern technology. + */ +#define CLIENT_BUFSIZE 131072 + using namespace std; extern FILE *yyin; @@ -81,13 +127,18 @@ static const char attach = '+'; static const char detach = '-'; static struct pidfh *pfh; -int Dflag; -int dflag; -int nflag; + +static int no_daemon = 0; +static int daemonize_quick = 0; +static int quiet_mode = 0; +static unsigned total_events = 0; +static volatile sig_atomic_t got_siginfo = 0; static volatile sig_atomic_t romeo_must_die = 0; static const char *configfile = CF; +static void devdlog(int priority, const char* message, ...) + __printflike(2, 3); static void event_loop(void); static void usage(void); @@ -105,7 +156,7 @@ config cfg; event_proc::event_proc() : _prio(-1) { - // nothing + _epsvec.reserve(4); } event_proc::~event_proc() @@ -134,7 +185,7 @@ bool event_proc::run(config &c) const { vector::const_iterator i; - + for (i = _epsvec.begin(); i != _epsvec.end(); ++i) if (!(*i)->do_action(c)) return (false); @@ -142,7 +193,7 @@ event_proc::run(config &c) const } action::action(const char *cmd) - : _cmd(cmd) + : _cmd(cmd) { // nothing } @@ -152,13 +203,66 @@ action::~action() // nothing } +static int +my_system(const char *command) +{ + pid_t pid, savedpid; + int pstat; + struct sigaction ign, intact, quitact; + sigset_t newsigblock, oldsigblock; + + if (!command) /* just checking... */ + return (1); + + /* + * Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save + * existing signal dispositions. + */ + ign.sa_handler = SIG_IGN; + ::sigemptyset(&ign.sa_mask); + ign.sa_flags = 0; + ::sigaction(SIGINT, &ign, &intact); + ::sigaction(SIGQUIT, &ign, &quitact); + ::sigemptyset(&newsigblock); + ::sigaddset(&newsigblock, SIGCHLD); + ::sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); + switch (pid = ::fork()) { + case -1: /* error */ + break; + case 0: /* child */ + /* + * Restore original signal dispositions and exec the command. + */ + ::sigaction(SIGINT, &intact, NULL); + ::sigaction(SIGQUIT, &quitact, NULL); + ::sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + /* + * Close the PID file, and all other open descriptors. + * Inherit std{in,out,err} only. + */ + cfg.close_pidfile(); + ::closefrom(3); + ::execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL); + ::_exit(127); + default: /* parent */ + savedpid = pid; + do { + pid = ::wait4(savedpid, &pstat, 0, (struct rusage *)0); + } while (pid == -1 && errno == EINTR); + break; + } + ::sigaction(SIGINT, &intact, NULL); + ::sigaction(SIGQUIT, &quitact, NULL); + ::sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + return (pid == -1 ? -1 : pstat); +} + bool action::do_action(config &c) { string s = c.expand_string(_cmd.c_str()); - if (Dflag) - fprintf(stderr, "Executing '%s'\n", s.c_str()); - ::system(s.c_str()); + devdlog(LOG_INFO, "Executing '%s'\n", s.c_str()); + my_system(s.c_str()); return (true); } @@ -187,9 +291,10 @@ match::do_match(config &c) * can consume excessive amounts of systime inside of connect(). Only * log when we're in -d mode. */ - if (Dflag) - fprintf(stderr, "Testing %s=%s against %s\n", _var.c_str(), - value.c_str(), _re.c_str()); + if (no_daemon) { + devdlog(LOG_DEBUG, "Testing %s=%s against %s, invert=%d\n", + _var.c_str(), value.c_str(), _re.c_str(), _inv); + } retval = (regexec(&_regex, value.c_str(), 0, NULL, 0) == 0); if (_inv == 1) @@ -240,8 +345,7 @@ media::do_match(config &c) value = c.get_variable("device-name"); if (value.empty()) value = c.get_variable("subsystem"); - if (Dflag) - fprintf(stderr, "Testing media type of %s against 0x%x\n", + devdlog(LOG_DEBUG, "Testing media type of %s against 0x%x\n", value.c_str(), _type); retval = false; @@ -253,13 +357,11 @@ media::do_match(config &c) if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0 && ifmr.ifm_status & IFM_AVALID) { - if (Dflag) - fprintf(stderr, "%s has media type 0x%x\n", + devdlog(LOG_DEBUG, "%s has media type 0x%x\n", value.c_str(), IFM_TYPE(ifmr.ifm_active)); retval = (IFM_TYPE(ifmr.ifm_active) == _type); } else if (_type == -1) { - if (Dflag) - fprintf(stderr, "%s has unknown media type\n", + devdlog(LOG_DEBUG, "%s has unknown media type\n", value.c_str()); retval = true; } @@ -298,8 +400,8 @@ var_list::set_variable(const string &var, const string &val) * can consume excessive amounts of systime inside of connect(). Only * log when we're in -d mode. */ - if (Dflag) - fprintf(stderr, "setting %s=%s\n", var.c_str(), val.c_str()); + if (no_daemon) + devdlog(LOG_DEBUG, "setting %s=%s\n", var.c_str(), val.c_str()); _vars[var] = val; } @@ -317,8 +419,7 @@ config::reset(void) void config::parse_one_file(const char *fn) { - if (Dflag) - fprintf(stderr, "Parsing %s\n", fn); + devdlog(LOG_DEBUG, "Parsing %s\n", fn); yyin = fopen(fn, "r"); if (yyin == NULL) err(1, "Cannot open config file %s", fn); @@ -335,8 +436,7 @@ config::parse_files_in_dir(const char *dirname) struct dirent *dp; char path[PATH_MAX]; - if (Dflag) - fprintf(stderr, "Parsing files in %s\n", dirname); + devdlog(LOG_DEBUG, "Parsing files in %s\n", dirname); dirp = opendir(dirname); if (dirp == NULL) return; @@ -363,7 +463,7 @@ public: void config::sort_vector(vector &v) { - sort(v.begin(), v.end(), epv_greater()); + stable_sort(v.begin(), v.end(), epv_greater()); } void @@ -460,11 +560,10 @@ void config::push_var_table() { var_list *vl; - + vl = new var_list(); _var_list_table.push_back(vl); - if (Dflag) - fprintf(stderr, "Pushing table\n"); + devdlog(LOG_DEBUG, "Pushing table\n"); } void @@ -472,8 +571,7 @@ config::pop_var_table() { delete _var_list_table.back(); _var_list_table.pop_back(); - if (Dflag) - fprintf(stderr, "Popping table\n"); + devdlog(LOG_DEBUG, "Popping table\n"); } void @@ -497,7 +595,7 @@ config::get_variable(const string &var) bool config::is_id_char(char ch) const { - return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || + return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); } @@ -513,7 +611,7 @@ config::expand_one(const char *&src, string &dst) dst += *src++; return; } - + // $(foo) -> $(foo) // Not sure if I want to support this or not, so for now we just pass // it through. @@ -530,7 +628,7 @@ config::expand_one(const char *&src, string &dst) } return; } - + // $[^A-Za-z] -> $\1 if (!isalpha(*src)) { dst += '$'; @@ -568,7 +666,7 @@ config::expand_string(const char *src, const char *prepend, const char *append) } dst.append(src, var_at - src); src = var_at; - expand_one(src, dst); + expand_one(src, dst); } if (append != NULL) @@ -581,7 +679,7 @@ bool config::chop_var(char *&buffer, char *&lhs, char *&rhs) const { char *walker; - + if (*buffer == '\0') return (false); walker = lhs = buffer; @@ -655,8 +753,7 @@ config::find_and_execute(char type) s = "detach"; break; } - if (Dflag) - fprintf(stderr, "Processing %s event\n", s); + devdlog(LOG_DEBUG, "Processing %s event\n", s); for (i = l->begin(); i != l->end(); ++i) { if ((*i)->matches(*this)) { (*i)->run(*this); @@ -674,8 +771,7 @@ process_event(char *buffer) char *sp; sp = buffer + 1; - if (Dflag) - fprintf(stderr, "Processing event '%s'\n", buffer); + devdlog(LOG_INFO, "Processing event '%s'\n", buffer); type = *buffer++; cfg.push_var_table(); // No match doesn't have a device, and the format is a little @@ -718,7 +814,7 @@ process_event(char *buffer) cfg.set_variable("bus", sp + 3); break; } - + cfg.find_and_execute(type); cfg.pop_var_table(); } @@ -746,33 +842,87 @@ create_socket(const char *name) return (fd); } +unsigned int max_clients = 10; /* Default, can be overriden on cmdline. */ +unsigned int num_clients; list clients; void notify_clients(const char *data, int len) { - list bad; - list::const_iterator i; + list::iterator i; - for (i = clients.begin(); i != clients.end(); ++i) { - if (write(*i, data, len) <= 0) { - bad.push_back(*i); + /* + * Deliver the data to all clients. Throw clients overboard at the + * first sign of trouble. This reaps clients who've died or closed + * their sockets, and also clients who are alive but failing to keep up + * (or who are maliciously not reading, to consume buffer space in + * kernel memory or tie up the limited number of available connections). + */ + for (i = clients.begin(); i != clients.end(); ) { + if (write(*i, data, len) != len) { + --num_clients; close(*i); - } + i = clients.erase(i); + devdlog(LOG_WARNING, "notify_clients: write() failed; " + "dropping unresponsive client\n"); + } else + ++i; } +} - for (i = bad.begin(); i != bad.end(); ++i) - clients.erase(find(clients.begin(), clients.end(), *i)); +void +check_clients(void) +{ + int s; + struct pollfd pfd; + list::iterator i; + + /* + * Check all existing clients to see if any of them have disappeared. + * Normally we reap clients when we get an error trying to send them an + * event. This check eliminates the problem of an ever-growing list of + * zombie clients because we're never writing to them on a system + * without frequent device-change activity. + */ + pfd.events = 0; + for (i = clients.begin(); i != clients.end(); ) { + pfd.fd = *i; + s = poll(&pfd, 1, 0); + if ((s < 0 && s != EINTR ) || + (s > 0 && (pfd.revents & POLLHUP))) { + --num_clients; + close(*i); + i = clients.erase(i); + devdlog(LOG_NOTICE, "check_clients: " + "dropping disconnected client\n"); + } else + ++i; + } } void new_client(int fd) { int s; + int sndbuf_size; + /* + * First go reap any zombie clients, then accept the connection, and + * shut down the read side to stop clients from consuming kernel memory + * by sending large buffers full of data we'll never read. + */ + check_clients(); s = accept(fd, NULL, NULL); - if (s != -1) + if (s != -1) { + sndbuf_size = CLIENT_BUFSIZE; + if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, + sizeof(sndbuf_size))) + err(1, "setsockopt"); + shutdown(s, SHUT_RD); clients.push_back(s); + ++num_clients; + } else + err(1, "accept"); } static void @@ -783,28 +933,27 @@ event_loop(void) char buffer[DEVCTL_MAXBUF]; int once = 0; int server_fd, max_fd; + int accepting; timeval tv; fd_set fds; - fd = open(PATH_DEVCTL, O_RDONLY); + fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC); if (fd == -1) err(1, "Can't open devctl device %s", PATH_DEVCTL); - if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) - err(1, "Can't set close-on-exec flag on devctl"); server_fd = create_socket(PIPE); + accepting = 1; max_fd = max(fd, server_fd) + 1; while (!romeo_must_die) { - if (!once && !dflag && !nflag) { + if (!once && !no_daemon && !daemonize_quick) { // Check to see if we have any events pending. tv.tv_sec = 0; tv.tv_usec = 0; FD_ZERO(&fds); FD_SET(fd, &fds); - rv = select(fd + 1, &fds, NULL, NULL, &tv); + rv = select(fd + 1, &fds, &fds, &fds, &tv); // No events -> we've processed all pending events if (rv == 0) { - if (Dflag) - fprintf(stderr, "Calling daemon\n"); + devdlog(LOG_DEBUG, "Calling daemon\n"); cfg.remove_pidfile(); cfg.open_pidfile(); daemon(0, 0); @@ -812,18 +961,52 @@ event_loop(void) once++; } } + /* + * When we've already got the max number of clients, stop + * accepting new connections (don't put server_fd in the set), + * shrink the accept() queue to reject connections quickly, and + * poll the existing clients more often, so that we notice more + * quickly when any of them disappear to free up client slots. + */ FD_ZERO(&fds); FD_SET(fd, &fds); - FD_SET(server_fd, &fds); - rv = select(max_fd, &fds, NULL, NULL, NULL); + if (num_clients < max_clients) { + if (!accepting) { + listen(server_fd, max_clients); + accepting = 1; + } + FD_SET(server_fd, &fds); + tv.tv_sec = 60; + tv.tv_usec = 0; + } else { + if (accepting) { + listen(server_fd, 0); + accepting = 0; + } + tv.tv_sec = 2; + tv.tv_usec = 0; + } + rv = select(max_fd, &fds, NULL, NULL, &tv); + if (got_siginfo) { + devdlog(LOG_NOTICE, "Events received so far=%u\n", + total_events); + got_siginfo = 0; + } if (rv == -1) { if (errno == EINTR) continue; err(1, "select"); - } + } else if (rv == 0) + check_clients(); if (FD_ISSET(fd, &fds)) { rv = read(fd, buffer, sizeof(buffer) - 1); if (rv > 0) { + total_events++; + if (rv == sizeof(buffer) - 1) { + devdlog(LOG_WARNING, "Warning: " + "available event data exceeded " + "buffer space\n"); + } notify_clients(buffer, rv); buffer[rv] = '\0'; while (buffer[--rv] == '\n') @@ -933,13 +1116,40 @@ static void gensighand(int) { romeo_must_die = 1; - unlink("/var/run/devd.pid"); /* XXX */ +} + +/* + * SIGINFO handler. Will print useful statistics to the syslog or stderr + * as appropriate + */ +static void +siginfohand(int) +{ + got_siginfo = 1; +} + +/* + * Local logging function. Prints to syslog if we're daemonized; stderr + * otherwise. + */ +static void +devdlog(int priority, const char* fmt, ...) +{ + va_list argp; + + va_start(argp, fmt); + if (no_daemon) + vfprintf(stderr, fmt, argp); + else if ((! quiet_mode) || (priority <= LOG_WARNING)) + vsyslog(priority, fmt, argp); + va_end(argp); } static void usage() { - fprintf(stderr, "usage: %s [-Ddn] [-f file]\n", getprogname()); + fprintf(stderr, "usage: %s [-dnq] [-l connlimit] [-f file]\n", + getprogname()); exit(1); } @@ -968,19 +1178,22 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "Ddf:n")) != -1) { + while ((ch = getopt(argc, argv, "df:l:nq")) != -1) { switch (ch) { - case 'D': - Dflag++; - break; case 'd': - dflag++; + no_daemon = 1; break; case 'f': configfile = optarg; break; + case 'l': + max_clients = MAX(1, strtoul(optarg, NULL, 0)); + break; case 'n': - nflag++; + daemonize_quick = 1; + break; + case 'q': + quiet_mode = 1; break; default: usage(); @@ -988,7 +1201,7 @@ main(int argc, char **argv) } cfg.parse(); - if (!dflag && nflag) { + if (!no_daemon && daemonize_quick) { cfg.open_pidfile(); daemon(0, 0); cfg.write_pidfile(); @@ -997,6 +1210,7 @@ main(int argc, char **argv) signal(SIGHUP, gensighand); signal(SIGINT, gensighand); signal(SIGTERM, gensighand); + signal(SIGINFO, siginfohand); event_loop(); return (0); } diff --git a/sbin/devd/devd.conf.5 b/sbin/devd/devd.conf.5 index 76144bda91..5baa1cf9de 100644 --- a/sbin/devd/devd.conf.5 +++ b/sbin/devd/devd.conf.5 @@ -22,8 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sbin/devd/devd.conf.5,v 1.11 2006/10/24 20:20:41 ru Exp $ -.\" $DragonFly: src/sbin/devd/devd.conf.5,v 1.3 2008/10/04 22:36:25 swildner Exp $ +.\" $FreeBSD: head/sbin/devd/devd.conf.5 247134 2013-02-21 21:35:09Z pluknet $ .\" .\" The section on comments was taken from named.conf.5, which has the .\" following copyright: @@ -42,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd October 2, 2008 +.Dd February 22, 2013 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -110,18 +109,22 @@ statement. .It Ic directory Qq Ar /some/path ; Adds the given directory to the list of directories from which .Xr devd 8 -will read +will read all files named "*.conf" as further configuration files. Any number of .Ic directory statements can be used. -.\" .It Ic pid-file Qq Pa /var/run/devd.pid ; -.\" Specifies PID file. +.It Ic pid-file Qq Pa /var/run/devd.pid ; +Specifies PID file. .It Ic set Ar regexp-name Qq Ar (some|regexp) ; Creates a regular expression and assigns it to the variable .Ar regexp-name . -The variable is avaiable throughout the rest of +The variable is available throughout the rest of the configuration file. +If the string begins with +.Ql \&! , +it matches if the regular expression formed by the rest of the string +does not match. All regular expressions have an implicit .Ql ^$ around them. @@ -175,10 +178,11 @@ For network devices, will match devices that have the given media type. Valid media types are: .Dq Li Ethernet , +.Dq Li Tokenring , +.Dq Li FDDI , .Dq Li 802.11 , -.Dq Li ATM , and -.Dq Li CARP . +.Dq Li ATM . .It Ic subdevice Qq Ar string ; This is shorthand for .Dq Ic match Qo Li subdevice Qc Qq Ar string . @@ -206,7 +210,7 @@ The following sub-statements are supported within the statement. The .Dq Li notify -variable is avaiable inside this statement and contains, a value, depending +variable is available inside this statement and contains, a value, depending on which system and subsystem that delivered the event. .Bl -tag -width ".Ic directory" .It Ic action Qq Ar command ; @@ -221,7 +225,7 @@ statements can exist within a statement; .Ar value can be either a fixed string or a regular expression. -Below is a list of avaiable systems, subsystems, and types. +Below is a list of available systems, subsystems, and types. .It Ic media-type Qq Ar string ; See above. .El @@ -236,6 +240,10 @@ statement. .Ic Description .It Li bus Device name of parent bus. +.It Li cdev +Device node path if one is created by the +.Xr devfs 5 +filesystem. .It Li cisproduct CIS-product. .It Li cisvendor @@ -244,19 +252,41 @@ CIS-vendor. Device class. .It Li device Device ID. +.It Li devclass +Device Class (USB) +.It Li devsubclass +Device Sub-class (USB) .It Li device-name Name of attached/detached device. +.It Li endpoints +Endpoint count (USB) .It Li function Card functions. +.It Li interface +Interface ID (USB) +.It Li intclass +Interface Class (USB) +.It Li intprotocol +Interface Protocol (USB) +.It Li intsubclass +Interface Sub-class (USB) .It Li manufacturer Manufacturer ID (pccard). +.It Li mode +Peripheral mode (USB) .It Li notify Match the value of the .Dq Li notify variable. +.It Li parent +Parent device +.It Li port +Hub port number (USB) .It Li product -Product ID (pccard). -.It Li serial +Product ID (pccard/USB). +.It Li release +Hardware revision (USB) +.It Li sernum Serial Number (USB). .It Li slot Card slot. @@ -278,7 +308,7 @@ A partial list of systems, subsystems, and types used within the .Ic notify mechanism. .Pp -.Bl -tag -width ".Li IFNET" -compact +.Bl -tag -width ".Li coretemp" -compact .It Sy System .It Li ACPI Events related to the ACPI subsystem. @@ -292,6 +322,8 @@ Button state ($notify=0x00 is power, 0x01 is sleep). Battery events. .It Li Lid Lid state ($notify=0x00 is closed, 0x01 is open). +.It Li PROCESSOR +Processor state/configuration ($notify=0x81 is a change in available Cx states). .It Li Thermal Thermal zone events. .El @@ -311,6 +343,80 @@ took place. Carrier status changed to UP. .It Li LINK_DOWN Carrier status changed to DOWN. +.It Li ATTACH +The network interface is attached to the system. +.It Li DETACH +The network interface is detached from the system. +.El +.El +.Pp +.It Li DEVFS +Events related to the +.Xr devfs 5 +filesystem. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li CDEV +.Bl -tag -width ".Li DESTROY" -compact +.It Sy Type +.It Li CREATE +The +.Xr devfs 5 +node is created. +.It Li DESTROY +The +.Xr devfs 5 +node is destroyed. +.El +.El +.Pp +.It Li USB +Events related to the USB subsystem. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li DEVICE +.Bl -tag -width ".Li DETACH" -compact +.It Sy Type +.It Li ATTACH +USB device is attached to the system. +.It Li DETACH +USB device is detached from the system. +.El +.It Li INTERFACE +.Bl -tag -width ".Li DETACH" -compact +.It Sy Type +.It Li ATTACH +USB interface is attached to a device. +.It Li DETACH +USB interface is detached from a device. +.El +.El +.Pp +.It Li coretemp +Events related to the +.Xr coretemp 4 +device. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li Thermal +Notification that the CPU core has reached critical temperature. +.Bl -tag -width ".Ar temperature" -compact +.It Sy Type +.It Ar temperature +String containing the temperature of the core that has become too hot. +.El +.El +.Pp +.It Li kern +Events related to the kernel. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li power +Information about the state of the system. +.Bl -tag -width ".li resume" -compact +.It Sy Type +.It Li resume +Notification that the system has woken from the suspended state. .El .El .El @@ -405,6 +511,17 @@ notify 0 { action "logger Lid opened, the sleeper must awaken!"; }; +# +# Match a USB device type +# +notify 0 { + match "system" "USB"; + match "subsystem" "INTERFACE"; + match "type" "ATTACH"; + match "intclass" "0x0e"; + action "logger USB video device attached"; +}; + # # Try to configure ath and wi devices with pccard_ether # as they are attached. @@ -428,4 +545,7 @@ The installed .Pa /etc/devd.conf has many additional examples. .Sh SEE ALSO +.Xr coretemp 4 , +.Xr devfs 5 , +.Xr re_format 7 , .Xr devd 8 diff --git a/sbin/devd/devd.h b/sbin/devd/devd.h index 82395eb405..14cd3a9c85 100644 --- a/sbin/devd/devd.h +++ b/sbin/devd/devd.h @@ -25,8 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/devd/devd.h,v 1.5 2005/07/10 03:37:15 imp Exp $ - * $DragonFly: src/sbin/devd/devd.h,v 1.1 2008/10/03 00:26:21 hasso Exp $ + * $FreeBSD: head/sbin/devd/devd.h 249951 2013-04-26 19:49:37Z asomers $ */ #ifndef DEVD_H @@ -54,6 +53,6 @@ int yyparse(void); __END_DECLS #define PATH_DEVCTL "/dev/devctl" -#define DEVCTL_MAXBUF 1025 +#define DEVCTL_MAXBUF 8192 #endif /* DEVD_H */ diff --git a/sbin/devd/devd.hh b/sbin/devd/devd.hh index f32e7b380c..9cb1b778f5 100644 --- a/sbin/devd/devd.hh +++ b/sbin/devd/devd.hh @@ -41,8 +41,6 @@ class config; class var_list { public: - var_list() {} - virtual ~var_list() {} /** Set a variable in this var list. */ void set_variable(const std::string &var, const std::string &val); @@ -65,10 +63,9 @@ private: * eps is short for event_proc_single. It is a single entry in an * event_proc. Each keyword needs its own subclass from eps. */ -class eps +struct eps { public: - eps() {} virtual ~eps() {} /** Does this eps match the current config? */ @@ -126,7 +123,7 @@ private: std::string _cmd; }; -class event_proc +struct event_proc { public: event_proc(); diff --git a/sbin/devd/parse.y b/sbin/devd/parse.y index 68bf221ffb..87a9497e35 100644 --- a/sbin/devd/parse.y +++ b/sbin/devd/parse.y @@ -26,13 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/devd/parse.y,v 1.5 2005/07/10 03:37:15 imp Exp $ - * $DragonFly: src/sbin/devd/parse.y,v 1.1 2008/10/03 00:26:21 hasso Exp $ + * $FreeBSD: head/sbin/devd/parse.y 235789 2012-05-22 16:33:10Z bapt $ */ +#include +#include "devd.h" #include #include -#include "devd.h" %} diff --git a/sbin/devd/token.l b/sbin/devd/token.l index 6cf72e555e..be2dff5f28 100644 --- a/sbin/devd/token.l +++ b/sbin/devd/token.l @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sbin/devd/token.l,v 1.7 2008/03/21 20:38:28 imp Exp $ + * $FreeBSD: head/sbin/devd/token.l 250227 2013-05-03 23:51:32Z jkim $ */ #include