Initial import from qualcomm sources
[gearbox.git] / usr / uio-dma-ioctl.h
blob8f0d3d7146df2af8859ed2f4ae2596622f23dd2f
1 /**
2 UIO DMA library.
3 Copyright (C) 2009 Qualcomm Inc. All rights reserved.
4 Written by Max Krasnyansky <maxk@qualcommm.com>
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright
10 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.
16 3. Neither the name of the QUALCOMM Incorporated nor the
17 names of any contributors may be used to endorse or promote products
18 derived from this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY QUALCOMM AND ANY OTHER CONTRIBUTORS
21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL QUALCOMM
24 AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED
26 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING
29 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef UIO_DMA_IOCTL_H
34 #define UIO_DMA_IOCTL_H
36 #include <stdint.h>
38 /* ioctl defines */
40 #define UIO_DMA_ALLOC _IOW('U', 200, int)
41 struct uio_dma_alloc_req {
42 uint64_t dma_mask;
43 uint16_t memnode;
44 uint16_t cache;
45 uint32_t flags;
46 uint32_t chunk_size;
47 uint32_t chunk_count;
48 uint64_t mmap_offset;
51 #define UIO_DMA_FREE _IOW('U', 201, int)
52 struct uio_dma_free_req {
53 uint64_t mmap_offset;
56 #define UIO_DMA_MAP _IOW('U', 202, int)
57 struct uio_dma_map_req {
58 uint64_t mmap_offset;
59 uint32_t flags;
60 uint32_t devid;
61 uint8_t direction;
62 uint32_t chunk_count;
63 uint32_t chunk_size;
64 uint64_t dmaddr[0];
67 #define UIO_DMA_UNMAP _IOW('U', 203, int)
68 struct uio_dma_unmap_req {
69 uint64_t mmap_offset;
70 uint32_t devid;
71 uint32_t flags;
72 uint8_t direction;
75 #endif /* UIO_DMA_IOCTL_H */