diff --git a/plugins/ocp/ocp-print-json.c b/plugins/ocp/ocp-print-json.c index a8c18ec18a..311b79e637 100644 --- a/plugins/ocp/ocp-print-json.c +++ b/plugins/ocp/ocp-print-json.c @@ -226,6 +226,12 @@ static void json_smart_extended_log_v1(struct ocp_smart_extended_log *log) case 0 ... 1: break; default: + case 6: + json_object_add_value_uint(root, "Form factor", + log->form_factor); + json_object_add_value_uint(root, "Die in use bad nand block", + le64_to_cpu(log->die_in_use_bad_nand_block)); + fallthrough; case 5: json_object_add_value_uint(root, "NVMe Over Pcie Errata Version", log->nvme_over_pcie_errate_version); diff --git a/plugins/ocp/ocp-print-stdout.c b/plugins/ocp/ocp-print-stdout.c index 3c884c43a2..29fdf2a000 100644 --- a/plugins/ocp/ocp-print-stdout.c +++ b/plugins/ocp/ocp-print-stdout.c @@ -168,6 +168,12 @@ static void stdout_smart_extended_log(struct ocp_smart_extended_log *log, unsign case 0 ... 1: break; default: + case 6: + printf(" Form factor %d\n", + log->form_factor); + printf(" Die in use bad nand block %"PRIu64"\n", + le64_to_cpu(log->die_in_use_bad_nand_block)); + fallthrough; case 5: printf(" NVMe Over Pcie Errata Version %d\n", log->nvme_over_pcie_errate_version); diff --git a/plugins/ocp/ocp-smart-extended-log.c b/plugins/ocp/ocp-smart-extended-log.c index 3eef14a9a7..da56b40ea1 100644 --- a/plugins/ocp/ocp-smart-extended-log.c +++ b/plugins/ocp/ocp-smart-extended-log.c @@ -42,7 +42,7 @@ static int get_c0_log_page(struct nvme_transport_handle *hdl, char *format, return ret; } - data = malloc(sizeof(__u8) * C0_SMART_CLOUD_ATTR_LEN); + data = (struct ocp_smart_extended_log *) malloc(sizeof(__u8) * C0_SMART_CLOUD_ATTR_LEN); if (!data) { fprintf(stderr, "ERROR : OCP : malloc : %s\n", strerror(errno)); return -1; diff --git a/plugins/ocp/ocp-smart-extended-log.h b/plugins/ocp/ocp-smart-extended-log.h index 9ac52e508f..1eebf76634 100644 --- a/plugins/ocp/ocp-smart-extended-log.h +++ b/plugins/ocp/ocp-smart-extended-log.h @@ -128,7 +128,7 @@ struct ocp_smart_extended_log { __le16 total_die_failure_tolerance; /* [219:218] */ __le16 media_dies_offline; /* [221:220] */ __u8 max_temperature_recorded; /* [222] */ - __u8 rsvd223; /* [223] */ + __u8 form_factor; /* [223] */ __le64 nand_avg_erase_count; /* [231:224] */ __le32 command_timeouts; /* [235:232] */ __le32 sys_area_program_fail_count_raw; /* [239:236] */ @@ -145,8 +145,9 @@ struct ocp_smart_extended_log { __u8 lifetime_power_consumed[6]; /* [269:264] */ __u8 dssd_firmware_revision[8]; /* [277:270] */ __u8 dssd_firmware_build_uuid[16]; /* [293:278] */ - __u8 dssd_firmware_build_label[64]; /* [375:294] */ - __u8 rsvd358[136]; /* [493:358] */ + __u8 dssd_firmware_build_label[64]; /* [357:294] */ + __le64 die_in_use_bad_nand_block; /* [365:358] */ + __u8 rsvd358[128]; /* [493:358] */ __le16 log_page_version; /* [495:494] */ __u8 log_page_guid[16]; /* [511:496] */ };