}
}
+static void pel_set_feature_event(void *pevent_log_info, __u32 offset)
+{
+ int fid, cdw11, cdw12, dword_cnt;
+ unsigned char *mem_buf;
+ struct nvme_set_feature_event *set_feat_event = pevent_log_info + offset;
+
+ printf("Set Feature Event Entry:\n");
+ dword_cnt = NVME_SET_FEAT_EVENT_DW_COUNT(set_feat_event->layout);
+ fid = NVME_GET(le32_to_cpu(set_feat_event->cdw_mem[0]), FEATURES_CDW10_FID);
+ cdw11 = le32_to_cpu(set_feat_event->cdw_mem[1]);
+
+ printf("Set Feature ID: 0x%02x (%s), value: 0x%08x\n", fid, nvme_feature_to_string(fid),
+ cdw11);
+
+ if (!NVME_SET_FEAT_EVENT_MB_COUNT(set_feat_event->layout))
+ return;
+
+ mem_buf = (unsigned char *)set_feat_event + 4 + dword_cnt * 4;
+ if (fid == NVME_FEAT_FID_FDP_EVENTS) {
+ cdw12 = le32_to_cpu(set_feat_event->cdw_mem[2]);
+ stdout_persistent_event_log_fdp_events(cdw11, cdw12, mem_buf);
+ } else {
+ stdout_feature_show_fields(fid, cdw11, mem_buf);
+ }
+}
+
static void stdout_persistent_event_log(void *pevent_log_info,
__u8 action, __u32 size,
const char *devname)
{
__u32 offset, por_info_len, por_info_list;
__u64 *fw_rev;
- int fid, cdw11, cdw12, dword_cnt;
- unsigned char *mem_buf = NULL;
struct nvme_smart_log *smart_event;
struct nvme_fw_commit_event *fw_commit_event;
struct nvme_time_stamp_change_event *ts_change_event;
struct nvme_format_nvm_compln_event *format_cmpln_event;
struct nvme_sanitize_start_event *sanitize_start_event;
struct nvme_sanitize_compln_event *sanitize_cmpln_event;
- struct nvme_set_feature_event *set_feat_event;
struct nvme_thermal_exc_event *thermal_exc_event;
struct nvme_persistent_event_log *pevent_log_head;
struct nvme_persistent_event_entry *pevent_entry_head;
le16_to_cpu(sanitize_cmpln_event->cmpln_info));
break;
case NVME_PEL_SET_FEATURE_EVENT:
- set_feat_event = pevent_log_info + offset;
- printf("Set Feature Event Entry:\n");
- dword_cnt = NVME_SET_FEAT_EVENT_DW_COUNT(set_feat_event->layout);
- fid = NVME_GET(le32_to_cpu(set_feat_event->cdw_mem[0]), FEATURES_CDW10_FID);
- cdw11 = le32_to_cpu(set_feat_event->cdw_mem[1]);
-
- printf("Set Feature ID: 0x%02x (%s), value: 0x%08x\n", fid,
- nvme_feature_to_string(fid), cdw11);
- if (NVME_SET_FEAT_EVENT_MB_COUNT(set_feat_event->layout)) {
- mem_buf = (unsigned char *)set_feat_event + 4 + dword_cnt * 4;
- if (fid == NVME_FEAT_FID_FDP_EVENTS) {
- cdw12 = le32_to_cpu(set_feat_event->cdw_mem[2]);
- stdout_persistent_event_log_fdp_events(cdw11, cdw12,
- mem_buf);
- } else {
- stdout_feature_show_fields(fid, cdw11, mem_buf);
- }
- }
+ pel_set_feature_event(pevent_log_info, offset);
break;
case NVME_PEL_TELEMETRY_CRT:
d(pevent_log_info + offset, 512, 16, 1);