svn commit: r317337 - stable/11/sys/dev/usb/storage

Alexander Motin mav at FreeBSD.org
Sun Apr 23 09:01:03 UTC 2017


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);
 }


More information about the svn-src-stable mailing list