Adding upstream version 2.7.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
04338f02fe
commit
d6e1a5d456
663 changed files with 15529 additions and 6994 deletions
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,7 @@
|
|||
#if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ)
|
||||
#define WDC_NVME
|
||||
|
||||
#define WDC_PLUGIN_VERSION "2.3.1"
|
||||
#define WDC_PLUGIN_VERSION "2.3.5"
|
||||
#include "cmd.h"
|
||||
|
||||
PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION),
|
||||
|
@ -17,34 +17,72 @@ PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERS
|
|||
ENTRY("id-ctrl", "WDC identify controller", wdc_id_ctrl)
|
||||
ENTRY("purge", "WDC Purge", wdc_purge)
|
||||
ENTRY("purge-monitor", "WDC Purge Monitor", wdc_purge_monitor)
|
||||
ENTRY("vs-internal-log", "WDC Internal Firmware Log", wdc_vs_internal_fw_log)
|
||||
ENTRY("vs-internal-log", "WDC Internal Firmware Log",
|
||||
wdc_vs_internal_fw_log)
|
||||
ENTRY("vs-nand-stats", "WDC NAND Statistics", wdc_vs_nand_stats)
|
||||
ENTRY("vs-smart-add-log", "WDC Additional Smart Log", wdc_vs_smart_add_log)
|
||||
ENTRY("clear-pcie-correctable-errors", "WDC Clear PCIe Correctable Error Count", wdc_clear_pcie_correctable_errors)
|
||||
ENTRY("drive-essentials", "WDC Drive Essentials", wdc_drive_essentials)
|
||||
ENTRY("get-drive-status", "WDC Get Drive Status", wdc_drive_status)
|
||||
ENTRY("clear-assert-dump", "WDC Clear Assert Dump", wdc_clear_assert_dump)
|
||||
ENTRY("vs-smart-add-log", "WDC Additional Smart Log",
|
||||
wdc_vs_smart_add_log)
|
||||
ENTRY("clear-pcie-correctable-errors",
|
||||
"WDC Clear PCIe Correctable Error Count",
|
||||
wdc_clear_pcie_correctable_errors)
|
||||
ENTRY("drive-essentials", "WDC Drive Essentials",
|
||||
wdc_drive_essentials)
|
||||
ENTRY("get-drive-status", "WDC Get Drive Status",
|
||||
wdc_drive_status)
|
||||
ENTRY("clear-assert-dump", "WDC Clear Assert Dump",
|
||||
wdc_clear_assert_dump)
|
||||
ENTRY("drive-resize", "WDC Drive Resize", wdc_drive_resize)
|
||||
ENTRY("vs-fw-activate-history", "WDC Get FW Activate History", wdc_vs_fw_activate_history)
|
||||
ENTRY("clear-fw-activate-history", "WDC Clear FW Activate History", wdc_clear_fw_activate_history)
|
||||
ENTRY("vs-fw-activate-history", "WDC Get FW Activate History",
|
||||
wdc_vs_fw_activate_history)
|
||||
ENTRY("clear-fw-activate-history",
|
||||
"WDC Clear FW Activate History",
|
||||
wdc_clear_fw_activate_history)
|
||||
ENTRY("enc-get-log", "WDC Get Enclosure Log", wdc_enc_get_log)
|
||||
ENTRY("vs-telemetry-controller-option", "WDC Enable/Disable Controller Initiated Telemetry Log", wdc_vs_telemetry_controller_option)
|
||||
ENTRY("vs-error-reason-identifier", "WDC Telemetry Reason Identifier", wdc_reason_identifier)
|
||||
ENTRY("log-page-directory", "WDC Get Log Page Directory", wdc_log_page_directory)
|
||||
ENTRY("namespace-resize", "WDC NamespaceDrive Resize", wdc_namespace_resize)
|
||||
ENTRY("vs-telemetry-controller-option",
|
||||
"WDC Enable/Disable Controller Initiated Telemetry Log",
|
||||
wdc_vs_telemetry_controller_option)
|
||||
ENTRY("vs-error-reason-identifier",
|
||||
"WDC Telemetry Reason Identifier",
|
||||
wdc_reason_identifier)
|
||||
ENTRY("log-page-directory", "WDC Get Log Page Directory",
|
||||
wdc_log_page_directory)
|
||||
ENTRY("namespace-resize", "WDC NamespaceDrive Resize",
|
||||
wdc_namespace_resize)
|
||||
ENTRY("vs-drive-info", "WDC Get Drive Info", wdc_vs_drive_info)
|
||||
ENTRY("vs-temperature-stats", "WDC Get Temperature Stats", wdc_vs_temperature_stats)
|
||||
ENTRY("capabilities", "WDC Device Capabilities", wdc_capabilities)
|
||||
ENTRY("cloud-SSD-plugin-version", "WDC Cloud SSD Plugin Version", wdc_cloud_ssd_plugin_version)
|
||||
ENTRY("vs-pcie-stats", "WDC VS PCIE Statistics", wdc_vs_pcie_stats)
|
||||
ENTRY("get-latency-monitor-log", "WDC Get Latency Monitor Log Page", wdc_get_latency_monitor_log)
|
||||
ENTRY("get-error-recovery-log", "WDC Get Error Recovery Log Page", wdc_get_error_recovery_log)
|
||||
ENTRY("get-dev-capabilities-log", "WDC Get Device Capabilities Log Page", wdc_get_dev_capabilities_log)
|
||||
ENTRY("get-unsupported-reqs-log", "WDC Get Unsupported Requirements Log Page", wdc_get_unsupported_reqs_log)
|
||||
ENTRY("cloud-boot-SSD-version", "WDC Get the Cloud Boot SSD Version", wdc_cloud_boot_SSD_version)
|
||||
ENTRY("vs-cloud-log", "WDC Get the Cloud Log Page", wdc_vs_cloud_log)
|
||||
ENTRY("vs-hw-rev-log", "WDC Get the Hardware Revision Log Page", wdc_vs_hw_rev_log)
|
||||
ENTRY("vs-device-waf", "WDC Calculate Device Write Amplication Factor", wdc_vs_device_waf)
|
||||
ENTRY("vs-temperature-stats", "WDC Get Temperature Stats",
|
||||
wdc_vs_temperature_stats)
|
||||
ENTRY("capabilities", "WDC Device Capabilities",
|
||||
wdc_capabilities)
|
||||
ENTRY("cloud-SSD-plugin-version",
|
||||
"WDC Cloud SSD Plugin Version",
|
||||
wdc_cloud_ssd_plugin_version)
|
||||
ENTRY("vs-pcie-stats", "WDC VS PCIE Statistics",
|
||||
wdc_vs_pcie_stats)
|
||||
ENTRY("get-latency-monitor-log",
|
||||
"WDC Get Latency Monitor Log Page",
|
||||
wdc_get_latency_monitor_log)
|
||||
ENTRY("get-error-recovery-log",
|
||||
"WDC Get Error Recovery Log Page",
|
||||
wdc_get_error_recovery_log)
|
||||
ENTRY("get-dev-capabilities-log",
|
||||
"WDC Get Device Capabilities Log Page",
|
||||
wdc_get_dev_capabilities_log)
|
||||
ENTRY("get-unsupported-reqs-log",
|
||||
"WDC Get Unsupported Requirements Log Page",
|
||||
wdc_get_unsupported_reqs_log)
|
||||
ENTRY("cloud-boot-SSD-version",
|
||||
"WDC Get the Cloud Boot SSD Version",
|
||||
wdc_cloud_boot_SSD_version)
|
||||
ENTRY("vs-cloud-log", "WDC Get the Cloud Log Page",
|
||||
wdc_vs_cloud_log)
|
||||
ENTRY("vs-hw-rev-log", "WDC Get the Hardware Revision Log Page",
|
||||
wdc_vs_hw_rev_log)
|
||||
ENTRY("vs-device-waf",
|
||||
"WDC Calculate Device Write Amplication Factor",
|
||||
wdc_vs_device_waf)
|
||||
ENTRY("set-latency-monitor-feature",
|
||||
"WDC set Latency Monitor feature",
|
||||
wdc_set_latency_monitor_feature)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include "nvme.h"
|
||||
#include "libnvme.h"
|
||||
#include "nvme-print.h"
|
||||
#include "wdc-utils.h"
|
||||
|
||||
int wdc_UtilsSnprintf(char *buffer, unsigned int sizeOfBuffer, const char *format, ...)
|
||||
|
@ -133,8 +136,8 @@ end:
|
|||
/**
|
||||
* Compares the strings ignoring their cases.
|
||||
*
|
||||
* @param pcSrc Points to a null terminated string for comapring.
|
||||
* @param pcDst Points to a null terminated string for comapring.
|
||||
* @param pcSrc Points to a null terminated string for comparing.
|
||||
* @param pcDst Points to a null terminated string for comparing.
|
||||
*
|
||||
* @returns zero if the string matches or
|
||||
* 1 if the pcSrc string is lexically higher than pcDst or
|
||||
|
@ -162,3 +165,42 @@ void wdc_StrFormat(char *formatter, size_t fmt_sz, char *tofmt, size_t tofmtsz)
|
|||
}
|
||||
}
|
||||
|
||||
bool wdc_CheckUuidListSupport(struct nvme_dev *dev, struct nvme_id_uuid_list *uuid_list)
|
||||
{
|
||||
int err;
|
||||
struct nvme_id_ctrl ctrl;
|
||||
|
||||
memset(&ctrl, 0, sizeof(struct nvme_id_ctrl));
|
||||
err = nvme_identify_ctrl(dev_fd(dev), &ctrl);
|
||||
if (err) {
|
||||
fprintf(stderr, "ERROR: WDC: nvme_identify_ctrl() failed 0x%x\n", err);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((ctrl.ctratt & NVME_CTRL_CTRATT_UUID_LIST) == NVME_CTRL_CTRATT_UUID_LIST) {
|
||||
err = nvme_identify_uuid(dev_fd(dev), uuid_list);
|
||||
if (!err)
|
||||
return true;
|
||||
else if (err > 0)
|
||||
nvme_show_status(err);
|
||||
else
|
||||
nvme_show_error("identify UUID list: %s", nvme_strerror(errno));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wdc_UuidEqual(struct nvme_id_uuid_list_entry *entry1, struct nvme_id_uuid_list_entry *entry2)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (entry1->uuid[i] != entry2->uuid[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == 16)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -76,4 +77,5 @@ int wdc_UtilsStrCompare(char *pcSrc, char *pcDst);
|
|||
int wdc_UtilsCreateDir(char *path);
|
||||
int wdc_WriteToFile(char *fileName, char *buffer, unsigned int bufferLen);
|
||||
void wdc_StrFormat(char *formatter, size_t fmt_sz, char *tofmt, size_t tofmtsz);
|
||||
|
||||
bool wdc_CheckUuidListSupport(struct nvme_dev *dev, struct nvme_id_uuid_list *uuid_list);
|
||||
bool wdc_UuidEqual(struct nvme_id_uuid_list_entry *entry1, struct nvme_id_uuid_list_entry *entry2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue