Skip to content

Commit e337bd5

Browse files
ikegami-tigaw
authored andcommitted
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 c818a42 commit e337bd5

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
@@ -3105,6 +3105,29 @@ static void stdout_id_ctrl_nvm_aocs(__u16 aocs)
31053105
printf("\n");
31063106
}
31073107

3108+
static void stdout_id_ctrl_nvm_ver(__u32 ver)
3109+
{
3110+
printf(" NVM command set specification: %d.%d.%d\n\n", NVME_MAJOR(ver), NVME_MINOR(ver),
3111+
NVME_TERTIARY(ver));
3112+
}
3113+
3114+
static void stdout_id_ctrl_nvm_lbamqf(__u8 lbamqf)
3115+
{
3116+
printf(" 0x%x: ", lbamqf);
3117+
3118+
switch (lbamqf) {
3119+
case NVME_ID_CTRL_NVM_LBAMQF_TYPE_0:
3120+
printf("LBA Migration Queue Entry Type 0\n\n");
3121+
break;
3122+
case NVME_ID_CTRL_NVM_LBAMQF_VENDOR_MIN ... NVME_ID_CTRL_NVM_LBAMQF_VENDOR_MAX:
3123+
printf("Vendor Specific\n\n");
3124+
break;
3125+
default:
3126+
printf("Reserved\n\n");
3127+
break;
3128+
}
3129+
}
3130+
31083131
static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
31093132
{
31103133
int verbose = stdout_print_ops.flags & VERBOSE;
@@ -3119,6 +3142,12 @@ static void stdout_id_ctrl_nvm(struct nvme_id_ctrl_nvm *ctrl_nvm)
31193142
printf("aocs : %u\n", le16_to_cpu(ctrl_nvm->aocs));
31203143
if (verbose)
31213144
stdout_id_ctrl_nvm_aocs(le16_to_cpu(ctrl_nvm->aocs));
3145+
printf("ver : 0x%x\n", le32_to_cpu(ctrl_nvm->ver));
3146+
if (verbose)
3147+
stdout_id_ctrl_nvm_ver(le32_to_cpu(ctrl_nvm->ver));
3148+
printf("lbamqf : %u\n", ctrl_nvm->lbamqf);
3149+
if (verbose)
3150+
stdout_id_ctrl_nvm_lbamqf(ctrl_nvm->lbamqf);
31223151
}
31233152

31243153
static void stdout_nvm_id_ns_pic(__u8 pic)

0 commit comments

Comments
 (0)