diff options
author | jmb <jmb@FreeBSD.org> | 2000-04-02 06:28:40 +0000 |
---|---|---|
committer | jmb <jmb@FreeBSD.org> | 2000-04-02 06:28:40 +0000 |
commit | e9c1e57b929f3fdc5cfe5c2abf488d93b155d7d7 (patch) | |
tree | 47c811219f2fa64b7498d528e5ba061c1be10625 /usr.sbin/usbd | |
parent | d63032307ca41e8bccddbaa5c33bc316d4fae7e6 (diff) | |
download | FreeBSD-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.c | 8 |
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': |