1 /* $NetBSD: nextdmavar.h,v 1.9 1999/08/29 05:56:26 dbj Exp $ */ 2 /* 3 * Copyright (c) 1998 Darrin B. Jewell 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. All advertising materials mentioning features or use of this software 15 * must display the following acknowledgement: 16 * This product includes software developed by Darrin B. Jewell 17 * 4. The name of the author may not be used to endorse or promote products 18 * derived from this software without specific prior written permission 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 33 struct nextdma_config { 34 bus_space_tag_t nd_bst; /* bus space tag */ 35 bus_space_handle_t nd_bsh; /* bus space handle for device */ 36 37 u_long nd_intr; /* NEXT_I_ values from cpu.h */ 38 39 bus_dma_tag_t nd_dmat; 40 41 /* This is called to get another map to dma */ 42 bus_dmamap_t (*nd_continue_cb) __P((void *)); 43 /* This is called when a map has completed dma */ 44 void (*nd_completed_cb) __P((bus_dmamap_t, void *)); 45 /* This is called when dma shuts down */ 46 void (*nd_shutdown_cb) __P((void *)); 47 48 void *nd_cb_arg; /* callback argument */ 49 50 struct next68k_bus_dma_tag _nd_dmat; /* should probably be elsewhere */ 51 bus_dmamap_t _nd_map; /* map currently in dd_next */ 52 int _nd_idx; /* idx of segment currently in dd_next */ 53 bus_dmamap_t _nd_map_cont; /* map needed to continue DMA */ 54 int _nd_idx_cont; /* segment index to continue DMA */ 55 }; 56 57 58 /* Configure the interface & initialize private structure vars */ 59 void nextdma_config __P((struct nextdma_config *)); 60 void nextdma_init __P((struct nextdma_config *)); 61 void nextdma_start __P((struct nextdma_config *, u_long)); 62 63 /* query to see if nextdma is finished */ 64 int nextdma_finished __P(( struct nextdma_config *)); 65 void nextdma_reset __P((struct nextdma_config *)); 66 67 int nextdma_intr __P((void *)); 68 void next_dma_print __P((struct nextdma_config *)); 69