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.
It's ontop of the new ids and silence patches sent today.
Bye,
Henning
--- linux-2.4.21-pre1.silent/drivers/usb/scanner.c 2002-12-19 13:10:15.000000000
+0100
+++ linux-2.4.21-pre1.endpoint/drivers/usb/scanner.c 2002-12-19 22:08:17.000000000
++0100
@@ -322,6 +322,8 @@
* <[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]>).
*
* TODO
* - Remove the 2/3 endpoint limitation
@@ -508,6 +510,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 @@
endpoint = interface[ifnum].endpoint;
/*
- * 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->bNumEndpoints);
- if ((interface->bNumEndpoints != 2) && (interface->bNumEndpoints != 3)) {
- info("probe_scanner: Only two or three endpoints supported.");
+ if ((interface->bNumEndpoints < 1) || (interface->bNumEndpoints > 3)) {
+ info("probe_scanner: Only 1, 2, or 3 endpoints supported.");
return NULL;
}
@@ -954,6 +962,12 @@
*/
switch(interface->bNumEndpoints) {
+ case 1:
+ if (!have_bulk_in) {
+ info("probe_scanner: One bulk-in endpoint required.");
+ return NULL;
+ }
+ break;
case 2:
if (!have_bulk_in || !have_bulk_out) {
info("probe_scanner: Two bulk endpoints required.");
-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now! Before the Holidays pass you by.
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