Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,8 @@ static void stdout_id_ctrl_ipmsr(__le16 ctrl_ipmsr)
__u16 srs = NVME_GET(ipmsr, CTRL_IPMSR_SRS);
__u16 srv = NVME_GET(ipmsr, CTRL_IPMSR_SRV);

printf(" [15:8] : %#x\tSample Rate Scale\n", srs);
printf(" [15:8] : %#x\tSample Rate Scale (%s)\n", srs,
nvme_ipmsr_srs_to_string(srs));
printf(" [7:0] : %#x\tSample Rate Value\n", srv);

printf("\n");
Expand Down
20 changes: 20 additions & 0 deletions nvme-print.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,26 @@ const char *nvme_power_measurement_action_to_string(__u8 act)
return "Reserved";
}

const char *nvme_ipmsr_srs_to_string(__u8 srs)
{
switch (srs) {
case 0:
return "Not reported";
case 1:
return "1 microsecond";
case 2:
return "10 microseconds";
case 3:
return "100 microseconds";
case 4:
return "1 millisecond";
case 5:
return "10 milliseconds";
default:
return "Reserved";
}
}

void nvme_feature_show(enum nvme_features_id fid, int sel, unsigned int result)
{
nvme_print(show_feature, NORMAL, fid, sel, result);
Expand Down
1 change: 1 addition & 0 deletions nvme-print.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ const char *nvme_bpwps_to_string(__u8 bpwps);
const char *nvme_feature_power_limit_scale_to_string(__u8 pls);
const char *nvme_power_measurement_type_to_string(__u8 pmt);
const char *nvme_power_measurement_action_to_string(__u8 act);
const char *nvme_ipmsr_srs_to_string(__u8 srs);

void nvme_dev_full_path(nvme_ns_t n, char *path, size_t len);
void nvme_generic_full_path(nvme_ns_t n, char *path, size_t len);
Expand Down
Loading