Re: [lsusb PATCH] - Show vendor and product in lsusb -t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Dafydd Crosby wrote:

I was having some issues with `lsusb -t` (the tree view mode) in that
it doesn't show the vendor and product (which is default behaviour
with lsusb and no arguments). This patch should take care of that.

-Dafydd Crosby

   This shouldn't be a part of patch description.

diff --git a/devtree.c b/devtree.c
index 69c93ac..83ce8e1 100644
--- a/devtree.c
+++ b/devtree.c
[...]
@@ -81,6 +82,30 @@ void devtree_markdeleted(void)
 	}
 }

+static int get_vendor_string(char *buf, size_t size, u_int16_t vid)
+{
+	const char *cp;
+
+	if (size < 1)
+		return 0;
+	*buf = 0;
+	if (!(cp = names_vendor(vid)))
+		return 0;
+	return snprintf(buf, size, "%s", cp);
+}
+
+static int get_product_string(char *buf, size_t size, u_int16_t vid,
u_int16_t pid)

   The patch is line-wrapped. Should be easy to fix by hand though...

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux