ChangeSet 1.946.3.2, 2002/12/23 11:21:38-08:00, [EMAIL PROTECTED]
[PATCH] scanner.c: Accept scanners with more than one interface
This patch allows the scanner driver to accept devices with more than
one interface. That's needed by some multi-function periphals (e.g.
scanner+printer).
diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c
--- a/drivers/usb/image/scanner.c Fri Dec 27 23:58:20 2002
+++ b/drivers/usb/image/scanner.c Fri Dec 27 23:58:20 2002
@@ -321,10 +321,12 @@
* "Jaeger, Gerhard" <[EMAIL PROTECTED]>, Ira Childress
* <[EMAIL PROTECTED]>, Till Kamppeter <[EMAIL PROTECTED]>,
* Ed Hamrick <[EMAIL PROTECTED]>, Oliver Schwartz
- * <[EMAIL PROTECTED]> and everyone else who sent ids.
+ * <[EMAIL PROTECTED]> and everyone else who sent ids.
* - Some Benq, Genius and Plustek ids are identified now.
* - Accept scanners with only one bulk (in) endpoint (thanks to Sergey
* Vlasov <[EMAIL PROTECTED]>).
+ * - Accept devices with more than one interface. Only use interfaces that
+ * look like belonging to scanners.
*
* TODO
* - Remove the 2/3 endpoint limitation
@@ -907,12 +909,14 @@
return -ENODEV;
}
- if (dev->config[0].desc.bNumInterfaces != 1) {
- info("probe_scanner: Only one device interface is supported.");
+ interface = intf->altsetting;
+
+ if (interface[0].desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC &&
+ interface[0].desc.bInterfaceClass != USB_CLASS_PER_INTERFACE &&
+ interface[0].desc.bInterfaceClass != 16) {
+ dbg("probe_scanner: This interface doesn't look like a scanner
+(class=0x%x).", interface[0].desc.bInterfaceClass);
return -ENODEV;
}
-
- interface = intf->altsetting;
/*
* Start checking for one or two bulk endpoints and an optional
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel