Date: Wed, 23 Jan 2008 21:09:40 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 133944 for review Message-ID: <200801232109.m0NL9ebu004209@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133944 Change 133944 by hselasky@hselasky_laptop001 on 2008/01/23 21:09:08 Make the USB status stage delay tunable through "hw.usb.ss_delay". This sysctl is used for advanced USB device testing. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_requests.c#17 edit .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#109 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_requests.c#17 (text+ko) ==== @@ -432,7 +432,8 @@ USETW(req.wLength, 0); /* Setting the address should not take more than 1 second ! */ - return (usbd_do_request_flags(udev, mtx, &req, NULL, 0, NULL, 1000)); + return (usbd_do_request_flags(udev, mtx, &req, NULL, + USBD_DELAY_STATUS_STAGE, NULL, 1000)); } /*------------------------------------------------------------------------* ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#109 (text+ko) ==== @@ -3570,6 +3570,13 @@ return; } +#ifdef USB_DEBUG +static int usb_ss_delay = 0; + +SYSCTL_INT(_hw_usb, OID_AUTO, ss_delay, CTLFLAG_RW, + &usb_ss_delay, 0, "USB status stage delay"); +#endif + /*------------------------------------------------------------------------* * usbd_do_request_flags and usbd_do_request * @@ -3702,12 +3709,18 @@ } else { if (xfer->frlengths[0] == 0) { if (xfer->flags.manual_status) { - /* - * Delay 70 milliseconds - * before doing the status - * stage: - */ - usbd_pause_mtx(xfer->priv_mtx, 70); +#ifdef USB_DEBUG + int temp; + + temp = usb_ss_delay; + if (temp > 5000) { + temp = 5000; + } + if (temp > 0) { + usbd_pause_mtx( + xfer->priv_mtx, temp); + } +#endif xfer->flags.manual_status = 0; } else { break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801232109.m0NL9ebu004209>