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