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