summaryrefslogtreecommitdiff
path: root/sys/dev/usb/umass.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2000-04-08 20:28:08 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2000-04-08 20:28:08 +0000
commitd86bfb608649a6a376db9bf1ae66742c61d53916 (patch)
tree04a7d79ecf45b5a336b398f0e72772abbec9e39a /sys/dev/usb/umass.c
parent382895ec1d9ffbf51e36f0d08687d2dbeb1e7100 (diff)
Y-E UFI drives don't clear sense on INQUIRY. Upper-layer SCSI drivers
don't like that too much. Now drive is detected correctly, even without floppy in it.
Diffstat (limited to 'sys/dev/usb/umass.c')
-rw-r--r--sys/dev/usb/umass.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 904c8ee1476..86381953196 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass.c,v 1.4 2000/04/08 20:03:34 aaron Exp $ */
+/* $OpenBSD: umass.c,v 1.5 2000/04/08 20:28:07 csapuntz Exp $ */
/* $NetBSD: umass.c,v 1.31 2000/04/03 12:31:34 augustss Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
@@ -3347,6 +3347,15 @@ umass_scsipi_sense_cb(struct umass_softc *sc, void *priv, int residue,
case STATUS_CMD_OK:
case STATUS_CMD_UNKNOWN:
/* getting sense data succeeded */
+ if ((xs->cmd->opcode == INQUIRY)
+ && (xs->resid < xs->datalen)) {
+ /* Some drivers return SENSE errors even after INQUIRY
+ * The upper layer doesn't like that.
+ */
+ xs->error = XS_NOERROR;
+ break;
+ }
+
bytes_received = sizeof(xs->sense) - residue;
if (bytes_received < 8 ||