|
8 | 8 | */ |
9 | 9 | #pragma once |
10 | 10 |
|
| 11 | +#include <linux/types.h> |
| 12 | + |
11 | 13 | struct nvme_global_ctx; |
12 | | -struct nvme_passthru_cmd; |
13 | 14 | struct nvme_transport_handle; |
| 15 | + |
| 16 | +/** |
| 17 | + * struct nvme_passthru_cmd - nvme passthrough command structure |
| 18 | + * @opcode: Operation code, see &enum nvme_io_opcodes and |
| 19 | + * &enum nvme_admin_opcodes |
| 20 | + * @flags: Supported only for NVMe-MI |
| 21 | + * @rsvd1: Reserved for future use |
| 22 | + * @nsid: Namespace Identifier, or Fabrics type |
| 23 | + * @cdw2: Command Dword 2 (no spec defined use) |
| 24 | + * @cdw3: Command Dword 3 (no spec defined use) |
| 25 | + * @metadata: User space address to metadata buffer (NULL if not used) |
| 26 | + * @addr: User space address to data buffer (NULL if not used) |
| 27 | + * @metadata_len: Metadata buffer transfer length |
| 28 | + * @data_len: Data buffer transfer length |
| 29 | + * @cdw10: Command Dword 10 (command specific) |
| 30 | + * @cdw11: Command Dword 11 (command specific) |
| 31 | + * @cdw12: Command Dword 12 (command specific) |
| 32 | + * @cdw13: Command Dword 13 (command specific) |
| 33 | + * @cdw14: Command Dword 14 (command specific) |
| 34 | + * @cdw15: Command Dword 15 (command specific) |
| 35 | + * @timeout_ms: If non-zero, overrides system default timeout in milliseconds |
| 36 | + * @rsvd2: Reserved for future use (and fills an implicit struct pad |
| 37 | + * @result: Set on completion to the command's CQE DWORD 0-1 |
| 38 | + * controller response |
| 39 | + */ |
| 40 | +struct nvme_passthru_cmd { |
| 41 | + __u8 opcode; |
| 42 | + __u8 flags; |
| 43 | + __u16 rsvd1; |
| 44 | + __u32 nsid; |
| 45 | + __u32 cdw2; |
| 46 | + __u32 cdw3; |
| 47 | + __u64 metadata; |
| 48 | + __u64 addr; |
| 49 | + __u32 metadata_len; |
| 50 | + __u32 data_len; |
| 51 | + __u32 cdw10; |
| 52 | + __u32 cdw11; |
| 53 | + __u32 cdw12; |
| 54 | + __u32 cdw13; |
| 55 | + __u32 cdw14; |
| 56 | + __u32 cdw15; |
| 57 | + __u32 timeout_ms; |
| 58 | + __u32 rsvd2; |
| 59 | + __u64 result; |
| 60 | +}; |
| 61 | + |
| 62 | +/** |
| 63 | + * struct nvme_uring_cmd - nvme uring command structure |
| 64 | + * @opcode: Operation code, see &enum nvme_io_opcodes and |
| 65 | + * &enum nvme_admin_opcodes |
| 66 | + * @flags: Not supported: intended for command flags (eg: SGL, FUSE) |
| 67 | + * @rsvd1: Reserved for future use |
| 68 | + * @nsid: Namespace Identifier, or Fabrics type |
| 69 | + * @cdw2: Command Dword 2 (no spec defined use) |
| 70 | + * @cdw3: Command Dword 3 (no spec defined use) |
| 71 | + * @metadata: User space address to metadata buffer (NULL if not used) |
| 72 | + * @addr: User space address to data buffer (NULL if not used) |
| 73 | + * @metadata_len: Metadata buffer transfer length |
| 74 | + * @data_len: Data buffer transfer length |
| 75 | + * @cdw10: Command Dword 10 (command specific) |
| 76 | + * @cdw11: Command Dword 11 (command specific) |
| 77 | + * @cdw12: Command Dword 12 (command specific) |
| 78 | + * @cdw13: Command Dword 13 (command specific) |
| 79 | + * @cdw14: Command Dword 14 (command specific) |
| 80 | + * @cdw15: Command Dword 15 (command specific) |
| 81 | + * @timeout_ms: If non-zero, overrides system default timeout in milliseconds |
| 82 | + * @rsvd2: Reserved for future use (and fills an implicit struct pad |
| 83 | + */ |
| 84 | +struct nvme_uring_cmd { |
| 85 | + __u8 opcode; |
| 86 | + __u8 flags; |
| 87 | + __u16 rsvd1; |
| 88 | + __u32 nsid; |
| 89 | + __u32 cdw2; |
| 90 | + __u32 cdw3; |
| 91 | + __u64 metadata; |
| 92 | + __u64 addr; |
| 93 | + __u32 metadata_len; |
| 94 | + __u32 data_len; |
| 95 | + __u32 cdw10; |
| 96 | + __u32 cdw11; |
| 97 | + __u32 cdw12; |
| 98 | + __u32 cdw13; |
| 99 | + __u32 cdw14; |
| 100 | + __u32 cdw15; |
| 101 | + __u32 timeout_ms; |
| 102 | + __u32 rsvd2; |
| 103 | +}; |
0 commit comments