Skip to content

Commit 808795d

Browse files
committed
nvme-print-stdout: add nvm-id-ctrl command VER and LBAMQF fields
The fields added by NVM command set specification 1.1. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 98b34e4 commit 808795d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

nvme-print-stdout.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3096,6 +3096,29 @@ static void stdout_id_ctrl_nvm_aocs(__u16 aocs)
30963096
printf("\n");
30973097
}
30983098

3099+
static void stdout_id_ctrl_nvm_ver(__u32 ver)
3100+
{
3101+
printf(" NVM command set specification: %d.%d.%d\n\n", NVME_MAJOR(ver), NVME_MINOR(ver),
3102+
NVME_TERTIARY(ver));
3103+
}
3104+
3105+
static void stdout_id_ctrl_nvm_lbamqf(__u8 lbamqf)
3106+
{
3107+
printf(" 0x%x: ", lbamqf);
3108+
3109+
switch (lbamqf) {
3110+
case NVME_ID_CTRL_NVM_LBAMQF_TYPE_0:
3111+
printf("LBA Migration Queue Entry Type 0\n\n");
3112+
break;
3113+
case NVME_ID_CTRL_NVM_LBAMQF_VENDOR_MIN ... NVME_ID_CTRL_NVM_LBAMQF_VENDOR_MAX:
3114+
printf("Vendor Specific\n\n");
3115+
break;
3116+
default:
3117+
printf("Reserved\n\n");
3118+
break;
3119+
}
3120+
}
3121+
30993122
static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
31003123
{
31013124
int verbose = stdout_print_ops.flags & VERBOSE;
@@ -3110,6 +3133,12 @@ static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
31103133
printf("aocs : %u\n", le16_to_cpu(ctrl_nvm->aocs));
31113134
if (verbose)
31123135
stdout_id_ctrl_nvm_aocs(le16_to_cpu(ctrl_nvm->aocs));
3136+
printf("ver : 0x%x\n", le32_to_cpu(ctrl_nvm->ver));
3137+
if (verbose)
3138+
stdout_id_ctrl_nvm_ver(le32_to_cpu(ctrl_nvm->ver));
3139+
printf("lbamqf : %u\n", ctrl_nvm->lbamqf);
3140+
if (verbose)
3141+
stdout_id_ctrl_nvm_lbamqf(ctrl_nvm->lbamqf);
31133142
}
31143143

31153144
static void stdout_nvm_id_ns_pic(__u8 pic)

0 commit comments

Comments
 (0)