Skip to content

Commit

Permalink
nvme-print-stdout: print VERS bit of SANICAP field
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
francispravin5 authored and igaw committed Oct 24, 2024
1 parent bccdb63 commit 2ecd546
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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");
}

Expand Down

0 comments on commit 2ecd546

Please sign in to comment.