Use ctl_queue_sense() to implement sense data reporting.

USB MS BBB transport does not support autosense, so we have to queue any
sense data back to CTL for later fetching via REQUEST SENSE.
This commit is contained in:
Alexander Motin 2017-02-25 14:24:29 +00:00
parent 6563855634
commit ebaf2c29d7

View File

@ -987,19 +987,21 @@ cfumass_done(union ctl_io *io)
return;
}
switch (io->scsiio.scsi_status) {
case SCSI_STATUS_OK:
if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)
sc->sc_current_status = 0;
break;
default:
else
sc->sc_current_status = 1;
break;
}
/* XXX: How should we report BUSY, RESERVATION CONFLICT, etc? */
if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SCSI_ERROR &&
io->scsiio.scsi_status == SCSI_STATUS_CHECK_COND)
ctl_queue_sense(io);
else
ctl_free_io(io);
CFUMASS_LOCK(sc);
cfumass_transfer_start(sc, CFUMASS_T_STATUS);
CFUMASS_UNLOCK(sc);
ctl_free_io(io);
refcount_release(&sc->sc_queued);
}