summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/wdreg.h
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1996-01-28 22:16:20 +0000
committerwollman <wollman@FreeBSD.org>1996-01-28 22:16:20 +0000
commitc02be74f05c64f577351db45298df1c42fcf75f2 (patch)
tree37f28d8762c4340f63d487d23ac932afd883fb9c /sys/i386/isa/wdreg.h
parentfbcc7783adf8c464e809cded0cb18ee191cc9a58 (diff)
downloadFreeBSD-src-c02be74f05c64f577351db45298df1c42fcf75f2.zip
FreeBSD-src-c02be74f05c64f577351db45298df1c42fcf75f2.tar.gz
Implement a prototype interface to bus-master IDE DMA on the Triton
chipset. This does not attempt to do anything special with the timing on the hope that the BIOS will have done the right thing already. The actual interface from the wd driver to the new facility is not implemented yet (this commit being an attempt at prodding someone else to do it because looking at the wd driver always confuses the h*** out of me).
Diffstat (limited to 'sys/i386/isa/wdreg.h')
-rw-r--r--sys/i386/isa/wdreg.h47
1 files changed, 46 insertions, 1 deletions
diff --git a/sys/i386/isa/wdreg.h b/sys/i386/isa/wdreg.h
index b1ceeb7..426d2ff 100644
--- a/sys/i386/isa/wdreg.h
+++ b/sys/i386/isa/wdreg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
- * $Id: wdreg.h,v 1.9 1995/11/04 13:23:45 bde Exp $
+ * $Id: wdreg.h,v 1.10 1995/11/04 17:07:58 bde Exp $
*/
/*
@@ -142,4 +142,49 @@ struct wdparams {
int wdformat(struct buf *bp);
#endif
+/*
+ * IDE DMA support.
+ * This is based on what is needed for the IDE DMA function of the Intel
+ * Triton chipset; hopefully it's general enough to be used for other
+ * chipsets as well.
+ *
+ * To use this:
+ * For each drive which you might want to do DMA on, call wdd_candma()
+ * to get a cookie. If it returns a null pointer, then the drive
+ * can't do DMA.
+ *
+ * Set up the transfer be calling wdd_dmaprep(). The cookie is what
+ * you got before; vaddr is the virtual address of the buffer to be
+ * written; len is the length of the buffer; and direction is either
+ * B_READ or B_WRITE.
+ *
+ * Send a read/write DMA command to the drive.
+ *
+ * Call wdd_dmastart().
+ *
+ * Wait for an interrupt. Multi-sector transfers will only interrupt
+ * at the end of the transfer.
+ *
+ * Call wdd_dmadone(). It will return the status as defined by the
+ * WDDS_* constants below.
+ */
+struct wddma {
+ void *(*wdd_candma) /* returns a cookie if can do DMA */
+ __P((int ctlr, int drive));
+ int (*wdd_dmaprep) /* prepare DMA hardware */
+ __P((void *cookie, char *vaddr, u_long len, int direction));
+ void (*wdd_dmastart) /* begin DMA transfer */
+ __P((void *cookie));
+ int (*wdd_dmadone) /* DMA transfer completed */
+ __P((void *cookie));
+ int (*wdd_dmastatus) /* return status of DMA */
+ __P((void *cookie));
+};
+
+#define WDDS_ACTIVE 0x0001
+#define WDDS_ERROR 0x0002
+#define WDDS_INTERRUPT 0x0004
+
+extern struct wddma wddma;
+
#endif /* KERNEL */
OpenPOWER on IntegriCloud