smartmontools  SVN Rev 5304
Utility to control and monitor storage systems with "S.M.A.R.T."
linux_nvme_ioctl.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Definitions for the NVM Express ioctl interface
4  * Copyright (c) 2011-2014, Intel Corporation.
5  */
6 
7 #ifndef _UAPI_LINUX_NVME_IOCTL_H
8 #define _UAPI_LINUX_NVME_IOCTL_H
9 
10 #include <linux/types.h>
11 
12 struct nvme_user_io {
13  __u8 opcode;
14  __u8 flags;
15  __u16 control;
16  __u16 nblocks;
17  __u16 rsvd;
18  __u64 metadata;
19  __u64 addr;
20  __u64 slba;
21  __u32 dsmgmt;
22  __u32 reftag;
23  __u16 apptag;
24  __u16 appmask;
25 };
26 
28  __u8 opcode;
29  __u8 flags;
30  __u16 rsvd1;
31  __u32 nsid;
32  __u32 cdw2;
33  __u32 cdw3;
34  __u64 metadata;
35  __u64 addr;
36  __u32 metadata_len;
37  __u32 data_len;
38  __u32 cdw10;
39  __u32 cdw11;
40  __u32 cdw12;
41  __u32 cdw13;
42  __u32 cdw14;
43  __u32 cdw15;
44  __u32 timeout_ms;
45  __u32 result;
46 };
47 
48 #define nvme_admin_cmd nvme_passthru_cmd
49 
50 #define NVME_IOCTL_ID _IO('N', 0x40)
51 #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
52 #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
53 #define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd)
54 #define NVME_IOCTL_RESET _IO('N', 0x44)
55 #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
56 #define NVME_IOCTL_RESCAN _IO('N', 0x46)
57 
58 #endif /* _UAPI_LINUX_NVME_IOCTL_H */