]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print-stdout: print VERS bit of SANICAP field
authorFrancis Pravin <francis.p@samsung.com>
Wed, 9 Oct 2024 13:37:57 +0000 (19:07 +0530)
committerDaniel Wagner <wagi@monom.org>
Thu, 24 Oct 2024 09:38:22 +0000 (11:38 +0200)
Print the newly added VERS bit of SANICAP field in Identify Controller
Data Structure. Also, changed the variable names as per spec.

Signed-off-by: Francis Pravin <francis.p@samsung.com>
nvme-print-stdout.c

index 90e9f5683d5c7298fbd445299c5a6508cd3d1ab5..2cb8a949d3b366e94ccbf000f34c7517b6ba51e1 100644 (file)
@@ -2070,10 +2070,11 @@ static void stdout_id_ctrl_mxtmt(__le16 mxtmt)
 static void stdout_id_ctrl_sanicap(__le32 ctrl_sanicap)
 {
        __u32 sanicap = le32_to_cpu(ctrl_sanicap);
-       __u32 rsvd = (sanicap & 0x1FFFFFF8) >> 3;
-       __u32 owr = (sanicap & 0x4) >> 2;
-       __u32 ber = (sanicap & 0x2) >> 1;
-       __u32 cer = sanicap & 0x1;
+       __u32 rsvd4 = (sanicap & 0x1FFFFFF0) >> 4;
+       __u32 vers = (sanicap & 0x8) >> 3;
+       __u32 ows = (sanicap & 0x4) >> 2;
+       __u32 bes = (sanicap & 0x2) >> 1;
+       __u32 ces = sanicap & 0x1;
        __u32 ndi = (sanicap & 0x20000000) >> 29;
        __u32 nodmmas = (sanicap & 0xC0000000) >> 30;
 
@@ -2087,14 +2088,16 @@ static void stdout_id_ctrl_sanicap(__le32 ctrl_sanicap)
        printf("  [31:30] : %#x\t%s\n", nodmmas, modifies_media[nodmmas]);
        printf("  [29:29] : %#x\tNo-Deallocate After Sanitize bit in Sanitize command %sSupported\n",
                ndi, ndi ? "Not " : "");
-       if (rsvd)
-               printf("  [28:3] : %#x\tReserved\n", rsvd);
-       printf("    [2:2] : %#x\tOverwrite Sanitize Operation %sSupported\n",
-               owr, owr ? "" : "Not ");
-       printf("    [1:1] : %#x\tBlock Erase Sanitize Operation %sSupported\n",
-               ber, ber ? "" : "Not ");
-       printf("    [0:0] : %#x\tCrypto Erase Sanitize Operation %sSupported\n",
-               cer, cer ? "" : "Not ");
+       if (rsvd4)
+               printf("  [28:4] : %#x\tReserved\n", rsvd4);
+       printf("  [3:3] : %#x\tMedia Verification and Post-Verification Deallocation state %sSupported\n",
+               vers, vers ? "" : "Not ");
+       printf("  [2:2] : %#x\tOverwrite Sanitize Operation %sSupported\n",
+               ows, ows ? "" : "Not ");
+       printf("  [1:1] : %#x\tBlock Erase Sanitize Operation %sSupported\n",
+               bes, bes ? "" : "Not ");
+       printf("  [0:0] : %#x\tCrypto Erase Sanitize Operation %sSupported\n",
+               ces, ces ? "" : "Not ");
        printf("\n");
 }