diff options
Diffstat (limited to 'sys/dev/usb/usbdi.c')
-rw-r--r-- | sys/dev/usb/usbdi.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 069457a94a6..9e2570cf152 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.c,v 1.19 2002/07/09 17:41:02 nate Exp $ */ +/* $OpenBSD: usbdi.c,v 1.20 2002/07/25 02:18:11 nate Exp $ */ /* $NetBSD: usbdi.c,v 1.81 2001/04/17 00:05:33 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -78,7 +78,7 @@ extern int usbdebug; #endif Static usbd_status usbd_ar_pipe(usbd_pipe_handle pipe); -Static void usbd_do_request_async_cb +Static void usbd_do_request_async_cb (usbd_xfer_handle, usbd_private_handle, usbd_status); Static void usbd_start_next(usbd_pipe_handle pipe); Static usbd_status usbd_open_pipe_ival @@ -124,18 +124,18 @@ usbd_dump_queue(usbd_pipe_handle pipe) } #endif -usbd_status +usbd_status usbd_open_pipe(usbd_interface_handle iface, u_int8_t address, u_int8_t flags, usbd_pipe_handle *pipe) -{ - return (usbd_open_pipe_ival(iface, address, flags, pipe, +{ + return (usbd_open_pipe_ival(iface, address, flags, pipe, USBD_DEFAULT_INTERVAL)); } -usbd_status +usbd_status usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address, u_int8_t flags, usbd_pipe_handle *pipe, int ival) -{ +{ usbd_pipe_handle p; struct usbd_endpoint *ep; usbd_status err; @@ -163,7 +163,7 @@ usbd_open_pipe_ival(usbd_interface_handle iface, u_int8_t address, return (USBD_NORMAL_COMPLETION); } -usbd_status +usbd_status usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address, u_int8_t flags, usbd_pipe_handle *pipe, usbd_private_handle priv, void *buffer, u_int32_t len, @@ -176,7 +176,7 @@ usbd_open_pipe_intr(usbd_interface_handle iface, u_int8_t address, DPRINTFN(3,("usbd_open_pipe_intr: address=0x%x flags=0x%x len=%d\n", address, flags, len)); - err = usbd_open_pipe_ival(iface, address, USBD_EXCLUSIVE_USE, + err = usbd_open_pipe_ival(iface, address, USBD_EXCLUSIVE_USE, &ipipe, ival); if (err) return (err); @@ -269,7 +269,7 @@ usbd_transfer(usbd_xfer_handle xfer) } /* Copy data if going out. */ - if (!(xfer->flags & USBD_NO_COPY) && size != 0 && + if (!(xfer->flags & USBD_NO_COPY) && size != 0 && !usbd_xfer_isread(xfer)) memcpy(KERNADDR(dmap), xfer->buffer, size); @@ -343,7 +343,7 @@ usbd_get_buffer(usbd_xfer_handle xfer) return (KERNADDR(&xfer->dmabuf)); } -usbd_xfer_handle +usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev) { usbd_xfer_handle xfer; @@ -357,7 +357,7 @@ usbd_alloc_xfer(usbd_device_handle dev) return (xfer); } -usbd_status +usbd_status usbd_free_xfer(usbd_xfer_handle xfer) { DPRINTFN(5,("usbd_free_xfer: %p\n", xfer)); @@ -484,7 +484,7 @@ usbd_interface2endpoint_descriptor(usbd_interface_handle iface, u_int8_t index) return (iface->endpoints[index].edesc); } -usbd_status +usbd_status usbd_abort_pipe(usbd_pipe_handle pipe) { usbd_status err; @@ -501,8 +501,8 @@ usbd_abort_pipe(usbd_pipe_handle pipe) splx(s); return (err); } - -usbd_status + +usbd_status usbd_clear_endpoint_stall(usbd_pipe_handle pipe) { usbd_device_handle dev = pipe->device; @@ -511,7 +511,7 @@ usbd_clear_endpoint_stall(usbd_pipe_handle pipe) DPRINTFN(8, ("usbd_clear_endpoint_stall\n")); - /* + /* * Clearing en endpoint stall resets the enpoint toggle, so * do the same to the HC toggle. */ @@ -533,7 +533,7 @@ XXX should we do this? return (err); } -usbd_status +usbd_status usbd_clear_endpoint_stall_async(usbd_pipe_handle pipe) { usbd_device_handle dev = pipe->device; @@ -558,7 +558,7 @@ usbd_clear_endpoint_toggle(usbd_pipe_handle pipe) pipe->methods->cleartoggle(pipe); } -usbd_status +usbd_status usbd_endpoint_count(usbd_interface_handle iface, u_int8_t *count) { #ifdef DIAGNOSTIC @@ -571,7 +571,7 @@ usbd_endpoint_count(usbd_interface_handle iface, u_int8_t *count) return (USBD_NORMAL_COMPLETION); } -usbd_status +usbd_status usbd_interface_count(usbd_device_handle dev, u_int8_t *count) { if (dev->cdesc == NULL) @@ -580,7 +580,7 @@ usbd_interface_count(usbd_device_handle dev, u_int8_t *count) return (USBD_NORMAL_COMPLETION); } -usbd_status +usbd_status usbd_interface2device_handle(usbd_interface_handle iface, usbd_device_handle *dev) { @@ -588,7 +588,7 @@ usbd_interface2device_handle(usbd_interface_handle iface, return (USBD_NORMAL_COMPLETION); } -usbd_status +usbd_status usbd_device2interface_handle(usbd_device_handle dev, u_int8_t ifaceno, usbd_interface_handle *iface) { @@ -651,7 +651,7 @@ usbd_get_no_alts(usb_config_descriptor_t *cdesc, int ifaceno) for (n = 0; p < end; p += d->bLength) { d = (usb_interface_descriptor_t *)p; - if (p + d->bLength <= end && + if (p + d->bLength <= end && d->bDescriptorType == UDESC_INTERFACE && d->bInterfaceNumber == ifaceno) n++; @@ -696,7 +696,7 @@ usbd_ar_pipe(usbd_pipe_handle pipe) pipe->repeat = 0; pipe->aborting = 1; while ((xfer = SIMPLEQ_FIRST(&pipe->queue)) != NULL) { - DPRINTFN(2,("usbd_ar_pipe: pipe=%p xfer=%p (methods=%p)\n", + DPRINTFN(2,("usbd_ar_pipe: pipe=%p xfer=%p (methods=%p)\n", pipe, xfer, pipe->methods)); /* Make the HC abort it (and invoke the callback). */ pipe->methods->abort(xfer); @@ -761,7 +761,7 @@ usb_transfer_complete(usbd_xfer_handle xfer) #endif SIMPLEQ_REMOVE_HEAD(&pipe->queue, xfer, next); } - DPRINTFN(5,("usb_transfer_complete: repeat=%d new head=%p\n", + DPRINTFN(5,("usb_transfer_complete: repeat=%d new head=%p\n", repeat, SIMPLEQ_FIRST(&pipe->queue))); /* Count completed transfers. */ @@ -809,7 +809,7 @@ usb_insert_transfer(usbd_xfer_handle xfer) usbd_status err; int s; - DPRINTFN(5,("usb_insert_transfer: pipe=%p running=%d timeout=%d\n", + DPRINTFN(5,("usb_insert_transfer: pipe=%p running=%d timeout=%d\n", pipe, pipe->running, xfer->timeout)); s = splusb(); SIMPLEQ_INSERT_TAIL(&pipe->queue, xfer, next); @@ -869,7 +869,7 @@ usbd_status usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req, void *data, u_int16_t flags, int *actlen, u_int32_t timo) { - return (usbd_do_request_flags_pipe(dev, dev->default_pipe, req, + return (usbd_do_request_flags_pipe(dev, dev->default_pipe, req, data, flags, actlen, timo)); } @@ -905,14 +905,14 @@ usbd_do_request_flags_pipe(usbd_device_handle dev, usbd_pipe_handle pipe, "%02x val=%d index=%d rlen=%d length=%d actlen=%d\n", dev->address, xfer->request.bmRequestType, xfer->request.bRequest, UGETW(xfer->request.wValue), - UGETW(xfer->request.wIndex), - UGETW(xfer->request.wLength), + UGETW(xfer->request.wIndex), + UGETW(xfer->request.wLength), xfer->length, xfer->actlen)); #endif if (actlen != NULL) *actlen = xfer->actlen; if (err == USBD_STALLED) { - /* + /* * The control endpoint has stalled. Control endpoints * should not halt, but some may do so anyway so clear * any halt condition. @@ -962,11 +962,11 @@ usbd_do_request_async_cb(usbd_xfer_handle xfer, usbd_private_handle priv, if (xfer->actlen > xfer->length) DPRINTF(("usbd_do_request: overrun addr=%d type=0x%02x req=0x" "%02x val=%d index=%d rlen=%d length=%d actlen=%d\n", - xfer->pipe->device->address, + xfer->pipe->device->address, xfer->request.bmRequestType, xfer->request.bRequest, UGETW(xfer->request.wValue), - UGETW(xfer->request.wIndex), - UGETW(xfer->request.wLength), + UGETW(xfer->request.wIndex), + UGETW(xfer->request.wLength), xfer->length, xfer->actlen)); #endif usbd_free_xfer(xfer); @@ -1080,7 +1080,7 @@ int usbd_driver_load(module_t mod, int what, void *arg) { /* XXX should implement something like a function that removes all generic devices */ - + return (0); } |