usb.c revision 1.25 1 1.25 augustss /* $NetBSD: usb.c,v 1.25 1999/09/18 11:25:51 augustss Exp $ */
2 1.1 augustss
3 1.1 augustss /*
4 1.1 augustss * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 1.1 augustss * All rights reserved.
6 1.1 augustss *
7 1.5 augustss * This code is derived from software contributed to The NetBSD Foundation
8 1.5 augustss * by Lennart Augustsson (augustss (at) carlstedt.se) at
9 1.5 augustss * Carlstedt Research & Technology.
10 1.1 augustss *
11 1.1 augustss * Redistribution and use in source and binary forms, with or without
12 1.1 augustss * modification, are permitted provided that the following conditions
13 1.1 augustss * are met:
14 1.1 augustss * 1. Redistributions of source code must retain the above copyright
15 1.1 augustss * notice, this list of conditions and the following disclaimer.
16 1.1 augustss * 2. Redistributions in binary form must reproduce the above copyright
17 1.1 augustss * notice, this list of conditions and the following disclaimer in the
18 1.1 augustss * documentation and/or other materials provided with the distribution.
19 1.1 augustss * 3. All advertising materials mentioning features or use of this software
20 1.1 augustss * must display the following acknowledgement:
21 1.1 augustss * This product includes software developed by the NetBSD
22 1.1 augustss * Foundation, Inc. and its contributors.
23 1.1 augustss * 4. Neither the name of The NetBSD Foundation nor the names of its
24 1.1 augustss * contributors may be used to endorse or promote products derived
25 1.1 augustss * from this software without specific prior written permission.
26 1.1 augustss *
27 1.1 augustss * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 1.1 augustss * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 1.1 augustss * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 1.1 augustss * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 1.1 augustss * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 1.1 augustss * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 1.1 augustss * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 1.1 augustss * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 1.1 augustss * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 1.1 augustss * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 1.1 augustss * POSSIBILITY OF SUCH DAMAGE.
38 1.1 augustss */
39 1.1 augustss
40 1.1 augustss /*
41 1.8 augustss * USB specifications and other documentation can be found at
42 1.8 augustss * http://www.usb.org/developers/data/ and
43 1.8 augustss * http://www.usb.org/developers/index.html .
44 1.1 augustss */
45 1.1 augustss
46 1.1 augustss #include <sys/param.h>
47 1.1 augustss #include <sys/systm.h>
48 1.1 augustss #include <sys/kernel.h>
49 1.1 augustss #include <sys/malloc.h>
50 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
51 1.1 augustss #include <sys/device.h>
52 1.13 augustss #include <sys/kthread.h>
53 1.7 augustss #elif defined(__FreeBSD__)
54 1.7 augustss #include <sys/module.h>
55 1.7 augustss #include <sys/bus.h>
56 1.7 augustss #include <sys/ioccom.h>
57 1.7 augustss #include <sys/uio.h>
58 1.7 augustss #include <sys/conf.h>
59 1.7 augustss #endif
60 1.22 augustss #include <sys/conf.h>
61 1.1 augustss #include <sys/poll.h>
62 1.1 augustss #include <sys/proc.h>
63 1.1 augustss #include <sys/select.h>
64 1.1 augustss
65 1.1 augustss #include <dev/usb/usb.h>
66 1.13 augustss #include <dev/usb/usbdi.h>
67 1.13 augustss #include <dev/usb/usbdi_util.h>
68 1.1 augustss
69 1.7 augustss #if defined(__FreeBSD__)
70 1.7 augustss MALLOC_DEFINE(M_USB, "USB", "USB");
71 1.7 augustss MALLOC_DEFINE(M_USBDEV, "USBdev", "USB device");
72 1.13 augustss MALLOC_DEFINE(M_USBHC, "USBHC", "USB host controller");
73 1.7 augustss
74 1.7 augustss #include "usb_if.h"
75 1.7 augustss #endif /* defined(__FreeBSD__) */
76 1.20 augustss
77 1.20 augustss #include <machine/bus.h>
78 1.7 augustss
79 1.1 augustss #include <dev/usb/usbdivar.h>
80 1.1 augustss #include <dev/usb/usb_quirks.h>
81 1.1 augustss
82 1.1 augustss #ifdef USB_DEBUG
83 1.16 augustss #define DPRINTF(x) if (usbdebug) logprintf x
84 1.16 augustss #define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x
85 1.1 augustss int usbdebug = 0;
86 1.1 augustss int uhcidebug;
87 1.1 augustss int ohcidebug;
88 1.21 augustss int usb_noexplore = 0;
89 1.1 augustss #else
90 1.1 augustss #define DPRINTF(x)
91 1.1 augustss #define DPRINTFN(n,x)
92 1.1 augustss #endif
93 1.1 augustss
94 1.22 augustss int usb_nbus = 0;
95 1.22 augustss
96 1.1 augustss #define USBUNIT(dev) (minor(dev))
97 1.1 augustss
98 1.1 augustss struct usb_softc {
99 1.22 augustss USBBASEDEVICE sc_dev; /* base device */
100 1.1 augustss usbd_bus_handle sc_bus; /* USB controller */
101 1.1 augustss struct usbd_port sc_port; /* dummy port for root hub */
102 1.25 augustss
103 1.22 augustss struct selinfo sc_consel; /* waiting for connect change */
104 1.22 augustss struct proc *sc_event_thread;
105 1.25 augustss
106 1.25 augustss char sc_dying;
107 1.1 augustss };
108 1.1 augustss
109 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
110 1.22 augustss cdev_decl(usb);
111 1.7 augustss #elif defined(__FreeBSD__)
112 1.7 augustss d_open_t usbopen;
113 1.7 augustss d_close_t usbclose;
114 1.7 augustss d_ioctl_t usbioctl;
115 1.7 augustss int usbpoll __P((dev_t, int, struct proc *));
116 1.7 augustss
117 1.7 augustss struct cdevsw usb_cdevsw = {
118 1.7 augustss usbopen, usbclose, noread, nowrite,
119 1.7 augustss usbioctl, nullstop, nullreset, nodevtotty,
120 1.7 augustss usbpoll, nommap, nostrat,
121 1.7 augustss "usb", NULL, -1
122 1.7 augustss };
123 1.7 augustss #endif
124 1.7 augustss
125 1.1 augustss usbd_status usb_discover __P((struct usb_softc *));
126 1.13 augustss void usb_create_event_thread __P((void *));
127 1.13 augustss void usb_event_thread __P((void *));
128 1.1 augustss
129 1.23 augustss /* Flag to see if we are in the cold boot process. */
130 1.23 augustss extern int cold;
131 1.23 augustss
132 1.11 augustss USB_DECLARE_DRIVER_INIT(usb, DEVMETHOD(bus_print_child, usbd_print_child));
133 1.1 augustss
134 1.7 augustss USB_MATCH(usb)
135 1.1 augustss {
136 1.1 augustss DPRINTF(("usbd_match\n"));
137 1.7 augustss return (UMATCH_GENERIC);
138 1.1 augustss }
139 1.1 augustss
140 1.7 augustss USB_ATTACH(usb)
141 1.1 augustss {
142 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
143 1.1 augustss struct usb_softc *sc = (struct usb_softc *)self;
144 1.7 augustss #elif defined(__FreeBSD__)
145 1.11 augustss struct usb_softc *sc = device_get_softc(self);
146 1.11 augustss void *aux = device_get_ivars(self);
147 1.7 augustss #endif
148 1.1 augustss usbd_device_handle dev;
149 1.1 augustss usbd_status r;
150 1.1 augustss
151 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
152 1.4 augustss printf("\n");
153 1.7 augustss #elif defined(__FreeBSD__)
154 1.11 augustss sc->sc_dev = self;
155 1.7 augustss #endif
156 1.4 augustss
157 1.1 augustss DPRINTF(("usbd_attach\n"));
158 1.4 augustss usbd_init();
159 1.1 augustss sc->sc_bus = aux;
160 1.1 augustss sc->sc_bus->usbctl = sc;
161 1.1 augustss sc->sc_port.power = USB_MAX_POWER;
162 1.24 augustss r = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, 0, 0,
163 1.22 augustss &sc->sc_port);
164 1.7 augustss
165 1.1 augustss if (r == USBD_NORMAL_COMPLETION) {
166 1.1 augustss dev = sc->sc_port.device;
167 1.1 augustss if (!dev->hub) {
168 1.22 augustss sc->sc_dying = 1;
169 1.7 augustss printf("%s: root device is not a hub\n",
170 1.7 augustss USBDEVNAME(sc->sc_dev));
171 1.7 augustss USB_ATTACH_ERROR_RETURN;
172 1.1 augustss }
173 1.1 augustss sc->sc_bus->root_hub = dev;
174 1.24 augustss #if 1
175 1.24 augustss /*
176 1.24 augustss * Turning this code off will delay attachment of USB devices
177 1.24 augustss * until the USB event thread is running, which means that
178 1.24 augustss * the keyboard will not work until after cold boot.
179 1.24 augustss */
180 1.24 augustss if (cold) {
181 1.24 augustss sc->sc_bus->use_polling++;
182 1.24 augustss dev->hub->explore(sc->sc_bus->root_hub);
183 1.24 augustss sc->sc_bus->use_polling--;
184 1.24 augustss }
185 1.24 augustss #endif
186 1.1 augustss } else {
187 1.1 augustss printf("%s: root hub problem, error=%d\n",
188 1.7 augustss USBDEVNAME(sc->sc_dev), r);
189 1.22 augustss sc->sc_dying = 1;
190 1.1 augustss }
191 1.7 augustss
192 1.14 thorpej kthread_create(usb_create_event_thread, sc);
193 1.13 augustss
194 1.22 augustss usb_nbus++;
195 1.7 augustss USB_ATTACH_SUCCESS_RETURN;
196 1.1 augustss }
197 1.1 augustss
198 1.13 augustss void
199 1.13 augustss usb_create_event_thread(arg)
200 1.13 augustss void *arg;
201 1.13 augustss {
202 1.13 augustss struct usb_softc *sc = arg;
203 1.13 augustss
204 1.22 augustss if (kthread_create1(usb_event_thread, sc, &sc->sc_event_thread,
205 1.13 augustss "%s", sc->sc_dev.dv_xname)) {
206 1.13 augustss printf("%s: unable to create event thread for\n",
207 1.13 augustss sc->sc_dev.dv_xname);
208 1.13 augustss panic("usb_create_event_thread");
209 1.13 augustss }
210 1.13 augustss }
211 1.13 augustss
212 1.13 augustss void
213 1.13 augustss usb_event_thread(arg)
214 1.13 augustss void *arg;
215 1.13 augustss {
216 1.13 augustss struct usb_softc *sc = arg;
217 1.13 augustss
218 1.22 augustss while (!sc->sc_dying) {
219 1.21 augustss #ifdef USB_DEBUG
220 1.22 augustss if (!usb_noexplore)
221 1.21 augustss #endif
222 1.22 augustss usb_discover(sc);
223 1.22 augustss (void)tsleep(&sc->sc_bus->needs_explore,
224 1.22 augustss PWAIT, "usbevt", hz*60);
225 1.13 augustss DPRINTFN(2,("usb_event_thread: woke up\n"));
226 1.13 augustss }
227 1.22 augustss sc->sc_event_thread = 0;
228 1.13 augustss
229 1.13 augustss /* In case parent is waiting for us to exit. */
230 1.13 augustss wakeup(sc);
231 1.13 augustss
232 1.13 augustss kthread_exit(0);
233 1.13 augustss }
234 1.13 augustss
235 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
236 1.1 augustss int
237 1.1 augustss usbctlprint(aux, pnp)
238 1.1 augustss void *aux;
239 1.1 augustss const char *pnp;
240 1.1 augustss {
241 1.1 augustss /* only "usb"es can attach to host controllers */
242 1.1 augustss if (pnp)
243 1.1 augustss printf("usb at %s", pnp);
244 1.1 augustss
245 1.1 augustss return (UNCONF);
246 1.1 augustss }
247 1.7 augustss #endif
248 1.7 augustss
249 1.1 augustss int
250 1.1 augustss usbopen(dev, flag, mode, p)
251 1.1 augustss dev_t dev;
252 1.1 augustss int flag, mode;
253 1.1 augustss struct proc *p;
254 1.1 augustss {
255 1.7 augustss USB_GET_SC_OPEN(usb, USBUNIT(dev), sc);
256 1.1 augustss
257 1.22 augustss if (sc == 0)
258 1.1 augustss return (ENXIO);
259 1.22 augustss if (sc->sc_dying)
260 1.22 augustss return (EIO);
261 1.1 augustss
262 1.1 augustss return (0);
263 1.1 augustss }
264 1.1 augustss
265 1.1 augustss int
266 1.1 augustss usbclose(dev, flag, mode, p)
267 1.1 augustss dev_t dev;
268 1.1 augustss int flag, mode;
269 1.1 augustss struct proc *p;
270 1.1 augustss {
271 1.1 augustss return (0);
272 1.1 augustss }
273 1.1 augustss
274 1.1 augustss int
275 1.1 augustss usbioctl(dev, cmd, data, flag, p)
276 1.1 augustss dev_t dev;
277 1.1 augustss u_long cmd;
278 1.1 augustss caddr_t data;
279 1.1 augustss int flag;
280 1.1 augustss struct proc *p;
281 1.1 augustss {
282 1.7 augustss USB_GET_SC(usb, USBUNIT(dev), sc);
283 1.1 augustss
284 1.22 augustss if (sc->sc_dying)
285 1.22 augustss return (EIO);
286 1.22 augustss
287 1.1 augustss switch (cmd) {
288 1.1 augustss #ifdef USB_DEBUG
289 1.1 augustss case USB_SETDEBUG:
290 1.1 augustss usbdebug = uhcidebug = ohcidebug = *(int *)data;
291 1.1 augustss break;
292 1.1 augustss #endif
293 1.1 augustss case USB_REQUEST:
294 1.1 augustss {
295 1.1 augustss struct usb_ctl_request *ur = (void *)data;
296 1.1 augustss int len = UGETW(ur->request.wLength);
297 1.1 augustss struct iovec iov;
298 1.1 augustss struct uio uio;
299 1.1 augustss void *ptr = 0;
300 1.1 augustss int addr = ur->addr;
301 1.1 augustss usbd_status r;
302 1.1 augustss int error = 0;
303 1.1 augustss
304 1.9 augustss DPRINTF(("usbioctl: USB_REQUEST addr=%d len=%d\n", addr, len));
305 1.1 augustss if (len < 0 || len > 32768)
306 1.9 augustss return (EINVAL);
307 1.1 augustss if (addr < 0 || addr >= USB_MAX_DEVICES ||
308 1.1 augustss sc->sc_bus->devices[addr] == 0)
309 1.9 augustss return (EINVAL);
310 1.1 augustss if (len != 0) {
311 1.1 augustss iov.iov_base = (caddr_t)ur->data;
312 1.1 augustss iov.iov_len = len;
313 1.1 augustss uio.uio_iov = &iov;
314 1.1 augustss uio.uio_iovcnt = 1;
315 1.1 augustss uio.uio_resid = len;
316 1.1 augustss uio.uio_offset = 0;
317 1.1 augustss uio.uio_segflg = UIO_USERSPACE;
318 1.1 augustss uio.uio_rw =
319 1.1 augustss ur->request.bmRequestType & UT_READ ?
320 1.1 augustss UIO_READ : UIO_WRITE;
321 1.1 augustss uio.uio_procp = p;
322 1.1 augustss ptr = malloc(len, M_TEMP, M_WAITOK);
323 1.1 augustss if (uio.uio_rw == UIO_WRITE) {
324 1.1 augustss error = uiomove(ptr, len, &uio);
325 1.1 augustss if (error)
326 1.1 augustss goto ret;
327 1.1 augustss }
328 1.1 augustss }
329 1.9 augustss r = usbd_do_request_flags(sc->sc_bus->devices[addr],
330 1.10 augustss &ur->request, ptr,
331 1.10 augustss ur->flags, &ur->actlen);
332 1.15 augustss if (r != USBD_NORMAL_COMPLETION) {
333 1.1 augustss error = EIO;
334 1.1 augustss goto ret;
335 1.1 augustss }
336 1.1 augustss if (len != 0) {
337 1.1 augustss if (uio.uio_rw == UIO_READ) {
338 1.1 augustss error = uiomove(ptr, len, &uio);
339 1.1 augustss if (error)
340 1.1 augustss goto ret;
341 1.1 augustss }
342 1.1 augustss }
343 1.1 augustss ret:
344 1.1 augustss if (ptr)
345 1.1 augustss free(ptr, M_TEMP);
346 1.1 augustss return (error);
347 1.1 augustss }
348 1.1 augustss
349 1.1 augustss case USB_DEVICEINFO:
350 1.1 augustss {
351 1.1 augustss struct usb_device_info *di = (void *)data;
352 1.1 augustss int addr = di->addr;
353 1.1 augustss usbd_device_handle dev;
354 1.1 augustss
355 1.1 augustss if (addr < 1 || addr >= USB_MAX_DEVICES)
356 1.1 augustss return (EINVAL);
357 1.1 augustss dev = sc->sc_bus->devices[addr];
358 1.1 augustss if (dev == 0)
359 1.1 augustss return (ENXIO);
360 1.6 augustss usbd_fill_deviceinfo(dev, di);
361 1.1 augustss break;
362 1.1 augustss }
363 1.2 augustss
364 1.2 augustss case USB_DEVICESTATS:
365 1.2 augustss *(struct usb_device_stats *)data = sc->sc_bus->stats;
366 1.2 augustss break;
367 1.1 augustss
368 1.1 augustss default:
369 1.1 augustss return (ENXIO);
370 1.1 augustss }
371 1.1 augustss return (0);
372 1.1 augustss }
373 1.1 augustss
374 1.1 augustss int
375 1.1 augustss usbpoll(dev, events, p)
376 1.1 augustss dev_t dev;
377 1.1 augustss int events;
378 1.1 augustss struct proc *p;
379 1.1 augustss {
380 1.1 augustss int revents, s;
381 1.7 augustss USB_GET_SC(usb, USBUNIT(dev), sc);
382 1.1 augustss
383 1.22 augustss if (sc->sc_dying)
384 1.22 augustss return (EIO);
385 1.22 augustss
386 1.1 augustss DPRINTFN(2, ("usbpoll: sc=%p events=0x%x\n", sc, events));
387 1.1 augustss s = splusb();
388 1.1 augustss revents = 0;
389 1.1 augustss if (events & (POLLOUT | POLLWRNORM))
390 1.1 augustss if (sc->sc_bus->needs_explore)
391 1.1 augustss revents |= events & (POLLOUT | POLLWRNORM);
392 1.1 augustss DPRINTFN(2, ("usbpoll: revents=0x%x\n", revents));
393 1.1 augustss if (revents == 0) {
394 1.1 augustss if (events & (POLLOUT | POLLWRNORM)) {
395 1.1 augustss DPRINTFN(2, ("usbpoll: selrecord\n"));
396 1.1 augustss selrecord(p, &sc->sc_consel);
397 1.1 augustss }
398 1.1 augustss }
399 1.1 augustss splx(s);
400 1.1 augustss return (revents);
401 1.1 augustss }
402 1.1 augustss
403 1.25 augustss /* Explore device tree from the root. */
404 1.1 augustss usbd_status
405 1.1 augustss usb_discover(sc)
406 1.1 augustss struct usb_softc *sc;
407 1.1 augustss {
408 1.25 augustss /*
409 1.25 augustss * We need mutual exclusion while traversing the device tree,
410 1.25 augustss * but this is guaranteed since this function is only called
411 1.25 augustss * from the event thread for the controller.
412 1.25 augustss */
413 1.13 augustss do {
414 1.13 augustss sc->sc_bus->needs_explore = 0;
415 1.13 augustss sc->sc_bus->root_hub->hub->explore(sc->sc_bus->root_hub);
416 1.22 augustss } while (sc->sc_bus->needs_explore && !sc->sc_dying);
417 1.13 augustss return (USBD_NORMAL_COMPLETION);
418 1.1 augustss }
419 1.1 augustss
420 1.1 augustss void
421 1.1 augustss usb_needs_explore(bus)
422 1.1 augustss usbd_bus_handle bus;
423 1.1 augustss {
424 1.1 augustss bus->needs_explore = 1;
425 1.1 augustss selwakeup(&bus->usbctl->sc_consel);
426 1.13 augustss wakeup(&bus->needs_explore);
427 1.1 augustss }
428 1.7 augustss
429 1.7 augustss int
430 1.13 augustss usb_activate(self, act)
431 1.19 augustss device_ptr_t self;
432 1.13 augustss enum devact act;
433 1.7 augustss {
434 1.22 augustss struct usb_softc *sc = (struct usb_softc *)self;
435 1.25 augustss usbd_device_handle dev = sc->sc_port.device;
436 1.25 augustss int i, rv = 0;
437 1.22 augustss
438 1.22 augustss switch (act) {
439 1.22 augustss case DVACT_ACTIVATE:
440 1.22 augustss return (EOPNOTSUPP);
441 1.22 augustss break;
442 1.22 augustss
443 1.22 augustss case DVACT_DEACTIVATE:
444 1.22 augustss sc->sc_dying = 1;
445 1.25 augustss if (dev && dev->cdesc && dev->subdevs) {
446 1.25 augustss for (i = 0; dev->subdevs[i]; i++)
447 1.25 augustss rv |= config_deactivate(dev->subdevs[i]);
448 1.25 augustss }
449 1.22 augustss break;
450 1.22 augustss }
451 1.22 augustss return (rv);
452 1.13 augustss }
453 1.7 augustss
454 1.13 augustss int
455 1.13 augustss usb_detach(self, flags)
456 1.19 augustss device_ptr_t self;
457 1.13 augustss int flags;
458 1.13 augustss {
459 1.22 augustss struct usb_softc *sc = (struct usb_softc *)self;
460 1.22 augustss
461 1.22 augustss sc->sc_dying = 1;
462 1.22 augustss
463 1.22 augustss /* Make all devices disconnect. */
464 1.25 augustss if (sc->sc_port.device)
465 1.25 augustss usb_disconnect_port(&sc->sc_port);
466 1.22 augustss
467 1.22 augustss /* Kill off event thread. */
468 1.22 augustss if (sc->sc_event_thread) {
469 1.22 augustss wakeup(&sc->sc_bus->needs_explore);
470 1.22 augustss if (tsleep(sc, PWAIT, "usbdet", hz * 60))
471 1.22 augustss printf("%s: event thread didn't die\n",
472 1.22 augustss USBDEVNAME(sc->sc_dev));
473 1.22 augustss }
474 1.22 augustss
475 1.22 augustss usb_nbus--;
476 1.22 augustss return (0);
477 1.22 augustss }
478 1.22 augustss
479 1.22 augustss int
480 1.22 augustss usbread(dev, uio, flag)
481 1.22 augustss dev_t dev;
482 1.22 augustss struct uio *uio;
483 1.22 augustss int flag;
484 1.22 augustss {
485 1.22 augustss /* XXX */
486 1.7 augustss return (0);
487 1.7 augustss }
488 1.7 augustss
489 1.13 augustss #if defined(__FreeBSD__)
490 1.7 augustss DRIVER_MODULE(usb, root, usb_driver, usb_devclass, 0, 0);
491 1.7 augustss #endif
492