Hi,

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).

The patch is ontop of the patches you already applied.

Bye,
  Henning

--- linux-2.4.21-pre1.endpoint/drivers/usb/scanner.c    2002-12-19 22:08:17.000000000 
+0100
+++ linux-2.4.21-pre1.interface/drivers/usb/scanner.c   2002-12-22 11:47:13.000000000 
++0100
@@ -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

Reply via email to