From 97299109999c9beeb267321b91e0498598e2297c Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 28 Jun 2007 06:22:40 +0000 Subject: [PATCH] The timeout is in milliseconds, not in hz. Only the portion of the patch that converts ms to ticks was used. Another PR states that a return code of 0 is the right one for libusb. Submitted by: Lonnie Mendez PR: 94311 Approved by: re (blanket) --- sys/dev/usb/ugen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 50fed1f44b47..a63422feb305 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -715,7 +715,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) sce->state |= UGEN_ASLP; DPRINTFN(5, ("ugenread: sleep on %p\n", sce)); error = tsleep(sce, PZERO | PCATCH, "ugenri", - sce->timeout); + (sce->timeout * hz + 999) / 1000); sce->state &= ~UGEN_ASLP; DPRINTFN(5, ("ugenread: woke, error=%d\n", error)); if (sc->sc_dying) @@ -785,7 +785,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) sce->state |= UGEN_ASLP; DPRINTFN(5, ("ugenread: sleep on %p\n", sce)); error = tsleep(sce, PZERO | PCATCH, "ugenri", - sce->timeout); + (sce->timeout * hz + 999) / 1000); sce->state &= ~UGEN_ASLP; DPRINTFN(5, ("ugenread: woke, error=%d\n", error)); if (sc->sc_dying)