2 * $OpenBSD: usb_port.h,v 1.18 2000/09/06 22:42:10 rahnds Exp $
3 * $NetBSD: usb_port.h,v 1.68 2005/07/30 06:14:50 skrll Exp $
4 * $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.65 2003/11/09 23:54:21 joe Exp $
5 * $DragonFly: src/sys/bus/usb/usb_port.h,v 1.14 2005/11/28 17:13:23 dillon Exp $
8 /* Also already merged from NetBSD:
9 * $NetBSD: usb_port.h,v 1.57 2002/09/27 20:42:01 thorpej Exp $
10 * $NetBSD: usb_port.h,v 1.58 2002/10/01 01:25:26 thorpej Exp $
14 * Copyright (c) 1998 The NetBSD Foundation, Inc.
15 * All rights reserved.
17 * This code is derived from software contributed to The NetBSD Foundation
18 * by Lennart Augustsson (lennart@augustsson.net) at
19 * Carlstedt Research & Technology.
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 * 3. All advertising materials mentioning features or use of this software
30 * must display the following acknowledgement:
31 * This product includes software developed by the NetBSD
32 * Foundation, Inc. and its contributors.
33 * 4. Neither the name of The NetBSD Foundation nor the names of its
34 * contributors may be used to endorse or promote products derived
35 * from this software without specific prior written permission.
37 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
38 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
39 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
40 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
41 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
43 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
44 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
45 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
47 * POSSIBILITY OF SUCH DAMAGE.
54 * Macro's to cope with the differences between operating systems.
57 #if defined(__NetBSD__)
62 #include "opt_usbverbose.h"
65 #include <sys/mallocvar.h>
67 MALLOC_DECLARE(M_USB);
68 MALLOC_DECLARE(M_USBDEV);
69 MALLOC_DECLARE(M_USBHC);
73 #define USB_USE_SOFTINTR
81 #define SCSI_MODE_SENSE MODE_SENSE
83 typedef struct proc *usb_proc_ptr;
85 typedef struct device *device_ptr_t;
86 #define USBBASEDEVICE struct device
87 #define USBDEV(bdev) (&(bdev))
88 #define USBDEVNAME(bdev) ((bdev).dv_xname)
89 #define USBDEVUNIT(bdev) ((bdev).dv_unit)
90 #define USBDEVPTRNAME(bdevptr) ((bdevptr)->dv_xname)
91 #define USBGETSOFTC(d) ((void *)(d))
93 #define DECLARE_USB_DMA_T \
94 struct usb_dma_block; \
96 struct usb_dma_block *block; \
100 typedef struct callout usb_callout_t;
101 #define usb_callout_init(h) callout_init(&(h))
102 #define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d))
103 #define usb_uncallout(h, f, d) callout_stop(&(h))
105 #define usb_kthread_create1 kthread_create1
106 #define usb_kthread_create kthread_create
108 typedef struct malloc_type *usb_malloc_type;
110 #define Ether_ifattach ether_ifattach
112 #define logprintf printf
114 #define USB_DNAME(dname) dname
115 #define USB_DECLARE_DRIVER(dname) \
116 int __CONCAT(dname,_match)(struct device *, struct cfdata *, void *); \
117 void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \
118 int __CONCAT(dname,_detach)(struct device *, int); \
119 int __CONCAT(dname,_activate)(struct device *, enum devact); \
121 extern struct cfdriver __CONCAT(dname,_cd); \
123 CFATTACH_DECL(USB_DNAME(dname), \
124 sizeof(struct ___CONCAT(dname,_softc)), \
125 ___CONCAT(dname,_match), \
126 ___CONCAT(dname,_attach), \
127 ___CONCAT(dname,_detach), \
128 ___CONCAT(dname,_activate))
130 #define USB_MATCH(dname) \
131 int __CONCAT(dname,_match)(struct device *parent, struct cfdata *match, void *aux)
133 #define USB_MATCH_START(dname, uaa) \
134 struct usb_attach_arg *uaa = aux
136 #define USB_ATTACH(dname) \
137 void __CONCAT(dname,_attach)(struct device *parent, struct device *self, void *aux)
139 #define USB_ATTACH_START(dname, sc, uaa) \
140 struct __CONCAT(dname,_softc) *sc = \
141 (struct __CONCAT(dname,_softc) *)self; \
142 struct usb_attach_arg *uaa = aux
144 /* Returns from attach */
145 #define USB_ATTACH_ERROR_RETURN return
146 #define USB_ATTACH_SUCCESS_RETURN return
148 #define USB_ATTACH_SETUP printf("\n")
150 #define USB_DETACH(dname) \
151 int __CONCAT(dname,_detach)(struct device *self, int flags)
153 #define USB_DETACH_START(dname, sc) \
154 struct __CONCAT(dname,_softc) *sc = \
155 (struct __CONCAT(dname,_softc) *)self
157 #define USB_GET_SC_OPEN(dname, unit, sc) \
158 if (unit >= __CONCAT(dname,_cd).cd_ndevs) \
160 sc = __CONCAT(dname,_cd).cd_devs[unit]; \
164 #define USB_GET_SC(dname, unit, sc) \
165 sc = __CONCAT(dname,_cd).cd_devs[unit]
167 #define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
168 (config_found_sm_loc(parent, (args)->port == 0 ? "usb" : "uhub", \
169 NULL, args, print, sub))
171 #elif defined(__OpenBSD__)
177 typedef struct proc *usb_proc_ptr;
179 #define UCOMBUSCF_PORTNO -1
180 #define UCOMBUSCF_PORTNO_DEFAULT -1
182 #define SCSI_MODE_SENSE MODE_SENSE
183 #define XS_STS_DONE ITSDONE
184 #define XS_CTL_POLL SCSI_POLL
185 #define XS_CTL_DATA_IN SCSI_DATA_IN
186 #define XS_CTL_DATA_OUT SCSI_DATA_OUT
187 #define scsipi_adapter scsi_adapter
188 #define scsipi_cmd scsi_cmd
189 #define scsipi_device scsi_device
190 #define scsipi_done scsi_done
191 #define scsipi_link scsi_link
192 #define scsipi_minphys scsi_minphys
193 #define scsipi_sense scsi_sense
194 #define scsipi_xfer scsi_xfer
195 #define xs_control flags
196 #define xs_status status
198 #define memcpy(d, s, l) bcopy((s),(d),(l))
199 #define memset(d, v, l) bzero((d),(l))
200 #define bswap32(x) swap32(x)
201 #define bswap16(x) swap16(x)
204 * The UHCI/OHCI controllers are little endian, so on big endian machines
205 * the data strored in memory needs to be swapped.
209 #define le32toh(x) letoh32(x)
210 #define le16toh(x) letoh16(x)
213 #define usb_kthread_create1 kthread_create
214 #define usb_kthread_create kthread_create_deferred
216 #define usb_lockmgr(lk, mode, ptr) lockmgr(lk, mode, ptr, curproc)
218 #define config_pending_incr()
219 #define config_pending_decr()
221 typedef int usb_malloc_type;
223 #define Ether_ifattach ether_ifattach
224 #define if_deactivate(x)
226 #define usbpoll usbselect
227 #define uhidpoll uhidselect
228 #define ugenpoll ugenselect
229 #define uscannerpoll uscannerselect
231 #define powerhook_establish(fn, sc) (fn)
232 #define powerhook_disestablish(hdl)
235 #define logprintf printf
237 #define swap_bytes_change_sign16_le swap_bytes_change_sign16
238 #define change_sign16_swap_bytes_le change_sign16_swap_bytes
239 #define change_sign16_le change_sign16
241 #define realloc usb_realloc
242 void *usb_realloc(void *, u_int, int, int);
246 typedef struct device *device_ptr_t;
247 #define USBBASEDEVICE struct device
248 #define USBDEV(bdev) (&(bdev))
249 #define USBDEVNAME(bdev) ((bdev).dv_xname)
250 #define USBDEVUNIT(bdev) ((bdev).dv_unit)
251 #define USBDEVPTRNAME(bdevptr) ((bdevptr)->dv_xname)
252 #define USBGETSOFTC(d) ((void *)(d))
254 #define DECLARE_USB_DMA_T \
255 struct usb_dma_block; \
257 struct usb_dma_block *block; \
261 typedef char usb_callout_t;
262 #define usb_callout_init(h)
263 #define usb_callout(h, t, f, d) timeout((f), (d), (t))
264 #define usb_uncallout(h, f, d) untimeout((f), (d))
266 #define USB_DECLARE_DRIVER(dname) \
267 int __CONCAT(dname,_match)(struct device *, void *, void *); \
268 void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \
269 int __CONCAT(dname,_detach)(struct device *, int); \
270 int __CONCAT(dname,_activate)(struct device *, enum devact); \
272 struct cfdriver __CONCAT(dname,_cd) = { \
273 NULL, #dname, DV_DULL \
276 const struct cfattach __CONCAT(dname,_ca) = { \
277 sizeof(struct __CONCAT(dname,_softc)), \
278 __CONCAT(dname,_match), \
279 __CONCAT(dname,_attach), \
280 __CONCAT(dname,_detach), \
281 __CONCAT(dname,_activate), \
284 #define USB_MATCH(dname) \
286 __CONCAT(dname,_match)(parent, match, aux) \
287 struct device *parent; \
291 #define USB_MATCH_START(dname, uaa) \
292 struct usb_attach_arg *uaa = aux
294 #define USB_ATTACH(dname) \
296 __CONCAT(dname,_attach)(parent, self, aux) \
297 struct device *parent; \
298 struct device *self; \
301 #define USB_ATTACH_START(dname, sc, uaa) \
302 struct __CONCAT(dname,_softc) *sc = \
303 (struct __CONCAT(dname,_softc) *)self; \
304 struct usb_attach_arg *uaa = aux
306 /* Returns from attach */
307 #define USB_ATTACH_ERROR_RETURN return
308 #define USB_ATTACH_SUCCESS_RETURN return
310 #define USB_ATTACH_SETUP printf("\n")
312 #define USB_DETACH(dname) \
314 __CONCAT(dname,_detach)(self, flags) \
315 struct device *self; \
318 #define USB_DETACH_START(dname, sc) \
319 struct __CONCAT(dname,_softc) *sc = \
320 (struct __CONCAT(dname,_softc) *)self
322 #define USB_GET_SC_OPEN(dname, unit, sc) \
323 if (unit >= __CONCAT(dname,_cd).cd_ndevs) \
325 sc = __CONCAT(dname,_cd).cd_devs[unit]; \
329 #define USB_GET_SC(dname, unit, sc) \
330 sc = __CONCAT(dname,_cd).cd_devs[unit]
332 #define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
333 (config_found_sm(parent, args, print, sub))
335 #elif defined(__DragonFly__)
336 /***************************************************************************
342 #include <sys/malloc.h>
344 MALLOC_DECLARE(M_USB);
345 MALLOC_DECLARE(M_USBDEV);
346 MALLOC_DECLARE(M_USBHC);
352 /* We don't use the soft interrupt code in FreeBSD. */
353 /* #undef USB_USE_SOFTINTR */
355 #define Static static
357 #define device_ptr_t device_t
358 #define USBBASEDEVICE device_t
359 #define USBDEV(bdev) (bdev)
360 #define USBDEVNAME(bdev) device_get_nameunit(bdev)
361 #define USBDEVUNIT(bdev) device_get_unit(bdev)
362 #define USBDEVPTRNAME(bdev) device_get_nameunit(bdev)
363 #define USBDEVUNIT(bdev) device_get_unit(bdev)
364 #define USBGETSOFTC(bdev) (device_get_softc(bdev))
366 #define DECLARE_USB_DMA_T \
367 struct usb_dma_block; \
369 struct usb_dma_block *block; \
375 #define PROC_UNLOCK(p)
376 #define uio_procp uio_td
378 #define selwakeuppri(p, pri) selwakeup(p)
380 typedef struct thread *usb_proc_ptr;
382 /* XXX Change this when FreeBSD has memset */
383 #define memcpy(d, s, l) bcopy((s),(d),(l))
384 #define memset(d, v, l) bzero((d),(l))
386 #define config_pending_incr()
387 #define config_pending_decr()
389 #define usb_kthread_create(f, s) \
390 kthread_create(f, s, NULL, "dummy")
391 #define usb_kthread_create1(f, s, p, name, arg) \
392 kthread_create(f, s, p, name, arg)
393 #define usb_kthread_create2(f, s, p, name) \
394 kthread_create(f, s, p, name)
396 typedef struct callout usb_callout_t;
397 #define usb_callout_init(h) callout_init(&(h))
398 #define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d))
399 #define usb_uncallout(h, f, d) callout_stop(&(h))
401 #define usb_lockmgr lockmgr
403 #define ETHER_ALIGN 2
405 #define clalloc(p, s, x) (clist_alloc_cblocks((p), (s), (s)), 0)
406 #define clfree(p) clist_free_cblocks((p))
409 #define PWR_SUSPEND 1
411 #define config_detach(dev, flag) device_delete_child(device_get_parent(dev), dev)
413 typedef struct malloc_type *usb_malloc_type;
415 #define USB_DECLARE_DRIVER_INIT(dname, init...) \
416 Static device_probe_t __CONCAT(dname,_match); \
417 Static device_attach_t __CONCAT(dname,_attach); \
418 Static device_detach_t __CONCAT(dname,_detach); \
420 Static devclass_t __CONCAT(dname,_devclass); \
422 Static device_method_t __CONCAT(dname,_methods)[] = { \
423 DEVMETHOD(device_probe, __CONCAT(dname,_match)), \
424 DEVMETHOD(device_attach, __CONCAT(dname,_attach)), \
425 DEVMETHOD(device_detach, __CONCAT(dname,_detach)), \
430 Static driver_t __CONCAT(dname,_driver) = { \
432 __CONCAT(dname,_methods), \
433 sizeof(struct __CONCAT(dname,_softc)) \
435 MODULE_DEPEND(dname, usb, 1, 1, 1)
438 #define METHODS_NONE {0,0}
439 #define USB_DECLARE_DRIVER(dname) USB_DECLARE_DRIVER_INIT(dname, METHODS_NONE)
441 #define USB_MATCH(dname) \
443 __CONCAT(dname,_match)(device_t self)
445 #define USB_MATCH_START(dname, uaa) \
446 struct usb_attach_arg *uaa = device_get_ivars(self)
448 #define USB_MATCH_SETUP \
451 #define USB_ATTACH(dname) \
453 __CONCAT(dname,_attach)(device_t self)
455 #define USB_ATTACH_START(dname, sc, uaa) \
456 struct __CONCAT(dname,_softc) *sc = device_get_softc(self); \
457 struct usb_attach_arg *uaa = device_get_ivars(self)
459 /* Returns from attach */
460 #define USB_ATTACH_ERROR_RETURN return ENXIO
461 #define USB_ATTACH_SUCCESS_RETURN return 0
463 #define USB_ATTACH_SETUP \
465 device_set_desc_copy(self, devinfo)
467 #define USB_DETACH(dname) \
469 __CONCAT(dname,_detach)(device_t self)
471 #define USB_DETACH_START(dname, sc) \
472 struct __CONCAT(dname,_softc) *sc = device_get_softc(self)
474 #define USB_GET_SC_OPEN(dname, unit, sc) \
475 sc = devclass_get_softc(__CONCAT(dname,_devclass), unit); \
479 #define USB_GET_SC(dname, unit, sc) \
480 sc = devclass_get_softc(__CONCAT(dname,_devclass), unit)
482 #define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
483 (device_probe_and_attach((bdev)) == 0 ? (bdev) : 0)
485 /* conversion from one type of queue to the other */
486 #define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD
487 #define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD
488 #define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL
489 #define SIMPLEQ_NEXT STAILQ_NEXT
490 #define SIMPLEQ_FIRST STAILQ_FIRST
491 #define SIMPLEQ_HEAD STAILQ_HEAD
492 #define SIMPLEQ_EMPTY STAILQ_EMPTY
493 #define SIMPLEQ_FOREACH STAILQ_FOREACH
494 #define SIMPLEQ_INIT STAILQ_INIT
495 #define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER
496 #define SIMPLEQ_ENTRY STAILQ_ENTRY
498 #include <sys/syslog.h>
500 #define logprintf(args...) log(LOG_DEBUG, args)
502 #define logprintf printf
505 SYSCTL_DECL(_hw_usb);
508 #elif defined(__FreeBSD__) || defined(__DragonFly__)
509 /***************************************************************************
516 #include <sys/malloc.h>
518 MALLOC_DECLARE(M_USB);
519 MALLOC_DECLARE(M_USBDEV);
520 MALLOC_DECLARE(M_USBHC);
526 /* We don't use the soft interrupt code in FreeBSD. */
528 #define USB_USE_SOFTINTR
531 #define Static static
533 #define device_ptr_t device_t
534 #define USBBASEDEVICE device_t
535 #define USBDEV(bdev) (bdev)
536 #define USBDEVNAME(bdev) device_get_nameunit(bdev)
537 #define USBDEVUNIT(bdev) device_get_unit(bdev)
538 #define USBDEVPTRNAME(bdev) device_get_nameunit(bdev)
539 #define USBDEVUNIT(bdev) device_get_unit(bdev)
540 #define USBGETSOFTC(bdev) (device_get_softc(bdev))
542 #define DECLARE_USB_DMA_T \
543 struct usb_dma_block; \
545 struct usb_dma_block *block; \
550 #if defined(__FreeBSD__) && __FreeBSD_version >= 500000
551 typedef struct thread *usb_proc_ptr;
553 #define uio_procp uio_td
555 #define usb_kthread_create1(f, s, p, a0, a1) \
556 kthread_create((f), (s), (p), RFHIGHPID, 0, (a0), (a1))
557 #define usb_kthread_create2(f, s, p, a0) \
558 kthread_create((f), (s), (p), RFHIGHPID, 0, (a0))
559 #define usb_kthread_create kthread_create
561 #define config_pending_incr()
562 #define config_pending_decr()
564 typedef struct callout usb_callout_t;
565 #define usb_callout_init(h) callout_init(&(h), 0)
566 #define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d))
567 #define usb_uncallout(h, f, d) callout_stop(&(h))
569 typedef struct proc *usb_proc_ptr;
572 #define PROC_UNLOCK(p)
574 #define usb_kthread_create1(f, s, p, a0, a1) \
575 kthread_create((f), (s), (p), (a0), (a1))
576 #define usb_kthread_create2(f, s, p, a0) \
577 kthread_create((f), (s), (p), (a0))
578 #define usb_kthread_create kthread_create
580 #define config_pending_incr()
581 #define config_pending_decr()
583 typedef struct callout usb_callout_t;
584 #define usb_callout_init(h) callout_init(&(h))
585 #define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d))
586 #define usb_uncallout(h, f, d) callout_stop(&(h))
589 #define clalloc(p, s, x) (clist_alloc_cblocks((p), (s), (s)), 0)
590 #define clfree(p) clist_free_cblocks((p))
593 #define PWR_SUSPEND 1
595 #define config_detach(dev, flag) device_delete_child(device_get_parent(dev), dev)
597 typedef struct malloc_type *usb_malloc_type;
599 #define USB_DECLARE_DRIVER_INIT(dname, init...) \
600 Static device_probe_t __CONCAT(dname,_match); \
601 Static device_attach_t __CONCAT(dname,_attach); \
602 Static device_detach_t __CONCAT(dname,_detach); \
604 Static devclass_t __CONCAT(dname,_devclass); \
606 Static device_method_t __CONCAT(dname,_methods)[] = { \
607 DEVMETHOD(device_probe, __CONCAT(dname,_match)), \
608 DEVMETHOD(device_attach, __CONCAT(dname,_attach)), \
609 DEVMETHOD(device_detach, __CONCAT(dname,_detach)), \
614 Static driver_t __CONCAT(dname,_driver) = { \
616 __CONCAT(dname,_methods), \
617 sizeof(struct __CONCAT(dname,_softc)) \
619 MODULE_DEPEND(dname, usb, 1, 1, 1)
622 #define METHODS_NONE {0,0}
623 #define USB_DECLARE_DRIVER(dname) USB_DECLARE_DRIVER_INIT(dname, METHODS_NONE)
625 #define USB_MATCH(dname) \
627 __CONCAT(dname,_match)(device_t self)
629 #define USB_MATCH_START(dname, uaa) \
630 struct usb_attach_arg *uaa = device_get_ivars(self)
632 #define USB_MATCH_SETUP \
635 #define USB_ATTACH(dname) \
637 __CONCAT(dname,_attach)(device_t self)
639 #define USB_ATTACH_START(dname, sc, uaa) \
640 struct __CONCAT(dname,_softc) *sc = device_get_softc(self); \
641 struct usb_attach_arg *uaa = device_get_ivars(self)
643 /* Returns from attach */
644 #define USB_ATTACH_ERROR_RETURN return ENXIO
645 #define USB_ATTACH_SUCCESS_RETURN return 0
647 #define USB_ATTACH_SETUP \
649 device_set_desc_copy(self, devinfo)
651 #define USB_DETACH(dname) \
653 __CONCAT(dname,_detach)(device_t self)
655 #define USB_DETACH_START(dname, sc) \
656 struct __CONCAT(dname,_softc) *sc = device_get_softc(self)
658 #define USB_GET_SC_OPEN(dname, unit, sc) \
659 sc = devclass_get_softc(__CONCAT(dname,_devclass), unit); \
663 #define USB_GET_SC(dname, unit, sc) \
664 sc = devclass_get_softc(__CONCAT(dname,_devclass), unit)
666 #define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \
667 (device_probe_and_attach((bdev)) == 0 ? (bdev) : 0)
669 /* conversion from one type of queue to the other */
670 #define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD
671 #define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD
672 #define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL
673 #define SIMPLEQ_NEXT STAILQ_NEXT
674 #define SIMPLEQ_FIRST STAILQ_FIRST
675 #define SIMPLEQ_HEAD STAILQ_HEAD
676 #define SIMPLEQ_EMPTY STAILQ_EMPTY
677 #define SIMPLEQ_FOREACH STAILQ_FOREACH
678 #define SIMPLEQ_INIT STAILQ_INIT
679 #define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER
680 #define SIMPLEQ_ENTRY STAILQ_ENTRY
682 #include <sys/syslog.h>
684 #define logprintf(args...) log(LOG_DEBUG, args)
686 #define logprintf printf
689 SYSCTL_DECL(_hw_usb);
692 #endif /* __FreeBSD__ */
694 #endif /* _USB_PORT_H */