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 on top of the 2.5 patches you already applied and
basically the same a the 2.4 patch.

Bye,
  Henning
  
--- linux-2.5.52-endpoint/drivers/usb/image/scanner.c   2002-12-20 17:48:20.000000000 
+0100
+++ linux-2.5.52-interface/drivers/usb/image/scanner.c  2002-12-22 20:00:13.000000000 
++0100
@@ -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,13 +909,15 @@
                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
  * interrupt endpoint. If we have an interrupt endpoint go ahead and


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