linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme-cli : wdc-plugin Add support for WDC SN100 and SN200 devices.
@ 2017-10-17 16:56 jeffreyalien
  2017-10-18 20:31 ` Keith Busch
  0 siblings, 1 reply; 2+ messages in thread
From: jeffreyalien @ 2017-10-17 16:56 UTC (permalink / raw)


From: jeffreyalien <jeff.lien@wdc.com>

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 at wdc.com>
---
 wdc-nvme.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/wdc-nvme.c b/wdc-nvme.c
index 03c86c9..b981298 100644
--- a/wdc-nvme.c
+++ b/wdc-nvme.c
@@ -47,9 +47,11 @@
 #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");
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] nvme-cli : wdc-plugin Add support for WDC SN100 and SN200 devices.
  2017-10-17 16:56 [PATCH] nvme-cli : wdc-plugin Add support for WDC SN100 and SN200 devices jeffreyalien
@ 2017-10-18 20:31 ` Keith Busch
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Busch @ 2017-10-18 20:31 UTC (permalink / raw)


On Tue, Oct 17, 2017@11:56:43AM -0500, jeffreyalien wrote:
> From: jeffreyalien <jeff.lien at wdc.com>
> 
> 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 at wdc.com>

Thanks, applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-18 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17 16:56 [PATCH] nvme-cli : wdc-plugin Add support for WDC SN100 and SN200 devices jeffreyalien
2017-10-18 20:31 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).