1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_LINUX_FPGA_DFL_H 7 #define _UAPI_LINUX_FPGA_DFL_H 8 #include <linux/types.h> 9 #include <linux/ioctl.h> 10 #define DFL_FPGA_API_VERSION 0 11 #define DFL_FPGA_MAGIC 0xB6 12 #define DFL_FPGA_BASE 0 13 #define DFL_PORT_BASE 0x40 14 #define DFL_FME_BASE 0x80 15 #define DFL_FPGA_GET_API_VERSION _IO(DFL_FPGA_MAGIC, DFL_FPGA_BASE + 0) 16 #define DFL_FPGA_CHECK_EXTENSION _IO(DFL_FPGA_MAGIC, DFL_FPGA_BASE + 1) 17 #define DFL_FPGA_PORT_RESET _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 0) 18 struct dfl_fpga_port_info { 19 20 __u32 argsz; 21 22 __u32 flags; 23 __u32 num_regions; 24 __u32 num_umsgs; 25 }; 26 #define DFL_FPGA_PORT_GET_INFO _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 1) 27 struct dfl_fpga_port_region_info { 28 29 __u32 argsz; 30 31 __u32 flags; 32 #define DFL_PORT_REGION_READ (1 << 0) 33 #define DFL_PORT_REGION_WRITE (1 << 1) 34 #define DFL_PORT_REGION_MMAP (1 << 2) 35 36 __u32 index; 37 #define DFL_PORT_REGION_INDEX_AFU 0 38 #define DFL_PORT_REGION_INDEX_STP 1 39 __u32 padding; 40 41 __u64 size; 42 __u64 offset; 43 }; 44 #define DFL_FPGA_PORT_GET_REGION_INFO _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 2) 45 struct dfl_fpga_port_dma_map { 46 47 __u32 argsz; 48 __u32 flags; 49 __u64 user_addr; 50 __u64 length; 51 52 __u64 iova; 53 }; 54 #define DFL_FPGA_PORT_DMA_MAP _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 3) 55 struct dfl_fpga_port_dma_unmap { 56 57 __u32 argsz; 58 __u32 flags; 59 __u64 iova; 60 }; 61 #define DFL_FPGA_PORT_DMA_UNMAP _IO(DFL_FPGA_MAGIC, DFL_PORT_BASE + 4) 62 struct dfl_fpga_fme_port_pr { 63 64 __u32 argsz; 65 __u32 flags; 66 __u32 port_id; 67 __u32 buffer_size; 68 __u64 buffer_address; 69 }; 70 #define DFL_FPGA_FME_PORT_PR _IO(DFL_FPGA_MAGIC, DFL_FME_BASE + 0) 71 #endif 72