summaryrefslogtreecommitdiff
path: root/includes/usb_util.h
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2024-04-22 00:35:53 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2024-04-22 00:35:53 -0300
commit5f01c706267c595de92406a32e7f31ef5056c2d0 (patch)
treed1e74ef54efc41ada622900fe3e2a50dee44a237 /includes/usb_util.h
parent09fcc751ef158898c315ebc9299a0fa3a722d914 (diff)
New upstream version 2.0.3preupstream/2.0.3pre
Diffstat (limited to 'includes/usb_util.h')
-rw-r--r--includes/usb_util.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/includes/usb_util.h b/includes/usb_util.h
new file mode 100644
index 00000000..736a9237
--- /dev/null
+++ b/includes/usb_util.h
@@ -0,0 +1,78 @@
+/*
+ * HardInfo - Displays System Information
+ * Copyright (C) 2003-2017 L. A. F. Pereira <l@tia.mat.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2 or later.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __USB_UTIL_H__
+#define __USB_UTIL_H__
+
+/* this is a linked list */
+typedef struct usbd {
+ int bus, dev;
+ int vendor_id, product_id;
+ char *vendor;
+ char *product;
+ char *manufacturer;
+ char *device;
+ char *serial;
+
+ int dev_class;
+ int dev_subclass;
+ int dev_protocol;
+ char *dev_class_str;
+ char *dev_subclass_str;
+ char *dev_protocol_str;
+
+ char *usb_version;
+ char *device_version; /* bcdDevice */
+
+ int max_curr_ma;
+
+ int speed_mbs;
+
+ vendor_list vendors;
+
+ gboolean user_scan; /* not scanned as root */
+ struct usbi *if_list;
+
+ struct usbd *next;
+} usbd;
+
+/* another linked list */
+typedef struct usbi {
+ int if_number;
+ int if_class;
+ int if_subclass;
+ int if_protocol;
+ char *if_label;
+ char *if_class_str;
+ char *if_subclass_str;
+ char *if_protocol_str;
+ char *driver;
+
+ struct usbi *next;
+} usbi;
+
+usbd *usb_get_device_list();
+int usbd_list_count(usbd *);
+void usbd_list_free(usbd *);
+void usb_lookup_ids_vendor_product_str(gint vendor_id, gint product_id,
+ gchar **vendor_str, gchar **product_str);
+
+usbd *usb_get_device(int bus, int dev, const gchar* sysfspath);
+void usbd_free(usbd *);
+
+#endif