diff options
Diffstat (limited to 'hardinfo')
-rw-r--r-- | hardinfo/usb_util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hardinfo/usb_util.c b/hardinfo/usb_util.c index 845dbd2a..cc839b9a 100644 --- a/hardinfo/usb_util.c +++ b/hardinfo/usb_util.c @@ -30,6 +30,7 @@ usbi *usbi_new() { void usbi_free(usbi *s) { if (s) { + g_free(s->if_label); g_free(s->if_class_str); g_free(s->if_subclass_str); g_free(s->if_protocol_str); @@ -234,6 +235,11 @@ static gboolean usb_get_device_lsusb(int bus, int dev, usbd *s) { if (t = strchr(l, ' ')) curr_if->if_protocol_str = g_strdup(t + 1); } + } else if (l = lsusb_line_value(p, "iInterface")) { + if (curr_if != NULL){ + if (t = strchr(l, ' ')) + curr_if->if_label = g_strdup(t + 1); + } } p = next_nl + 1; @@ -270,6 +276,9 @@ static gboolean usb_get_interface_sysfs(int conf, int number, intf->if_subclass = h_sysfs_read_hex(ifpath, "bInterfaceSubClass"); intf->if_protocol = h_sysfs_read_hex(ifpath, "bInterfaceProtocol"); + if (intf->if_label == NULL) + intf->if_label = h_sysfs_read_string(ifpath, "interface"); + g_free(ifpath); return TRUE; } |