blob: 027e078851891aa5669162cd607d9b0165f3e45f [file] [log] [blame]
Christopher Ferris05d08e92016-02-04 13:16:38 -08001/****************************************************************************
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 _CXLFLASH_IOCTL_H
20#define _CXLFLASH_IOCTL_H
21#include <linux/types.h>
22#define DK_CXLFLASH_VERSION_0 0
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24struct dk_cxlflash_hdr {
25 __u16 version;
26 __u16 rsvd[3];
27 __u64 flags;
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 __u64 return_flags;
30};
Christopher Ferris106b3a82016-08-24 12:15:38 -070031#define DK_CXLFLASH_ALL_PORTS_ACTIVE 0x0000000000000001ULL
Christopher Ferris6a9755d2017-01-13 14:09:31 -080032#define DK_CXLFLASH_APP_CLOSE_ADAP_FD 0x0000000000000002ULL
Christopher Ferris05d08e92016-02-04 13:16:38 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080034#define DK_CXLFLASH_ATTACH_REUSE_CONTEXT 0x8000000000000000ULL
Christopher Ferris106b3a82016-08-24 12:15:38 -070035struct dk_cxlflash_attach {
Christopher Ferris05d08e92016-02-04 13:16:38 -080036 struct dk_cxlflash_hdr hdr;
37 __u64 num_interrupts;
Christopher Ferris05d08e92016-02-04 13:16:38 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080039 __u64 context_id;
Christopher Ferris106b3a82016-08-24 12:15:38 -070040 __u64 mmio_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080041 __u64 block_size;
42 __u64 adap_fd;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080044 __u64 last_lba;
Christopher Ferris106b3a82016-08-24 12:15:38 -070045 __u64 max_xfer;
Christopher Ferris05d08e92016-02-04 13:16:38 -080046 __u64 reserved[8];
47};
Christopher Ferris05d08e92016-02-04 13:16:38 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080049struct dk_cxlflash_detach {
Christopher Ferris106b3a82016-08-24 12:15:38 -070050 struct dk_cxlflash_hdr hdr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080051 __u64 context_id;
52 __u64 reserved[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080054};
Christopher Ferris106b3a82016-08-24 12:15:38 -070055struct dk_cxlflash_udirect {
Christopher Ferris05d08e92016-02-04 13:16:38 -080056 struct dk_cxlflash_hdr hdr;
57 __u64 context_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080059 __u64 rsrc_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070060 __u64 last_lba;
Christopher Ferris05d08e92016-02-04 13:16:38 -080061 __u64 reserved[8];
62};
Christopher Ferris05d08e92016-02-04 13:16:38 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080064#define DK_CXLFLASH_UVIRTUAL_NEED_WRITE_SAME 0x8000000000000000ULL
Christopher Ferris106b3a82016-08-24 12:15:38 -070065struct dk_cxlflash_uvirtual {
Christopher Ferris05d08e92016-02-04 13:16:38 -080066 struct dk_cxlflash_hdr hdr;
67 __u64 context_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080069 __u64 lun_size;
Christopher Ferris106b3a82016-08-24 12:15:38 -070070 __u64 rsrc_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -080071 __u64 last_lba;
72 __u64 reserved[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080074};
Christopher Ferris106b3a82016-08-24 12:15:38 -070075struct dk_cxlflash_release {
Christopher Ferris05d08e92016-02-04 13:16:38 -080076 struct dk_cxlflash_hdr hdr;
77 __u64 context_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080079 __u64 rsrc_handle;
Christopher Ferris106b3a82016-08-24 12:15:38 -070080 __u64 reserved[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -080081};
82struct dk_cxlflash_resize {
Christopher Ferris05d08e92016-02-04 13:16:38 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080084 struct dk_cxlflash_hdr hdr;
Christopher Ferris106b3a82016-08-24 12:15:38 -070085 __u64 context_id;
Christopher Ferris05d08e92016-02-04 13:16:38 -080086 __u64 rsrc_handle;
87 __u64 req_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080089 __u64 last_lba;
Christopher Ferris106b3a82016-08-24 12:15:38 -070090 __u64 reserved[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -080091};
92struct dk_cxlflash_clone {
Christopher Ferris05d08e92016-02-04 13:16:38 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080094 struct dk_cxlflash_hdr hdr;
Christopher Ferris106b3a82016-08-24 12:15:38 -070095 __u64 context_id_src;
Christopher Ferris05d08e92016-02-04 13:16:38 -080096 __u64 context_id_dst;
97 __u64 adap_fd_src;
Christopher Ferris05d08e92016-02-04 13:16:38 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080099 __u64 reserved[8];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700100};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800101#define DK_CXLFLASH_VERIFY_SENSE_LEN 18
102#define DK_CXLFLASH_VERIFY_HINT_SENSE 0x8000000000000000ULL
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800104struct dk_cxlflash_verify {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700105 struct dk_cxlflash_hdr hdr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106 __u64 context_id;
107 __u64 rsrc_handle;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800109 __u64 hint;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700110 __u64 last_lba;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 __u8 sense_data[DK_CXLFLASH_VERIFY_SENSE_LEN];
112 __u8 pad[6];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800114 __u64 reserved[8];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700115};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800116#define DK_CXLFLASH_RECOVER_AFU_CONTEXT_RESET 0x8000000000000000ULL
117struct dk_cxlflash_recover_afu {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800119 struct dk_cxlflash_hdr hdr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700120 __u64 reason;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800121 __u64 context_id;
122 __u64 mmio_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800124 __u64 adap_fd;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125 __u64 reserved[8];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800126};
127#define DK_CXLFLASH_MANAGE_LUN_WWID_LEN 16
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800129#define DK_CXLFLASH_MANAGE_LUN_ENABLE_SUPERPIPE 0x8000000000000000ULL
Christopher Ferris106b3a82016-08-24 12:15:38 -0700130#define DK_CXLFLASH_MANAGE_LUN_DISABLE_SUPERPIPE 0x4000000000000000ULL
Christopher Ferris05d08e92016-02-04 13:16:38 -0800131#define DK_CXLFLASH_MANAGE_LUN_ALL_PORTS_ACCESSIBLE 0x2000000000000000ULL
132struct dk_cxlflash_manage_lun {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800134 struct dk_cxlflash_hdr hdr;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135 __u8 wwid[DK_CXLFLASH_MANAGE_LUN_WWID_LEN];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800136 __u64 reserved[8];
137};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800139union cxlflash_ioctls {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700140 struct dk_cxlflash_attach attach;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141 struct dk_cxlflash_detach detach;
142 struct dk_cxlflash_udirect udirect;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800144 struct dk_cxlflash_uvirtual uvirtual;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700145 struct dk_cxlflash_release release;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800146 struct dk_cxlflash_resize resize;
147 struct dk_cxlflash_clone clone;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800149 struct dk_cxlflash_verify verify;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700150 struct dk_cxlflash_recover_afu recover_afu;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800151 struct dk_cxlflash_manage_lun manage_lun;
152};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800154#define MAX_CXLFLASH_IOCTL_SZ (sizeof(union cxlflash_ioctls))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155#define CXL_MAGIC 0xCA
Christopher Ferris05d08e92016-02-04 13:16:38 -0800156#define CXL_IOWR(_n,_s) _IOWR(CXL_MAGIC, _n, struct _s)
157#define DK_CXLFLASH_ATTACH CXL_IOWR(0x80, dk_cxlflash_attach)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800159#define DK_CXLFLASH_USER_DIRECT CXL_IOWR(0x81, dk_cxlflash_udirect)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700160#define DK_CXLFLASH_RELEASE CXL_IOWR(0x82, dk_cxlflash_release)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800161#define DK_CXLFLASH_DETACH CXL_IOWR(0x83, dk_cxlflash_detach)
162#define DK_CXLFLASH_VERIFY CXL_IOWR(0x84, dk_cxlflash_verify)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800164#define DK_CXLFLASH_RECOVER_AFU CXL_IOWR(0x85, dk_cxlflash_recover_afu)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700165#define DK_CXLFLASH_MANAGE_LUN CXL_IOWR(0x86, dk_cxlflash_manage_lun)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800166#define DK_CXLFLASH_USER_VIRTUAL CXL_IOWR(0x87, dk_cxlflash_uvirtual)
167#define DK_CXLFLASH_VLUN_RESIZE CXL_IOWR(0x88, dk_cxlflash_resize)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800169#define DK_CXLFLASH_VLUN_CLONE CXL_IOWR(0x89, dk_cxlflash_clone)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700170#endif