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 _RIO_MPORT_CDEV_H_ 20 #define _RIO_MPORT_CDEV_H_ 21 #include <linux/ioctl.h> 22 #include <linux/types.h> 23 struct rio_mport_maint_io { 24 __u16 rioid; 25 __u8 hopcount; 26 __u8 pad0[5]; 27 __u32 offset; 28 __u32 length; 29 __u64 buffer; 30 }; 31 #define RIO_TRANSFER_MODE_MAPPED (1 << 0) 32 #define RIO_TRANSFER_MODE_TRANSFER (1 << 1) 33 #define RIO_CAP_DBL_SEND (1 << 2) 34 #define RIO_CAP_DBL_RECV (1 << 3) 35 #define RIO_CAP_PW_SEND (1 << 4) 36 #define RIO_CAP_PW_RECV (1 << 5) 37 #define RIO_CAP_MAP_OUTB (1 << 6) 38 #define RIO_CAP_MAP_INB (1 << 7) 39 struct rio_mport_properties { 40 __u16 hdid; 41 __u8 id; 42 __u8 index; 43 __u32 flags; 44 __u32 sys_size; 45 __u8 port_ok; 46 __u8 link_speed; 47 __u8 link_width; 48 __u8 pad0; 49 __u32 dma_max_sge; 50 __u32 dma_max_size; 51 __u32 dma_align; 52 __u32 transfer_mode; 53 __u32 cap_sys_size; 54 __u32 cap_addr_size; 55 __u32 cap_transfer_mode; 56 __u32 cap_mport; 57 }; 58 #define RIO_DOORBELL (1 << 0) 59 #define RIO_PORTWRITE (1 << 1) 60 struct rio_doorbell { 61 __u16 rioid; 62 __u16 payload; 63 }; 64 struct rio_doorbell_filter { 65 __u16 rioid; 66 __u16 low; 67 __u16 high; 68 __u16 pad0; 69 }; 70 struct rio_portwrite { 71 __u32 payload[16]; 72 }; 73 struct rio_pw_filter { 74 __u32 mask; 75 __u32 low; 76 __u32 high; 77 __u32 pad0; 78 }; 79 #define RIO_MAP_ANY_ADDR (__u64) (~((__u64) 0)) 80 struct rio_mmap { 81 __u16 rioid; 82 __u16 pad0[3]; 83 __u64 rio_addr; 84 __u64 length; 85 __u64 handle; 86 __u64 address; 87 }; 88 struct rio_dma_mem { 89 __u64 length; 90 __u64 dma_handle; 91 __u64 address; 92 }; 93 struct rio_event { 94 __u32 header; 95 union { 96 struct rio_doorbell doorbell; 97 struct rio_portwrite portwrite; 98 } u; 99 __u32 pad0; 100 }; 101 enum rio_transfer_sync { 102 RIO_TRANSFER_SYNC, 103 RIO_TRANSFER_ASYNC, 104 RIO_TRANSFER_FAF, 105 }; 106 enum rio_transfer_dir { 107 RIO_TRANSFER_DIR_READ, 108 RIO_TRANSFER_DIR_WRITE, 109 }; 110 enum rio_exchange { 111 RIO_EXCHANGE_DEFAULT, 112 RIO_EXCHANGE_NWRITE, 113 RIO_EXCHANGE_SWRITE, 114 RIO_EXCHANGE_NWRITE_R, 115 RIO_EXCHANGE_SWRITE_R, 116 RIO_EXCHANGE_NWRITE_R_ALL, 117 }; 118 struct rio_transfer_io { 119 __u64 rio_addr; 120 __u64 loc_addr; 121 __u64 handle; 122 __u64 offset; 123 __u64 length; 124 __u16 rioid; 125 __u16 method; 126 __u32 completion_code; 127 }; 128 struct rio_transaction { 129 __u64 block; 130 __u32 count; 131 __u32 transfer_mode; 132 __u16 sync; 133 __u16 dir; 134 __u32 pad0; 135 }; 136 struct rio_async_tx_wait { 137 __u32 token; 138 __u32 timeout; 139 }; 140 #define RIO_MAX_DEVNAME_SZ 20 141 struct rio_rdev_info { 142 __u16 destid; 143 __u8 hopcount; 144 __u8 pad0; 145 __u32 comptag; 146 char name[RIO_MAX_DEVNAME_SZ + 1]; 147 }; 148 #define RIO_MPORT_DRV_MAGIC 'm' 149 #define RIO_MPORT_MAINT_HDID_SET _IOW(RIO_MPORT_DRV_MAGIC, 1, __u16) 150 #define RIO_MPORT_MAINT_COMPTAG_SET _IOW(RIO_MPORT_DRV_MAGIC, 2, __u32) 151 #define RIO_MPORT_MAINT_PORT_IDX_GET _IOR(RIO_MPORT_DRV_MAGIC, 3, __u32) 152 #define RIO_MPORT_GET_PROPERTIES _IOR(RIO_MPORT_DRV_MAGIC, 4, struct rio_mport_properties) 153 #define RIO_MPORT_MAINT_READ_LOCAL _IOR(RIO_MPORT_DRV_MAGIC, 5, struct rio_mport_maint_io) 154 #define RIO_MPORT_MAINT_WRITE_LOCAL _IOW(RIO_MPORT_DRV_MAGIC, 6, struct rio_mport_maint_io) 155 #define RIO_MPORT_MAINT_READ_REMOTE _IOR(RIO_MPORT_DRV_MAGIC, 7, struct rio_mport_maint_io) 156 #define RIO_MPORT_MAINT_WRITE_REMOTE _IOW(RIO_MPORT_DRV_MAGIC, 8, struct rio_mport_maint_io) 157 #define RIO_ENABLE_DOORBELL_RANGE _IOW(RIO_MPORT_DRV_MAGIC, 9, struct rio_doorbell_filter) 158 #define RIO_DISABLE_DOORBELL_RANGE _IOW(RIO_MPORT_DRV_MAGIC, 10, struct rio_doorbell_filter) 159 #define RIO_ENABLE_PORTWRITE_RANGE _IOW(RIO_MPORT_DRV_MAGIC, 11, struct rio_pw_filter) 160 #define RIO_DISABLE_PORTWRITE_RANGE _IOW(RIO_MPORT_DRV_MAGIC, 12, struct rio_pw_filter) 161 #define RIO_SET_EVENT_MASK _IOW(RIO_MPORT_DRV_MAGIC, 13, __u32) 162 #define RIO_GET_EVENT_MASK _IOR(RIO_MPORT_DRV_MAGIC, 14, __u32) 163 #define RIO_MAP_OUTBOUND _IOWR(RIO_MPORT_DRV_MAGIC, 15, struct rio_mmap) 164 #define RIO_UNMAP_OUTBOUND _IOW(RIO_MPORT_DRV_MAGIC, 16, struct rio_mmap) 165 #define RIO_MAP_INBOUND _IOWR(RIO_MPORT_DRV_MAGIC, 17, struct rio_mmap) 166 #define RIO_UNMAP_INBOUND _IOW(RIO_MPORT_DRV_MAGIC, 18, __u64) 167 #define RIO_ALLOC_DMA _IOWR(RIO_MPORT_DRV_MAGIC, 19, struct rio_dma_mem) 168 #define RIO_FREE_DMA _IOW(RIO_MPORT_DRV_MAGIC, 20, __u64) 169 #define RIO_TRANSFER _IOWR(RIO_MPORT_DRV_MAGIC, 21, struct rio_transaction) 170 #define RIO_WAIT_FOR_ASYNC _IOW(RIO_MPORT_DRV_MAGIC, 22, struct rio_async_tx_wait) 171 #define RIO_DEV_ADD _IOW(RIO_MPORT_DRV_MAGIC, 23, struct rio_rdev_info) 172 #define RIO_DEV_DEL _IOW(RIO_MPORT_DRV_MAGIC, 24, struct rio_rdev_info) 173 #endif 174