Add a way to do control transfers on other pipes than the default pipe.

This commit is contained in:
augustss 2000-09-23 21:02:04 +00:00
parent 6417d32d9d
commit d9c7baa183
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: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
/*
@ -884,6 +884,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;
@ -903,7 +911,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.43 2000/06/01 14:29:02 augustss Exp $ */
/* $NetBSD: usbdi.h,v 1.44 2000/09/23 21:02:04 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
/*
@ -142,6 +142,9 @@ usbd_status usbd_do_request_async(usbd_device_handle pipe,
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(usbd_device_handle dev);