linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nvme-cli] edit huawei ssd filter
@ 2020-05-20  1:39 l00293085
  2020-05-20  8:04 ` Chaitanya Kulkarni
  0 siblings, 1 reply; 4+ messages in thread
From: l00293085 @ 2020-05-20  1:39 UTC (permalink / raw)
  To: kbusch, linux-nvme; +Cc: liuzhouhua, wangzan, kangwenhong, Michael.wangchong

Hi, I'd like to modify command: nvme huawei list, add huawei vendor id as filter

Signed-off-by: Andy Liu <liuzhouhua@huawei.com>
Reviewed-by: Wang Zan <wangzan@huawei.com>
---
 plugins/huawei/huawei-nvme.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/huawei/huawei-nvme.c b/plugins/huawei/huawei-nvme.c
index c935f47..c7f3307 100644
--- a/plugins/huawei/huawei-nvme.c
+++ b/plugins/huawei/huawei-nvme.c
@@ -41,6 +41,7 @@
 #define CREATE_CMD
 #include "huawei-nvme.h"
 
+#define HW_SSD_PCI_VENDOR_ID 0x19E5
 #define ARRAY_NAME_LEN 80
 #define NS_NAME_LEN    40
 
@@ -80,16 +81,15 @@ static int huawei_get_nvme_info(int fd, struct huawei_list_item *item, const cha
 		return err;
 
 	/*identify huawei device*/
-	if (strstr(item->ctrl.mn, "Huawei") == NULL) {
+	if ((strstr(item->ctrl.mn, "Huawei") == NULL) \
+		&& (le16_to_cpu(item->ctrl.vid) != HW_SSD_PCI_VENDOR_ID)) {
 		item->huawei_device = false;
 		return 0;
 	}
-	else
-		item->huawei_device = true;
 
+	item->huawei_device = true;
 	item->nsid = nvme_get_nsid(fd);
-	err = nvme_identify_ns(fd, item->nsid,
-							0, &item->ns);
+	err = nvme_identify_ns(fd, item->nsid, 0, &item->ns);
 	if (err)
 		return err;
 
-- 
2.22.0


_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2020-05-22  0:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  1:39 [PATCH nvme-cli] edit huawei ssd filter l00293085
2020-05-20  8:04 ` Chaitanya Kulkarni
2020-05-21  9:34   ` Zhouhua Liu
2020-05-22  0:58     ` Chaitanya Kulkarni

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).