summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_mem.c
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2003-07-08 13:19:10 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2003-07-08 13:19:10 +0000
commite375f3615c7463097f3e178339aad0f6ec36c197 (patch)
tree5080b79ebe15758c7db466ea511c6083b4d9fad2 /sys/dev/usb/usb_mem.c
parent18791832a5c844c5d36cd0f7afaf4e92d40bcd09 (diff)
Sync USB code with NetBSD.
This includes numerous fixes and paves the way for usb 2.0 support.
Diffstat (limited to 'sys/dev/usb/usb_mem.c')
-rw-r--r--sys/dev/usb/usb_mem.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c
index bd917fd6486..311c37c949c 100644
--- a/sys/dev/usb/usb_mem.c
+++ b/sys/dev/usb/usb_mem.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: usb_mem.c,v 1.13 2002/07/25 02:18:11 nate Exp $ */
-/* $NetBSD: usb_mem.c,v 1.22 2001/11/13 06:24:56 lukem Exp $ */
+/* $OpenBSD: usb_mem.c,v 1.14 2003/07/08 13:19:09 nate Exp $ */
+/* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,12 +65,18 @@
#ifdef USB_DEBUG
#define DPRINTF(x) if (usbdebug) logprintf x
#define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x
-int usbdebug;
+extern int usbdebug;
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
#endif
+#if defined(__NetBSD__)
+MALLOC_DEFINE(M_USB, "USB", "USB misc. memory");
+MALLOC_DEFINE(M_USBDEV, "USB device", "USB device driver");
+MALLOC_DEFINE(M_USBHC, "USB HC", "USB host controller");
+#endif
+
#define USB_MEM_SMALL 64
#define USB_MEM_CHUNKS 64
#define USB_MEM_BLOCK (USB_MEM_SMALL * USB_MEM_CHUNKS)
@@ -270,7 +276,7 @@ usb_freemem(usbd_bus_handle bus, usb_dma_t *p)
usb_block_freemem(p->block);
return;
}
- f = KERNADDR(p);
+ f = KERNADDR(p, 0);
f->block = p->block;
f->offs = p->offs;
s = splusb();