summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata_if.m
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-12-06 00:10:13 +0000
committermav <mav@FreeBSD.org>2009-12-06 00:10:13 +0000
commit6a3018e7cff16ab166672e276b4b39154ad09739 (patch)
tree8def18d183a8f2ec2847c5ef06fe2fac081d798e /sys/dev/ata/ata_if.m
parent9bb92ae41af45cc801f28a880e08648aad72e241 (diff)
downloadFreeBSD-src-6a3018e7cff16ab166672e276b4b39154ad09739.zip
FreeBSD-src-6a3018e7cff16ab166672e276b4b39154ad09739.tar.gz
MFp4:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part)
Diffstat (limited to 'sys/dev/ata/ata_if.m')
-rw-r--r--sys/dev/ata/ata_if.m19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/ata/ata_if.m b/sys/dev/ata/ata_if.m
index 8fcc3f2..a1775ac 100644
--- a/sys/dev/ata/ata_if.m
+++ b/sys/dev/ata/ata_if.m
@@ -57,17 +57,24 @@ HEADER {
};
CODE {
- static void ata_null_setmode(device_t parent, device_t dev)
+ static int ata_null_setmode(device_t dev, int target, int mode)
{
- struct ata_device *atadev = device_get_softc(dev);
- atadev->mode = ata_limit_mode(dev, atadev->mode, ATA_PIO_MAX);
+ if (mode > ATA_PIO_MAX)
+ return (ATA_PIO_MAX);
+ return (mode);
}
};
-METHOD void setmode {
- device_t channel;
+METHOD int setmode {
+ device_t dev;
+ int target;
+ int mode;
+} DEFAULT ata_null_setmode;
+
+METHOD int getrev {
device_t dev;
-} DEFAULT ata_null_setmode;;
+ int target;
+};
METHOD void reset {
device_t channel;
OpenPOWER on IntegriCloud