diff options
author | 2009-03-19 16:19:51 +0000 | |
---|---|---|
committer | 2009-03-19 16:19:51 +0000 | |
commit | 8dfd96e1f9cdfb07583f2acf1ac21908e2b7e147 (patch) | |
tree | c3a968e7aa70ecf0c5ae47793d322e32b5c4153e | |
parent | Unify command id printing. (diff) | |
download | wireguard-openbsd-8dfd96e1f9cdfb07583f2acf1ac21908e2b7e147.tar.xz wireguard-openbsd-8dfd96e1f9cdfb07583f2acf1ac21908e2b7e147.zip |
For pass-through commands adjust timeout value to what controller
supports. Make sure our timeout will be fired after controller
gives up.
-rw-r--r-- | sys/dev/pci/ips.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index 2f7db15cf31..50c43b81efe 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.76 2009/03/19 16:07:14 grange Exp $ */ +/* $OpenBSD: ips.c,v 1.77 2009/03/19 16:19:51 grange Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org> @@ -1032,12 +1032,22 @@ ips_scsi_pt_cmd(struct scsi_xfer *xs) dcdb->attr |= IPS_DCDB_DATAIN; if (xs->flags & SCSI_DATA_OUT) dcdb->attr |= IPS_DCDB_DATAOUT; - if (xs->timeout <= 10000) + + /* + * Adjust timeout value to what controller supports. Make sure our + * timeout will be fired after controller gives up. + */ + if (xs->timeout <= 10000) { dcdb->attr |= IPS_DCDB_TIMO10; - else if (xs->timeout <= 60000) + xs->timeout = 11000; + } else if (xs->timeout <= 60000) { dcdb->attr |= IPS_DCDB_TIMO60; - else + xs->timeout = 61000; + } else { dcdb->attr |= IPS_DCDB_TIMO20M; + xs->timeout = 20 * 60000 + 1000; + } + dcdb->attr |= IPS_DCDB_DISCON; dcdb->datalen = htole16(xs->datalen); dcdb->cdblen = xs->cmdlen; |