Date: Sat, 5 Nov 2011 18:27:47 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r227117 - stable/9/sys/dev/mfi Message-ID: <201111051827.pA5IRl8O079594@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111051827.pA5IRl8O079594>