]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli : wdc-plugin Add support for WDC SN100 and SN200 devices.
authorjeffreyalien <jeff.lien@wdc.com>
Tue, 17 Oct 2017 16:56:43 +0000 (11:56 -0500)
committerKeith Busch <keith.busch@intel.com>
Wed, 18 Oct 2017 20:31:13 +0000 (14:31 -0600)
Update the checking for the wdc-plugin commands so that a
"Device not supported" message will be displayed for non-WDC
devices.

Signed-off-by: jeffreyalien <jeff.lien@wdc.com>
wdc-nvme.c

index 03c86c9ef54be3bb69dde5c9f0833b92475a6d8c..b9812985602ec7479a565f03cd147a8a71e7dec2 100644 (file)
 #define WDC_NVME_SUBCMD_SHIFT  8
 
 #define WDC_NVME_LOG_SIZE_DATA_LEN                     0x08
+
 /* Device Config */
-#define WDC_NVME_GF_VID                0x1c58
-#define WDC_NVME_GF_CNTL_ID 0x0003
+#define WDC_NVME_VID                   0x1c58
+#define WDC_NVME_SN100_CNTL_ID 0x0003
+#define WDC_NVME_SN200_CNTL_ID 0x0023
 
 /* Capture Diagnostics */
 #define WDC_NVME_CAP_DIAG_HEADER_TOC_SIZE      WDC_NVME_LOG_SIZE_DATA_LEN
@@ -200,9 +202,10 @@ static int wdc_check_device(int fd)
                return -1;
        }
        ret = -1;
-       /* GF : ctrl->cntlid == PCI Device ID, use that with VID to identify GF Device */
-       if ((le32_to_cpu(ctrl.cntlid) == WDC_NVME_GF_CNTL_ID) &&
-                       (le32_to_cpu(ctrl.vid) == WDC_NVME_GF_VID))
+       /* WDC : ctrl->cntlid == PCI Device ID, use that with VID to identify WDC Devices */
+       if ((le32_to_cpu(ctrl.vid) == WDC_NVME_VID) &&
+               ((le32_to_cpu(ctrl.cntlid) == WDC_NVME_SN100_CNTL_ID) ||
+               (le32_to_cpu(ctrl.cntlid) == WDC_NVME_SN200_CNTL_ID)))
                ret = 0;
        else
                fprintf(stderr, "WARNING : WDC : Device not supported\n");