Skip to content

Commit 3d870fa

Browse files
francispravin5igaw
authored andcommitted
nvme-print-stdout: add human readable output for DSTO field
Add human readable output for DSTO field of Identify Controller Data Structure. Signed-off-by: Francis Pravin <[email protected]>
1 parent 5f3a369 commit 3d870fa

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nvme-print-stdout.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,22 @@ void stdout_id_ctrl_rpmbs(__le32 ctrl_rpmbs)
21412141
printf("\n");
21422142
}
21432143

2144+
static void stdout_id_ctrl_dsto(__u8 dsto)
2145+
{
2146+
__u8 rsvd2 = (dsto & 0xfc) >> 2;
2147+
__u8 hirs = (dsto & 0x2) >> 1;
2148+
__u8 sdso = dsto & 0x1;
2149+
2150+
if (rsvd2)
2151+
printf(" [7:2] : %#x\tReserved\n", rsvd2);
2152+
printf(" [1:1] : %#x\tHost-Initiated Refresh capability %sSupported\n",
2153+
hirs, hirs ? "" : "Not ");
2154+
printf(" [0:0] : %#x\tNVM subsystem supports %s at a time\n", sdso,
2155+
sdso ? "only one device self-test operation in progress" :
2156+
"one device self-test operation per controller");
2157+
printf("\n");
2158+
}
2159+
21442160
static void stdout_id_ctrl_hctma(__le16 ctrl_hctma)
21452161
{
21462162
__u16 hctma = le16_to_cpu(ctrl_hctma);
@@ -3140,6 +3156,8 @@ static void stdout_id_ctrl(struct nvme_id_ctrl *ctrl,
31403156
stdout_id_ctrl_rpmbs(ctrl->rpmbs);
31413157
printf("edstt : %d\n", le16_to_cpu(ctrl->edstt));
31423158
printf("dsto : %d\n", ctrl->dsto);
3159+
if (human)
3160+
stdout_id_ctrl_dsto(ctrl->dsto);
31433161
printf("fwug : %d\n", ctrl->fwug);
31443162
printf("kas : %d\n", le16_to_cpu(ctrl->kas));
31453163
printf("hctma : %#x\n", le16_to_cpu(ctrl->hctma));

0 commit comments

Comments
 (0)