summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-05-06 18:23:36 +0000
committerjoe <joe@FreeBSD.org>2002-05-06 18:23:36 +0000
commit06d090201082aed150ddddb16d8da5721b05c296 (patch)
tree095a2aa1fe3247d0faa299940e67e2a2b5357fa2 /sys/dev
parent977bd7ea63183b1c8c12248ed022fa4066d91a17 (diff)
downloadFreeBSD-src-06d090201082aed150ddddb16d8da5721b05c296.zip
FreeBSD-src-06d090201082aed150ddddb16d8da5721b05c296.tar.gz
MFNetBSD: ugen.c (1.57), ulpt.c (1.48), usb.c (1.67), usbdi.c (1.96),
usbdi.h (1.60) (and local changes compatibility changes to ufm.c and urio.c) date: 2002/02/11 15:11:49; author: augustss; Give usbd_do_request_flags() an extra argument for the timeout.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ufm.c3
-rw-r--r--sys/dev/usb/ugen.c15
-rw-r--r--sys/dev/usb/ulpt.c4
-rw-r--r--sys/dev/usb/urio.c3
-rw-r--r--sys/dev/usb/usb.c5
-rw-r--r--sys/dev/usb/usbdi.c18
-rw-r--r--sys/dev/usb/usbdi.h7
7 files changed, 27 insertions, 28 deletions
diff --git a/sys/dev/usb/ufm.c b/sys/dev/usb/ufm.c
index 403ee05..0ad7679 100644
--- a/sys/dev/usb/ufm.c
+++ b/sys/dev/usb/ufm.c
@@ -274,7 +274,8 @@ ufm_do_req(struct ufm_softc *sc, u_int8_t reqtype, u_int8_t request,
USETW(req.wValue, value);
USETW(req.wIndex, index);
USETW(req.wLength, len);
- err = usbd_do_request_flags(sc->sc_udev, &req, retbuf, 0, NULL);
+ err = usbd_do_request_flags(sc->sc_udev, &req, retbuf, 0, NULL,
+ USBD_DEFAULT_TIMEOUT);
splx(s);
if (err) {
printf("usbd_do_request_flags returned %#x\n", err);
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 31726f5..3e3327d 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ugen.c,v 1.51 2001/11/13 07:59:32 augustss Exp $ */
+/* $NetBSD: ugen.c,v 1.57 2002/02/11 15:11:49 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -487,6 +487,7 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
usbd_free_xfer(sce->isoreqs[i].xfer);
return (ENOMEM);
case UE_CONTROL:
+ sce->timeout = USBD_DEFAULT_TIMEOUT;
return (EINVAL);
}
}
@@ -1112,18 +1113,9 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
sce->state &= ~UGEN_SHORT_OK;
return (0);
case USB_SET_TIMEOUT:
- if (endpt == USB_CONTROL_ENDPOINT) {
- /* XXX the lower levels don't support this yet. */
- return (EINVAL);
- }
sce = &sc->sc_endpoints[endpt][IN];
if (sce == NULL)
return (EINVAL);
-
- if (sce->pipeh == NULL) {
- printf("ugenioctl: USB_SET_TIMEOUT, no pipe\n");
- return (EIO);
- }
sce->timeout = *(int *)addr;
return (0);
default:
@@ -1316,8 +1308,9 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
goto ret;
}
}
+ sce = &sc->sc_endpoints[endpt][IN];
err = usbd_do_request_flags(sc->sc_udev, &ur->ucr_request,
- ptr, ur->ucr_flags, &ur->ucr_actlen);
+ ptr, ur->ucr_flags, &ur->ucr_actlen, sce->timeout);
if (err) {
error = EIO;
goto ret;
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index 0c6844d..97e1709 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ulpt.c,v 1.46 2001/12/31 12:15:21 augustss Exp $ */
+/* $NetBSD: ulpt.c,v 1.48 2002/02/11 15:11:49 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -309,7 +309,7 @@ USB_ATTACH(ulpt)
USETW2(req.wIndex, id->bInterfaceNumber, id->bAlternateSetting);
USETW(req.wLength, sizeof devinfo - 1);
err = usbd_do_request_flags(dev, &req, devinfo, USBD_SHORT_XFER_OK,
- &alen);
+ &alen, USBD_DEFAULT_TIMEOUT);
if (err) {
printf("%s: cannot get device id\n", USBDEVNAME(sc->sc_dev));
} else if (alen <= 2) {
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index b1a28a6..10049c1 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -576,7 +576,8 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
}
r = usbd_do_request_flags(sc->sc_udev, &req,
- ptr, req_flags, &req_actlen);
+ ptr, req_flags, &req_actlen,
+ USBD_DEFAULT_TIMEOUT);
if (r == USBD_NORMAL_COMPLETION) {
error = 0;
if (len != 0) {
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index b748b38..0874ff5 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.c,v 1.66 2002/02/03 18:15:21 augustss Exp $ */
+/* $NetBSD: usb.c,v 1.67 2002/02/11 15:11:49 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -613,7 +613,8 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
}
}
err = usbd_do_request_flags(sc->sc_bus->devices[addr],
- &ur->ucr_request, ptr, ur->ucr_flags, &ur->ucr_actlen);
+ &ur->ucr_request, ptr, ur->ucr_flags, &ur->ucr_actlen,
+ USBD_DEFAULT_TIMEOUT);
if (err) {
error = EIO;
goto ret;
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index ca39ea3..82d1ed6 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.94 2001/12/30 20:26:59 augustss Exp $ */
+/* $NetBSD: usbdi.c,v 1.96 2002/02/11 15:11:49 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -178,7 +178,7 @@ 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,
- USBD_DEFAULT_INTERVAL));
+ USBD_DEFAULT_TIMEOUT));
}
usbd_status
@@ -923,20 +923,22 @@ usbd_start_next(usbd_pipe_handle pipe)
usbd_status
usbd_do_request(usbd_device_handle dev, usb_device_request_t *req, void *data)
{
- return (usbd_do_request_flags(dev, req, data, 0, 0));
+ return (usbd_do_request_flags(dev, req, data, 0, 0,
+ USBD_DEFAULT_TIMEOUT));
}
usbd_status
usbd_do_request_flags(usbd_device_handle dev, usb_device_request_t *req,
- void *data, u_int16_t flags, int *actlen)
+ void *data, u_int16_t flags, int *actlen, u_int32_t timo)
{
- return (usbd_do_request_flags_pipe(dev, dev->default_pipe, req,
- data, flags, actlen));
+ return (usbd_do_request_flags_pipe(dev, dev->default_pipe, req,
+ data, flags, actlen, timo));
}
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_device_request_t *req, void *data, u_int16_t flags, int *actlen,
+ u_int32_t timeout)
{
usbd_xfer_handle xfer;
usbd_status err;
@@ -955,7 +957,7 @@ usbd_do_request_flags_pipe(usbd_device_handle dev, usbd_pipe_handle pipe,
xfer = usbd_alloc_xfer(dev);
if (xfer == NULL)
return (USBD_NOMEM);
- usbd_setup_default_xfer(xfer, dev, 0, USBD_DEFAULT_TIMEOUT, req,
+ usbd_setup_default_xfer(xfer, dev, 0, timeout, req,
data, UGETW(req->wLength), flags, 0);
xfer->pipe = pipe;
err = usbd_sync_transfer(xfer);
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 72084bd..811345c 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.h,v 1.59 2001/12/24 21:36:15 augustss Exp $ */
+/* $NetBSD: usbdi.h,v 1.60 2002/02/11 15:11:49 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -139,10 +139,11 @@ usbd_status usbd_do_request_async(usbd_device_handle pipe,
usb_device_request_t *req, void *data);
usbd_status usbd_do_request_flags(usbd_device_handle pipe,
usb_device_request_t *req,
- void *data, u_int16_t flags, int *);
+ void *data, u_int16_t flags, int*, u_int32_t);
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_device_request_t *req, void *data, u_int16_t flags, int *actlen,
+ u_int32_t);
usb_interface_descriptor_t *usbd_get_interface_descriptor
(usbd_interface_handle iface);
usb_config_descriptor_t *usbd_get_config_descriptor(usbd_device_handle dev);
OpenPOWER on IntegriCloud