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 _UAPI_LINUX_NVME_IOCTL_H 8 #define _UAPI_LINUX_NVME_IOCTL_H 9 #include <linux/types.h> 10 struct nvme_user_io { 11 __u8 opcode; 12 __u8 flags; 13 __u16 control; 14 __u16 nblocks; 15 __u16 rsvd; 16 __u64 metadata; 17 __u64 addr; 18 __u64 slba; 19 __u32 dsmgmt; 20 __u32 reftag; 21 __u16 apptag; 22 __u16 appmask; 23 }; 24 struct nvme_passthru_cmd { 25 __u8 opcode; 26 __u8 flags; 27 __u16 rsvd1; 28 __u32 nsid; 29 __u32 cdw2; 30 __u32 cdw3; 31 __u64 metadata; 32 __u64 addr; 33 __u32 metadata_len; 34 __u32 data_len; 35 __u32 cdw10; 36 __u32 cdw11; 37 __u32 cdw12; 38 __u32 cdw13; 39 __u32 cdw14; 40 __u32 cdw15; 41 __u32 timeout_ms; 42 __u32 result; 43 }; 44 struct nvme_passthru_cmd64 { 45 __u8 opcode; 46 __u8 flags; 47 __u16 rsvd1; 48 __u32 nsid; 49 __u32 cdw2; 50 __u32 cdw3; 51 __u64 metadata; 52 __u64 addr; 53 __u32 metadata_len; 54 union { 55 __u32 data_len; 56 __u32 vec_cnt; 57 }; 58 __u32 cdw10; 59 __u32 cdw11; 60 __u32 cdw12; 61 __u32 cdw13; 62 __u32 cdw14; 63 __u32 cdw15; 64 __u32 timeout_ms; 65 __u32 rsvd2; 66 __u64 result; 67 }; 68 struct nvme_uring_cmd { 69 __u8 opcode; 70 __u8 flags; 71 __u16 rsvd1; 72 __u32 nsid; 73 __u32 cdw2; 74 __u32 cdw3; 75 __u64 metadata; 76 __u64 addr; 77 __u32 metadata_len; 78 __u32 data_len; 79 __u32 cdw10; 80 __u32 cdw11; 81 __u32 cdw12; 82 __u32 cdw13; 83 __u32 cdw14; 84 __u32 cdw15; 85 __u32 timeout_ms; 86 __u32 rsvd2; 87 }; 88 #define nvme_admin_cmd nvme_passthru_cmd 89 #define NVME_IOCTL_ID _IO('N', 0x40) 90 #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd) 91 #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io) 92 #define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd) 93 #define NVME_IOCTL_RESET _IO('N', 0x44) 94 #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45) 95 #define NVME_IOCTL_RESCAN _IO('N', 0x46) 96 #define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64) 97 #define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64) 98 #define NVME_IOCTL_IO64_CMD_VEC _IOWR('N', 0x49, struct nvme_passthru_cmd64) 99 #define NVME_URING_CMD_IO _IOWR('N', 0x80, struct nvme_uring_cmd) 100 #define NVME_URING_CMD_IO_VEC _IOWR('N', 0x81, struct nvme_uring_cmd) 101 #define NVME_URING_CMD_ADMIN _IOWR('N', 0x82, struct nvme_uring_cmd) 102 #define NVME_URING_CMD_ADMIN_VEC _IOWR('N', 0x83, struct nvme_uring_cmd) 103 #endif 104