Skip to content
Merged
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
9 changes: 9 additions & 0 deletions nvme-print-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -3518,6 +3518,12 @@ static void json_feature_show_fields_spinup_control(struct json_object *r, unsig
obj_add_str(r, "Spinup control feature Enabled", result & 1 ? "True" : "False");
}

static void json_feature_show_fields_power_loss_signal(struct json_object *r, unsigned int result)
{
obj_add_str(r, "Power Loss Signaling Mode (PLSM)",
nvme_pls_mode_to_string(NVME_GET(result, FEAT_PLS_MODE)));
}

static void json_host_metadata(struct json_object *r, enum nvme_features_id fid,
struct nvme_host_metadata *data)
{
Expand Down Expand Up @@ -3728,6 +3734,9 @@ static void json_feature_show_fields(enum nvme_features_id fid, unsigned int res
case NVME_FEAT_FID_SPINUP_CONTROL:
json_feature_show_fields_spinup_control(r, result);
break;
case NVME_FEAT_FID_POWER_LOSS_SIGNAL:
json_feature_show_fields_power_loss_signal(r, result);
break;
case NVME_FEAT_FID_ENH_CTRL_METADATA:
case NVME_FEAT_FID_CTRL_METADATA:
case NVME_FEAT_FID_NS_METADATA:
Expand Down
4 changes: 4 additions & 0 deletions nvme-print-stdout.c
Original file line number Diff line number Diff line change
Expand Up @@ -4971,6 +4971,10 @@ static void stdout_feature_show_fields(enum nvme_features_id fid,
case NVME_FEAT_FID_SPINUP_CONTROL:
printf("\tSpinup control feature Enabled: %s\n", (result & 1) ? "True" : "False");
break;
case NVME_FEAT_FID_POWER_LOSS_SIGNAL:
printf("\tPower Loss Signaling Mode (PLSM): %s\n",
nvme_pls_mode_to_string(NVME_GET(result, FEAT_PLS_MODE)));
break;
case NVME_FEAT_FID_ENH_CTRL_METADATA:
case NVME_FEAT_FID_CTRL_METADATA:
case NVME_FEAT_FID_NS_METADATA:
Expand Down
16 changes: 16 additions & 0 deletions nvme-print.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,22 @@ const char *nvme_time_scale_to_string(__u8 ts)
return "Reserved";
}

const char *nvme_pls_mode_to_string(__u8 mode)
{
switch (mode) {
case 0:
return "not enabled";
case 1:
return "enabled with Emergency Power Fail";
case 2:
return "enabled with Forced Quiescence";
default:
break;
}

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 @@ -313,6 +313,7 @@ const char *nvme_pel_rci_rcpit_to_string(enum nvme_pel_rci_rcpit rcpit);
const char *nvme_pel_ehai_pit_to_string(enum nvme_pel_ehai_pit pit);
const char *nvme_ssi_state_to_string(__u8 state);
const char *nvme_time_scale_to_string(__u8 ts);
const char *nvme_pls_mode_to_string(__u8 mode);

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