svn commit: r250454 - projects/pmac_pmu/sys/powerpc/powermac
Justin Hibbits
jhibbits at FreeBSD.org
Fri May 10 14:28:17 UTC 2013
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);
+}
+
More information about the svn-src-projects
mailing list