summaryrefslogtreecommitdiffstats
path: root/plugins/wdc/wdc-nvme.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wdc/wdc-nvme.c')
-rw-r--r--plugins/wdc/wdc-nvme.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c
index ec3f2b0..ae57e85 100644
--- a/plugins/wdc/wdc-nvme.c
+++ b/plugins/wdc/wdc-nvme.c
@@ -80,12 +80,13 @@
#define WDC_NVME_SN655_DEV_ID 0x2722
#define WDC_NVME_SN860_DEV_ID 0x2730
#define WDC_NVME_SN660_DEV_ID 0x2704
-
-/* This id's are no longer supported, delete ?? */
-#define WDC_NVME_SN550_DEV_ID 0x2708
#define WDC_NVME_SN560_DEV_ID_1 0x2712
#define WDC_NVME_SN560_DEV_ID_2 0x2713
#define WDC_NVME_SN560_DEV_ID_3 0x2714
+#define WDC_NVME_SN861_DEV_ID 0x2750
+
+/* This id's are no longer supported, delete ?? */
+#define WDC_NVME_SN550_DEV_ID 0x2708
#define WDC_NVME_SXSLCL_DEV_ID 0x2001
#define WDC_NVME_SN520_DEV_ID 0x5003
@@ -1666,6 +1667,17 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev)
WDC_DRIVE_CAP_CLEAR_PCIE);
break;
+ case WDC_NVME_SN861_DEV_ID:
+ capabilities |= (WDC_DRIVE_CAP_C0_LOG_PAGE | WDC_DRIVE_CAP_OCP_C1_LOG_PAGE |
+ WDC_DRIVE_CAP_C3_LOG_PAGE | WDC_DRIVE_CAP_OCP_C4_LOG_PAGE |
+ WDC_DRIVE_CAP_OCP_C5_LOG_PAGE);
+
+ capabilities |= (WDC_DRIVE_CAP_CAP_DIAG | WDC_DRIVE_CAP_INTERNAL_LOG |
+ WDC_DRIVE_CAP_DRIVE_STATUS | WDC_DRIVE_CAP_CLEAR_ASSERT |
+ WDC_DRIVE_CAP_RESIZE | WDC_DRIVE_CAP_FW_ACTIVATE_HISTORY |
+ WDC_DRVIE_CAP_DISABLE_CTLR_TELE_LOG |
+ WDC_DRIVE_CAP_REASON_ID);
+
default:
capabilities = 0;
}
@@ -6514,6 +6526,8 @@ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format
case WDC_NVME_SN560_DEV_ID_3:
fallthrough;
case WDC_NVME_SN550_DEV_ID:
+ fallthrough;
+ case WDC_NVME_SN861_DEV_ID:
ret = wdc_get_c0_log_page_sn(r, dev, uuid_index, format, namespace_id, fmt);
break;
case WDC_NVME_ZN350_DEV_ID:
@@ -9437,7 +9451,7 @@ static int wdc_reason_identifier(int argc, char **argv,
cfg.log_id != NVME_LOG_LID_TELEMETRY_CTRL) {
fprintf(stderr, "ERROR: WDC: Invalid Log ID. It must be 7 (Host) or 8 (Controller)\n");
ret = -1;
- goto close_fd;
+ goto close_dev;
}
if (cfg.file) {
@@ -9448,7 +9462,7 @@ static int wdc_reason_identifier(int argc, char **argv,
if (verify_file < 0) {
fprintf(stderr, "ERROR: WDC: open: %s\n", strerror(errno));
ret = -1;
- goto close_fd;
+ goto close_dev;
}
close(verify_file);
strncpy(f, cfg.file, PATH_MAX - 1);
@@ -9466,12 +9480,12 @@ static int wdc_reason_identifier(int argc, char **argv,
if (wdc_get_serial_name(dev, f, PATH_MAX, fileSuffix) == -1) {
fprintf(stderr, "ERROR: WDC: failed to generate file name\n");
ret = -1;
- goto close_fd;
+ goto close_dev;
}
if (strlen(f) > PATH_MAX - 5) {
fprintf(stderr, "ERROR: WDC: file name overflow\n");
ret = -1;
- goto close_fd;
+ goto close_dev;
}
strcat(f, ".bin");
}
@@ -9488,7 +9502,7 @@ static int wdc_reason_identifier(int argc, char **argv,
nvme_show_status(ret);
-close_fd:
+close_dev:
dev_close(dev);
nvme_free_tree(r);
return ret;
@@ -10372,7 +10386,7 @@ static int wdc_vs_pcie_stats(int argc, char **argv, struct command *command,
goto out;
}
- pcieStatsPtr = nvme_alloc(pcie_stats_size, &huge);
+ pcieStatsPtr = nvme_alloc_huge(pcie_stats_size, &huge);
if (!pcieStatsPtr) {
fprintf(stderr, "ERROR: WDC: PCIE Stats alloc: %s\n", strerror(errno));
ret = -1;
@@ -10403,7 +10417,7 @@ static int wdc_vs_pcie_stats(int argc, char **argv, struct command *command,
}
}
- nvme_free(pcieStatsPtr, huge);
+ nvme_free_huge(pcieStatsPtr, huge);
out:
nvme_free_tree(r);