diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-03-28 17:38:00 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-03-28 17:38:00 +0000 |
commit | b9cb6f83fc005d50087afb3add38a73a1813cdf0 (patch) | |
tree | f0999ac18dac9bcf1db9a6deeb89a3f9a5341994 /sys | |
parent | 25904dc02e3359fd8c7733243fc4b933e1bde754 (diff) | |
download | FreeBSD-src-b9cb6f83fc005d50087afb3add38a73a1813cdf0.zip FreeBSD-src-b9cb6f83fc005d50087afb3add38a73a1813cdf0.tar.gz |
Revert to a static value for the timeout. The timeout was supposedly
to be based on the transfer speed, but I got it all wrong. The by far
biggest factor in the timeout is the start of a removable device, which
is about 2 seconds anyway.
Prodded by: Lennart Augustsson
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 932c572..f598544 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -144,11 +144,12 @@ int umassdebug = UDMASS_ALL; #define DEVNAME_SIM "umass-" #define UMASS_MAX_TRANSFER_SIZE 65536 -/* The transfer speed determines the timeout value */ #define UMASS_DEFAULT_TRANSFER_SPEED 150 /* in kb/s, conservative est. */ #define UMASS_FLOPPY_TRANSFER_SPEED 20 #define UMASS_ZIP100_TRANSFER_SPEED 650 +#define UMASS_TIMEOUT 5000 /* msecs */ + /* CAM specific definitions */ /* The bus id, whatever that is */ @@ -391,7 +392,6 @@ struct umass_softc { struct scsi_sense cam_scsi_sense; int transfer_speed; /* in kb/s */ - int timeout; /* in msecs */ }; #ifdef UMASS_DEBUG @@ -626,14 +626,6 @@ umass_match_proto(struct umass_softc *sc, usbd_interface_handle iface) return(UMATCH_NONE); } - /* The timeout is based on the maximum expected transfer size - * divided by the expected transfer speed. - * We multiply by 4 to make sure a busy system doesn't make things - * fail. - */ - sc->timeout = 4 * (1000 * UMASS_MAX_TRANSFER_SIZE / sc->transfer_speed); - sc->timeout += 1; /* add some leeway for spin up of a drive */ - return(UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO); } @@ -913,8 +905,8 @@ umass_setup_transfer(struct umass_softc *sc, usbd_pipe_handle pipe, /* Initialiase a USB transfer and then schedule it */ - (void) usbd_setup_xfer(xfer, pipe, (void *) sc, buffer, buflen, - flags, sc->timeout, sc->state); + (void) usbd_setup_xfer(xfer, pipe, (void *) sc, buffer, buflen, flags, + UMASS_TIMEOUT, sc->state); err = usbd_transfer(xfer); if (err && err != USBD_IN_PROGRESS) { @@ -938,8 +930,7 @@ umass_setup_ctrl_transfer(struct umass_softc *sc, usbd_device_handle dev, /* Initialiase a USB control transfer and then schedule it */ (void) usbd_setup_default_xfer(xfer, dev, (void *) sc, - sc->timeout, req, buffer, buflen, - flags, sc->state); + UMASS_TIMEOUT, req, buffer, buflen, flags, sc->state); err = usbd_transfer(xfer); if (err && err != USBD_IN_PROGRESS) { |