1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef __ABC_PCIE_DMA_H 20 #define __ABC_PCIE_DMA_H 21 #include <linux/ioctl.h> 22 #include <linux/types.h> 23 #define ABC_PCIE_DMA_IOC_MAGIC 'U' 24 enum dma_buf_type { 25 DMA_BUFFER_USER = 0, 26 DMA_BUFFER_DMA_BUF 27 }; 28 enum abc_dma_data_direction { 29 ABC_DMA_TO_DEVICE = 1, 30 ABC_DMA_FROM_DEVICE = 2, 31 }; 32 struct abc_pcie_dma_desc_legacy { 33 enum dma_buf_type local_buf_type; 34 union { 35 void * local_buf; 36 int local_dma_buf_fd; 37 }; 38 __u32 local_buf_size; 39 enum dma_buf_type remote_buf_type; 40 union { 41 __u64 remote_buf; 42 int remote_dma_buf_fd; 43 }; 44 enum abc_dma_data_direction dir; 45 __u8 chan; 46 }; 47 struct abc_pcie_dma_desc { 48 enum dma_buf_type local_buf_type; 49 union { 50 void * local_buf; 51 int local_dma_buf_fd; 52 }; 53 __u64 local_dma_buf_off; 54 enum dma_buf_type remote_buf_type; 55 union { 56 __u64 remote_buf; 57 int remote_dma_buf_fd; 58 }; 59 __u64 remote_dma_buf_off; 60 __u64 size; 61 enum abc_dma_data_direction dir; 62 }; 63 struct abc_pcie_dma_desc_async { 64 struct abc_pcie_dma_desc dma_desc; 65 __u64 id; 66 }; 67 struct abc_pcie_dma_desc_start { 68 __u64 id; 69 __u32 start_id; 70 }; 71 struct abc_pcie_dma_desc_wait { 72 __u64 id; 73 int timeout; 74 int error; 75 __u32 start_id; 76 }; 77 #define ABC_PCIE_DMA_IOC_POST_DMA_XFER_LEGACY _IOW(ABC_PCIE_DMA_IOC_MAGIC, 1, struct abc_pcie_dma_desc_legacy *) 78 #define ABC_PCIE_DMA_IOC_POST_DMA_XFER_SYNC _IOW(ABC_PCIE_DMA_IOC_MAGIC, 2, struct abc_pcie_dma_desc) 79 #define ABC_PCIE_DMA_IOC_POST_DMA_XFER_CREATE _IOWR(ABC_PCIE_DMA_IOC_MAGIC, 3, struct abc_pcie_dma_desc_async) 80 #define ABC_PCIE_DMA_IOC_POST_DMA_XFER_START _IOWR(ABC_PCIE_DMA_IOC_MAGIC, 4, struct abc_pcie_dma_desc_start) 81 #define ABC_PCIE_DMA_IOC_POST_DMA_XFER_WAIT _IOWR(ABC_PCIE_DMA_IOC_MAGIC, 5, struct abc_pcie_dma_desc_wait) 82 #define ABC_PCIE_DMA_IOC_POST_DMA_XFER_CLEAN _IOW(ABC_PCIE_DMA_IOC_MAGIC, 6, __u64) 83 #endif 84