libmtp/probe-3-ep-only.patch
2011-04-01 01:08:56 +02:00

19 lines
639 B
Diff

diff --git a/src/libusb-glue.c b/src/libusb-glue.c
index 5d7889b..3c0a124 100644
--- a/src/libusb-glue.c
+++ b/src/libusb-glue.c
@@ -284,6 +284,13 @@ static int probe_device_descriptor(struct usb_device *dev, FILE *dumpfile)
&dev->config[i].interface[j].altsetting[k];
/*
+ * MTP interfaces have three endpoints, two bulk and one
+ * interrupt. Don't probe anything else.
+ */
+ if (intf->bNumEndpoints != 3)
+ continue;
+
+ /*
* We only want to probe for the OS descriptor if the
* device is USB_CLASS_VENDOR_SPEC or one of the interfaces
* in it is, so flag if we find an interface like this.