git: da548abbc35c - stable/14 - nvme: Add constants for the PSDT field in cdw0

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 27 Aug 2024 01:06:26 UTC
The branch stable/14 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=da548abbc35c86d4f504c5392ce79ec1c67bd432

commit da548abbc35c86d4f504c5392ce79ec1c67bd432
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-03-23 00:23:24 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-08-26 18:27:36 +0000

    nvme: Add constants for the PSDT field in cdw0
    
    This is not used in nvme(4) but is used in NVMe over Fabrics
    transports which use SGLs to describe buffers instead of PRPs.
    
    While here, adjust the shift value for the FUSE field to be relative
    to the 'fuse' member of 'struct nvme_command'.
    
    Reviewed by:    imp
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D44443
    
    (cherry picked from commit b8cb8dd3625d7396ea98152d89e1e64b16e77bc6)
---
 sys/dev/nvme/nvme.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index f00090731dff..04eec1ff0917 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -211,9 +211,18 @@
 
 /* Command field definitions */
 
-#define NVME_CMD_FUSE_SHIFT				(8)
+#define NVME_CMD_FUSE_SHIFT				(0)
 #define NVME_CMD_FUSE_MASK				(0x3)
 
+enum nvme_psdt {
+	NVME_PSDT_PRP					= 0x0,
+	NVME_PSDT_SGL					= 0x1,
+	NVME_PSDT_SGL_MPTR				= 0x2
+};
+#define	NVME_CMD_PSDT_SHIFT				(6)
+#define	NVME_CMD_PSDT_MASK				(0x3)
+
+
 #define NVME_STATUS_P_SHIFT				(0)
 #define NVME_STATUS_P_MASK				(0x1)
 #define NVME_STATUS_SC_SHIFT				(1)