From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 23 21:42:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32A15106566B; Tue, 23 Nov 2010 21:42:27 +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 16F088FC0C; Tue, 23 Nov 2010 21:42:27 +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 oANLgQi2045098; Tue, 23 Nov 2010 21:42:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANLgQVs045095; Tue, 23 Nov 2010 21:42:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201011232142.oANLgQVs045095@svn.freebsd.org> From: Alexander Motin Date: Tue, 23 Nov 2010 21:42:26 +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: r215777 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 21:42:27 -0000 Author: mav Date: Tue Nov 23 21:42:26 2010 New Revision: 215777 URL: http://svn.freebsd.org/changeset/base/215777 Log: MFC r215468: Make ATA_CAM wrapper to report SATA power management capabilities to CAM to make it configure device to initiate transitions if controller configured to accept them. This makes hint.ata.X.pm_level=1 mode working. Modified: stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.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/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Tue Nov 23 21:40:21 2010 (r215776) +++ stable/8/sys/dev/ata/ata-all.c Tue Nov 23 21:42:26 2010 (r215777) @@ -170,7 +170,12 @@ ata_attach(device_t dev) ch->user[i].bytecount = 8192; else ch->user[i].bytecount = MAXPHYS; + ch->user[i].caps = 0; ch->curr[i] = ch->user[i]; + if (ch->pm_level > 0) + ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ; + if (ch->pm_level > 1) + ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ; } #endif callout_init(&ch->poll_callout, 1); @@ -1626,6 +1631,8 @@ ataaction(struct cam_sim *sim, union ccb d->bytecount = min(8192, cts->xport_specific.sata.bytecount); if (cts->xport_specific.sata.valid & CTS_SATA_VALID_ATAPI) d->atapi = cts->xport_specific.sata.atapi; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_CAPS) + d->caps = cts->xport_specific.sata.caps; } else { if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) { if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { @@ -1671,9 +1678,21 @@ ataaction(struct cam_sim *sim, union ccb cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; } + cts->xport_specific.sata.caps = + d->caps & CTS_SATA_CAPS_D; + if (ch->pm_level) { + cts->xport_specific.sata.caps |= + CTS_SATA_CAPS_H_PMREQ; + } + cts->xport_specific.sata.caps &= + ch->user[ccb->ccb_h.target_id].caps; + cts->xport_specific.sata.valid |= + CTS_SATA_VALID_CAPS; } else { cts->xport_specific.sata.revision = d->revision; cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + cts->xport_specific.sata.caps = d->caps; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_CAPS; } cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Tue Nov 23 21:40:21 2010 (r215776) +++ stable/8/sys/dev/ata/ata-all.h Tue Nov 23 21:42:26 2010 (r215777) @@ -535,6 +535,7 @@ struct ata_cam_device { int mode; u_int bytecount; u_int atapi; + u_int caps; }; #endif