]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
types: Fix PMRWBM register name
authorTokunori Ikegami <ikegami.t@gmail.com>
Mon, 29 Apr 2024 14:01:39 +0000 (23:01 +0900)
committerDaniel Wagner <wagi@monom.org>
Tue, 30 Apr 2024 13:28:06 +0000 (15:28 +0200)
Incorrectly defined as PMRWMB.
Also add enum nvme_pmrcap documentation.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
src/nvme/types.h
test/register.c

index 3eff85794746020534daffd2fe2f21b00908704b..b5e4dd3f5302462891a91c054da215f820701b05 100644 (file)
@@ -646,21 +646,44 @@ enum nvme_crto {
 #define NVME_CRTO_CRIMT(crto)  NVME_GET(crto, CRTO_CRIMT)
 #define NVME_CRTO_CRWMT(crto)  NVME_GET(crto, CRTO_CRWMT)
 
+/**
+ * enum nvme_pmrcap - This field indicates the persistent memory region capabilities
+ * @NVME_PMRCAP_RDS_SHIFT:     Shift amount to get the read data support
+ * @NVME_PMRCAP_WDS_SHIFT:     Shift amount to get the write data support
+ * @NVME_PMRCAP_BIR_SHIFT:     Shift amount to get the base indicator register
+ * @NVME_PMRCAP_PMRTU_SHIFT:   Shift amount to get the persistent memory region time units
+ * @NVME_PMRCAP_PMRWBM_SHIFT:  Shift amount to get the persistent memory region write barrier mechanisms
+ * @NVME_PMRCAP_PMRTO_SHIFT:   Shift amount to get the persistent memory region timeout
+ * @NVME_PMRCAP_CMSS_SHIFT:    Shift amount to get the controller memory space supported
+ * @NVME_PMRCAP_PMRWMB_SHIFT:  Deprecated shift amount to get the persistent memory region write barrier mechanisms
+ * @NVME_PMRCAP_RDS_MASK:      Mask to get the read data support
+ * @NVME_PMRCAP_WDS_MASK:      Mask to get the write data support
+ * @NVME_PMRCAP_BIR_MASK:      Mask to get the base indicator register
+ * @NVME_PMRCAP_PMRTU_MASK:    Mask to get the persistent memory region time units
+ * @NVME_PMRCAP_PMRWBM_MASK:   Mask to get the persistent memory region write barrier mechanisms
+ * @NVME_PMRCAP_PMRTO_MASK:    Mask to get the persistent memory region timeout
+ * @NVME_PMRCAP_CMSS_MASK:     Mask to get the controller memory space supported
+ * @NVME_PMRCAP_PMRWMB_MASK:   Deprecated mask to get the persistent memory region write barrier mechanisms
+ * @NVME_PMRCAP_PMRTU_500MS:   500 milliseconds
+ * @NVME_PMRCAP_PMRTU_60S:     minutes
+ */
 enum nvme_pmrcap {
        NVME_PMRCAP_RDS_SHIFT           = 3,
        NVME_PMRCAP_WDS_SHIFT           = 4,
        NVME_PMRCAP_BIR_SHIFT           = 5,
        NVME_PMRCAP_PMRTU_SHIFT         = 8,
-       NVME_PMRCAP_PMRWMB_SHIFT        = 10,
+       NVME_PMRCAP_PMRWBM_SHIFT        = 10,
        NVME_PMRCAP_PMRTO_SHIFT         = 16,
        NVME_PMRCAP_CMSS_SHIFT          = 24,
+       NVME_PMRCAP_PMRWMB_SHIFT        = NVME_PMRCAP_PMRWBM_SHIFT, /* Deprecated */
        NVME_PMRCAP_RDS_MASK            = 0x1,
        NVME_PMRCAP_WDS_MASK            = 0x1,
        NVME_PMRCAP_BIR_MASK            = 0x7,
        NVME_PMRCAP_PMRTU_MASK          = 0x3,
-       NVME_PMRCAP_PMRWMB_MASK         = 0xf,
+       NVME_PMRCAP_PMRWBM_MASK         = 0xf,
        NVME_PMRCAP_PMRTO_MASK          = 0xff,
        NVME_PMRCAP_CMSS_MASK           = 0x1,
+       NVME_PMRCAP_PMRWMB_MASK         = NVME_PMRCAP_PMRWBM_MASK, /* Deprecated */
        NVME_PMRCAP_PMRTU_500MS         = 0,
        NVME_PMRCAP_PMRTU_60S           = 1,
 };
@@ -669,9 +692,10 @@ enum nvme_pmrcap {
 #define NVME_PMRCAP_WDS(pmrcap)                NVME_GET(pmrcap, PMRCAP_WDS)
 #define NVME_PMRCAP_BIR(pmrcap)                NVME_GET(pmrcap, PMRCAP_BIR)
 #define NVME_PMRCAP_PMRTU(pmrcap)      NVME_GET(pmrcap, PMRCAP_PMRTU)
-#define NVME_PMRCAP_PMRWMB(pmrcap)     NVME_GET(pmrcap, PMRCAP_PMRWMB)
+#define NVME_PMRCAP_PMRWBM(pmrcap)     NVME_GET(pmrcap, PMRCAP_PMRWBM)
 #define NVME_PMRCAP_PMRTO(pmrcap)      NVME_GET(pmrcap, PMRCAP_PMRTO)
 #define NVME_PMRCAP_CMSS(pmrcap)       NVME_GET(pmrcap, PMRCAP_CMSS)
+#define NVME_PMRCAP_PMRWMB(pmrcap)     NVME_GET(pmrcap, PMRCAP_PMRWMB) /* Deprecated */
 
 enum nvme_pmrctl {
        NVME_PMRCTL_EN_SHIFT    = 0,
index a7dd07665135e698303562f128f5bf44ff3dd627..1fb692b83cad967791ceec363418bcadec8213fe 100644 (file)
@@ -166,7 +166,7 @@ void nvme_print_registers(void *regs)
        printf("  %-8s : %x\n", "WDS", NVME_PMRCAP_WDS(pmrcap));
        printf("  %-8s : %x\n", "BIR", NVME_PMRCAP_BIR(pmrcap));
        printf("  %-8s : %x\n", "PMRTU", NVME_PMRCAP_PMRTU(pmrcap));
-       printf("  %-8s : %x\n", "PMRWMB", NVME_PMRCAP_PMRWMB(pmrcap));
+       printf("  %-8s : %x\n", "PMRWBM", NVME_PMRCAP_PMRWBM(pmrcap));
        printf("  %-8s : %x\n", "PMRTO", NVME_PMRCAP_PMRTO(pmrcap));
        printf("  %-8s : %x\n", "CMSS", NVME_PMRCAP_CMSS(pmrcap));