From 52085051fcad1a12e40827d66ced57d203f2155a Mon Sep 17 00:00:00 2001 From: "m. allan noah" Date: Tue, 9 Dec 2003 18:47:53 +0000 Subject: [PATCH] moved desc for one scanner, added packet counting code to backend --- ChangeLog | 7 +++++++ backend/fujitsu.c | 14 ++++++++++++++ doc/descriptions/fujitsu.desc | 4 ---- doc/descriptions/ma1509.desc | 6 ++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5432ef3f2..00690b073 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-12-09 Allan Noah + * doc/desc/{fujitsu|ma1509}.desc: move fujitsu fi-4110eox2 section + +2003-12-09 Allan Noah + * backend/fujitsu.c: count USB packets to prevent timeouts, perhaps + due to DATA0/1 toggle problems in certain scanners + 2003-12-07 Peter Fales * acinclude.m4, aclocal.m4, configure: remove "enabling GPHOTO2" messages printed by configure diff --git a/backend/fujitsu.c b/backend/fujitsu.c index b4d734977..708322614 100644 --- a/backend/fujitsu.c +++ b/backend/fujitsu.c @@ -360,6 +360,9 @@ static int forceModel = -1; /* Also set via config file. */ static int scsiBuffer = 64 * 1024; +/* flaming hack to get USB scanners + working without timeouts under linux */ +static unsigned int cmd_count = 0; /* * required for compressed data transfer. sense_handler has to tell @@ -3024,6 +3027,8 @@ do_usb_cmd (int fd, unsigned char *cmd, retry: hexdump (IO_CMD, " 0) op_code = ((int)cmd[0]) & 0xff; if ((cmd_len+USB_CMD_HEADER_BYTES) > (int)sizeof(buf)) { @@ -3252,6 +3257,15 @@ free_scanner (struct fujitsu *s) if (ret) return ret; + /* flaming hack cause some usb scanners (fi-4x20) fail + to work properly on next connection if an odd number + of commands are sent to the scanner. */ + if(s->connection == SANE_FUJITSU_USB && cmd_count % 2){ + ret = get_hardware_status(s); + if (ret) + return ret; + } + DBG (10, "free_scanner: ok\n"); return ret; } diff --git a/doc/descriptions/fujitsu.desc b/doc/descriptions/fujitsu.desc index a9cecdc8a..b0c60cb5e 100644 --- a/doc/descriptions/fujitsu.desc +++ b/doc/descriptions/fujitsu.desc @@ -49,10 +49,6 @@ :interface "SCSI" :status :good -:model "fi-4110EOX2" -:interface "USB" -:status :unsupported - :model "fi-4120C" :interface "SCSI USB" :status :good diff --git a/doc/descriptions/ma1509.desc b/doc/descriptions/ma1509.desc index ec66b4afb..41cd90077 100644 --- a/doc/descriptions/ma1509.desc +++ b/doc/descriptions/ma1509.desc @@ -30,6 +30,12 @@ :status :good :comment "Works upto 600 dpi. No support for TA and ADF yet." +:mfg "Fujitsu" ; name a manufacturer +:model "fi-4110EOX2" +:interface "USB" +:status :unsupported +:comment "Uses ma1509 chip, but very different from other scanners supported by backend" +:url "http://www2.pfeiffer.edu/~anoah/fujitsu/" ; :comment and :url specifiers are optional after :mfg, :model, :desc, ; and at the top-level.