Skip to content

Commit 438304a

Browse files
jeff-lien-sndkigaw
authored andcommitted
sndk: Add sndk cu-smart-log plugin command
Add support for the customer unique smart log command in the Sandisk plugin. Signed-off-by: jeff-lien-wdc <[email protected]>
1 parent a3528d7 commit 438304a

File tree

7 files changed

+77
-1
lines changed

7 files changed

+77
-1
lines changed

Documentation/cmd-plugins.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ linknvme:nvme-sndk-cloud-SSD-plugin-version[1]::
7373
linknvme:nvme-sndk-cloud-boot-SSD-version[1]::
7474
Display Sandisk Cloud Boot SSD Version
7575

76+
linknvme:nvme-sndk-cu-smart-log[1]::
77+
Display Sandisk Customer Unique Smart log pagee
78+
7679
linknvme:nvme-sndk-drive-resize[1]::
7780
Send NVMe Sandisk Resize Vendor Unique Command
7881

Documentation/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ adoc_sources = [
150150
'nvme-sndk-clear-pcie-correctable-errors',
151151
'nvme-sndk-cloud-SSD-plugin-version',
152152
'nvme-sndk-cloud-boot-SSD-version',
153+
'nvme-sndk-cu-smart-log',
153154
'nvme-sndk-drive-resize',
154155
'nvme-sndk-get-drive-status',
155156
'nvme-sndk-get-dev-capabilities-log',
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
nvme-sndk-cu-smart-log(1)
2+
=========================
3+
4+
NAME
5+
----
6+
nvme-sndk-cu-smart-log - Send NVMe Sandisk cu-smart-log Vendor Unique Command, return result
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
'nvme sndk cu-smart-log' <device> [--output-format=<normal|json> -o <normal|json>]
12+
[--uuid-index=<uuid-index> | -u <uuid-index>]
13+
14+
DESCRIPTION
15+
-----------
16+
For the NVMe device given, retrieves and formats the Vendor Unique Sandisk 0xCA log page.
17+
18+
The <device> parameter is mandatory and may be either the NVMe character
19+
device (ex: /dev/nvme0) or block device (ex: /dev/nvme0n1).
20+
21+
This will only work on Sandisk devices supporting this feature.
22+
Results for any other device are undefined.
23+
24+
On success it returns 0, error code otherwise.
25+
26+
OPTIONS
27+
-------
28+
-o <fmt>::
29+
--output-format=<fmt>::
30+
Set the reporting format to 'normal', or
31+
'json'. Only one output format can be used at a time.
32+
Default is normal.
33+
34+
-u <uuid-index>::
35+
--uuid-index=<uuid-index>::
36+
Sets the uuid-index of the log page to be retrieved. Defaults to
37+
0 if not given.
38+
39+
EXAMPLES
40+
--------
41+
* Has the program issue Sandisk cu-smart-log plugin Command :
42+
+
43+
------------
44+
# nvme sndk cu-smart-log /dev/nvme0
45+
------------
46+
47+
NVME
48+
----
49+
Part of the nvme-user suite.

plugins/sandisk/sandisk-nvme.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,10 @@ static int sndk_vs_temperature_stats(int argc, char **argv,
305305
{
306306
return run_wdc_vs_temperature_stats(argc, argv, command, plugin);
307307
}
308+
309+
static int sndk_cu_smart_log(int argc, char **argv,
310+
struct command *command,
311+
struct plugin *plugin)
312+
{
313+
return run_wdc_cu_smart_log(argc, argv, command, plugin);
314+
}

plugins/sandisk/sandisk-nvme.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#if !defined(SANDISK_NVME) || defined(CMD_HEADER_MULTI_READ)
66
#define SANDISK_NVME
77

8-
#define SANDISK_PLUGIN_VERSION "2.12.0"
8+
#define SANDISK_PLUGIN_VERSION "2.14.1"
99
#include "cmd.h"
1010

1111
PLUGIN(NAME("sndk", "Sandisk vendor specific extensions", SANDISK_PLUGIN_VERSION),
@@ -73,6 +73,10 @@ PLUGIN(NAME("sndk", "Sandisk vendor specific extensions", SANDISK_PLUGIN_VERSION
7373
ENTRY("set-latency-monitor-feature",
7474
"Sandisk set Latency Monitor feature",
7575
sndk_set_latency_monitor_feature)
76+
ENTRY("cu-smart-log",
77+
"Sandisk Get Customer Unique Smart Log",
78+
sndk_cu_smart_log)
79+
7680
)
7781
);
7882

plugins/wdc/wdc-nvme-cmds.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ int run_wdc_vs_temperature_stats(int argc, char **argv,
113113
struct command *command,
114114
struct plugin *plugin);
115115

116+
int run_wdc_cu_smart_log(int argc, char **argv,
117+
struct command *command,
118+
struct plugin *plugin);
119+
116120
bool run_wdc_nvme_check_supported_log_page(nvme_root_t r,
117121
struct nvme_dev *dev,
118122
__u8 log_id);

plugins/wdc/wdc-nvme.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12918,6 +12918,14 @@ int run_wdc_vs_temperature_stats(int argc, char **argv,
1291812918
return wdc_vs_temperature_stats(argc, argv, command, plugin);
1291912919
}
1292012920

12921+
int run_wdc_cu_smart_log(int argc, char **argv,
12922+
struct command *command,
12923+
struct plugin *plugin)
12924+
{
12925+
return wdc_cu_smart_log(argc, argv, command, plugin);
12926+
}
12927+
12928+
1292112929
__u32 run_wdc_get_fw_cust_id(nvme_root_t r, struct nvme_dev *dev)
1292212930
{
1292312931
return wdc_get_fw_cust_id(r, dev);

0 commit comments

Comments
 (0)