summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-pci.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-08-24 09:22:26 +0000
committersos <sos@FreeBSD.org>2003-08-24 09:22:26 +0000
commitacd43345e5181bc90912ee1da2b67fd9c3d9c7f6 (patch)
treefc8660c3fbead647641e9e7a6968b5a490dfd90f /sys/dev/ata/ata-pci.c
parent2b41ad87c9729efcb95d20102fb76ef2684cb633 (diff)
downloadFreeBSD-src-acd43345e5181bc90912ee1da2b67fd9c3d9c7f6.zip
FreeBSD-src-acd43345e5181bc90912ee1da2b67fd9c3d9c7f6.tar.gz
This is a major rework of the ATA driver (ATAng)
Restructure the way ATA/ATAPI commands are processed, use a common ata_request structure for both. This centralises the way requests are handled so locking is much easier to handle. The driver is now layered much more cleanly to seperate the lowlevel HW access so it can be tailored to specific controllers without touching the upper layers. This is needed to support some of the newer semi-intelligent ATA controllers showing up. The top level drivers (disk, ATAPI devices) are more or less still the same with just corrections to use the new interface. Pull ATA out from under Gaint now that locking can be done in a sane way. Add support for a the National Geode SC1100. Thanks to Soekris engineering for sponsoring a Soekris 4801 to make this support. Fixed alot of small bugs in the chipset code for various chips now we are around in that corner anyways.
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r--sys/dev/ata/ata-pci.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 4a40ae2..efb8e6d 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -35,6 +35,7 @@
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
+#include <sys/taskqueue.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
@@ -79,6 +80,8 @@ ata_pci_probe(device_t dev)
return ata_highpoint_ident(dev);
case ATA_INTEL_ID:
return ata_intel_ident(dev);
+ case ATA_NATIONAL_ID:
+ return ata_national_ident(dev);
case ATA_NVIDIA_ID:
return ata_nvidia_ident(dev);
case ATA_PROMISE_ID:
@@ -413,13 +416,11 @@ ata_pci_dmastart(struct ata_channel *ch, caddr_t data, int32_t count, int dir)
if ((error = ata_dmastart(ch, data, count, dir)))
return error;
-
- ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab);
- ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, dir ? ATA_BMCMD_WRITE_READ : 0);
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) |
(ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR)));
- ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
- ATA_IDX_INB(ch, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP);
+ ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab);
+ ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
+ (dir ? ATA_BMCMD_WRITE_READ : 0) | ATA_BMCMD_START_STOP);
return 0;
}
@@ -432,10 +433,8 @@ ata_pci_dmastop(struct ata_channel *ch)
ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
-
ata_dmastop(ch);
-
- return (error & ATA_BMSTAT_MASK);
+ return error;
}
static int
@@ -505,8 +504,6 @@ ata_pcisub_probe(device_t dev)
if ((error = ctlr->allocate(dev, ch)))
return error;
- if (ctlr->chip)
- ch->chiptype = ctlr->chip->chipid;
ch->device[MASTER].setmode = ctlr->setmode;
ch->device[SLAVE].setmode = ctlr->setmode;
ch->locking = ctlr->locking;
OpenPOWER on IntegriCloud