diff options
Diffstat (limited to 'sys/dev/usb/usb_port.h')
-rw-r--r-- | sys/dev/usb/usb_port.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index dc2c648..4d9a6a5 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -1,5 +1,5 @@ /* $OpenBSD: usb_port.h,v 1.18 2000/09/06 22:42:10 rahnds Exp $ */ -/* $NetBSD: usb_port.h,v 1.54 2002/03/28 21:49:19 ichiro Exp $ */ +/* $NetBSD: usb_port.h,v 1.68 2005/07/30 06:14:50 skrll Exp $ */ /* $FreeBSD$ */ /* Also already merged from NetBSD: @@ -58,6 +58,15 @@ #include "opt_usbverbose.h" +#if defined(_KERNEL) +#include <sys/mallocvar.h> + +MALLOC_DECLARE(M_USB); +MALLOC_DECLARE(M_USBDEV); +MALLOC_DECLARE(M_USBHC); + +#endif + #define USB_USE_SOFTINTR #ifdef USB_DEBUG @@ -93,7 +102,7 @@ typedef struct callout usb_callout_t; #define usb_kthread_create1 kthread_create1 #define usb_kthread_create kthread_create -typedef int usb_malloc_type; +typedef struct malloc_type *usb_malloc_type; #define Ether_ifattach ether_ifattach #define IF_INPUT(ifp, m) (*(ifp)->if_input)((ifp), (m)) @@ -155,7 +164,8 @@ int __CONCAT(dname,_detach)(struct device *self, int flags) sc = __CONCAT(dname,_cd).cd_devs[unit] #define USB_DO_ATTACH(dev, bdev, parent, args, print, sub) \ - (config_found_sm(parent, args, print, sub)) + (config_found_sm_loc(parent, (args)->port == 0 ? "usb" : "uhub", \ + NULL, args, print, sub)) #elif defined(__OpenBSD__) /* @@ -202,6 +212,8 @@ typedef struct proc *usb_proc_ptr; #define usb_kthread_create1 kthread_create #define usb_kthread_create kthread_create_deferred +#define usb_lockmgr(lk, mode, ptr) lockmgr(lk, mode, ptr, curproc) + #define config_pending_incr() #define config_pending_decr() @@ -220,7 +232,6 @@ typedef int usb_malloc_type; #define usbpoll usbselect #define uhidpoll uhidselect #define ugenpoll ugenselect -#define uriopoll urioselect #define uscannerpoll uscannerselect #define powerhook_establish(fn, sc) (fn) @@ -407,6 +418,8 @@ typedef struct callout usb_callout_t; #define usb_callout(h, t, f, d) callout_reset(&(h), (t), (f), (d)) #define usb_uncallout(h, f, d) callout_stop(&(h)) +#define usb_lockmgr lockmgr + #define BUS_DMA_COHERENT 0 #define ETHER_ALIGN 2 #define BPF_MTAP(ifp, m) if ((ifp)->if_bpf) bpf_mtap((ifp), (m)); |