summaryrefslogtreecommitdiff
path: root/sys/include/dev
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-04-01 00:59:04 -0400
committerIan Moffett <ian@osmora.org>2024-04-01 00:59:04 -0400
commit7e37147b1687035e038546623e3ee964a27f528f (patch)
tree0dc837dbeb0b9c9d8505c65ad713e4e4b2b1602e /sys/include/dev
parenteafdef57ab503c33fc9f3978aef63d73584edac8 (diff)
kernel: nvme: Update nvmevar.h
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/dev')
-rw-r--r--sys/include/dev/ic/nvmevar.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/sys/include/dev/ic/nvmevar.h b/sys/include/dev/ic/nvmevar.h
index d4b13e0..50f5ae0 100644
--- a/sys/include/dev/ic/nvmevar.h
+++ b/sys/include/dev/ic/nvmevar.h
@@ -32,7 +32,10 @@
#include <sys/cdefs.h>
-#define NVME_OP_IDENTIFY 0x06
+/* Admin commands */
+#define NVME_OP_CREATE_IOSQ 0x01
+#define NVME_OP_CREATE_IOCQ 0x05
+#define NVME_OP_IDENTIFY 0x06
/* I/O commands */
#define NVME_OP_READ 0x02
@@ -81,10 +84,41 @@ struct nvme_rw_cmd {
uint16_t appmask;
};
+/* Create I/O completion queue */
+struct nvme_create_iocq_cmd {
+ uint8_t opcode;
+ uint8_t flags;
+ uint16_t cid;
+ uint32_t unused1[5];
+ uint64_t prp1;
+ uint64_t unused2;
+ uint16_t qid;
+ uint16_t qsize;
+ uint16_t qflags;
+ uint16_t irqvec;
+ uint64_t unused3[2];
+};
+
+struct nvme_create_iosq_cmd {
+ uint8_t opcode;
+ uint8_t flags;
+ uint16_t cid;
+ uint32_t unused1[5];
+ uint64_t prp1;
+ uint64_t unused2;
+ uint16_t sqid;
+ uint16_t qsize;
+ uint16_t qflags;
+ uint16_t cqid;
+ uint64_t unused3[2];
+};
+
struct nvme_cmd {
union {
struct nvme_identify_cmd identify;
struct nvme_common_cmd common;
+ struct nvme_create_iocq_cmd create_iocq;
+ struct nvme_create_iosq_cmd create_iosq;
};
};
@@ -216,6 +250,7 @@ struct nvme_ns {
size_t nsid; /* Namespace ID */
size_t lba_bsize; /* LBA block size */
size_t size; /* Size in logical blocks */
+ struct nvme_queue ioq; /* I/O queue */
struct nvme_lbaf lba_fmt; /* LBA format */
struct nvme_state *cntl; /* NVMe controller */
TAILQ_ENTRY(nvme_ns) link;