Skip to content

Commit 3a1048e

Browse files
francispravin5igaw
authored andcommitted
nvme-print: use Completion Condition enum
Use the Completion Condition enum for LBA Status Descriptor. Also, modified the print statement of Completion Condition. Signed-off-by: Francis Pravin <francis.p@samsung.com>
1 parent 48bc3cf commit 3a1048e

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

nvme-print-json.c

+11-4
Original file line numberDiff line numberDiff line change
@@ -1853,13 +1853,20 @@ static void json_lba_status(struct nvme_lba_status *list,
18531853
obj_add_uint(r, "Completion Condition (CMPC)", list->cmpc);
18541854

18551855
switch (list->cmpc) {
1856-
case 1:
1856+
case NVME_LBA_STATUS_CMPC_NO_CMPC:
1857+
obj_add_str(r, "cmpc-definition", "No indication of the completion condition");
1858+
break;
1859+
case NVME_LBA_STATUS_CMPC_INCOMPLETE:
18571860
obj_add_str(r, "cmpc-definition",
1858-
"Completed due to transferring the amount of data specified in the MNDW field");
1861+
"Completed transferring the amount of data specified in the"\
1862+
"MNDW field. But, additional LBA Status Descriptor Entries are"\
1863+
"available to transfer or scan did not complete (if ATYPE = 10h)");
18591864
break;
1860-
case 2:
1865+
case NVME_LBA_STATUS_CMPC_COMPLETE:
18611866
obj_add_str(r, "cmpc-definition",
1862-
"Completed due to having performed the action specified in the Action Type field over the number of logical blocks specified in the Range Length field");
1867+
"Completed the specified action over the number of LBAs specified"\
1868+
"in the Range Length field and transferred all available LBA Status"\
1869+
"Descriptor Entries");
18631870
break;
18641871
default:
18651872
break;

nvme-print-stdout.c

+11-8
Original file line numberDiff line numberDiff line change
@@ -4685,15 +4685,18 @@ static void stdout_lba_status(struct nvme_lba_status *list,
46854685
printf("Completion Condition(CMPC): %u\n", list->cmpc);
46864686

46874687
switch (list->cmpc) {
4688-
case 1:
4689-
printf("\tCompleted due to transferring the amount of data"\
4690-
" specified in the MNDW field\n");
4688+
case NVME_LBA_STATUS_CMPC_NO_CMPC:
4689+
printf("\tNo indication of the completion condition\n");
46914690
break;
4692-
case 2:
4693-
printf("\tCompleted due to having performed the action\n"\
4694-
"\tspecified in the Action Type field over the\n"\
4695-
"\tnumber of logical blocks specified in the\n"\
4696-
"\tRange Length field\n");
4691+
case NVME_LBA_STATUS_CMPC_INCOMPLETE:
4692+
printf("\tCompleted transferring the amount of data specified in the\n"\
4693+
"\tMNDW field. But, additional LBA Status Descriptor Entries are\n"\
4694+
"\tavailable to transfer or scan did not complete (if ATYPE = 10h)\n");
4695+
break;
4696+
case NVME_LBA_STATUS_CMPC_COMPLETE:
4697+
printf("\tCompleted the specified action over the number of LBAs specified\n"\
4698+
"\tin the Range Length field and transferred all available LBA Status\n"\
4699+
"\tDescriptor Entries\n");
46974700
break;
46984701
default:
46994702
break;

0 commit comments

Comments
 (0)