1/* $Id: dmamap.h,v 1.1.1.1 2008/10/15 03:27:17 james26_jang Exp $
2 *
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License.  See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1992 - 1997, 2000-2001 Silicon Graphics, Inc. All rights reserved.
8 */
9#ifndef _ASM_IA64_SN_DMAMAP_H
10#define _ASM_IA64_SN_DMAMAP_H
11
12#include <asm/sn/sv.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/*
19 * Definitions for allocating, freeing, and using DMA maps
20 */
21
22/*
23 * DMA map types
24 */
25#define	DMA_SCSI	0
26#define	DMA_A24VME	1		/* Challenge/Onyx only 	*/
27#define	DMA_A32VME	2		/* Challenge/Onyx only 	*/
28#define	DMA_A64VME	3		/* SN0/Racer */
29
30#define	DMA_EISA	4
31
32#define	DMA_PCI32	5		/* SN0/Racer 	*/
33#define	DMA_PCI64	6		/* SN0/Racer 	*/
34
35/*
36 * DMA map structure as returned by dma_mapalloc()
37 */
38typedef struct dmamap {
39	int		dma_type;	/* Map type (see above) */
40	int		dma_adap;	/* I/O adapter */
41	int		dma_index;	/* Beginning map register to use */
42	int		dma_size;	/* Number of map registers to use */
43	paddr_t		dma_addr;	/* Corresponding bus addr for A24/A32 */
44	caddr_t		dma_virtaddr;	/* Beginning virtual address that is mapped */
45} dmamap_t;
46
47struct alenlist_s;
48
49/*
50 * Prototypes of exported functions
51 */
52extern dmamap_t	*dma_mapalloc(int, int, int, int);
53extern void	dma_mapfree(dmamap_t *);
54extern int	dma_map(dmamap_t *, caddr_t, int);
55extern int	dma_map2(dmamap_t *, caddr_t, caddr_t, int);
56extern paddr_t	dma_mapaddr(dmamap_t *, caddr_t);
57#ifdef LATER
58extern int	dma_mapbp(dmamap_t *, buf_t *, int);
59#endif
60extern int	dma_map_alenlist(dmamap_t *, struct alenlist_s *, size_t);
61extern uint	ev_kvtoiopnum(caddr_t);
62
63/*
64 * These variables are defined in master.d/kernel
65 */
66extern struct map *a24map[];
67extern struct map *a32map[];
68
69extern int a24_mapsize;
70extern int a32_mapsize;
71
72extern sv_t dmamapout;
73
74#ifdef __cplusplus
75}
76#endif
77
78/* standard flags values for pio_map routines,
79 * including {xtalk,pciio}_dmamap calls.
80 * NOTE: try to keep these in step with PIOMAP flags.
81 */
82#define DMAMAP_FIXED	0x1
83#define DMAMAP_NOSLEEP	0x2
84#define	DMAMAP_INPLACE	0x4
85
86#define	DMAMAP_FLAGS	0x7
87
88#endif /* _ASM_IA64_SN_DMAMAP_H */
89