1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Definitions for the NVM Express ioctl interface
4 * Copyright (c) 2011-2014, Intel Corporation.
7 #ifndef _LINUX_NVME_IOCTL_H
8 #define _LINUX_NVME_IOCTL_H
10 #include <linux/types.h>
27 struct nvme_passthru_cmd
{
48 struct nvme_passthru_cmd64
{
59 __u32 data_len
; /* for non-vectored io */
60 __u32 vec_cnt
; /* for vectored io */
73 /* same as struct nvme_passthru_cmd64, minus the 8b result field */
74 struct nvme_uring_cmd
{
95 #define nvme_admin_cmd nvme_passthru_cmd
97 #define NVME_IOCTL_ID _IO('N', 0x40)
98 #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
99 #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
100 #define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd)
101 #define NVME_IOCTL_RESET _IO('N', 0x44)
102 #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
103 #define NVME_IOCTL_RESCAN _IO('N', 0x46)
104 #define NVME_IOCTL_ADMIN64_CMD _IOWR('N', 0x47, struct nvme_passthru_cmd64)
105 #define NVME_IOCTL_IO64_CMD _IOWR('N', 0x48, struct nvme_passthru_cmd64)
106 #define NVME_IOCTL_IO64_CMD_VEC _IOWR('N', 0x49, struct nvme_passthru_cmd64)
108 /* io_uring async commands: */
109 #define NVME_URING_CMD_IO _IOWR('N', 0x80, struct nvme_uring_cmd)
110 #define NVME_URING_CMD_IO_VEC _IOWR('N', 0x81, struct nvme_uring_cmd)
111 #define NVME_URING_CMD_ADMIN _IOWR('N', 0x82, struct nvme_uring_cmd)
112 #define NVME_URING_CMD_ADMIN_VEC _IOWR('N', 0x83, struct nvme_uring_cmd)
114 #endif /* _LINUX_NVME_IOCTL_H */