Introduce channel-level setmode newbus method.
Thanks to sos for the code re-org that allowed this.
This commit is contained in:
parent
f8eecc0813
commit
98cbfce5db
@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/rman.h>
|
||||
#include <sys/ata.h>
|
||||
#include <dev/ata/ata-all.h>
|
||||
#include <ata_if.h>
|
||||
|
||||
#include <dev/ofw/openfirm.h>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <sys/rman.h>
|
||||
#include <sys/ata.h>
|
||||
#include <dev/ata/ata-all.h>
|
||||
#include <ata_if.h>
|
||||
|
||||
#include <dev/ofw/ofw_bus.h>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <sys/rman.h>
|
||||
#include <sys/ata.h>
|
||||
#include <dev/ata/ata-all.h>
|
||||
#include <ata_if.h>
|
||||
|
||||
#include <dev/ofw/openfirm.h>
|
||||
#include <powerpc/psim/iobusvar.h>
|
||||
@ -211,6 +212,7 @@ ata_iobus_release_resource(device_t dev, device_t child, int type, int rid,
|
||||
*/
|
||||
|
||||
static int ata_iobus_sub_probe(device_t dev);
|
||||
static void ata_iobus_sub_setmode(device_t parent, device_t dev);
|
||||
|
||||
static device_method_t ata_iobus_sub_methods[] = {
|
||||
/* Device interface */
|
||||
@ -219,6 +221,8 @@ static device_method_t ata_iobus_sub_methods[] = {
|
||||
DEVMETHOD(device_detach, ata_detach),
|
||||
DEVMETHOD(device_resume, ata_resume),
|
||||
|
||||
/* ATA interface */
|
||||
DEVMETHOD(ata_setmode, ata_iobus_sub_setmode),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -242,3 +246,12 @@ ata_iobus_sub_probe(device_t dev)
|
||||
|
||||
return ata_probe(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
ata_iobus_sub_setmode(device_t parent, device_t dev)
|
||||
{
|
||||
struct ata_device *atadev = device_get_softc(dev);
|
||||
|
||||
/* Only ever PIO mode here... */
|
||||
atadev->mode = ATA_PIO;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user