From owner-svn-src-stable@FreeBSD.ORG Sat Nov 5 18:27:47 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 864B71065673; Sat, 5 Nov 2011 18:27:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 759BB8FC12; Sat, 5 Nov 2011 18:27:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA5IRlfp079596; Sat, 5 Nov 2011 18:27:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA5IRl8O079594; Sat, 5 Nov 2011 18:27:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111051827.pA5IRl8O079594@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Nov 2011 18:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227117 - stable/9/sys/dev/mfi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2011 18:27:47 -0000 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);