From d262a59fb260e380b1eea63660e2af6430b47e85 Mon Sep 17 00:00:00 2001 From: Josef Karthauser Date: Mon, 1 Apr 2002 17:30:24 +0000 Subject: [PATCH] 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. --- sys/dev/usb/usbdi.c | 13 +++++++++++-- sys/dev/usb/usbdi.h | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 171161df867f..ae40185aac46 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -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) diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index 839832cdf5f3..cc0d7c7f263b 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -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