summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/usb.c b/src/usb.c
index 3ce2abb..e0fadfd 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -53,7 +53,6 @@
struct usb_device {
libusb_device_handle *dev;
uint8_t bus, address;
- uint16_t vid, pid;
char serial[256];
int alive;
uint8_t interface, ep_in, ep_out;
@@ -61,6 +60,7 @@ struct usb_device {
struct collection tx_xfers;
int wMaxPacketSize;
uint64_t speed;
+ struct libusb_device_descriptor devdesc;
};
static struct collection device_list;
@@ -396,8 +396,7 @@ static int usb_device_add(libusb_device* dev)
usbdev->serial[res] = 0;
usbdev->bus = bus;
usbdev->address = address;
- usbdev->vid = devdesc.idVendor;
- usbdev->pid = devdesc.idProduct;
+ usbdev->devdesc = devdesc;
usbdev->speed = 480000000;
usbdev->dev = handle;
usbdev->alive = 1;
@@ -542,7 +541,7 @@ uint16_t usb_get_pid(struct usb_device *dev)
if(!dev->dev) {
return 0;
}
- return dev->pid;
+ return dev->devdesc.idProduct;
}
uint64_t usb_get_speed(struct usb_device *dev)