From owner-svn-src-all@FreeBSD.ORG Tue Jan 19 13:36:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9BA1065698; Tue, 19 Jan 2010 13:36:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32E038FC1D; Tue, 19 Jan 2010 13:36:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0JDaD5t004321; Tue, 19 Jan 2010 13:36:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0JDaD1j004318; Tue, 19 Jan 2010 13:36:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001191336.o0JDaD1j004318@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Jan 2010 13:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202626 - stable/8/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 13:36:13 -0000 Author: mav Date: Tue Jan 19 13:36:12 2010 New Revision: 202626 URL: http://svn.freebsd.org/changeset/base/202626 Log: MFC r201222: Usually these controllers are able to automatically decode command code to get required command protocol. But they have no idea about new commands, such as DATA SET MANAGEMENT (TRIM). As soon as this info any way provided by CAM, give controller specific instructions. Modified: stable/8/sys/dev/siis/siis.c stable/8/sys/dev/siis/siis.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Tue Jan 19 13:33:54 2010 (r202625) +++ stable/8/sys/dev/siis/siis.c Tue Jan 19 13:36:12 2010 (r202626) @@ -987,13 +987,29 @@ siis_execute_transaction(struct siis_slo ctp->protocol_override = 0; ctp->transfer_count = 0; /* Special handling for Soft Reset command. */ - if ((ccb->ccb_h.func_code == XPT_ATA_IO) && - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) { - ctp->control |= htole16(SIIS_PRB_SOFT_RESET); + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + if (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) { + ctp->control |= htole16(SIIS_PRB_SOFT_RESET); + } else { + ctp->control |= htole16(SIIS_PRB_PROTOCOL_OVERRIDE); + if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { + ctp->protocol_override |= + htole16(SIIS_PRB_PROTO_NCQ); + } + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { + ctp->protocol_override |= + htole16(SIIS_PRB_PROTO_READ); + } else + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) { + ctp->protocol_override |= + htole16(SIIS_PRB_PROTO_WRITE); + } + } } else if (ccb->ccb_h.func_code == XPT_SCSI_IO) { - if (ccb->ccb_h.flags & CAM_DIR_IN) + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) ctp->control |= htole16(SIIS_PRB_PACKET_READ); - if (ccb->ccb_h.flags & CAM_DIR_OUT) + else + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) ctp->control |= htole16(SIIS_PRB_PACKET_WRITE); } /* Setup the FIS for this request */ Modified: stable/8/sys/dev/siis/siis.h ============================================================================== --- stable/8/sys/dev/siis/siis.h Tue Jan 19 13:33:54 2010 (r202625) +++ stable/8/sys/dev/siis/siis.h Tue Jan 19 13:36:12 2010 (r202626) @@ -304,6 +304,12 @@ struct siis_cmd { #define SIIS_PRB_INTERRUPT_MASK 0x0040 #define SIIS_PRB_SOFT_RESET 0x0080 u_int16_t protocol_override; +#define SIIS_PRB_PROTO_PACKET 0x0001 +#define SIIS_PRB_PROTO_TCQ 0x0002 +#define SIIS_PRB_PROTO_NCQ 0x0004 +#define SIIS_PRB_PROTO_READ 0x0008 +#define SIIS_PRB_PROTO_WRITE 0x0010 +#define SIIS_PRB_PROTO_TRANSPARENT 0x0020 u_int32_t transfer_count; u_int8_t fis[24]; union {