diff options
author | Nathan Binkert <nate@cvs.openbsd.org> | 2002-07-09 17:41:03 +0000 |
---|---|---|
committer | Nathan Binkert <nate@cvs.openbsd.org> | 2002-07-09 17:41:03 +0000 |
commit | 5f8c9aa17ff339d9cd2fe163ad5e09cec45cb884 (patch) | |
tree | 6f38e0ab07c7daf86f44f263ad1aed45b82e0ca8 | |
parent | cebe98a45ed501bcac0a82360db9f4a93e1bd4cd (diff) |
make the timeout a function parameter
From NetBSD
-rw-r--r-- | sys/dev/usb/ugen.c | 5 | ||||
-rw-r--r-- | sys/dev/usb/urio.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.c | 14 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.h | 7 | ||||
-rw-r--r-- | sys/dev/usb/uvisor.c | 6 |
6 files changed, 22 insertions, 18 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index ab1996330d9..2a393c3f1df 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.20 2002/05/07 18:29:18 nate Exp $ */ +/* $OpenBSD: ugen.c,v 1.21 2002/07/09 17:41:02 nate Exp $ */ /* $NetBSD: ugen.c,v 1.49 2001/10/24 22:31:04 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -1220,7 +1220,8 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, } } 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, + USBD_DEFAULT_TIMEOUT); if (err) { error = EIO; goto ret; diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index 981eb1208d4..65de5ae9bf0 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: urio.c,v 1.9 2002/06/11 03:08:15 nate Exp $ */ +/* $OpenBSD: urio.c,v 1.10 2002/07/09 17:41:02 nate Exp $ */ /* $NetBSD: urio.c,v 1.11 2002/02/11 15:11:49 augustss Exp $ */ /* @@ -544,7 +544,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p) sc->sc_refcnt++; err = usbd_do_request_flags(sc->sc_udev, &req, ptr, req_flags, - &req_actlen); + &req_actlen, USBD_DEFAULT_TIMEOUT); if (--sc->sc_refcnt < 0) usb_detach_wakeup(USBDEV(sc->sc_dev)); diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index cd8e4d0aa93..1d5c4ca370b 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.19 2002/05/07 18:29:18 nate Exp $ */ +/* $OpenBSD: usb.c,v 1.20 2002/07/09 17:41:02 nate Exp $ */ /* $NetBSD: usb.c,v 1.53 2001/01/23 17:04:30 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb.c,v 1.20 1999/11/17 22:33:46 n_hibma Exp $ */ @@ -448,7 +448,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p) } err = usbd_do_request_flags(sc->sc_bus->devices[addr], &ur->ucr_request, ptr, ur->ucr_flags, - &ur->ucr_actlen); + &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 012409d05d3..069457a94a6 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.c,v 1.18 2002/05/07 18:29:19 nate Exp $ */ +/* $OpenBSD: usbdi.c,v 1.19 2002/07/09 17:41:02 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 $ */ @@ -861,20 +861,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)); + 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; @@ -893,7 +895,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 77c4dd6d425..1c25a18911c 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.h,v 1.16 2002/05/07 18:29:19 nate Exp $ */ +/* $OpenBSD: usbdi.h,v 1.17 2002/07/09 17:41:02 nate Exp $ */ /* $NetBSD: usbdi.h,v 1.53 2001/08/15 00:04:59 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -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); diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index 719f63fad42..424e7fc1625 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvisor.c,v 1.9 2002/07/09 17:18:48 nate Exp $ */ +/* $OpenBSD: uvisor.c,v 1.10 2002/07/09 17:41:02 nate Exp $ */ /* $NetBSD: uvisor.c,v 1.15 2002/06/16 15:01:31 augustss Exp $ */ /* @@ -361,7 +361,7 @@ uvisor_init(struct uvisor_softc *sc, struct uvisor_connection_info *ci) USETW(req.wIndex, 0); USETW(req.wLength, UVISOR_CONNECTION_INFO_SIZE); err = usbd_do_request_flags(sc->sc_udev, &req, ci, - USBD_SHORT_XFER_OK, &actlen); + USBD_SHORT_XFER_OK, &actlen, USBD_DEFAULT_TIMEOUT); if (err) return (err); @@ -417,5 +417,5 @@ uvisor_close(void *addr, int portno) USETW(req.wIndex, 0); USETW(req.wLength, UVISOR_CONNECTION_INFO_SIZE); (void)usbd_do_request_flags(sc->sc_udev, &req, &coninfo, - USBD_SHORT_XFER_OK, &actlen); + USBD_SHORT_XFER_OK, &actlen, USBD_DEFAULT_TIMEOUT); } |