ChangeSet 1.893.2.7, 2002/12/23 11:48:26-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/scanner.c b/drivers/usb/scanner.c
--- a/drivers/usb/scanner.c Mon Jan 6 11:31:29 2003
+++ b/drivers/usb/scanner.c Mon Jan 6 11:31:29 2003
@@ -319,11 +319,13 @@
* "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.
* - Don't clutter syslog with "Unable to access minor data" messages.
* - 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
@@ -906,12 +908,15 @@
return NULL;
}
- if (dev->config[0].bNumInterfaces != 1) {
- info("probe_scanner: Only one device interface is supported.");
+ interface = dev->config[0].interface[ifnum].altsetting;
+
+ if (interface[0].bInterfaceClass != USB_CLASS_VENDOR_SPEC &&
+ interface[0].bInterfaceClass != USB_CLASS_PER_INTERFACE &&
+ interface[0].bInterfaceClass != 16) {
+ dbg("probe_scanner: This interface doesn't look like a scanner
+(class=0x%x).", interface[0].bInterfaceClass);
return NULL;
}
- interface = dev->config[0].interface[ifnum].altsetting;
endpoint = interface[ifnum].endpoint;
/*
-------------------------------------------------------
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