From owner-svn-src-projects@FreeBSD.ORG Fri May 10 14:28:17 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E40EBAE; Fri, 10 May 2013 14:28:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50DC9D64; Fri, 10 May 2013 14:28:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AESHZI007555; Fri, 10 May 2013 14:28:17 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AESHsj007554; Fri, 10 May 2013 14:28:17 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201305101428.r4AESHsj007554@svn.freebsd.org> From: Justin Hibbits Date: Fri, 10 May 2013 14:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r250454 - projects/pmac_pmu/sys/powerpc/powermac X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 14:28:17 -0000 Author: jhibbits Date: Fri May 10 14:28:16 2013 New Revision: 250454 URL: http://svnweb.freebsd.org/changeset/base/250454 Log: Add suspend/resume to the mac-io ATA driver. Modified: projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c Modified: projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c ============================================================================== --- projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c Fri May 10 13:57:44 2013 (r250453) +++ projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c Fri May 10 14:28:16 2013 (r250454) @@ -114,11 +114,15 @@ static int ata_macio_probe(device_t de static int ata_macio_setmode(device_t dev, int target, int mode); static int ata_macio_attach(device_t dev); static int ata_macio_begin_transaction(struct ata_request *request); +static int ata_macio_suspend(device_t dev); +static int ata_macio_resume(device_t dev); static device_method_t ata_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_macio_probe), DEVMETHOD(device_attach, ata_macio_attach), + DEVMETHOD(device_suspend, ata_macio_suspend), + DEVMETHOD(device_resume, ata_macio_resume), /* ATA interface */ DEVMETHOD(ata_setmode, ata_macio_setmode), @@ -333,3 +337,31 @@ ata_macio_begin_transaction(struct ata_r return ata_begin_transaction(request); } +static int +ata_macio_suspend(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; + + if (!ch->attached) + return (0); + + error = ata_suspend(dev); + + return (error); +} + +static int +ata_macio_resume(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; + + if (!ch->attached) + return (0); + + error = ata_resume(dev); + + return (error); +} +