diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-09-05 14:21:53 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-09-05 14:21:53 +0000 |
commit | 311bd9a43d7daa17e91adc18df0e999c606882a0 (patch) | |
tree | 1bb6cae6b9a80c5242a41912d47b5c84ea929c7c /sys/dev/usb | |
parent | 2378367b6b423b06926486b2392031f32dbd3525 (diff) |
Rename SID_INQUIRY_HDR (a.k.a. 5) to more explicit SID_SCSI2_HDRLEN and use it
to replace various uses of '5' when calculating the amount of data in the
INQUIRY response. Matches up more naturally with SID_SCSI2_ALEN.
Also use to fix SCSIDEBUG display of INQUIRY responses to show correct count of
bytes received/available.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/umass.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 02391ee39ef..de23c439817 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.77 2020/06/24 07:46:10 patrick Exp $ */ +/* $OpenBSD: umass.c,v 1.78 2020/09/05 14:21:52 krw Exp $ */ /* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */ /* @@ -819,13 +819,13 @@ umass_adjust_transfer(struct umass_softc *sc) { switch (sc->sc_cmd) { case UMASS_CPROTO_UFI: - sc->cbw.bCDBLength = UFI_COMMAND_LENGTH; + sc->cbw.bCDBLength = UFI_COMMAND_LENGTH; /* Adjust the length field in certain scsi commands. */ switch (sc->cbw.CBWCDB[0]) { case INQUIRY: - if (sc->transfer_datalen > 36) { - sc->transfer_datalen = 36; - sc->cbw.CBWCDB[4] = 36; + if (sc->transfer_datalen > SID_SCSI2_HDRLEN + SID_SCSI2_ALEN) { + sc->transfer_datalen = SID_SCSI2_HDRLEN + SID_SCSI2_ALEN; + sc->cbw.CBWCDB[4] = sc->transfer_datalen; } break; case MODE_SENSE_BIG: |