| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 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 _UAPI_LINUX_NVME_IOCTL_H | 
 | 20 | #define _UAPI_LINUX_NVME_IOCTL_H | 
 | 21 | #include <linux/types.h> | 
 | 22 | struct nvme_user_io { | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 23 |   __u8 opcode; | 
 | 24 |   __u8 flags; | 
 | 25 |   __u16 control; | 
 | 26 |   __u16 nblocks; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 27 |   __u16 rsvd; | 
 | 28 |   __u64 metadata; | 
 | 29 |   __u64 addr; | 
 | 30 |   __u64 slba; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 31 |   __u32 dsmgmt; | 
 | 32 |   __u32 reftag; | 
 | 33 |   __u16 apptag; | 
 | 34 |   __u16 appmask; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 35 | }; | 
 | 36 | struct nvme_passthru_cmd { | 
 | 37 |   __u8 opcode; | 
 | 38 |   __u8 flags; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 39 |   __u16 rsvd1; | 
 | 40 |   __u32 nsid; | 
 | 41 |   __u32 cdw2; | 
 | 42 |   __u32 cdw3; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 43 |   __u64 metadata; | 
 | 44 |   __u64 addr; | 
 | 45 |   __u32 metadata_len; | 
 | 46 |   __u32 data_len; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 47 |   __u32 cdw10; | 
 | 48 |   __u32 cdw11; | 
 | 49 |   __u32 cdw12; | 
 | 50 |   __u32 cdw13; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 51 |   __u32 cdw14; | 
 | 52 |   __u32 cdw15; | 
 | 53 |   __u32 timeout_ms; | 
 | 54 |   __u32 result; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 55 | }; | 
| Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 56 | struct nvme_passthru_cmd64 { | 
 | 57 |   __u8 opcode; | 
 | 58 |   __u8 flags; | 
 | 59 |   __u16 rsvd1; | 
 | 60 |   __u32 nsid; | 
 | 61 |   __u32 cdw2; | 
 | 62 |   __u32 cdw3; | 
 | 63 |   __u64 metadata; | 
 | 64 |   __u64 addr; | 
 | 65 |   __u32 metadata_len; | 
| Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 66 |   union { | 
 | 67 |     __u32 data_len; | 
 | 68 |     __u32 vec_cnt; | 
 | 69 |   }; | 
| Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 70 |   __u32 cdw10; | 
 | 71 |   __u32 cdw11; | 
 | 72 |   __u32 cdw12; | 
 | 73 |   __u32 cdw13; | 
 | 74 |   __u32 cdw14; | 
 | 75 |   __u32 cdw15; | 
 | 76 |   __u32 timeout_ms; | 
 | 77 |   __u32 rsvd2; | 
 | 78 |   __u64 result; | 
 | 79 | }; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 80 | #define nvme_admin_cmd nvme_passthru_cmd | 
 | 81 | #define NVME_IOCTL_ID _IO('N', 0x40) | 
 | 82 | #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd) | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 83 | #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io) | 
 | 84 | #define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd) | 
 | 85 | #define NVME_IOCTL_RESET _IO('N', 0x44) | 
 | 86 | #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45) | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 87 | #define NVME_IOCTL_RESCAN _IO('N', 0x46) | 
| Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 88 | #define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64) | 
 | 89 | #define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64) | 
| Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 90 | #define NVME_IOCTL_IO64_CMD_VEC _IOWR('N', 0x49, struct nvme_passthru_cmd64) | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 91 | #endif |