diff options
author | sos <sos@FreeBSD.org> | 2005-04-13 07:14:17 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2005-04-13 07:14:17 +0000 |
commit | 9d28f86771fbb646356b42d213a5fd137b84b26c (patch) | |
tree | 12fa8249eea69efd18e2cd9984312ea0494071b7 /sys/dev/ata/ata-isa.c | |
parent | c94ee5f99fbf2245bfd5e5161fb2d3472845d3d6 (diff) | |
download | FreeBSD-src-9d28f86771fbb646356b42d213a5fd137b84b26c.zip FreeBSD-src-9d28f86771fbb646356b42d213a5fd137b84b26c.tar.gz |
Add a ata_setmode method so we dont panic on setmode.
Note that the mode is only set on the device, we (mostly) have
no knowledge on how to set mode on the controller if at all possible.
Diffstat (limited to 'sys/dev/ata/ata-isa.c')
-rw-r--r-- | sys/dev/ata/ata-isa.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-isa.c b/sys/dev/ata/ata-isa.c index a6c50f9..2e8acda 100644 --- a/sys/dev/ata/ata-isa.c +++ b/sys/dev/ata/ata-isa.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <isa/isavar.h> #include <dev/ata/ata-all.h> +#include <ata_if.h> /* local vars */ static struct isa_pnp_id ata_ids[] = { @@ -109,12 +110,25 @@ ata_isa_probe(device_t dev) return ata_probe(dev); } +static void +ata_isa_setmode(device_t parent, device_t dev) +{ + struct ata_device *atadev = device_get_softc(dev); + int mode = atadev->mode; + + atadev->mode = ata_limit_mode(atadev, mode, ATA_PIO_MAX); +} + + static device_method_t ata_isa_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_isa_probe), DEVMETHOD(device_attach, ata_attach), DEVMETHOD(device_suspend, ata_suspend), DEVMETHOD(device_resume, ata_resume), + + /* ATA methods */ + DEVMETHOD(ata_setmode, ata_isa_setmode), { 0, 0 } }; |