diff --git a/Documentation/cmd-plugins.txt b/Documentation/cmd-plugins.txt index 580c795fe2..8b28629f1e 100644 --- a/Documentation/cmd-plugins.txt +++ b/Documentation/cmd-plugins.txt @@ -73,6 +73,9 @@ linknvme:nvme-sndk-cloud-SSD-plugin-version[1]:: linknvme:nvme-sndk-cloud-boot-SSD-version[1]:: Display Sandisk Cloud Boot SSD Version +linknvme:nvme-sndk-cu-smart-log[1]:: + Display Sandisk Customer Unique Smart log pagee + linknvme:nvme-sndk-drive-resize[1]:: Send NVMe Sandisk Resize Vendor Unique Command diff --git a/Documentation/meson.build b/Documentation/meson.build index 47e9e7ddf7..995ed106e1 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -150,6 +150,7 @@ adoc_sources = [ 'nvme-sndk-clear-pcie-correctable-errors', 'nvme-sndk-cloud-SSD-plugin-version', 'nvme-sndk-cloud-boot-SSD-version', + 'nvme-sndk-cu-smart-log', 'nvme-sndk-drive-resize', 'nvme-sndk-get-drive-status', 'nvme-sndk-get-dev-capabilities-log', diff --git a/Documentation/nvme-sndk-cu-smart-log.txt b/Documentation/nvme-sndk-cu-smart-log.txt new file mode 100644 index 0000000000..74c4bf44ea --- /dev/null +++ b/Documentation/nvme-sndk-cu-smart-log.txt @@ -0,0 +1,49 @@ +nvme-sndk-cu-smart-log(1) +========================= + +NAME +---- +nvme-sndk-cu-smart-log - Send NVMe Sandisk cu-smart-log Vendor Unique Command, return result + +SYNOPSIS +-------- +[verse] +'nvme sndk cu-smart-log' [--output-format= -o ] + [--uuid-index= | -u ] + +DESCRIPTION +----------- +For the NVMe device given, retrieves and formats the Vendor Unique Sandisk 0xCA log page. + +The parameter is mandatory and may be either the NVMe character +device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1). + +This will only work on Sandisk devices supporting this feature. +Results for any other device are undefined. + +On success it returns 0, error code otherwise. + +OPTIONS +------- +-o :: +--output-format=:: + Set the reporting format to 'normal', or + 'json'. Only one output format can be used at a time. + Default is normal. + +-u :: +--uuid-index=:: + Sets the uuid-index of the log page to be retrieved. Defaults to + 0 if not given. + +EXAMPLES +-------- +* Has the program issue Sandisk cu-smart-log plugin Command : ++ +------------ +# nvme sndk cu-smart-log /dev/nvme0 +------------ + +NVME +---- +Part of the nvme-user suite. diff --git a/plugins/sandisk/sandisk-nvme.c b/plugins/sandisk/sandisk-nvme.c index b867ea21cd..cafada17b3 100644 --- a/plugins/sandisk/sandisk-nvme.c +++ b/plugins/sandisk/sandisk-nvme.c @@ -305,3 +305,10 @@ static int sndk_vs_temperature_stats(int argc, char **argv, { return run_wdc_vs_temperature_stats(argc, argv, command, plugin); } + +static int sndk_cu_smart_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return run_wdc_cu_smart_log(argc, argv, command, plugin); +} diff --git a/plugins/sandisk/sandisk-nvme.h b/plugins/sandisk/sandisk-nvme.h index a5597b09f1..037c895c4a 100644 --- a/plugins/sandisk/sandisk-nvme.h +++ b/plugins/sandisk/sandisk-nvme.h @@ -5,7 +5,7 @@ #if !defined(SANDISK_NVME) || defined(CMD_HEADER_MULTI_READ) #define SANDISK_NVME -#define SANDISK_PLUGIN_VERSION "2.12.0" +#define SANDISK_PLUGIN_VERSION "2.14.1" #include "cmd.h" PLUGIN(NAME("sndk", "Sandisk vendor specific extensions", SANDISK_PLUGIN_VERSION), @@ -73,6 +73,10 @@ PLUGIN(NAME("sndk", "Sandisk vendor specific extensions", SANDISK_PLUGIN_VERSION ENTRY("set-latency-monitor-feature", "Sandisk set Latency Monitor feature", sndk_set_latency_monitor_feature) + ENTRY("cu-smart-log", + "Sandisk Get Customer Unique Smart Log", + sndk_cu_smart_log) + ) ); diff --git a/plugins/wdc/wdc-nvme-cmds.h b/plugins/wdc/wdc-nvme-cmds.h index 305e35e5c2..3f60d6dde8 100644 --- a/plugins/wdc/wdc-nvme-cmds.h +++ b/plugins/wdc/wdc-nvme-cmds.h @@ -113,6 +113,10 @@ int run_wdc_vs_temperature_stats(int argc, char **argv, struct command *command, struct plugin *plugin); +int run_wdc_cu_smart_log(int argc, char **argv, + struct command *command, + struct plugin *plugin); + bool run_wdc_nvme_check_supported_log_page(nvme_root_t r, struct nvme_dev *dev, __u8 log_id); diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index cd26fefd83..a6c1572ecc 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -12918,6 +12918,14 @@ int run_wdc_vs_temperature_stats(int argc, char **argv, return wdc_vs_temperature_stats(argc, argv, command, plugin); } +int run_wdc_cu_smart_log(int argc, char **argv, + struct command *command, + struct plugin *plugin) +{ + return wdc_cu_smart_log(argc, argv, command, plugin); +} + + __u32 run_wdc_get_fw_cust_id(nvme_root_t r, struct nvme_dev *dev) { return wdc_get_fw_cust_id(r, dev);