usb.c revision 1.24 1 1.24 augustss /* $NetBSD: usb.c,v 1.24 1999/09/15 21:10:11 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.22 augustss char sc_exploring;
103 1.22 augustss char sc_dying;
104 1.22 augustss struct selinfo sc_consel; /* waiting for connect change */
105 1.22 augustss struct proc *sc_event_thread;
106 1.1 augustss };
107 1.1 augustss
108 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
109 1.22 augustss cdev_decl(usb);
110 1.7 augustss #elif defined(__FreeBSD__)
111 1.7 augustss d_open_t usbopen;
112 1.7 augustss d_close_t usbclose;
113 1.7 augustss d_ioctl_t usbioctl;
114 1.7 augustss int usbpoll __P((dev_t, int, struct proc *));
115 1.7 augustss
116 1.7 augustss struct cdevsw usb_cdevsw = {
117 1.7 augustss usbopen, usbclose, noread, nowrite,
118 1.7 augustss usbioctl, nullstop, nullreset, nodevtotty,
119 1.7 augustss usbpoll, nommap, nostrat,
120 1.7 augustss "usb", NULL, -1
121 1.7 augustss };
122 1.7 augustss #endif
123 1.7 augustss
124 1.1 augustss usbd_status usb_discover __P((struct usb_softc *));
125 1.13 augustss void usb_create_event_thread __P((void *));
126 1.13 augustss void usb_event_thread __P((void *));
127 1.1 augustss
128 1.23 augustss /* Flag to see if we are in the cold boot process. */
129 1.23 augustss extern int cold;
130 1.23 augustss
131 1.11 augustss USB_DECLARE_DRIVER_INIT(usb, DEVMETHOD(bus_print_child, usbd_print_child));
132 1.1 augustss
133 1.7 augustss USB_MATCH(usb)
134 1.1 augustss {
135 1.1 augustss DPRINTF(("usbd_match\n"));
136 1.7 augustss return (UMATCH_GENERIC);
137 1.1 augustss }
138 1.1 augustss
139 1.7 augustss USB_ATTACH(usb)
140 1.1 augustss {
141 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
142 1.1 augustss struct usb_softc *sc = (struct usb_softc *)self;
143 1.7 augustss #elif defined(__FreeBSD__)
144 1.11 augustss struct usb_softc *sc = device_get_softc(self);
145 1.11 augustss void *aux = device_get_ivars(self);
146 1.7 augustss #endif
147 1.1 augustss usbd_device_handle dev;
148 1.1 augustss usbd_status r;
149 1.1 augustss
150 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
151 1.4 augustss printf("\n");
152 1.7 augustss #elif defined(__FreeBSD__)
153 1.11 augustss sc->sc_dev = self;
154 1.7 augustss #endif
155 1.4 augustss
156 1.1 augustss DPRINTF(("usbd_attach\n"));
157 1.4 augustss usbd_init();
158 1.1 augustss sc->sc_bus = aux;
159 1.1 augustss sc->sc_bus->usbctl = sc;
160 1.1 augustss sc->sc_port.power = USB_MAX_POWER;
161 1.24 augustss r = usbd_new_device(USBDEV(sc->sc_dev), sc->sc_bus, 0, 0, 0,
162 1.22 augustss &sc->sc_port);
163 1.7 augustss
164 1.1 augustss if (r == USBD_NORMAL_COMPLETION) {
165 1.1 augustss dev = sc->sc_port.device;
166 1.1 augustss if (!dev->hub) {
167 1.22 augustss sc->sc_dying = 1;
168 1.7 augustss printf("%s: root device is not a hub\n",
169 1.7 augustss USBDEVNAME(sc->sc_dev));
170 1.7 augustss USB_ATTACH_ERROR_RETURN;
171 1.1 augustss }
172 1.1 augustss sc->sc_bus->root_hub = dev;
173 1.24 augustss #if 1
174 1.24 augustss /*
175 1.24 augustss * Turning this code off will delay attachment of USB devices
176 1.24 augustss * until the USB event thread is running, which means that
177 1.24 augustss * the keyboard will not work until after cold boot.
178 1.24 augustss */
179 1.24 augustss if (cold) {
180 1.24 augustss sc->sc_bus->use_polling++;
181 1.24 augustss dev->hub->explore(sc->sc_bus->root_hub);
182 1.24 augustss sc->sc_bus->use_polling--;
183 1.24 augustss }
184 1.24 augustss #endif
185 1.1 augustss } else {
186 1.1 augustss printf("%s: root hub problem, error=%d\n",
187 1.7 augustss USBDEVNAME(sc->sc_dev), r);
188 1.22 augustss sc->sc_dying = 1;
189 1.1 augustss }
190 1.7 augustss
191 1.14 thorpej kthread_create(usb_create_event_thread, sc);
192 1.13 augustss
193 1.22 augustss usb_nbus++;
194 1.7 augustss USB_ATTACH_SUCCESS_RETURN;
195 1.1 augustss }
196 1.1 augustss
197 1.13 augustss void
198 1.13 augustss usb_create_event_thread(arg)
199 1.13 augustss void *arg;
200 1.13 augustss {
201 1.13 augustss struct usb_softc *sc = arg;
202 1.13 augustss
203 1.22 augustss if (kthread_create1(usb_event_thread, sc, &sc->sc_event_thread,
204 1.13 augustss "%s", sc->sc_dev.dv_xname)) {
205 1.13 augustss printf("%s: unable to create event thread for\n",
206 1.13 augustss sc->sc_dev.dv_xname);
207 1.13 augustss panic("usb_create_event_thread");
208 1.13 augustss }
209 1.13 augustss }
210 1.13 augustss
211 1.13 augustss void
212 1.13 augustss usb_event_thread(arg)
213 1.13 augustss void *arg;
214 1.13 augustss {
215 1.13 augustss struct usb_softc *sc = arg;
216 1.13 augustss
217 1.22 augustss while (!sc->sc_dying) {
218 1.21 augustss #ifdef USB_DEBUG
219 1.22 augustss if (!usb_noexplore)
220 1.21 augustss #endif
221 1.22 augustss usb_discover(sc);
222 1.22 augustss (void)tsleep(&sc->sc_bus->needs_explore,
223 1.22 augustss PWAIT, "usbevt", hz*60);
224 1.13 augustss DPRINTFN(2,("usb_event_thread: woke up\n"));
225 1.13 augustss }
226 1.22 augustss sc->sc_event_thread = 0;
227 1.13 augustss
228 1.13 augustss /* In case parent is waiting for us to exit. */
229 1.13 augustss wakeup(sc);
230 1.13 augustss
231 1.13 augustss kthread_exit(0);
232 1.13 augustss }
233 1.13 augustss
234 1.17 augustss #if defined(__NetBSD__) || defined(__OpenBSD__)
235 1.1 augustss int
236 1.1 augustss usbctlprint(aux, pnp)
237 1.1 augustss void *aux;
238 1.1 augustss const char *pnp;
239 1.1 augustss {
240 1.1 augustss /* only "usb"es can attach to host controllers */
241 1.1 augustss if (pnp)
242 1.1 augustss printf("usb at %s", pnp);
243 1.1 augustss
244 1.1 augustss return (UNCONF);
245 1.1 augustss }
246 1.7 augustss #endif
247 1.7 augustss
248 1.1 augustss int
249 1.1 augustss usbopen(dev, flag, mode, p)
250 1.1 augustss dev_t dev;
251 1.1 augustss int flag, mode;
252 1.1 augustss struct proc *p;
253 1.1 augustss {
254 1.7 augustss USB_GET_SC_OPEN(usb, USBUNIT(dev), sc);
255 1.1 augustss
256 1.22 augustss if (sc == 0)
257 1.1 augustss return (ENXIO);
258 1.22 augustss if (sc->sc_dying)
259 1.22 augustss return (EIO);
260 1.1 augustss
261 1.1 augustss return (0);
262 1.1 augustss }
263 1.1 augustss
264 1.1 augustss int
265 1.1 augustss usbclose(dev, flag, mode, p)
266 1.1 augustss dev_t dev;
267 1.1 augustss int flag, mode;
268 1.1 augustss struct proc *p;
269 1.1 augustss {
270 1.1 augustss return (0);
271 1.1 augustss }
272 1.1 augustss
273 1.1 augustss int
274 1.1 augustss usbioctl(dev, cmd, data, flag, p)
275 1.1 augustss dev_t dev;
276 1.1 augustss u_long cmd;
277 1.1 augustss caddr_t data;
278 1.1 augustss int flag;
279 1.1 augustss struct proc *p;
280 1.1 augustss {
281 1.7 augustss USB_GET_SC(usb, USBUNIT(dev), sc);
282 1.1 augustss
283 1.22 augustss if (sc->sc_dying)
284 1.22 augustss return (EIO);
285 1.22 augustss
286 1.1 augustss switch (cmd) {
287 1.1 augustss #ifdef USB_DEBUG
288 1.1 augustss case USB_SETDEBUG:
289 1.1 augustss usbdebug = uhcidebug = ohcidebug = *(int *)data;
290 1.1 augustss break;
291 1.1 augustss #endif
292 1.13 augustss #if 0
293 1.1 augustss case USB_DISCOVER:
294 1.1 augustss usb_discover(sc);
295 1.1 augustss break;
296 1.13 augustss #endif
297 1.1 augustss case USB_REQUEST:
298 1.1 augustss {
299 1.1 augustss struct usb_ctl_request *ur = (void *)data;
300 1.1 augustss int len = UGETW(ur->request.wLength);
301 1.1 augustss struct iovec iov;
302 1.1 augustss struct uio uio;
303 1.1 augustss void *ptr = 0;
304 1.1 augustss int addr = ur->addr;
305 1.1 augustss usbd_status r;
306 1.1 augustss int error = 0;
307 1.1 augustss
308 1.9 augustss DPRINTF(("usbioctl: USB_REQUEST addr=%d len=%d\n", addr, len));
309 1.1 augustss if (len < 0 || len > 32768)
310 1.9 augustss return (EINVAL);
311 1.1 augustss if (addr < 0 || addr >= USB_MAX_DEVICES ||
312 1.1 augustss sc->sc_bus->devices[addr] == 0)
313 1.9 augustss return (EINVAL);
314 1.1 augustss if (len != 0) {
315 1.1 augustss iov.iov_base = (caddr_t)ur->data;
316 1.1 augustss iov.iov_len = len;
317 1.1 augustss uio.uio_iov = &iov;
318 1.1 augustss uio.uio_iovcnt = 1;
319 1.1 augustss uio.uio_resid = len;
320 1.1 augustss uio.uio_offset = 0;
321 1.1 augustss uio.uio_segflg = UIO_USERSPACE;
322 1.1 augustss uio.uio_rw =
323 1.1 augustss ur->request.bmRequestType & UT_READ ?
324 1.1 augustss UIO_READ : UIO_WRITE;
325 1.1 augustss uio.uio_procp = p;
326 1.1 augustss ptr = malloc(len, M_TEMP, M_WAITOK);
327 1.1 augustss if (uio.uio_rw == UIO_WRITE) {
328 1.1 augustss error = uiomove(ptr, len, &uio);
329 1.1 augustss if (error)
330 1.1 augustss goto ret;
331 1.1 augustss }
332 1.1 augustss }
333 1.9 augustss r = usbd_do_request_flags(sc->sc_bus->devices[addr],
334 1.10 augustss &ur->request, ptr,
335 1.10 augustss ur->flags, &ur->actlen);
336 1.15 augustss if (r != USBD_NORMAL_COMPLETION) {
337 1.1 augustss error = EIO;
338 1.1 augustss goto ret;
339 1.1 augustss }
340 1.1 augustss if (len != 0) {
341 1.1 augustss if (uio.uio_rw == UIO_READ) {
342 1.1 augustss error = uiomove(ptr, len, &uio);
343 1.1 augustss if (error)
344 1.1 augustss goto ret;
345 1.1 augustss }
346 1.1 augustss }
347 1.1 augustss ret:
348 1.1 augustss if (ptr)
349 1.1 augustss free(ptr, M_TEMP);
350 1.1 augustss return (error);
351 1.1 augustss }
352 1.1 augustss
353 1.1 augustss case USB_DEVICEINFO:
354 1.1 augustss {
355 1.1 augustss struct usb_device_info *di = (void *)data;
356 1.1 augustss int addr = di->addr;
357 1.1 augustss usbd_device_handle dev;
358 1.1 augustss
359 1.1 augustss if (addr < 1 || addr >= USB_MAX_DEVICES)
360 1.1 augustss return (EINVAL);
361 1.1 augustss dev = sc->sc_bus->devices[addr];
362 1.1 augustss if (dev == 0)
363 1.1 augustss return (ENXIO);
364 1.6 augustss usbd_fill_deviceinfo(dev, di);
365 1.1 augustss break;
366 1.1 augustss }
367 1.2 augustss
368 1.2 augustss case USB_DEVICESTATS:
369 1.2 augustss *(struct usb_device_stats *)data = sc->sc_bus->stats;
370 1.2 augustss break;
371 1.1 augustss
372 1.1 augustss default:
373 1.1 augustss return (ENXIO);
374 1.1 augustss }
375 1.1 augustss return (0);
376 1.1 augustss }
377 1.1 augustss
378 1.1 augustss int
379 1.1 augustss usbpoll(dev, events, p)
380 1.1 augustss dev_t dev;
381 1.1 augustss int events;
382 1.1 augustss struct proc *p;
383 1.1 augustss {
384 1.1 augustss int revents, s;
385 1.7 augustss USB_GET_SC(usb, USBUNIT(dev), sc);
386 1.1 augustss
387 1.22 augustss if (sc->sc_dying)
388 1.22 augustss return (EIO);
389 1.22 augustss
390 1.1 augustss DPRINTFN(2, ("usbpoll: sc=%p events=0x%x\n", sc, events));
391 1.1 augustss s = splusb();
392 1.1 augustss revents = 0;
393 1.1 augustss if (events & (POLLOUT | POLLWRNORM))
394 1.1 augustss if (sc->sc_bus->needs_explore)
395 1.1 augustss revents |= events & (POLLOUT | POLLWRNORM);
396 1.1 augustss DPRINTFN(2, ("usbpoll: revents=0x%x\n", revents));
397 1.1 augustss if (revents == 0) {
398 1.1 augustss if (events & (POLLOUT | POLLWRNORM)) {
399 1.1 augustss DPRINTFN(2, ("usbpoll: selrecord\n"));
400 1.1 augustss selrecord(p, &sc->sc_consel);
401 1.1 augustss }
402 1.1 augustss }
403 1.1 augustss splx(s);
404 1.1 augustss return (revents);
405 1.1 augustss }
406 1.1 augustss
407 1.1 augustss usbd_status
408 1.1 augustss usb_discover(sc)
409 1.1 augustss struct usb_softc *sc;
410 1.1 augustss {
411 1.1 augustss int s;
412 1.1 augustss
413 1.1 augustss /* Explore device tree from the root */
414 1.1 augustss /* We need mutual exclusion while traversing the device tree. */
415 1.13 augustss do {
416 1.13 augustss s = splusb();
417 1.13 augustss while (sc->sc_exploring)
418 1.13 augustss tsleep(&sc->sc_exploring, PRIBIO, "usbdis", 0);
419 1.13 augustss sc->sc_exploring = 1;
420 1.13 augustss sc->sc_bus->needs_explore = 0;
421 1.13 augustss splx(s);
422 1.13 augustss
423 1.13 augustss sc->sc_bus->root_hub->hub->explore(sc->sc_bus->root_hub);
424 1.13 augustss
425 1.13 augustss s = splusb();
426 1.13 augustss sc->sc_exploring = 0;
427 1.13 augustss wakeup(&sc->sc_exploring);
428 1.13 augustss splx(s);
429 1.22 augustss } while (sc->sc_bus->needs_explore && !sc->sc_dying);
430 1.13 augustss return (USBD_NORMAL_COMPLETION);
431 1.1 augustss }
432 1.1 augustss
433 1.1 augustss void
434 1.1 augustss usb_needs_explore(bus)
435 1.1 augustss usbd_bus_handle bus;
436 1.1 augustss {
437 1.1 augustss bus->needs_explore = 1;
438 1.1 augustss selwakeup(&bus->usbctl->sc_consel);
439 1.13 augustss wakeup(&bus->needs_explore);
440 1.1 augustss }
441 1.7 augustss
442 1.7 augustss int
443 1.13 augustss usb_activate(self, act)
444 1.19 augustss device_ptr_t self;
445 1.13 augustss enum devact act;
446 1.7 augustss {
447 1.22 augustss struct usb_softc *sc = (struct usb_softc *)self;
448 1.22 augustss int rv = 0;
449 1.22 augustss
450 1.22 augustss switch (act) {
451 1.22 augustss case DVACT_ACTIVATE:
452 1.22 augustss return (EOPNOTSUPP);
453 1.22 augustss break;
454 1.22 augustss
455 1.22 augustss case DVACT_DEACTIVATE:
456 1.22 augustss sc->sc_dying = 1;
457 1.22 augustss break;
458 1.22 augustss }
459 1.22 augustss return (rv);
460 1.13 augustss }
461 1.7 augustss
462 1.13 augustss int
463 1.13 augustss usb_detach(self, flags)
464 1.19 augustss device_ptr_t self;
465 1.13 augustss int flags;
466 1.13 augustss {
467 1.22 augustss struct usb_softc *sc = (struct usb_softc *)self;
468 1.22 augustss
469 1.22 augustss sc->sc_dying = 1;
470 1.22 augustss
471 1.22 augustss /* Make all devices disconnect. */
472 1.22 augustss usb_disconnect_port(&sc->sc_port);
473 1.22 augustss
474 1.22 augustss /* Kill off event thread. */
475 1.22 augustss if (sc->sc_event_thread) {
476 1.22 augustss wakeup(&sc->sc_bus->needs_explore);
477 1.22 augustss if (tsleep(sc, PWAIT, "usbdet", hz * 60))
478 1.22 augustss printf("%s: event thread didn't die\n",
479 1.22 augustss USBDEVNAME(sc->sc_dev));
480 1.22 augustss }
481 1.22 augustss
482 1.22 augustss usb_nbus--;
483 1.22 augustss return (0);
484 1.22 augustss }
485 1.22 augustss
486 1.22 augustss int
487 1.22 augustss usbread(dev, uio, flag)
488 1.22 augustss dev_t dev;
489 1.22 augustss struct uio *uio;
490 1.22 augustss int flag;
491 1.22 augustss {
492 1.22 augustss /* XXX */
493 1.7 augustss return (0);
494 1.7 augustss }
495 1.7 augustss
496 1.13 augustss #if defined(__FreeBSD__)
497 1.7 augustss DRIVER_MODULE(usb, root, usb_driver, usb_devclass, 0, 0);
498 1.7 augustss #endif
499