forked from linux-nvme/nvme-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib-types.h
More file actions
103 lines (99 loc) · 3.1 KB
/
lib-types.h
File metadata and controls
103 lines (99 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* This file is part of libnvme.
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
*
* Authors: Keith Busch <[email protected]>
* Chaitanya Kulkarni <[email protected]>
*/
#pragma once
#include <platform/types.h>
struct nvme_global_ctx;
struct nvme_transport_handle;
/**
* struct nvme_passthru_cmd - nvme passthrough command structure
* @opcode: Operation code, see &enum nvme_io_opcodes and
* &enum nvme_admin_opcodes
* @flags: Supported only for NVMe-MI
* @rsvd1: Reserved for future use
* @nsid: Namespace Identifier, or Fabrics type
* @cdw2: Command Dword 2 (no spec defined use)
* @cdw3: Command Dword 3 (no spec defined use)
* @metadata: User space address to metadata buffer (NULL if not used)
* @addr: User space address to data buffer (NULL if not used)
* @metadata_len: Metadata buffer transfer length
* @data_len: Data buffer transfer length
* @cdw10: Command Dword 10 (command specific)
* @cdw11: Command Dword 11 (command specific)
* @cdw12: Command Dword 12 (command specific)
* @cdw13: Command Dword 13 (command specific)
* @cdw14: Command Dword 14 (command specific)
* @cdw15: Command Dword 15 (command specific)
* @timeout_ms: If non-zero, overrides system default timeout in milliseconds
* @rsvd2: Reserved for future use (and fills an implicit struct pad
* @result: Set on completion to the command's CQE DWORD 0-1
* controller response
*/
struct nvme_passthru_cmd {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
__u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
__u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
__u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
__u32 rsvd2;
__u64 result;
};
/**
* struct nvme_uring_cmd - nvme uring command structure
* @opcode: Operation code, see &enum nvme_io_opcodes and
* &enum nvme_admin_opcodes
* @flags: Not supported: intended for command flags (eg: SGL, FUSE)
* @rsvd1: Reserved for future use
* @nsid: Namespace Identifier, or Fabrics type
* @cdw2: Command Dword 2 (no spec defined use)
* @cdw3: Command Dword 3 (no spec defined use)
* @metadata: User space address to metadata buffer (NULL if not used)
* @addr: User space address to data buffer (NULL if not used)
* @metadata_len: Metadata buffer transfer length
* @data_len: Data buffer transfer length
* @cdw10: Command Dword 10 (command specific)
* @cdw11: Command Dword 11 (command specific)
* @cdw12: Command Dword 12 (command specific)
* @cdw13: Command Dword 13 (command specific)
* @cdw14: Command Dword 14 (command specific)
* @cdw15: Command Dword 15 (command specific)
* @timeout_ms: If non-zero, overrides system default timeout in milliseconds
* @rsvd2: Reserved for future use (and fills an implicit struct pad
*/
struct nvme_uring_cmd {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
__u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
__u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
__u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
__u32 rsvd2;
};