blob: b68cdfffabc7204456c59a0e5329fe709d4242a3 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 Ferris05d08e92016-02-04 13:16:38 -08007#ifndef _UAPI_LINUX_NVME_IOCTL_H
8#define _UAPI_LINUX_NVME_IOCTL_H
9#include <linux/types.h>
10struct nvme_user_io {
Christopher Ferris05d08e92016-02-04 13:16:38 -080011 __u8 opcode;
12 __u8 flags;
13 __u16 control;
14 __u16 nblocks;
Christopher Ferris05d08e92016-02-04 13:16:38 -080015 __u16 rsvd;
16 __u64 metadata;
17 __u64 addr;
18 __u64 slba;
Christopher Ferris05d08e92016-02-04 13:16:38 -080019 __u32 dsmgmt;
20 __u32 reftag;
21 __u16 apptag;
22 __u16 appmask;
Christopher Ferris05d08e92016-02-04 13:16:38 -080023};
24struct nvme_passthru_cmd {
25 __u8 opcode;
26 __u8 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080027 __u16 rsvd1;
28 __u32 nsid;
29 __u32 cdw2;
30 __u32 cdw3;
Christopher Ferris05d08e92016-02-04 13:16:38 -080031 __u64 metadata;
32 __u64 addr;
33 __u32 metadata_len;
34 __u32 data_len;
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 __u32 cdw10;
36 __u32 cdw11;
37 __u32 cdw12;
38 __u32 cdw13;
Christopher Ferris05d08e92016-02-04 13:16:38 -080039 __u32 cdw14;
40 __u32 cdw15;
41 __u32 timeout_ms;
42 __u32 result;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043};
Christopher Ferris9584fa42019-12-09 15:36:13 -080044struct 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;
Christopher Ferris10a76e62022-06-08 13:31:52 -070054 union {
55 __u32 data_len;
56 __u32 vec_cnt;
57 };
Christopher Ferris9584fa42019-12-09 15:36:13 -080058 __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};
Christopher Ferris80ae69d2022-08-02 16:32:21 -070068struct 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};
Christopher Ferris05d08e92016-02-04 13:16:38 -080088#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)
Christopher Ferris05d08e92016-02-04 13:16:38 -080091#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)
Christopher Ferris106b3a82016-08-24 12:15:38 -070095#define NVME_IOCTL_RESCAN _IO('N', 0x46)
Christopher Ferris9584fa42019-12-09 15:36:13 -080096#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)
Christopher Ferris10a76e62022-06-08 13:31:52 -070098#define NVME_IOCTL_IO64_CMD_VEC _IOWR('N', 0x49, struct nvme_passthru_cmd64)
Christopher Ferris80ae69d2022-08-02 16:32:21 -070099#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)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103#endif