aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/umass.c
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2000-03-28 17:38:00 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2000-03-28 17:38:00 +0000
commita0e14f58d966d920a67ac943505366658dd06ab6 (patch)
tree9a780d6feb114ad7f4a1806b4f4013ca7259af2b /sys/dev/usb/umass.c
parent99d2860f1bc451577d10458c9f6a85611d7d577c (diff)
downloadsrc-a0e14f58d966d920a67ac943505366658dd06ab6.tar.gz
src-a0e14f58d966d920a67ac943505366658dd06ab6.zip
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
Notes
Notes: svn path=/head/; revision=58751
Diffstat (limited to 'sys/dev/usb/umass.c')
-rw-r--r--sys/dev/usb/umass.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 932c572c54a9..f598544f56a3 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) {