Merge from NetBSD: usbdi.c rev 1.77, usbdi.h rev 1.44

date: 2000/09/23 21:02:04;  author: augustss;
    Add a way to do control transfers on other pipes than the default pipe.
This commit is contained in:
joe 2002-04-01 17:30:24 +00:00
parent 2c7908baab
commit 05e8567b72
2 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi.c,v 1.76 2000/06/06 11:36:21 augustss Exp $ */
/* $NetBSD: usbdi.c,v 1.77 2000/09/23 21:02:04 augustss Exp $ */
/* $FreeBSD$ */
/*
@ -882,6 +882,14 @@ usbd_do_request(usbd_device_handle dev, usb_device_request_t *req, void *data)
usbd_status
usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req,
void *data, u_int16_t flags, int *actlen)
{
return (usbd_do_request_flags_pipe(dev, dev->default_pipe, req,
data, flags, actlen));
}
usbd_status
usbd_do_request_flags_pipe(usbd_device_handle dev, usbd_pipe_handle pipe,
usb_device_request_t *req, void *data, u_int16_t flags, int *actlen)
{
usbd_xfer_handle xfer;
usbd_status err;
@ -901,7 +909,8 @@ usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req,
if (xfer == NULL)
return (USBD_NOMEM);
usbd_setup_default_xfer(xfer, dev, 0, USBD_DEFAULT_TIMEOUT, req,
data, UGETW(req->wLength), flags, 0);
data, UGETW(req->wLength), flags, 0);
xfer->pipe = pipe;
err = usbd_sync_transfer(xfer);
#if defined(USB_DEBUG) || defined(DIAGNOSTIC)
if (xfer->actlen > xfer->length)

View File

@ -1,4 +1,4 @@
/* $NetBSD: usbdi.h,v 1.40 2000/02/02 07:34:00 augustss Exp $ */
/* $NetBSD: usbdi.h,v 1.44 2000/09/23 21:02:04 augustss Exp $ */
/* $FreeBSD$ */
/*
@ -151,6 +151,9 @@ usbd_status usbd_do_request_async
usbd_status usbd_do_request_flags
(usbd_device_handle pipe, usb_device_request_t *req,
void *data, u_int16_t flags, int *);
usbd_status usbd_do_request_flags_pipe(
usbd_device_handle dev, usbd_pipe_handle pipe,
usb_device_request_t *req, void *data, u_int16_t flags, int *actlen);
usb_interface_descriptor_t *usbd_get_interface_descriptor
(usbd_interface_handle iface);
usb_config_descriptor_t *usbd_get_config_descriptor