svn commit: r227117 - stable/9/sys/dev/mfi

Konstantin Belousov kib at FreeBSD.org
Sat Nov 5 18:27:47 UTC 2011


Author: kib
Date: Sat Nov  5 18:27:47 2011
New Revision: 227117
URL: http://svn.freebsd.org/changeset/base/227117

Log:
  MFC r226896:
  Fix an implicit dependency between the MFI driver and CAM that had grown due
  to an API change in CAM.  It's once again possible to link a static kernel
  with 'mfi' without requiring 'scbus' as well.  Ditto for KLD loading.
  
  Approved by:	re (bz)

Modified:
  stable/9/sys/dev/mfi/mfivar.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/mfi/mfivar.h
==============================================================================
--- stable/9/sys/dev/mfi/mfivar.h	Sat Nov  5 17:55:49 2011	(r227116)
+++ stable/9/sys/dev/mfi/mfivar.h	Sat Nov  5 18:27:47 2011	(r227117)
@@ -352,12 +352,29 @@ mfi_dequeue_bio(struct mfi_softc *sc)
 	return (bp);
 }
 
+/*
+ * This is from the original scsi_extract_sense() in CAM.  It's copied
+ * here because CAM now uses a non-inline version that follows more complex
+ * additions to the SPC spec, and we don't want to force a dependency on
+ * the CAM module for such a trivial action.
+ */
+static __inline void
+mfi_extract_sense(struct scsi_sense_data_fixed *sense,
+    int *error_code, int *sense_key, int *asc, int *ascq)
+{
+
+	*error_code = sense->error_code & SSD_ERRCODE;
+	*sense_key = sense->flags & SSD_KEY;
+	*asc = (sense->extra_len >= 5) ? sense->add_sense_code : 0;
+	*ascq = (sense->extra_len >= 6) ? sense->add_sense_code_qual : 0;
+}
+
 static __inline void
 mfi_print_sense(struct mfi_softc *sc, void *sense)
 {
 	int error, key, asc, ascq;
 
-	scsi_extract_sense((struct scsi_sense_data *)sense,
+	mfi_extract_sense((struct scsi_sense_data_fixed *)sense,
 	    &error, &key, &asc, &ascq);
 	device_printf(sc->mfi_dev, "sense error %d, sense_key %d, "
 	    "asc %d, ascq %d\n", error, key, asc, ascq);


More information about the svn-src-stable-9 mailing list