Date: Sun, 23 Apr 2017 09:01:02 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317337 - stable/11/sys/dev/usb/storage Message-ID: <201704230901.v3N912di081575@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Apr 23 09:01:01 2017 New Revision: 317337 URL: https://svnweb.freebsd.org/changeset/base/317337 Log: MFC r314256: 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. Modified: stable/11/sys/dev/usb/storage/cfumass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/storage/cfumass.c ============================================================================== --- stable/11/sys/dev/usb/storage/cfumass.c Sun Apr 23 09:00:26 2017 (r317336) +++ stable/11/sys/dev/usb/storage/cfumass.c Sun Apr 23 09:01:01 2017 (r317337) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704230901.v3N912di081575>