Page MenuHomeFreeBSD

D49475.id155112.diff
No OneTemporary

D49475.id155112.diff

diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c
--- a/sys/dev/usb/storage/umass.c
+++ b/sys/dev/usb/storage/umass.c
@@ -431,6 +431,7 @@
uint8_t sc_maxlun; /* maximum LUN number, inclusive */
uint8_t sc_last_xfer_index;
uint8_t sc_status_try;
+ bool sc_sending_sense;
};
struct umass_probe_proto {
@@ -2013,16 +2014,20 @@
/*
* Section 3.4.3.1.3 specifies that the UFI command
* protocol returns an ASC and ASCQ in the interrupt
- * data block.
+ * data block. However, we might also be fetching the
+ * sense explicitly, where they are likely to be
+ * non-zero, in which case we should succeed.
*/
DPRINTF(sc, UDMASS_CBI, "UFI CCI, ASC = 0x%02x, "
"ASCQ = 0x%02x\n", sc->sbl.ufi.asc,
sc->sbl.ufi.ascq);
- status = (((sc->sbl.ufi.asc == 0) &&
- (sc->sbl.ufi.ascq == 0)) ?
- STATUS_CMD_OK : STATUS_CMD_FAILED);
+ if ((sc->sbl.ufi.asc == 0 && sc->sbl.ufi.ascq == 0) ||
+ sc->sc_transfer.cmd_data[0] == REQUEST_SENSE)
+ status = STATUS_CMD_OK;
+ else
+ status = STATUS_CMD_FAILED;
sc->sc_transfer.ccb = NULL;

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 21, 1:36 PM (18 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31913304
Default Alt Text
D49475.id155112.diff (1 KB)

Event Timeline