From a6baad1fc1a9dd81496feaa3b9c2d6e293db7645 Mon Sep 17 00:00:00 2001 From: grehan Date: Fri, 1 Apr 2005 03:28:55 +0000 Subject: Introduce channel-level setmode newbus method. Thanks to sos for the code re-org that allowed this. --- sys/powerpc/powermac/ata_kauai.c | 12 ++++++++++++ sys/powerpc/powermac/ata_macio.c | 13 +++++++++++++ 2 files changed, 25 insertions(+) (limited to 'sys/powerpc/powermac') diff --git a/sys/powerpc/powermac/ata_kauai.c b/sys/powerpc/powermac/ata_kauai.c index c74b579..4c03de7 100644 --- a/sys/powerpc/powermac/ata_kauai.c +++ b/sys/powerpc/powermac/ata_kauai.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -69,6 +70,7 @@ __FBSDID("$FreeBSD$"); * Define the kauai pci bus attachment. */ static int ata_kauai_probe(device_t dev); +static void ata_kauai_setmode(device_t parent, device_t dev); static device_method_t ata_kauai_methods[] = { /* Device interface */ @@ -79,6 +81,8 @@ static device_method_t ata_kauai_methods[] = { DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), + /* ATA interface */ + DEVMETHOD(ata_setmode, ata_kauai_setmode), { 0, 0 } }; @@ -183,3 +187,11 @@ ata_kauai_probe(device_t dev) return (ata_probe(dev)); } +static void +ata_kauai_setmode(device_t parent, device_t dev) +{ + struct ata_device *atadev = device_get_softc(dev); + + /* TODO bang kauai speed register */ + atadev->mode = ATA_PIO; +} diff --git a/sys/powerpc/powermac/ata_macio.c b/sys/powerpc/powermac/ata_macio.c index 9be8399..3375dac 100644 --- a/sys/powerpc/powermac/ata_macio.c +++ b/sys/powerpc/powermac/ata_macio.c @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -63,12 +64,15 @@ * Define the macio ata bus attachment. */ static int ata_macio_probe(device_t dev); +static void ata_macio_setmode(device_t parent, device_t dev); static device_method_t ata_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_macio_probe), DEVMETHOD(device_attach, ata_attach), + /* ATA interface */ + DEVMETHOD(ata_setmode, ata_macio_setmode), { 0, 0 } }; @@ -120,3 +124,12 @@ ata_macio_probe(device_t dev) return (ata_probe(dev)); } +static void +ata_macio_setmode(device_t parent, device_t dev) +{ + struct ata_device *atadev = device_get_softc(dev); + + /* TODO bang macio speed register */ + atadev->mode = ATA_PIO; +} + -- cgit v1.1