diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-10-31 12:43:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-10-31 12:43:34 +0000 |
commit | ef3ccf0f04bf21507bcd6680d0f0de00189b9c3e (patch) | |
tree | 371c36cee90b56c0122bfba2757d9abb4b879335 /sys/dev/usb | |
parent | 293febad156729395747f999389cb9d886080da6 (diff) |
Use understandable messages when the per-xfer poison value is incorrect.
Prodded by a comment from stsp@.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/usbdi.c | 19 | ||||
-rw-r--r-- | sys/dev/usb/usbdivar.h | 6 |
2 files changed, 10 insertions, 15 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 4b62400f572..c967ce4713b 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.c,v 1.73 2014/09/26 09:31:08 guenther Exp $ */ +/* $OpenBSD: usbdi.c,v 1.74 2014/10/31 12:43:33 mpi Exp $ */ /* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -396,7 +396,7 @@ usbd_alloc_xfer(struct usbd_device *dev) if (xfer == NULL) return (NULL); #ifdef DIAGNOSTIC - xfer->busy_free = XFER_BUSY; + xfer->busy_free = XFER_FREE; #endif xfer->device = dev; timeout_set(&xfer->timeout_handle, NULL, NULL); @@ -411,9 +411,8 @@ usbd_free_xfer(struct usbd_xfer *xfer) if (xfer->rqflags & (URQ_DEV_DMABUF | URQ_AUTO_DMABUF)) usbd_free_buffer(xfer); #ifdef DIAGNOSTIC - if (xfer->busy_free != XFER_BUSY) { - printf("%s: xfer=%p not busy, 0x%08x\n", __func__, xfer, - xfer->busy_free); + if (xfer->busy_free != XFER_FREE) { + printf("%s: xfer=%p not free\n", __func__, xfer); return; } #endif @@ -718,8 +717,7 @@ usb_transfer_complete(struct usbd_xfer *xfer) "actlen=%d\n", pipe, xfer, xfer->status, xfer->actlen)); #ifdef DIAGNOSTIC if (xfer->busy_free != XFER_ONQU) { - printf("usb_transfer_complete: xfer=%p not busy 0x%08x\n", - xfer, xfer->busy_free); + printf("%s: xfer=%p not on queue\n", __func__, xfer); return; } #endif @@ -762,7 +760,7 @@ usb_transfer_complete(struct usbd_xfer *xfer) if (xfer != SIMPLEQ_FIRST(&pipe->queue)) printf("usb_transfer_complete: bad dequeue %p != %p\n", xfer, SIMPLEQ_FIRST(&pipe->queue)); - xfer->busy_free = XFER_BUSY; + xfer->busy_free = XFER_FREE; #endif SIMPLEQ_REMOVE_HEAD(&pipe->queue, next); } @@ -825,9 +823,8 @@ usb_insert_transfer(struct usbd_xfer *xfer) DPRINTFN(5,("usb_insert_transfer: pipe=%p running=%d timeout=%d\n", pipe, pipe->running, xfer->timeout)); #ifdef DIAGNOSTIC - if (xfer->busy_free != XFER_BUSY) { - printf("usb_insert_transfer: xfer=%p not busy 0x%08x\n", xfer, - xfer->busy_free); + if (xfer->busy_free != XFER_FREE) { + printf("%s: xfer=%p not free\n", __func__, xfer); return (USBD_INVAL); } xfer->busy_free = XFER_ONQU; diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h index 6b9c2a88fea..100ee85a916 100644 --- a/sys/dev/usb/usbdivar.h +++ b/sys/dev/usb/usbdivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdivar.h,v 1.63 2014/10/30 23:50:25 mpi Exp $ */ +/* $OpenBSD: usbdivar.h,v 1.64 2014/10/31 12:43:33 mpi Exp $ */ /* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */ @@ -192,7 +192,7 @@ struct usbd_xfer { volatile char done; #ifdef DIAGNOSTIC u_int32_t busy_free; -#define XFER_BUSY 0x42555359 +#define XFER_FREE 0x42555359 #define XFER_ONQU 0x4f4e5155 #endif @@ -220,13 +220,11 @@ struct usbd_xfer { struct timeout timeout_handle; }; -#ifdef USB_DEBUG void usbd_dump_iface(struct usbd_interface *); void usbd_dump_device(struct usbd_device *); void usbd_dump_endpoint(struct usbd_endpoint *); void usbd_dump_queue(struct usbd_pipe *); void usbd_dump_pipe(struct usbd_pipe *); -#endif /* Routines from usb_subr.c */ int usbctlprint(void *, const char *); |