Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame^] | 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 | */ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 7 | #ifndef _CXLFLASH_IOCTL_H |
| 8 | #define _CXLFLASH_IOCTL_H |
| 9 | #include <linux/types.h> |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 10 | #define CXLFLASH_WWID_LEN 16 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 11 | #define DK_CXLFLASH_VERSION_0 0 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 12 | struct dk_cxlflash_hdr { |
| 13 | __u16 version; |
| 14 | __u16 rsvd[3]; |
| 15 | __u64 flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 16 | __u64 return_flags; |
| 17 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 18 | #define DK_CXLFLASH_ALL_PORTS_ACTIVE 0x0000000000000001ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 19 | #define DK_CXLFLASH_APP_CLOSE_ADAP_FD 0x0000000000000002ULL |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 20 | #define DK_CXLFLASH_CONTEXT_SQ_CMD_MODE 0x0000000000000004ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 21 | #define DK_CXLFLASH_ATTACH_REUSE_CONTEXT 0x8000000000000000ULL |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 22 | struct dk_cxlflash_attach { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 23 | struct dk_cxlflash_hdr hdr; |
| 24 | __u64 num_interrupts; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 25 | __u64 context_id; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 26 | __u64 mmio_size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 27 | __u64 block_size; |
| 28 | __u64 adap_fd; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 29 | __u64 last_lba; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 30 | __u64 max_xfer; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 31 | __u64 reserved[8]; |
| 32 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 33 | struct dk_cxlflash_detach { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 34 | struct dk_cxlflash_hdr hdr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 35 | __u64 context_id; |
| 36 | __u64 reserved[8]; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 37 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 38 | struct dk_cxlflash_udirect { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 39 | struct dk_cxlflash_hdr hdr; |
| 40 | __u64 context_id; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 41 | __u64 rsrc_handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 42 | __u64 last_lba; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 43 | __u64 reserved[8]; |
| 44 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 45 | #define DK_CXLFLASH_UVIRTUAL_NEED_WRITE_SAME 0x8000000000000000ULL |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 46 | struct dk_cxlflash_uvirtual { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 47 | struct dk_cxlflash_hdr hdr; |
| 48 | __u64 context_id; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 49 | __u64 lun_size; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 50 | __u64 rsrc_handle; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 51 | __u64 last_lba; |
| 52 | __u64 reserved[8]; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 53 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 54 | struct dk_cxlflash_release { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 55 | struct dk_cxlflash_hdr hdr; |
| 56 | __u64 context_id; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 57 | __u64 rsrc_handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 58 | __u64 reserved[8]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 59 | }; |
| 60 | struct dk_cxlflash_resize { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 61 | struct dk_cxlflash_hdr hdr; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 62 | __u64 context_id; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 63 | __u64 rsrc_handle; |
| 64 | __u64 req_size; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 65 | __u64 last_lba; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 66 | __u64 reserved[8]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 67 | }; |
| 68 | struct dk_cxlflash_clone { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 69 | struct dk_cxlflash_hdr hdr; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 70 | __u64 context_id_src; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 71 | __u64 context_id_dst; |
| 72 | __u64 adap_fd_src; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 73 | __u64 reserved[8]; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 74 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 75 | #define DK_CXLFLASH_VERIFY_SENSE_LEN 18 |
| 76 | #define DK_CXLFLASH_VERIFY_HINT_SENSE 0x8000000000000000ULL |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 77 | struct dk_cxlflash_verify { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 78 | struct dk_cxlflash_hdr hdr; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 79 | __u64 context_id; |
| 80 | __u64 rsrc_handle; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 81 | __u64 hint; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 82 | __u64 last_lba; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 83 | __u8 sense_data[DK_CXLFLASH_VERIFY_SENSE_LEN]; |
| 84 | __u8 pad[6]; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 85 | __u64 reserved[8]; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 86 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 87 | #define DK_CXLFLASH_RECOVER_AFU_CONTEXT_RESET 0x8000000000000000ULL |
| 88 | struct dk_cxlflash_recover_afu { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 89 | struct dk_cxlflash_hdr hdr; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 90 | __u64 reason; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 91 | __u64 context_id; |
| 92 | __u64 mmio_size; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 93 | __u64 adap_fd; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 94 | __u64 reserved[8]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 95 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 96 | #define DK_CXLFLASH_MANAGE_LUN_WWID_LEN CXLFLASH_WWID_LEN |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 97 | #define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 98 | #define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 99 | #define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL |
| 100 | struct dk_cxlflash_manage_lun { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 101 | struct dk_cxlflash_hdr hdr; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 102 | __u8 wwid[DK_CXLFLASH_MANAGE_LUN_WWID_LEN]; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 103 | __u64 reserved[8]; |
| 104 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 105 | union cxlflash_ioctls { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 106 | struct dk_cxlflash_attach attach; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 107 | struct dk_cxlflash_detach detach; |
| 108 | struct dk_cxlflash_udirect udirect; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 109 | struct dk_cxlflash_uvirtual uvirtual; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 110 | struct dk_cxlflash_release release; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 111 | struct dk_cxlflash_resize resize; |
| 112 | struct dk_cxlflash_clone clone; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 113 | struct dk_cxlflash_verify verify; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 114 | struct dk_cxlflash_recover_afu recover_afu; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 115 | struct dk_cxlflash_manage_lun manage_lun; |
| 116 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 117 | #define MAX_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ioctls)) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 118 | #define CXL_MAGIC 0xCA |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 119 | #define CXL_IOWR(_n,_s) _IOWR(CXL_MAGIC, _n, struct _s) |
| 120 | #define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 121 | #define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 122 | #define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 123 | #define DK_CXLFLASH_DETACH CXL_IOWR(0x83, dk_cxlflash_detach) |
| 124 | #define DK_CXLFLASH_VERIFY CXL_IOWR(0x84, dk_cxlflash_verify) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 125 | #define DK_CXLFLASH_RECOVER_AFU CXL_IOWR(0x85, dk_cxlflash_recover_afu) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 126 | #define DK_CXLFLASH_MANAGE_LUN CXL_IOWR(0x86, dk_cxlflash_manage_lun) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 127 | #define DK_CXLFLASH_USER_VIRTUAL CXL_IOWR(0x87, dk_cxlflash_uvirtual) |
| 128 | #define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 129 | #define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 130 | #define HT_CXLFLASH_VERSION_0 0 |
| 131 | struct ht_cxlflash_hdr { |
| 132 | __u16 version; |
| 133 | __u16 subcmd; |
| 134 | __u16 rsvd[2]; |
| 135 | __u64 flags; |
| 136 | __u64 return_flags; |
| 137 | }; |
| 138 | #define HT_CXLFLASH_HOST_READ 0x0000000000000000ULL |
| 139 | #define HT_CXLFLASH_HOST_WRITE 0x0000000000000001ULL |
| 140 | #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_CREATE_LUN 0x0001 |
| 141 | #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_DELETE_LUN 0x0002 |
| 142 | #define HT_CXLFLASH_LUN_PROVISION_SUBCMD_QUERY_PORT 0x0003 |
| 143 | struct ht_cxlflash_lun_provision { |
| 144 | struct ht_cxlflash_hdr hdr; |
| 145 | __u16 port; |
| 146 | __u16 reserved16[3]; |
| 147 | __u64 size; |
| 148 | __u64 lun_id; |
| 149 | __u8 wwid[CXLFLASH_WWID_LEN]; |
| 150 | __u64 max_num_luns; |
| 151 | __u64 cur_num_luns; |
| 152 | __u64 max_cap_port; |
| 153 | __u64 cur_cap_port; |
| 154 | __u64 reserved[8]; |
| 155 | }; |
| 156 | #define HT_CXLFLASH_AFU_DEBUG_MAX_DATA_LEN 262144 |
| 157 | #define HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN 12 |
| 158 | struct ht_cxlflash_afu_debug { |
| 159 | struct ht_cxlflash_hdr hdr; |
| 160 | __u8 reserved8[4]; |
| 161 | __u8 afu_subcmd[HT_CXLFLASH_AFU_DEBUG_SUBCMD_LEN]; |
| 162 | __u64 data_ea; |
| 163 | __u32 data_len; |
| 164 | __u32 reserved32; |
| 165 | __u64 reserved[8]; |
| 166 | }; |
| 167 | union cxlflash_ht_ioctls { |
| 168 | struct ht_cxlflash_lun_provision lun_provision; |
| 169 | struct ht_cxlflash_afu_debug afu_debug; |
| 170 | }; |
| 171 | #define MAX_HT_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ht_ioctls)) |
| 172 | #define HT_CXLFLASH_LUN_PROVISION CXL_IOWR(0xBF, ht_cxlflash_lun_provision) |
| 173 | #define HT_CXLFLASH_AFU_DEBUG CXL_IOWR(0xBE, ht_cxlflash_afu_debug) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 174 | #endif |