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-cbus.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-cbus.c')
-rw-r--r-- | sys/dev/ata/ata-cbus.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-cbus.c b/sys/dev/ata/ata-cbus.c index ac26664..d534a54 100644 --- a/sys/dev/ata/ata-cbus.c +++ b/sys/dev/ata/ata-cbus.c @@ -332,6 +332,15 @@ ata_cbuschannel_banking(device_t dev, int flags) return res; } +static void +ata_cbus_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_cbuschannel_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_cbuschannel_probe), @@ -342,7 +351,7 @@ static device_method_t ata_cbuschannel_methods[] = { /* ATA methods */ DEVMETHOD(ata_locking, ata_cbuschannel_banking), - + DEVMETHOD(ata_setmode, ata_cbus_setmode), { 0, 0 } }; |