ixp12x0_pci_dma.c revision 1.1.2.3 1 1.1.2.3 gehenna /* $NetBSD: ixp12x0_pci_dma.c,v 1.1.2.3 2002/08/30 00:19:15 gehenna Exp $ */
2 1.1.2.2 gehenna /*
3 1.1.2.2 gehenna * Copyright (c) 2002
4 1.1.2.2 gehenna * Ichiro FUKUHARA <ichiro (at) ichiro.org>.
5 1.1.2.2 gehenna * All rights reserved.
6 1.1.2.2 gehenna *
7 1.1.2.2 gehenna * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 gehenna * modification, are permitted provided that the following conditions
9 1.1.2.2 gehenna * are met:
10 1.1.2.2 gehenna * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 gehenna * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 gehenna * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 gehenna * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 gehenna * documentation and/or other materials provided with the distribution.
15 1.1.2.2 gehenna * 3. All advertising materials mentioning features or use of this software
16 1.1.2.2 gehenna * must display the following acknowledgement:
17 1.1.2.2 gehenna * This product includes software developed by Ichiro FUKUHARA.
18 1.1.2.2 gehenna * 4. The name of the company nor the name of the author may be used to
19 1.1.2.2 gehenna * endorse or promote products derived from this software without specific
20 1.1.2.2 gehenna * prior written permission.
21 1.1.2.2 gehenna *
22 1.1.2.2 gehenna * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
23 1.1.2.2 gehenna * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.1.2.2 gehenna * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.1.2.2 gehenna * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
26 1.1.2.2 gehenna * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1.2.2 gehenna * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1.2.2 gehenna * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1.2.2 gehenna * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1.2.2 gehenna * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1.2.2 gehenna * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1.2.2 gehenna * SUCH DAMAGE.
33 1.1.2.2 gehenna */
34 1.1.2.2 gehenna
35 1.1.2.2 gehenna #include <sys/param.h>
36 1.1.2.2 gehenna #include <sys/systm.h>
37 1.1.2.2 gehenna #include <sys/device.h>
38 1.1.2.2 gehenna #include <sys/malloc.h>
39 1.1.2.2 gehenna #include <sys/mbuf.h>
40 1.1.2.2 gehenna
41 1.1.2.2 gehenna #include <uvm/uvm_extern.h>
42 1.1.2.2 gehenna
43 1.1.2.2 gehenna #define _ARM32_BUS_DMA_PRIVATE
44 1.1.2.2 gehenna #include <machine/bus.h>
45 1.1.2.2 gehenna
46 1.1.2.2 gehenna void
47 1.1.2.2 gehenna ixp12x0_pci_dma_init(bus_dma_tag_t dmat, void *cookie)
48 1.1.2.2 gehenna {
49 1.1.2.2 gehenna dmat->_ranges = 0;
50 1.1.2.2 gehenna dmat->_nranges = 0;
51 1.1.2.2 gehenna
52 1.1.2.2 gehenna dmat->_dmamap_create = _bus_dmamap_create;
53 1.1.2.2 gehenna dmat->_dmamap_destroy = _bus_dmamap_destroy;
54 1.1.2.3 gehenna dmat->_dmamap_load = _bus_dmamap_load;
55 1.1.2.3 gehenna dmat->_dmamap_load_mbuf = _bus_dmamap_load_mbuf;
56 1.1.2.3 gehenna dmat->_dmamap_load_uio = _bus_dmamap_load_uio;
57 1.1.2.3 gehenna dmat->_dmamap_load_raw = _bus_dmamap_load_raw;
58 1.1.2.2 gehenna dmat->_dmamap_unload = _bus_dmamap_unload;
59 1.1.2.3 gehenna dmat->_dmamap_sync_pre = _bus_dmamap_sync;
60 1.1.2.3 gehenna dmat->_dmamap_sync_post = NULL;
61 1.1.2.3 gehenna dmat->_dmamem_alloc = _bus_dmamem_alloc;
62 1.1.2.2 gehenna dmat->_dmamem_free = _bus_dmamem_free;
63 1.1.2.2 gehenna dmat->_dmamem_map = _bus_dmamem_map;
64 1.1.2.2 gehenna dmat->_dmamem_unmap = _bus_dmamem_unmap;
65 1.1.2.2 gehenna dmat->_dmamem_mmap = _bus_dmamem_mmap;
66 1.1.2.2 gehenna }
67