]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
[NVMe CLI] Add capability for unique plugin version
authorJeff Lien <jeff.lien@wdc.com>
Fri, 18 Jun 2021 15:03:33 +0000 (10:03 -0500)
committerKeith Busch <kbusch@kernel.org>
Fri, 25 Jun 2021 16:21:17 +0000 (10:21 -0600)
21 files changed:
cmd_handler.h
plugin.c
plugin.h
plugins/amzn/amzn-nvme.h
plugins/dera/dera-nvme.h
plugins/huawei/huawei-nvme.h
plugins/intel/intel-nvme.h
plugins/lnvm/lnvm-nvme.h
plugins/memblaze/memblaze-nvme.h
plugins/micron/micron-nvme.h
plugins/netapp/netapp-nvme.h
plugins/nvidia/nvidia-nvme.h
plugins/scaleflux/sfx-nvme.h
plugins/seagate/seagate-nvme.h
plugins/shannon/shannon-nvme.h
plugins/toshiba/toshiba-nvme.h
plugins/transcend/transcend-nvme.h
plugins/virtium/virtium-nvme.h
plugins/wdc/wdc-nvme.h
plugins/ymtc/ymtc-nvme.h
plugins/zns/zns.h

index d40740d7bb16cc327266ae8669147345e95a96c0..73b5962e51c4da7bd8000248433af72a56c43c61 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #undef NAME
-#define NAME(n, d)
+#define NAME(n, d, v)
 
 #undef ENTRY
 #define ENTRY(n, h, f, ...) \
@@ -26,7 +26,7 @@ static int f(int argc, char **argv, struct command *command, struct plugin *plug
  */
 
 #undef NAME
-#define NAME(n, d)
+#define NAME(n, d, v)
 
 #undef ENTRY_W_ALIAS
 #define ENTRY_W_ALIAS(n, h, f, a)      \
@@ -63,7 +63,7 @@ static struct command f ## _cmd = {   \
  */
 
 #undef NAME
-#define NAME(n, d)
+#define NAME(n, d, v)
 
 #undef ENTRY
 #define ENTRY(n, h, f, ...) &f ## _cmd,
@@ -87,7 +87,7 @@ static struct command *commands[] = { \
  */
 
 #undef NAME
-#define NAME(n, d) .name = n, .desc = d,
+#define NAME(n, d, v) .name = n, .desc = d, .version = v,
 
 #undef COMMAND_LIST
 #define COMMAND_LIST(args...)
index c7d6b2e10c318549c56fa9881d85c0a6ab3f0ba2..78f03ab4139cee4263ca3c3499f83b876b34bf51 100644 (file)
--- a/plugin.c
+++ b/plugin.c
@@ -11,7 +11,7 @@ static int version(struct plugin *plugin)
        struct program *prog = plugin->parent;
 
        if (plugin->name)
-               printf("%s %s version %s\n", prog->name, plugin->name, prog->version);
+               printf("%s %s version %s\n", prog->name, plugin->name, plugin->version);
        else
                printf("%s version %s\n", prog->name, prog->version);
        return 0;
index 91079fbecc8a68be05f3bf6db78e23568a5717a9..7a8ed090f7fa9584691474426ae6d655e0517e8a 100644 (file)
--- a/plugin.h
+++ b/plugin.h
@@ -16,6 +16,7 @@ struct program {
 struct plugin {
        const char *name;
        const char *desc;
+       const char *version;
        struct command **commands;
        struct program *parent;
        struct plugin *next;
index 9b8d797c48d9c539892ee672272368788f0f9fbb..f969c0ecadb0ae4513704e13c34229ab6f1ee854 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("amzn", "Amazon vendor specific extensions"),
+PLUGIN(NAME("amzn", "Amazon vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl)
        )
index dc54fabcb1eb04b7bcaa220ee6f1dce72160cdc6..d3a8b0b5e22dc7b6c28ecdcd0936a62f89cc21b7 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("dera", "Dera vendor specific extensions"),
+PLUGIN(NAME("dera", "Dera vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("smart-log-add", "Retrieve Dera SMART Log, show it", get_status, "stat")
        )
index 7aac90cb76e9806e1459d5c3083b10cadc302eb4..175ddd5b9bb91f95da22df14d8b62b8bae8a4640 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("huawei", "Huawei vendor specific extensions"),
+PLUGIN(NAME("huawei", "Huawei vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("list", "List all Huawei NVMe devices and namespaces on machine", huawei_list)
                ENTRY("id-ctrl", "Huawei identify controller", huawei_id_ctrl)
index b1190042330613ba95b4185b586016c92cce58a5..af1231a943229e60481e591d34249e1b72231e3f 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("intel", "Intel vendor specific extensions"),
+PLUGIN(NAME("intel", "Intel vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl)
                ENTRY("internal-log", "Retrieve Intel internal firmware log, save it", get_internal_log)
index 45b3cf027b79710948ada71156020212879aa0ac..18dffe19e7cc717c9b93b02ac612ac885e9949af 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("lnvm", "LightNVM specific extensions"),
+PLUGIN(NAME("lnvm", "LightNVM specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("list", "List available LightNVM devices", lnvm_list)
                ENTRY("info", "List general information and available target engines", lnvm_info)
index 043d0a8d0cc972a0e497d71ff4fba20deb0cd8c6..6f10bd7aed1a15904457205cad3283302361bc17 100644 (file)
@@ -12,7 +12,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-PLUGIN(NAME("memblaze", "Memblaze vendor specific extensions"),
+PLUGIN(NAME("memblaze", "Memblaze vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("smart-log-add", "Retrieve Memblaze SMART Log, show it", mb_get_additional_smart_log)
                ENTRY("get-pm-status", "Get Memblaze Power Manager Status", mb_get_powermanager_status)
index 118f8cdfcc56e5993e8710e96add9f709d97948e..65eca6ab67c70e74592cf79fa95fdc772ba7e8a6 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("micron", "Micron vendor specific extensions"),
+PLUGIN(NAME("micron", "Micron vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(ENTRY("select-download", "Selective Firmware Download", micron_selective_download)
                ENTRY("vs-temperature-stats", "Retrieve Micron temperature statistics ", micron_temp_stats)
                ENTRY("vs-pcie-stats", "Retrieve Micron PCIe error stats", micron_pcie_stats)
index d4eebd6eca88d03b47039a501dfe43abf67adfbf..2599db029220dbcbfa05d18d4506256efc82df39 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("netapp", "NetApp vendor specific extensions"),
+PLUGIN(NAME("netapp", "NetApp vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("smdevices", "NetApp SMdevices", netapp_smdevices)
                ENTRY("ontapdevices", "NetApp ONTAPdevices", netapp_ontapdevices)
index bf562b91052d17119f4e89a4ffbc459e6bd40e95..74a20b8b6130d6d1f4e79eb944440a8e6fd73dd9 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("nvidia", "NVIDIA vendor specific extensions"),
+PLUGIN(NAME("nvidia", "NVIDIA vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("id-ctrl", "Send NVMe Identify Controller", id_ctrl)
        )
index 8f145019037a0aa92b9a3a516551df59e199ed2c..fde5ba3d8aab2f9fc5a192a8767c7615ec514f91 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("sfx", "ScaleFlux vendor specific extensions"),
+PLUGIN(NAME("sfx", "ScaleFlux vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("smart-log-add", "Retrieve ScaleFlux SMART Log, show it", get_additional_smart_log)
                ENTRY("lat-stats", "Retrieve ScaleFlux IO Latency Statistics log, show it", get_lat_stats_log)
index f5706978071ee299326008fcc18b1a955b875d3d..a4989f1ecc4a5f6e48eb057d31ab9d4185b9d871 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("seagate", "Seagate vendor specific extensions"),
+PLUGIN(NAME("seagate", "Seagate vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("vs-temperature-stats", "Retrieve Seagate temperature statistics ",          temp_stats)
                ENTRY("vs-log-page-sup",      "Retrieve Seagate Supported Log-pages Information ", log_pages_supp)
index d40732e64f7a98ee0e13cb228678a118c600bea4..db258288d5d88917272069f6dcc9e99131653b45 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("shannon", "Shannon vendor specific extensions"),
+PLUGIN(NAME("shannon", "Shannon vendor specific extensions", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("smart-log-add", "Retrieve Shannon SMART Log, show it", get_additional_smart_log)
                ENTRY("get-feature-add", "Get Shannon feature and show the resulting value", get_additional_feature)
index c405e78129d17c78eb33649d5cc7bed25617265c..ebd7575fab40c3c61c93ef986efff950b4303e82 100644 (file)
@@ -7,7 +7,7 @@
 #include "cmd.h"
 #include "plugin.h"
 
-PLUGIN(NAME("toshiba", "Toshiba NVME plugin"),
+PLUGIN(NAME("toshiba", "Toshiba NVME plugin", NVME_VERSION),
     COMMAND_LIST(
                        ENTRY("vs-smart-add-log", "Extended SMART information", vendor_log)
                        ENTRY("vs-internal-log", "Get Internal Log", internal_log)
index 14d62ec7df64e18338695ec9e0b61966c9d26b98..317793aa65b611c836ee8675ce912ec379b6bb6f 100644 (file)
@@ -7,7 +7,7 @@
 #include "cmd.h"
  
 
-PLUGIN(NAME("transcend", "Transcend vendor specific extensions"),
+PLUGIN(NAME("transcend", "Transcend vendor specific extensions", NVME_VERSION),
     COMMAND_LIST(
                        ENTRY("healthvalue", "NVME health percentage", getHealthValue)
                        ENTRY("badblock", "Get NVME bad block number", getBadblock)
index b95c910cf0fc5db0f2e610d423c7fc228d8cf2e4..124ab182a7d4bfe0a476f794287eeda9ee2fe5e0 100644 (file)
@@ -7,7 +7,7 @@
 #include "cmd.h"
 #include "plugin.h"
 
-PLUGIN(NAME("virtium", "Virtium vendor specific extensions"),
+PLUGIN(NAME("virtium", "Virtium vendor specific extensions", NVME_VERSION),
     COMMAND_LIST(
             ENTRY("save-smart-to-vtview-log", "Periodically save smart attributes into a log file.\n\
                              The data in this log file can be analyzed using excel or using Virtium’s vtView.\n\
index de6affab99a1b57922e13c334b33cfb151ba6b7a..29ff6a08a610273b48da7bead97d1699a09b987a 100644 (file)
@@ -4,9 +4,10 @@
 #if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ)
 #define WDC_NVME
 
+#define WDC_PLUGIN_VERSION   "1.14.1"
 #include "cmd.h"
 
-PLUGIN(NAME("wdc", "Western Digital vendor specific extensions"),
+PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION),
        COMMAND_LIST(
                ENTRY("cap-diag", "WDC Capture-Diagnostics", wdc_cap_diag)
                ENTRY("drive-log", "WDC Drive Log", wdc_drive_log)
index 739fd374489f38667769776da7081a5a349f01c3..c1ebc11eea5a99e7cebb585091c618ff53ca1db0 100644 (file)
@@ -12,7 +12,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-PLUGIN(NAME("ymtc", "Ymtc vendor specific extensions"),
+PLUGIN(NAME("ymtc", "Ymtc vendor specific extensions", NVME_VERSION),
     COMMAND_LIST(
         ENTRY("smart-log-add", "Retrieve Ymtc SMART Log, show it", get_additional_smart_log)
     )
index a92de69c5214bda6ebf30f598ce4219c87891346..61063f70e39f992ad0b0d2298551d01265f7fcb7 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "cmd.h"
 
-PLUGIN(NAME("zns", "Zoned Namespace Command Set"),
+PLUGIN(NAME("zns", "Zoned Namespace Command Set", NVME_VERSION),
        COMMAND_LIST(
                ENTRY("id-ctrl", "Retrieve ZNS controller identification", id_ctrl)
                ENTRY("id-ns", "Retrieve ZNS namespace identification", id_ns)