summaryrefslogtreecommitdiffstats
path: root/plugins/wdc
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wdc')
-rw-r--r--plugins/wdc/wdc-nvme.c55
-rw-r--r--plugins/wdc/wdc-nvme.h2
2 files changed, 37 insertions, 20 deletions
diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c
index fa4157d..f3e97db 100644
--- a/plugins/wdc/wdc-nvme.c
+++ b/plugins/wdc/wdc-nvme.c
@@ -79,6 +79,7 @@
#define WDC_NVME_SN650_DEV_ID_3 0x2720
#define WDC_NVME_SN650_DEV_ID_4 0x2721
#define WDC_NVME_SN655_DEV_ID 0x2722
+#define WDC_NVME_SN655_DEV_ID_1 0x2723
#define WDC_NVME_SN860_DEV_ID 0x2730
#define WDC_NVME_SN660_DEV_ID 0x2704
#define WDC_NVME_SN560_DEV_ID_1 0x2712
@@ -86,6 +87,8 @@
#define WDC_NVME_SN560_DEV_ID_3 0x2714
#define WDC_NVME_SN861_DEV_ID 0x2750
#define WDC_NVME_SN861_DEV_ID_1 0x2751
+#define WDC_NVME_SN861_DEV_ID_2 0x2752
+#define WDC_NVME_SNTMP_DEV_ID 0x2761
/* This id's are no longer supported, delete ?? */
#define WDC_NVME_SN550_DEV_ID 0x2708
@@ -138,6 +141,10 @@
#define WDC_NVME_SN810_DEV_ID 0x5011
#define WDC_NVME_SN820CL_DEV_ID 0x5037
+#define WDC_NVME_SN5100S_DEV_ID_1 0x5061
+#define WDC_NVME_SN5100S_DEV_ID_2 0x5062
+#define WDC_NVME_SN5100S_DEV_ID_3 0x5063
+
#define WDC_DRIVE_CAP_CAP_DIAG 0x0000000000000001
#define WDC_DRIVE_CAP_INTERNAL_LOG 0x0000000000000002
#define WDC_DRIVE_CAP_C1_LOG_PAGE 0x0000000000000004
@@ -1530,7 +1537,8 @@ static int wdc_get_vendor_id(struct nvme_dev *dev, uint32_t *vendor_id)
static bool wdc_is_sn861(__u32 device_id)
{
if ((device_id == WDC_NVME_SN861_DEV_ID) ||
- (device_id == WDC_NVME_SN861_DEV_ID_1))
+ (device_id == WDC_NVME_SN861_DEV_ID_1) ||
+ (device_id == WDC_NVME_SN861_DEV_ID_2))
return true;
else
return false;
@@ -1822,6 +1830,7 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev)
case WDC_NVME_SN650_DEV_ID_3:
case WDC_NVME_SN650_DEV_ID_4:
case WDC_NVME_SN655_DEV_ID:
+ case WDC_NVME_SN655_DEV_ID_1:
case WDC_NVME_SN550_DEV_ID:
/* verify the 0xC0 log page is supported */
if (wdc_nvme_check_supported_log_page(r, dev,
@@ -1872,6 +1881,8 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev)
case WDC_NVME_SN861_DEV_ID:
case WDC_NVME_SN861_DEV_ID_1:
+ case WDC_NVME_SN861_DEV_ID_2:
+ case WDC_NVME_SNTMP_DEV_ID:
capabilities |= (WDC_DRIVE_CAP_C0_LOG_PAGE |
WDC_DRIVE_CAP_C3_LOG_PAGE |
WDC_DRIVE_CAP_CA_LOG_PAGE |
@@ -1970,6 +1981,12 @@ static __u64 wdc_get_drive_capabilities(nvme_root_t r, struct nvme_dev *dev)
fallthrough;
case WDC_NVME_SN8000S_DEV_ID:
fallthrough;
+ case WDC_NVME_SN5100S_DEV_ID_1:
+ fallthrough;
+ case WDC_NVME_SN5100S_DEV_ID_2:
+ fallthrough;
+ case WDC_NVME_SN5100S_DEV_ID_3:
+ fallthrough;
case WDC_NVME_SN740_DEV_ID:
case WDC_NVME_SN740_DEV_ID_1:
case WDC_NVME_SN740_DEV_ID_2:
@@ -2357,28 +2374,24 @@ end:
static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev,
__u8 log_id, void **cbs_data)
{
- int ret = -1;
bool found = false;
__u8 uuid_ix = 0;
__u8 lid = 0;
*cbs_data = NULL;
- __u32 device_id, read_vendor_id;
+ __u32 device_id = 0, vendor_id = 0;
bool uuid_present = false;
int index = 0, uuid_index = 0;
struct nvme_id_uuid_list uuid_list;
- ret = wdc_get_pci_ids(r, dev, &device_id, &read_vendor_id);
- if (ret == 0) {
- if (device_id == WDC_NVME_ZN350_DEV_ID || device_id == WDC_NVME_ZN350_DEV_ID_1) {
- lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID_C8;
- uuid_ix = 0;
- } else {
- lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID;
- }
- } else {
- fprintf(stderr, "ERROR: WDC: get pci ids: %d\n", ret);
- return false;
- }
+ /* The wdc_get_pci_ids function could fail when drives are connected
+ * via a PCIe switch. Therefore, the return code is intentionally
+ * being ignored. The device_id and vendor_id variables have been
+ * initialized to 0 so the code can continue on without issue for
+ * both cases: wdc_get_pci_ids successful or failed.
+ */
+ wdc_get_pci_ids(r, dev, &device_id, &vendor_id);
+
+ lid = WDC_NVME_GET_DEV_MGMNT_LOG_PAGE_ID;
typedef struct nvme_id_uuid_list_entry *uuid_list_entry;
@@ -6909,6 +6922,7 @@ static int wdc_get_c0_log_page(nvme_root_t r, struct nvme_dev *dev, char *format
case WDC_NVME_SN650_DEV_ID_3:
case WDC_NVME_SN650_DEV_ID_4:
case WDC_NVME_SN655_DEV_ID:
+ case WDC_NVME_SN655_DEV_ID_1:
if (uuid_index == 0) {
ret = nvme_get_print_ocp_cloud_smart_log(dev,
uuid_index,
@@ -10832,13 +10846,13 @@ static void wdc_print_nand_stats_json(__u16 version, void *data)
le32_to_cpu(nand_stats_v3->ssd_correction_counts[12]));
json_object_add_value_uint(root, "System data % life-used",
nand_stats_v3->percent_life_used);
- json_object_add_value_uint64(root, "User Data Erase Counts - SLC Min",
+ json_object_add_value_uint64(root, "User Data Erase Counts - TLC Min",
le64_to_cpu(nand_stats_v3->user_data_erase_counts[0]));
- json_object_add_value_uint64(root, "User Data Erase Counts - SLC Max",
+ json_object_add_value_uint64(root, "User Data Erase Counts - TLC Max",
le64_to_cpu(nand_stats_v3->user_data_erase_counts[1]));
- json_object_add_value_uint64(root, "User Data Erase Counts - TLC Min",
+ json_object_add_value_uint64(root, "User Data Erase Counts - SLC Min",
le64_to_cpu(nand_stats_v3->user_data_erase_counts[2]));
- json_object_add_value_uint64(root, "User Data Erase Counts - TLC Max",
+ json_object_add_value_uint64(root, "User Data Erase Counts - SLC Max",
le64_to_cpu(nand_stats_v3->user_data_erase_counts[3]));
temp_ptr = (__u64 *)nand_stats_v3->program_fail_count;
temp_norm = (__u16)(*temp_ptr & 0x000000000000FFFF);
@@ -11305,12 +11319,14 @@ static int wdc_vs_drive_info(int argc, char **argv,
case WDC_NVME_SN650_DEV_ID_3:
case WDC_NVME_SN650_DEV_ID_4:
case WDC_NVME_SN655_DEV_ID:
+ case WDC_NVME_SN655_DEV_ID_1:
case WDC_NVME_SN560_DEV_ID_1:
case WDC_NVME_SN560_DEV_ID_2:
case WDC_NVME_SN560_DEV_ID_3:
case WDC_NVME_SN550_DEV_ID:
case WDC_NVME_ZN350_DEV_ID:
case WDC_NVME_ZN350_DEV_ID_1:
+ case WDC_NVME_SNTMP_DEV_ID:
ret = wdc_do_drive_info(dev, &result);
if (!ret) {
@@ -11429,6 +11445,7 @@ static int wdc_vs_drive_info(int argc, char **argv,
break;
case WDC_NVME_SN861_DEV_ID:
case WDC_NVME_SN861_DEV_ID_1:
+ case WDC_NVME_SN861_DEV_ID_2:
data_len = sizeof(info);
num_dwords = data_len / 4;
if (data_len % 4 != 0)
diff --git a/plugins/wdc/wdc-nvme.h b/plugins/wdc/wdc-nvme.h
index a18da16..6efdbc1 100644
--- a/plugins/wdc/wdc-nvme.h
+++ b/plugins/wdc/wdc-nvme.h
@@ -5,7 +5,7 @@
#if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ)
#define WDC_NVME
-#define WDC_PLUGIN_VERSION "2.9.1"
+#define WDC_PLUGIN_VERSION "2.11.1"
#include "cmd.h"
PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION),