diff options
author | Alexis Ballier | 2018-01-07 02:41:48 +0100 |
---|---|---|
committer | Nikias Bassen | 2018-01-08 02:39:38 +0100 |
commit | 789b16a4a42ab56899092392f1c2d5dde6e9dd34 (patch) | |
tree | 22f3cb17626f43f1545bb01a9cb238a389a82941 | |
parent | 7f601f8e5241756c09d08a1319d90f24b9f8b1bc (diff) | |
download | usbmuxd-789b16a4a42ab56899092392f1c2d5dde6e9dd34.tar.gz usbmuxd-789b16a4a42ab56899092392f1c2d5dde6e9dd34.tar.bz2 |
usb: Store the whole device descriptor in struct usb_device
-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) |