Skip to content

Commit 6ec9763

Browse files
committed
lib-types: move struct nvme_passthrue_cmd up
This data structure is used through out the library and there is no point in forward declare it and then have it in ioctl.h. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 063ae51 commit 6ec9763

2 files changed

Lines changed: 91 additions & 89 deletions

File tree

libnvme/src/nvme/ioctl.h

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
#pragma once
1111

12-
#include <linux/types.h>
13-
1412
#include <nvme/lib-types.h>
1513

1614
/**
@@ -33,92 +31,6 @@
3331
*/
3432
#define NVME_URING_ENTRIES 16
3533

36-
/**
37-
* struct nvme_passthru_cmd - nvme passthrough command structure
38-
* @opcode: Operation code, see &enum nvme_io_opcodes and &enum nvme_admin_opcodes
39-
* @flags: Supported only for NVMe-MI
40-
* @rsvd1: Reserved for future use
41-
* @nsid: Namespace Identifier, or Fabrics type
42-
* @cdw2: Command Dword 2 (no spec defined use)
43-
* @cdw3: Command Dword 3 (no spec defined use)
44-
* @metadata: User space address to metadata buffer (NULL if not used)
45-
* @addr: User space address to data buffer (NULL if not used)
46-
* @metadata_len: Metadata buffer transfer length
47-
* @data_len: Data buffer transfer length
48-
* @cdw10: Command Dword 10 (command specific)
49-
* @cdw11: Command Dword 11 (command specific)
50-
* @cdw12: Command Dword 12 (command specific)
51-
* @cdw13: Command Dword 13 (command specific)
52-
* @cdw14: Command Dword 14 (command specific)
53-
* @cdw15: Command Dword 15 (command specific)
54-
* @timeout_ms: If non-zero, overrides system default timeout in milliseconds
55-
* @rsvd2: Reserved for future use (and fills an implicit struct pad
56-
* @result: Set on completion to the command's CQE DWORD 0-1 controller response
57-
*/
58-
struct nvme_passthru_cmd {
59-
__u8 opcode;
60-
__u8 flags;
61-
__u16 rsvd1;
62-
__u32 nsid;
63-
__u32 cdw2;
64-
__u32 cdw3;
65-
__u64 metadata;
66-
__u64 addr;
67-
__u32 metadata_len;
68-
__u32 data_len;
69-
__u32 cdw10;
70-
__u32 cdw11;
71-
__u32 cdw12;
72-
__u32 cdw13;
73-
__u32 cdw14;
74-
__u32 cdw15;
75-
__u32 timeout_ms;
76-
__u32 rsvd2;
77-
__u64 result;
78-
};
79-
80-
/**
81-
* struct nvme_uring_cmd - nvme uring command structure
82-
* @opcode: Operation code, see &enum nvme_io_opcodes and &enum nvme_admin_opcodes
83-
* @flags: Not supported: intended for command flags (eg: SGL, FUSE)
84-
* @rsvd1: Reserved for future use
85-
* @nsid: Namespace Identifier, or Fabrics type
86-
* @cdw2: Command Dword 2 (no spec defined use)
87-
* @cdw3: Command Dword 3 (no spec defined use)
88-
* @metadata: User space address to metadata buffer (NULL if not used)
89-
* @addr: User space address to data buffer (NULL if not used)
90-
* @metadata_len: Metadata buffer transfer length
91-
* @data_len: Data buffer transfer length
92-
* @cdw10: Command Dword 10 (command specific)
93-
* @cdw11: Command Dword 11 (command specific)
94-
* @cdw12: Command Dword 12 (command specific)
95-
* @cdw13: Command Dword 13 (command specific)
96-
* @cdw14: Command Dword 14 (command specific)
97-
* @cdw15: Command Dword 15 (command specific)
98-
* @timeout_ms: If non-zero, overrides system default timeout in milliseconds
99-
* @rsvd2: Reserved for future use (and fills an implicit struct pad
100-
*/
101-
struct nvme_uring_cmd {
102-
__u8 opcode;
103-
__u8 flags;
104-
__u16 rsvd1;
105-
__u32 nsid;
106-
__u32 cdw2;
107-
__u32 cdw3;
108-
__u64 metadata;
109-
__u64 addr;
110-
__u32 metadata_len;
111-
__u32 data_len;
112-
__u32 cdw10;
113-
__u32 cdw11;
114-
__u32 cdw12;
115-
__u32 cdw13;
116-
__u32 cdw14;
117-
__u32 cdw15;
118-
__u32 timeout_ms;
119-
__u32 rsvd2;
120-
};
121-
12234
/**
12335
* nvme_submit_admin_passthru() - Submit an nvme passthrough admin command
12436
* @hdl: Transport handle

libnvme/src/nvme/lib-types.h

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,96 @@
88
*/
99
#pragma once
1010

11+
#include <linux/types.h>
12+
1113
struct nvme_global_ctx;
12-
struct nvme_passthru_cmd;
1314
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

Comments
 (0)