Date: Sat, 29 Oct 2011 06:26:50 +0000 (UTC) From: Scott Long <scottl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r226896 - head/sys/dev/mfi Message-ID: <201110290626.p9T6QoKC097568@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: scottl Date: Sat Oct 29 06:26:49 2011 New Revision: 226896 URL: http://svn.freebsd.org/changeset/base/226896 Log: 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. Submitted by: kib Reviewed by: ken MFC after: 3 days Modified: head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Sat Oct 29 06:13:47 2011 (r226895) +++ head/sys/dev/mfi/mfivar.h Sat Oct 29 06:26:49 2011 (r226896) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110290626.p9T6QoKC097568>