diff options
-rw-r--r-- | src/usb.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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) |