From 7e37147b1687035e038546623e3ee964a27f528f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 1 Apr 2024 00:59:04 -0400 Subject: kernel: nvme: Update nvmevar.h Signed-off-by: Ian Moffett --- sys/include/dev/ic/nvmevar.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'sys/include') 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 -#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; -- cgit v1.2.3