summaryrefslogtreecommitdiffstats
path: root/usr.sbin/usbd
diff options
context:
space:
mode:
authorjmb <jmb@FreeBSD.org>2000-04-02 06:28:40 +0000
committerjmb <jmb@FreeBSD.org>2000-04-02 06:28:40 +0000
commite9c1e57b929f3fdc5cfe5c2abf488d93b155d7d7 (patch)
tree47c811219f2fa64b7498d528e5ba061c1be10625 /usr.sbin/usbd
parentd63032307ca41e8bccddbaa5c33bc316d4fae7e6 (diff)
downloadFreeBSD-src-e9c1e57b929f3fdc5cfe5c2abf488d93b155d7d7.zip
FreeBSD-src-e9c1e57b929f3fdc5cfe5c2abf488d93b155d7d7.tar.gz
if USB support is not compiled into the kernel,
and has not been loaded via a kldload, running usbd(8) will autoload the "usb.ko" kld. thanks to Peter Wemm for enlightening me on the differences between kldfind(2) and modfind(2).
Diffstat (limited to 'usr.sbin/usbd')
-rw-r--r--usr.sbin/usbd/usbd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/usbd/usbd.c b/usr.sbin/usbd/usbd.c
index 09190c9..b866eca 100644
--- a/usr.sbin/usbd/usbd.c
+++ b/usr.sbin/usbd/usbd.c
@@ -896,6 +896,14 @@ main(int argc, char **argv)
int itimeout = TIMEOUT; /* timeout for select */
struct timeval tv;
+ if (modfind(USB_OHCI) < 0 && modfind(USB_UHCI) < 0) {
+ if (kldload(USB_KLD) < 0 ||
+ (modfind(USB_OHCI) < 0 && modfind(USB_UHCI) < 0)) {
+ perror(USB_KLD ": Kernel module not available");
+ return 1;
+ }
+ }
+
while ((ch = getopt(argc, argv, "c:def:nt:v")) != -1) {
switch(ch) {
case 'c':
OpenPOWER on IntegriCloud