Hi,

This patch (originally from Sergey Vlasov) adds support for scanners
with only one bulk-in endpoint. It's needed by all the GT-6801 based
scanners like the Artec Ultima 2000 or some of the Mustek BearPaws.

That's the 2.5 version of the patch sent yesterday and it's ontop of
the new ids patch sent today.

Bye,
  Henning
  
diff -u -r linux-2.5.52-newids/drivers/usb/image/scanner.c 
linux-2.5.52-endpoint/drivers/usb/image/scanner.c
--- linux-2.5.52-newids/drivers/usb/image/scanner.c     2002-12-20 18:43:19.000000000 
+0100
+++ linux-2.5.52-endpoint/drivers/usb/image/scanner.c   2002-12-20 17:48:20.000000000 
++0100
@@ -323,6 +323,8 @@
  *      Ed Hamrick <[EMAIL PROTECTED]>, Oliver Schwartz
  *     <[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]>).
  *
  * TODO
  *    - Remove the 2/3 endpoint limitation
@@ -513,6 +515,12 @@
 
        down(&(scn->sem));
 
+       if (!scn->bulk_out_ep) {
+               /* This scanner does not have a bulk-out endpoint */
+               up(&(scn->sem));
+               return -EINVAL;
+       }
+
        scn_minor = scn->scn_minor;
 
        obuf = scn->obuf;
@@ -907,15 +915,15 @@
        interface = intf->altsetting;
 
 /*
- * Start checking for two bulk endpoints OR two bulk endpoints *and* one
+ * Start checking for one or two bulk endpoints and an optional
  * interrupt endpoint. If we have an interrupt endpoint go ahead and
  * setup the handler. FIXME: This is a future enhancement...
  */
 
        dbg("probe_scanner: Number of Endpoints:%d", (int) 
interface->desc.bNumEndpoints);
 
-       if ((interface->desc.bNumEndpoints != 2) && (interface->desc.bNumEndpoints != 
3)) {
-               info("probe_scanner: Only two or three endpoints supported.");
+       if ((interface->desc.bNumEndpoints < 1) || (interface->desc.bNumEndpoints > 
+3)) {
+               info("probe_scanner: Only 1, 2, or 3 endpoints supported.");
                return -ENODEV;
        }
 
@@ -955,6 +963,12 @@
  */
 
        switch(interface->desc.bNumEndpoints) {
+       case 1:
+               if (!have_bulk_in) {
+                       info("probe_scanner: One bulk-in endpoint required.");
+                       return -EIO;
+               }
+               break;
        case 2:
                if (!have_bulk_in || !have_bulk_out) {
                        info("probe_scanner: Two bulk endpoints required.");


-------------------------------------------------------
This SF.NET email is sponsored by:  The Best Geek Holiday Gifts!
Time is running out!  Thinkgeek.com has the coolest gifts for
your favorite geek.   Let your fingers do the typing.   Visit Now.
T H I N K G E E K . C O M        http://www.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