Skip to content

Commit ccfd791

Browse files
sc108-leeigaw
authored andcommitted
nvme-print: Add id-ctrl CTRATT.RHII, using enum
use enum nvme_id_ctrl_ctratt to parse values reorder variable define rename variables with abbreviation from nvme spec 2.1 Signed-off-by: Steven Seungcheol Lee <[email protected]>
1 parent 98b34e4 commit ccfd791

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

nvme-print-stdout.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,69 +1743,69 @@ static void stdout_id_ctrl_ctratt(__le32 ctrl_ctratt)
17431743
{
17441744
__u32 ctratt = le32_to_cpu(ctrl_ctratt);
17451745
__u32 rsvd20 = (ctratt >> 20);
1746-
__u32 fdps = (ctratt >> 19) & 0x1;
1747-
__u32 rsvd18 = (ctratt >> 18) & 0x1;
1748-
__u32 hmbr = (ctratt >> 17) & 0x1;
1749-
__u32 mem = (ctratt >> 16) & 0x1;
1750-
__u32 elbas = (ctratt >> 15) & 0x1;
1751-
__u32 delnvmset = (ctratt >> 14) & 0x1;
1752-
__u32 delegrp = (ctratt >> 13) & 0x1;
1753-
__u32 vcap = (ctratt >> 12) & 0x1;
1754-
__u32 fcap = (ctratt >> 11) & 0x1;
1755-
__u32 mds = (ctratt >> 10) & 0x1;
1756-
__u32 hostid128 = (ctratt & NVME_CTRL_CTRATT_128_ID) >> 0;
1757-
__u32 psp = (ctratt & NVME_CTRL_CTRATT_NON_OP_PSP) >> 1;
1758-
__u32 sets = (ctratt & NVME_CTRL_CTRATT_NVM_SETS) >> 2;
1759-
__u32 rrl = (ctratt & NVME_CTRL_CTRATT_READ_RECV_LVLS) >> 3;
1760-
__u32 eg = (ctratt & NVME_CTRL_CTRATT_ENDURANCE_GROUPS) >> 4;
1761-
__u32 iod = (ctratt & NVME_CTRL_CTRATT_PREDICTABLE_LAT) >> 5;
1762-
__u32 tbkas = (ctratt & NVME_CTRL_CTRATT_TBKAS) >> 6;
1763-
__u32 ng = (ctratt & NVME_CTRL_CTRATT_NAMESPACE_GRANULARITY) >> 7;
1746+
__u32 fdps = (ctratt & NVME_CTRL_CTRATT_FDPS) >> 19;
1747+
__u32 rhii = (ctratt & NVME_CTRL_CTRATT_RHII) >> 18;
1748+
__u32 hmbr = (ctratt & NVME_CTRL_CTRATT_HMBR) >> 17;
1749+
__u32 mem = (ctratt & NVME_CTRL_CTRATT_MEM) >> 16;
1750+
__u32 elbas = (ctratt & NVME_CTRL_CTRATT_ELBAS) >> 15;
1751+
__u32 dnvms = (ctratt & NVME_CTRL_CTRATT_DEL_NVM_SETS) >> 14;
1752+
__u32 deg = (ctratt & NVME_CTRL_CTRATT_DEL_ENDURANCE_GROUPS) >> 13;
1753+
__u32 vcm = (ctratt & NVME_CTRL_CTRATT_VARIABLE_CAP) >> 12;
1754+
__u32 fcm = (ctratt & NVME_CTRL_CTRATT_FIXED_CAP) >> 11;
1755+
__u32 mds = (ctratt & NVME_CTRL_CTRATT_MDS) >> 10;
1756+
__u32 ulist = (ctratt & NVME_CTRL_CTRATT_UUID_LIST) >> 9;
17641757
__u32 sqa = (ctratt & NVME_CTRL_CTRATT_SQ_ASSOCIATIONS) >> 8;
1765-
__u32 uuidlist = (ctratt & NVME_CTRL_CTRATT_UUID_LIST) >> 9;
1758+
__u32 ng = (ctratt & NVME_CTRL_CTRATT_NAMESPACE_GRANULARITY) >> 7;
1759+
__u32 tbkas = (ctratt & NVME_CTRL_CTRATT_TBKAS) >> 6;
1760+
__u32 plm = (ctratt & NVME_CTRL_CTRATT_PREDICTABLE_LAT) >> 5;
1761+
__u32 egs = (ctratt & NVME_CTRL_CTRATT_ENDURANCE_GROUPS) >> 4;
1762+
__u32 rrlvls = (ctratt & NVME_CTRL_CTRATT_READ_RECV_LVLS) >> 3;
1763+
__u32 nsets = (ctratt & NVME_CTRL_CTRATT_NVM_SETS) >> 2;
1764+
__u32 nopspm = (ctratt & NVME_CTRL_CTRATT_NON_OP_PSP) >> 1;
1765+
__u32 hids = (ctratt & NVME_CTRL_CTRATT_128_ID) >> 0;
17661766

17671767
if (rsvd20)
17681768
printf(" [31:20] : %#x\tReserved\n", rsvd20);
17691769
printf(" [19:19] : %#x\tFlexible Data Placement %sSupported\n",
17701770
fdps, fdps ? "" : "Not ");
1771-
if (rsvd18)
1772-
printf(" [18:18] : %#x\tReserved\n", rsvd18);
1771+
printf(" [18:18] : %#x\tReservations and Host Identifier Interaction %sSupported\n",
1772+
rhii, rhii ? "" : "Not ");
17731773
printf(" [17:17] : %#x\tHMB Restrict Non-Operational Power State Access %sSupported\n",
17741774
hmbr, hmbr ? "" : "Not ");
17751775
printf(" [16:16] : %#x\tMDTS and Size Limits Exclude Metadata %sSupported\n",
17761776
mem, mem ? "" : "Not ");
17771777
printf(" [15:15] : %#x\tExtended LBA Formats %sSupported\n",
17781778
elbas, elbas ? "" : "Not ");
17791779
printf(" [14:14] : %#x\tDelete NVM Set %sSupported\n",
1780-
delnvmset, delnvmset ? "" : "Not ");
1780+
dnvms, dnvms ? "" : "Not ");
17811781
printf(" [13:13] : %#x\tDelete Endurance Group %sSupported\n",
1782-
delegrp, delegrp ? "" : "Not ");
1782+
deg, deg ? "" : "Not ");
17831783
printf(" [12:12] : %#x\tVariable Capacity Management %sSupported\n",
1784-
vcap, vcap ? "" : "Not ");
1784+
vcm, vcm ? "" : "Not ");
17851785
printf(" [11:11] : %#x\tFixed Capacity Management %sSupported\n",
1786-
fcap, fcap ? "" : "Not ");
1786+
fcm, fcm ? "" : "Not ");
17871787
printf(" [10:10] : %#x\tMulti Domain Subsystem %sSupported\n",
17881788
mds, mds ? "" : "Not ");
17891789
printf(" [9:9] : %#x\tUUID List %sSupported\n",
1790-
uuidlist, uuidlist ? "" : "Not ");
1790+
ulist, ulist ? "" : "Not ");
17911791
printf(" [8:8] : %#x\tSQ Associations %sSupported\n",
17921792
sqa, sqa ? "" : "Not ");
17931793
printf(" [7:7] : %#x\tNamespace Granularity %sSupported\n",
17941794
ng, ng ? "" : "Not ");
17951795
printf(" [6:6] : %#x\tTraffic Based Keep Alive %sSupported\n",
17961796
tbkas, tbkas ? "" : "Not ");
17971797
printf(" [5:5] : %#x\tPredictable Latency Mode %sSupported\n",
1798-
iod, iod ? "" : "Not ");
1798+
plm, plm ? "" : "Not ");
17991799
printf(" [4:4] : %#x\tEndurance Groups %sSupported\n",
1800-
eg, eg ? "" : "Not ");
1800+
egs, egs ? "" : "Not ");
18011801
printf(" [3:3] : %#x\tRead Recovery Levels %sSupported\n",
1802-
rrl, rrl ? "" : "Not ");
1802+
rrlvls, rrlvls ? "" : "Not ");
18031803
printf(" [2:2] : %#x\tNVM Sets %sSupported\n",
1804-
sets, sets ? "" : "Not ");
1804+
nsets, nsets ? "" : "Not ");
18051805
printf(" [1:1] : %#x\tNon-Operational Power State Permissive %sSupported\n",
1806-
psp, psp ? "" : "Not ");
1806+
nopspm, nopspm ? "" : "Not ");
18071807
printf(" [0:0] : %#x\t128-bit Host Identifier %sSupported\n",
1808-
hostid128, hostid128 ? "" : "Not ");
1808+
hids, hids ? "" : "Not ");
18091809
printf("\n");
18101810
}
18111811

0 commit comments

Comments
 (0)