Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wdc: Fix for Reading WDC C2 Vendor Unique Log Page #2528

Merged
merged 1 commit into from
Oct 8, 2024
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
24 changes: 10 additions & 14 deletions plugins/wdc/wdc-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2364,28 +2364,24 @@ static bool get_dev_mgmt_log_page_lid_data(struct nvme_dev *dev,
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;

Expand Down
2 changes: 1 addition & 1 deletion plugins/wdc/wdc-nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ)
#define WDC_NVME

#define WDC_PLUGIN_VERSION "2.11.0"
#define WDC_PLUGIN_VERSION "2.11.1"
#include "cmd.h"

PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION),
Expand Down