diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:32:49 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:32:49 +0200 |
commit | cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (patch) | |
tree | 56cb8849a5df91b19b72fd4f48c79c343cd9bc5e /backend/avision.c | |
parent | ba8d09abe681600aad991f4a75e904615b7ed29f (diff) |
Imported Upstream version 1.0.25upstream/1.0.25
Diffstat (limited to 'backend/avision.c')
-rw-r--r-- | backend/avision.c | 399 |
1 files changed, 200 insertions, 199 deletions
diff --git a/backend/avision.c b/backend/avision.c index 31b0a58..146125c 100644 --- a/backend/avision.c +++ b/backend/avision.c @@ -39,25 +39,22 @@ ***************************************************************************** - This backend is based upon the Tamarack backend and adapted to the Avision - scanners by René Rebe and Meino Cramer. - This file implements a SANE backend for the Avision SCSI Scanners (like the AV 630 / 620 (CS) ...) and some Avision (OEM) USB scanners (like the HP 53xx, 74xx, Minolta FS-V1 ...) or Fujitsu ScanPartner with the AVISION SCSI-2/3 - or USB command set. + or USB command set and written by René Rebe and Meino Cramer. + + Copyright 2002 - 2015 by + "Ren Rebe" <rene@exactcode.de> + Copyright 1999, 2000, 2001 by "René Rebe" <rene@exactcode.de> "Meino Christian Cramer" <mccramer@s.netic.de> Copyright 2002 by - "René Rebe" <rene@exactcode.de> "Jose Paulo Moitinho de Almeida" <moitinho@civil.ist.utl.pt> - Copyright 2003, 2004, 2005, 2006, 2007 by - "René Rebe" <rene@exactcode.de> - Copyright 2010, 2011 by "Mike Kelly" <mike@piratehaven.org> @@ -137,7 +134,7 @@ #include <math.h> #define BACKEND_NAME avision -#define BACKEND_BUILD 296 /* avision backend BUILD version */ +#define BACKEND_BUILD 297 /* avision backend BUILD version */ #include "../include/sane/sane.h" #include "../include/sane/sanei.h" @@ -167,444 +164,451 @@ static Avision_HWEntry Avision_Device_List [] = { "AVISION", "AV100CS", 0, 0, "Avision", "AV100CS", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV100IIICS", 0, 0, "Avision", "AV100IIICS", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV100S", 0, 0, "Avision", "AV100S", - 0,0}, + 0}, /* status="untested" */ { NULL, NULL, 0x0638, 0x0A27, "Avision", "AV120", - AV_INT_STATUS,0}, + AV_INT_STATUS}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A3C, "Avision", "AV121", - AV_INT_BUTTON | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA,0}, + AV_INT_BUTTON | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA}, /* comment="sheetfed scanner" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0A33, "Avision", "AV122", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET,0}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, /* comment="sheetfed duplex scanner" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0A93, "Avision", "AV122 C2", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_NOT_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET,0}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_NOT_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, /* comment="sheetfed duplex scanner" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0A24, "Avision", "AV210", - AV_INT_BUTTON | AV_ACCEL_TABLE,0}, + AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A25, "Avision", "AV210", - AV_INT_BUTTON | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN,0}, + AV_INT_BUTTON | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A3A, "Avision", "AV210C2", - AV_INT_BUTTON | AV_GRAY_MODES,0}, + AV_INT_BUTTON | AV_GRAY_MODES}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2F, "Avision", "AV210C2-G", - AV_INT_BUTTON | AV_GRAY_MODES,0}, + AV_INT_BUTTON | AV_GRAY_MODES}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x1A35, "Avision", "AV210D2+", - AV_INT_BUTTON, AV_USE_GRAY_FILTER}, + AV_INT_BUTTON | AV_USE_GRAY_FILTER}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A23, "Avision", "AV220", - AV_INT_BUTTON | AV_GRAY_MODES,0}, + AV_INT_BUTTON | AV_GRAY_MODES}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2A, "Avision", "AV220C2", - AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, + AV_INT_BUTTON | AV_CANCEL_BUTTON}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2B, "Avision", "AV220D2", - AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, + AV_INT_BUTTON | AV_CANCEL_BUTTON}, + /* comment="duplex! sheetfed scanner" */ + /* status="complete" */ + + { NULL, NULL, + 0x0638, 0x1A31, + "Avision", "AV220D2+", + AV_INT_BUTTON | AV_CANCEL_BUTTON | AV_USE_GRAY_FILTER}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2C, "Avision", "AV220+", - AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, + AV_INT_BUTTON | AV_CANCEL_BUTTON}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2D, "Avision", "AV220C2-G", - AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, + AV_INT_BUTTON | AV_CANCEL_BUTTON}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A2E, "Avision", "AV220C2-B", - AV_INT_BUTTON | AV_CANCEL_BUTTON,0}, + AV_INT_BUTTON | AV_CANCEL_BUTTON}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A94, "Avision", "AV220-G", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED, AV_FIRMWARE}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_FIRMWARE}, /* comment="duplex! sheetfed scanner" */ /* status="complete" */ { "AVISION", "AV240SC", 0, 0, "Avision", "AV240SC", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV260CS", 0, 0, "Avision", "AV260CS", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV360CS", 0, 0, "Avision", "AV360CS", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV363CS", 0, 0, "Avision", "AV363CS", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV420CS", 0, 0, "Avision", "AV420CS", - 0,0}, + 0}, /* status="untested" */ { "AVISION", "AV6120", 0, 0, "Avision", "AV6120", - 0,0}, + 0}, /* status="untested" */ { NULL, "AV610", 0x0638, 0x0a18, "Avision", "AV610", - AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | AV_INT_BUTTON, 0}, + AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x0638, 0x0a18, "Avision", "AV600U Plus", /* If this unit requires the AV_INT_STATUS flag, then we'll need to alter the code to deal with two different devices with the same USB id (AV610 above) */ - AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | /* AV_INT_STATUS | */ AV_INT_BUTTON,0}, + AV_GRAY_CALIB_BLUE | AV_ACCEL_TABLE | AV_NO_64BYTE_ALIGN | /* AV_INT_STATUS | */ AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x0638, 0x0a5e, "Avision", "AV610C2", - AV_NO_BACKGROUND | AV_INT_BUTTON,0}, /* cancel button -> sense abort! */ + AV_NO_BACKGROUND | AV_INT_BUTTON}, /* cancel button -> sense abort! */ /* status="good" */ { NULL, NULL, 0x0638, 0x0a41, "Avision", "AM3000 Series", - 0,0}, + 0}, /* comment="MFD" */ /* status="basic" */ { NULL, NULL, 0x0638, 0x0a16, "Avision", "DS610CU Scancopier", - AV_INT_STATUS,0}, + AV_INT_STATUS}, /* comment="1 pass, 600 dpi, A4" */ /* status="good" */ { "AVISION", "AV620CS", 0, 0, "Avision", "AV620CS", - 0,0}, + 0}, /* comment="1 pass, 600 dpi" */ /* status="complete" */ { "AVISION", "AV620CS Plus", 0, 0, "Avision", "AV620CS Plus", - 0,0}, + 0}, /* comment="1 pass, 1200 dpi" */ /* status="complete" */ { "AVISION", "AV630CS", 0, 0, "Avision", "AV630CS", - 0,0}, + 0}, /* comment="1 pass, 1200 dpi" */ /* status="complete" */ { "AVISION", "AV630CSL", 0, 0, "Avision", "AV630CSL", - 0,0}, + 0}, /* comment="1 pass, 1200 dpi" */ /* status="untested" */ { "AVISION", "AV6240", 0, 0, "Avision", "AV6240", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A13, "Avision", "AV600U", - AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_SOFT_SCALE | AV_INT_STATUS | AV_NO_BUTTON,0}, + AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_SOFT_SCALE | AV_INT_STATUS | AV_NO_BUTTON}, /* comment="1 pass, 600 dpi" */ /* status="good" */ { "AVISION", "AV660S", 0, 0, "Avision", "AV660S", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV680S", 0, 0, "Avision", "AV680S", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV690U", 0, 0, "Avision", "AV690U", - 0,0}, + 0}, /* comment="1 pass, 2400 dpi" */ /* status="untested" */ { "AVISION", "AV800S", 0, 0, "Avision", "AV800S", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV810C", 0, 0, "Avision", "AV810C", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV820", 0, 0, "Avision", "AV820", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV820C", 0, 0, "Avision", "AV820C", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV820C Plus", 0, 0, "Avision", "AV820C Plus", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV830C", 0, 0, "Avision", "AV830C", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV830C Plus", 0, 0, "Avision", "AV830C Plus", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV880", 0, 0, "Avision", "AV880", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV880C", 0, 0, "Avision", "AV880C", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="untested" */ { "AVISION", "AV3200C", 0, 0, "Avision", "AV3200C", - AV_NON_INTERLACED_DUPLEX_300 | AV_FASTER_WITH_FILTER,0}, + AV_NON_INTERLACED_DUPLEX_300 | AV_FASTER_WITH_FILTER}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3200SU", 0x0638, 0x0A4E, "Avision", "AV3200SU", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3730SU", 0x0638, 0x0A4F, "Avision", "AV3730SU", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3750SU", 0x0638, 0x0A65, "Avision", "AV3750SU", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3800C", 0, 0, "Avision", "AV3800C", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "AV3850SU", 0x0638, 0x0a66, "Avision", "AV3850SU", - 0,0}, + 0}, /* comment="1 pass, ??? dpi" */ /* status="complete" */ { "AVISION", "FB6000E", 0, 0, "Avision", "FB6000E", - AV_NON_INTERLACED_DUPLEX_300,0}, + AV_NON_INTERLACED_DUPLEX_300}, /* comment="1 pass, 1200 dpi, A3 - duplex! - zero edge!" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0a82, "Avision", "FB6080E", - AV_NON_INTERLACED_DUPLEX_300,0}, + AV_NON_INTERLACED_DUPLEX_300}, /* comment="1 pass, 1200 dpi, A3 - duplex! - zero edge!" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0a84, "Avision", "FB2080E", - 0,0}, + 0}, /* comment="1 pass, 600 dpi, zero-edge" ASIC 7 */ /* status="basic" */ { "AVISION", "AV8000S", 0, 0, "Avision", "AV8000S", - AV_DOES_NOT_KEEP_WINDOW,0}, + AV_DOES_NOT_KEEP_WINDOW}, /* comment="1 pass, 1200 dpi, A3" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0a4d, "Avision", "AV8050U", - AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA,0}, + AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA}, /* comment="1 pass, 1200 dpi, A3 - duplex!" */ /* status="complete" */ { "AVISION", "AV8300", 0x0638, 0x0A40, "Avision", "AV8300", - AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA,0}, + AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA}, /* comment="1 pass, 1200 dpi, A3 - duplex!" */ /* status="complete" */ { "AVISION", "AV8350", 0x0638, 0x0A68, "Avision", "AV8350", - AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA,0}, + AV_NON_INTERLACED_DUPLEX_300 | AV_DOES_NOT_KEEP_GAMMA}, /* comment="1 pass, 1200 dpi, A3 - duplex!" */ /* status="complete" */ { NULL, NULL, 0x0638, 0x0A61, "Avision", "IT8300", - AV_NON_INTERLACED_DUPLEX_300 | AV_ACCEL_TABLE,0}, + AV_NON_INTERLACED_DUPLEX_300 | AV_ACCEL_TABLE}, /* comment="1 pass, 1200 dpi, A3 - duplex!, LCD screen, paper sensors" */ /* status="good" */ { NULL, NULL, 0x0638, 0x0AA1, "Avision", "@V2500", - 0,0}, + 0}, /* comment="" */ /* status="untested" */ { NULL, NULL, 0x0638, 0x0A45, "Avision", "@V5100", - 0,0}, + 0}, /* comment="1 pass, 1200 dpi, A3 - duplex!, LCD screen, paper sensors" */ /* status="good" */ { "AVISION", "AVA3", 0, 0, "Avision", "AVA3", - AV_FORCE_A3,0}, + AV_FORCE_A3}, /* comment="1 pass, 600 dpi, A3" */ /* status="basic" */ @@ -613,21 +617,21 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "ScanJet 5300C", 0x03f0, 0x0701, "Hewlett-Packard", "ScanJet 5300C", - AV_INT_STATUS,0}, + AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - some FW revisions have x-axis image scaling problems over 1200 dpi" */ /* status="complete" */ { "HP", "ScanJet 5370C", 0x03f0, 0x0701, "Hewlett-Packard", "ScanJet 5370C", - AV_MULTI_CALIB_CMD | AV_INT_STATUS, AV_FIRMWARE }, + AV_MULTI_CALIB_CMD | AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - some FW revisions have x-axis image scaling problems over 1200 dpi" */ /* status="good" */ { "hp", "scanjet 7400c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7400c", - AV_LIGHT_CHECK_BOGUS | AV_NO_64BYTE_ALIGN | AV_INT_STATUS,0}, + AV_LIGHT_CHECK_BOGUS | AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - dual USB/SCSI interface" */ /* status="good" */ @@ -635,14 +639,14 @@ static Avision_HWEntry Avision_Device_List [] = { "hp", "scanjet 7450c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7450c", - AV_NO_64BYTE_ALIGN | AV_INT_STATUS,0}, + AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, /* comment="1 pass, 2400 dpi - dual USB/SCSI interface" */ /* status="good" */ { "hp", "scanjet 7490c", 0x03f0, 0x0801, "Hewlett-Packard", "ScanJet 7490c", - AV_NO_64BYTE_ALIGN | AV_INT_STATUS,0}, + AV_NO_64BYTE_ALIGN | AV_INT_STATUS}, /* comment="1 pass, 1200 dpi - dual USB/SCSI interface" */ /* status="good" */ @@ -650,7 +654,7 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "C9930A", 0x03f0, 0x0b01, "Hewlett-Packard", "ScanJet 8200", - 0, AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE }, + AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ @@ -658,7 +662,7 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "C9930A", 0x03f0, 0x0b01, "Hewlett-Packard", "ScanJet 8250", - 0, AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE }, + AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ #endif @@ -666,7 +670,7 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "C9930A", 0x03f0, 0x3905, "Hewlett-Packard", "ScanJet 8270", - 0, AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE }, + AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ @@ -674,7 +678,7 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "C9930A", 0x03f0, 0x0b01, "Hewlett-Packard", "ScanJet 8290", - 0, AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE }, + AV_ADF_FLIPPING_DUPLEX | AV_FIRMWARE}, /* comment="1 pass, 4800 (?) dpi - USB 2.0 and SCSI - only SCSI tested so far" */ /* status="good" */ @@ -682,7 +686,7 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "C9930A", 0x03f0, 0x3805, "Hewlett-Packard", "ScanJet 8300", - 0,0}, + 0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ @@ -690,14 +694,14 @@ static Avision_HWEntry Avision_Device_List [] = { "HP", "C9930A", 0x03f0, 0x3805, "Hewlett-Packard", "ScanJet 8350", - 0,0}, + 0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ { "HP", "C9930A", 0x03f0, 0x3805, "Hewlett-Packard", "ScanJet 8390", - 0,0}, + 0}, /* comment="1 pass, 4800 (?) dpi - USB 2.0" */ /* status="good" */ @@ -705,79 +709,79 @@ static Avision_HWEntry Avision_Device_List [] = { "Minolta", "#2882", 0, 0, "Minolta", "Dimage Scan Dual I", - AV_FORCE_FILM | AV_NO_START_SCAN,0}, /* not AV_FILMSCANNER (no frame control) */ + AV_FORCE_FILM | AV_NO_START_SCAN}, /* not AV_FILMSCANNER (no frame control) */ /* status="basic" */ { "Minolta", "#2887", 0, 0, "Minolta", "Scan Multi Pro", - AV_FORCE_FILM | AV_NO_START_SCAN,0}, /* AV_FILMSCANNER (frame control)? */ + AV_FORCE_FILM | AV_NO_START_SCAN}, /* AV_FILMSCANNER (frame control)? */ /* status="untested" */ { "MINOLTA", "FS-V1", 0x0638, 0x026a, "Minolta", "Dimage Scan Dual II", - AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_12_BIT_MODE,0}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_12_BIT_MODE}, /* comment="1 pass, film-scanner" */ /* status="good" */ { "MINOLTA", "Elite II", 0x0686, 0x4004, "Minolta", "Elite II", - AV_FILMSCANNER | AV_ONE_CALIB_CMD,0}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD}, /* comment="1 pass, film-scanner" */ /* status="untested" */ { "MINOLTA", "FS-V3", 0x0686, 0x400d, "Minolta", "Dimage Scan Dual III", - AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_ACCEL_TABLE ,0}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD | AV_ACCEL_TABLE}, /* comment="1 pass, film-scanner" */ /* status="good" */ { "MINOLTA", "FS-V4", 0x0686, 0x400e, "Minolta", "Dimage Scan Elite 5400", - AV_FILMSCANNER | AV_ONE_CALIB_CMD | /*AV_ACCEL_TABLE |*/ AV_NO_START_SCAN,0}, + AV_FILMSCANNER | AV_ONE_CALIB_CMD | /*AV_ACCEL_TABLE |*/ AV_NO_START_SCAN}, /* comment="1 pass, film-scanner" */ /* status="good" */ { "QMS", "SC-110", 0x0638, 0x0a15, "Minolta-QMS", "SC-110", - 0,0}, + 0}, /* comment="" */ /* status="untested" */ { "QMS", "SC-215", 0x0638, 0x0a16, "Minolta-QMS", "SC-215", - 0,0}, + 0}, /* comment="" */ /* status="good" */ { "MITSBISH", "MCA-ADFC", 0, 0, "Mitsubishi", "MCA-ADFC", - 0,0}, + 0}, /* status="untested" */ { "MITSBISH", "MCA-S1200C", 0, 0, "Mitsubishi", "S1200C", - 0,0}, + 0}, /* status="untested" */ { "MITSBISH", "MCA-S600C", 0, 0, "Mitsubishi", "S600C", - 0,0}, + 0}, /* status="untested" */ { "MITSBISH", "SS600", 0, 0, "Mitsubishi", "SS600", - 0,0}, + 0}, /* status="good" */ /* The next are all untested ... */ @@ -785,209 +789,209 @@ static Avision_HWEntry Avision_Device_List [] = { "FCPA", "ScanPartner", 0, 0, "Fujitsu", "ScanPartner", - AV_FUJITSU,0}, + AV_FUJITSU}, /* status="untested" */ { "FCPA", "ScanPartner 10", 0, 0, "Fujitsu", "ScanPartner 10", - AV_FUJITSU,0}, + AV_FUJITSU}, /* status="untested" */ { "FCPA", "ScanPartner 10C", 0, 0, "Fujitsu", "ScanPartner 10C", - AV_FUJITSU,0}, + AV_FUJITSU}, /* status="untested" */ { "FCPA", "ScanPartner 15C", 0, 0, "Fujitsu", "ScanPartner 15C", - AV_FUJITSU,0}, + AV_FUJITSU}, /* status="untested" */ { "FCPA", "ScanPartner 300C", 0, 0, "Fujitsu", "ScanPartner 300C", - 0,0}, + 0}, /* status="untested" */ { "FCPA", "ScanPartner 600C", 0, 0, "Fujitsu", "ScanPartner 600C", - 0,0}, + 0}, /* status="untested" */ { "FCPA", "ScanPartner 620C", 0, 0, "Fujitsu", "ScanPartner 620C", - AV_LIGHT_CHECK_BOGUS,0}, + AV_LIGHT_CHECK_BOGUS}, /* status="good" */ { "FCPA", "ScanPartner Jr", 0, 0, "Fujitsu", "ScanPartner Jr", - 0,0}, + 0}, /* status="untested" */ { "FCPA", "ScanStation", 0, 0, "Fujitsu", "ScanStation", - 0,0}, + 0}, /* status="untested" */ { NULL, NULL, 0x04c5, 0x1029, "Fujitsu", "fi-4010CU", - 0,0}, + 0}, /* status="untested" */ { NULL, NULL, 0x04c5, 0x10ef, "Fujitsu", "fi-5015C", - 0,0}, + 0}, /* status="good" */ { NULL, NULL, 0x040a, 0x6001, "Kodak", "i30", - AV_INT_BUTTON | AV_GRAY_MODES,0}, + AV_INT_BUTTON | AV_GRAY_MODES}, /* status="untested" */ { NULL, NULL, 0x040a, 0x6002, "Kodak", "i40", - AV_INT_BUTTON | AV_GRAY_MODES,0}, + AV_INT_BUTTON | AV_GRAY_MODES}, /* status="basic" */ { NULL, NULL, 0x040a, 0x6003, "Kodak", "i50", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { NULL, NULL, 0x040a, 0x6003, "Kodak", "i55", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #endif { NULL, NULL, 0x040a, 0x6004, "Kodak", "i60", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { NULL, NULL, 0x040a, 0x6004, "Kodak", "i65", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #endif { NULL, NULL, 0x040a, 0x6005, "Kodak", "i80", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { "iVina", "1200U", 0x0638, 0x0268, "iVina", "1200U", - 0,0}, + 0}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0424, "Visioneer", "Strobe XP 450", - AV_INT_BUTTON | AV_ACCEL_TABLE,0}, + AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0491, "Visioneer", "Strobe XP 450-G", - AV_INT_BUTTON | AV_ACCEL_TABLE,0}, + AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0479, "Visioneer", "Strobe XP 470", - AV_INT_BUTTON | AV_ACCEL_TABLE,0}, + AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x048F, "Visioneer", "Strobe XP 470-G", - AV_INT_BUTTON | AV_ACCEL_TABLE,0}, + AV_INT_BUTTON | AV_ACCEL_TABLE}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0420, "Visioneer", "9320", - 0,0}, + 0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0421, "Visioneer", "9450", - AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_NO_BUTTON, AV_NO_TUNE_SCAN_LENGTH}, + AV_MULTI_CALIB_CMD | AV_ADF_BGR_ORDER_INVERT | AV_NO_BUTTON | AV_NO_TUNE_SCAN_LENGTH}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x047A, "Visioneer", "9450-G", - 0,0}, + 0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0422, "Visioneer", "9550", - 0,0}, + 0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0390, "Visioneer", "9650", - 0,0}, + 0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x047B, "Visioneer", "9650-G", - 0,0}, + 0}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0423, "Visioneer", "9750", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0493, "Visioneer", "9750-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0497, "Visioneer", "Patriot 430", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET,0}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET}, /* comment="sheetfed scanner" */ /* status="complete" */ @@ -995,7 +999,7 @@ static Avision_HWEntry Avision_Device_List [] = { NULL, NULL, 0x04a7, 0x048F, "Visioneer", "Patriot 470", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* comment="sheetfed scanner" */ /* status="complete" */ #endif @@ -1003,150 +1007,150 @@ static Avision_HWEntry Avision_Device_List [] = { NULL, NULL, 0x04a7, 0x0498, "Visioneer", "Patriot 680", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x0499, "Visioneer", "Patriot 780", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* comment="sheetfed scanner" */ /* status="complete" */ { NULL, NULL, 0x04a7, 0x049C, "Xerox", "DocuMate150", - AV_INT_BUTTON | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_BACKGROUND_QUIRK,0}, + AV_INT_BUTTON | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_BACKGROUND_QUIRK}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0477, "Xerox", "DocuMate152", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK,0}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK}, /* status="good" */ { NULL, NULL, 0x04a7, 0x049D, "Xerox", "DocuMate162", - AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK,0}, + AV_INT_BUTTON | AV_2ND_LINE_INTERLACED | AV_NO_REAR | AV_SOFT_SCALE | AV_DOES_KEEP_WINDOW | AV_DOES_KEEP_GAMMA | AV_REAR_OFFSET | AV_BACKGROUND_QUIRK}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0448, "Xerox", "DocuMate250", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0490, "Xerox", "DocuMate250-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0449, "Xerox", "DocuMate252", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x048C, "Xerox", "DocuMate252-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0476, "Xerox", "DocuMate232", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x044c, "Xerox", "DocuMate262", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x048D, "Xerox", "DocuMate262-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x04a7, "Xerox", "DocuMate262i", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="good" */ { NULL, NULL, 0x04a7, 0x0475, "Xerox", "DocuMate272", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x048E, "Xerox", "DocuMate272-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0446, "Xerox", "DocuMate510", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0495, "Xerox", "DocuMate512", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x047c, "Xerox", "DocuMate510-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0447, "Xerox", "DocuMate520", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x0492, "Xerox", "DocuMate520-G", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { NULL, NULL, 0x04a7, 0x0498, "Xerox", "DocuMate632", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #endif { NULL, NULL, 0x04a7, 0x0478, "Xerox", "DocuMate752", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ { NULL, NULL, 0x04a7, 0x049A, "Xerox", "DocuMate752", - AV_INT_BUTTON,0}, + AV_INT_BUTTON}, /* status="untested" */ #ifdef FAKE_ENTRIES_FOR_DESC_GENERATION { NULL, NULL, 0x0638, 0x0a16, "OKI", "S700 Scancopier", - 0,0}, + 0}, /* comment="1 pass, 600 dpi, A4" */ /* status="good" */ #endif @@ -1154,14 +1158,14 @@ static Avision_HWEntry Avision_Device_List [] = { "B+H", "2000F", 0, 0, "Bell+Howell", "2000F", - 0,0}, + 0}, /* comment="1 pass, ??? dpi, A4" */ /* status="basic" */ { NULL, NULL, 0x0482, 0x0335, "Kyocera", "FS-1016MFP", - 0,0}, + 0}, /* comment="1 pass, ??? dpi, A4" */ /* status="untested" */ @@ -1203,7 +1207,7 @@ Lexmark X4500 MFP { NULL, NULL, 0, 0, NULL, NULL, - 0,0} + 0} }; #if 0 @@ -3208,7 +3212,7 @@ get_accessories_info (Avision_Scanner* s) dev->inquiry_adf |= result [0]; - if (dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX) + if (dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) { if (result[0] == 1) { @@ -3765,14 +3769,14 @@ attach (SANE_String_Const devname, Avision_ConnectionType con_type, if (!found) { DBG (0, "attach: \"%s\" - \"%s\" not yet in whitelist!\n", mfg, model); DBG (0, "attach: You might want to report this output.\n"); - DBG (0, "attach: To: mike@piratehaven.org (the Avision backend maintainer)\n"); + DBG (0, "attach: To: rene@exactcode.de (the Avision backend author)\n"); status = SANE_STATUS_INVAL; goto close_scanner_and_return; } /* second: maybe ask for the firmware status and flash ram info */ - if (Avision_Device_List [model_num].feature_type2 & AV_FIRMWARE) + if (Avision_Device_List [model_num].feature_type & AV_FIRMWARE) { DBG (3, "attach: reading firmware status\n"); status = get_firmware_status (&av_con); @@ -4211,7 +4215,7 @@ get_double ( &(result[48] ) )); } dev->inquiry_tune_scan_length = BIT(result[94],2); - if (Avision_Device_List [model_num].feature_type2 & AV_NO_TUNE_SCAN_LENGTH) + if (Avision_Device_List [model_num].feature_type & AV_NO_TUNE_SCAN_LENGTH) dev->inquiry_tune_scan_length = 0; dev->inquiry_background_raster = BIT(result[95],2); @@ -4278,7 +4282,9 @@ get_double ( &(result[48] ) )); else dev->scsi_buffer_size = sanei_scsi_max_request_size; - if (dev->inquiry_asic_type >= AV_ASIC_C5) + if (dev->inquiry_asic_type > AV_ASIC_C7 && dev->inquiry_asic_type < AV_ASIC_OA980) + dev->read_stripe_size = 16; + else if (dev->inquiry_asic_type >= AV_ASIC_C5) dev->read_stripe_size = 32; else /* tested on AV3200 with it's max of 300dpi @color */ dev->read_stripe_size = 8; /* maybe made dynamic on scan res ... */ @@ -5142,7 +5148,7 @@ send_gamma (Avision_Scanner* s) switch (dev->inquiry_asic_type) { case AV_ASIC_Cx: - case AV_ASIC_C1: /* from avision code */ + case AV_ASIC_C1: gamma_table_raw_size = 4096; gamma_table_size = 2048; break; @@ -5150,10 +5156,6 @@ send_gamma (Avision_Scanner* s) gamma_table_raw_size = 256; gamma_table_size = 256; break; - case AV_ASIC_C6: /* SPEC claims: 256 ... ? */ - case AV_ASIC_C7: - gamma_table_raw_size = 512; - gamma_table_size = 512; break; case AV_ASIC_OA980: gamma_table_raw_size = 4096; @@ -5164,7 +5166,8 @@ send_gamma (Avision_Scanner* s) gamma_table_size = 256; break; default: - gamma_table_raw_size = gamma_table_size = 4096; + gamma_table_raw_size = 512; /* SPEC claims: 256 ... ? */ + gamma_table_size = 512; } gamma_values = gamma_table_size / 256; @@ -5678,8 +5681,9 @@ set_window (Avision_Scanner* s) } } - if (s->val[OPT_PAPERLEN].w) + if (s->val[OPT_PAPERLEN].w != SANE_FALSE) { set_double (cmd.window.descriptor.paper_length, (int)((double)30.0*1200)); + } if ( !(dev->hw->feature_type & AV_FUJITSU) ) { @@ -5780,7 +5784,7 @@ set_window (Avision_Scanner* s) else { if (dev->hw->feature_type & AV_FASTER_WITH_FILTER) cmd.window.avision.bitset1 |= AVISION_FILTER_GREEN; - else if (dev->hw->feature_type2 & AV_USE_GRAY_FILTER) + else if (dev->hw->feature_type & AV_USE_GRAY_FILTER) cmd.window.avision.bitset1 |= AVISION_FILTER_GRAY; else cmd.window.avision.bitset1 |= AVISION_FILTER_NONE; @@ -6182,7 +6186,7 @@ do_eof (Avision_Scanner *s) /* we can now mark the rear data as valid */ if (s->avdimen.interlaced_duplex || - (s->hw->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX)) { + (s->hw->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX)) { DBG (3, "do_eof: toggling duplex rear data valid\n"); s->duplex_rear_valid = !s->duplex_rear_valid; DBG (3, "do_eof: duplex rear data valid: %x\n", @@ -6262,11 +6266,6 @@ init_options (Avision_Scanner* s) /* Init the SANE option from the scanner inquiry data */ - dev->x_range.max = SANE_FIX ( (int)dev->inquiry_x_ranges[s->source_mode_dim]); - dev->x_range.quant = 0; - dev->y_range.max = SANE_FIX ( (int)dev->inquiry_y_ranges[s->source_mode_dim]); - dev->y_range.quant = 0; - switch (dev->inquiry_asic_type) { case AV_ASIC_C2: dev->dpi_range.min = 100; @@ -6331,6 +6330,11 @@ init_options (Avision_Scanner* s) s->source_mode = match_source_mode (dev, s->val[OPT_SOURCE].s); s->source_mode_dim = match_source_mode_dim (s->source_mode); + dev->x_range.max = SANE_FIX ( (int)dev->inquiry_x_ranges[s->source_mode_dim]); + dev->x_range.quant = 0; + dev->y_range.max = SANE_FIX ( (int)dev->inquiry_y_ranges[s->source_mode_dim]); + dev->y_range.quant = 0; + /* resolution */ s->opt[OPT_RESOLUTION].name = SANE_NAME_SCAN_RESOLUTION; s->opt[OPT_RESOLUTION].title = SANE_TITLE_SCAN_RESOLUTION; @@ -6667,7 +6671,7 @@ init_options (Avision_Scanner* s) /* ADF page flipping */ s->opt[OPT_ADF_FLIP].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT | SANE_CAP_AUTOMATIC | SANE_CAP_ADVANCED; - if (!(s->hw->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX)) + if (!(s->hw->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX)) s->opt[OPT_ADF_FLIP].cap |= SANE_CAP_INACTIVE; s->opt[OPT_ADF_FLIP].name = "flip-page"; s->opt[OPT_ADF_FLIP].title = "Flip document after duplex scanning"; @@ -6782,7 +6786,7 @@ reader_process (void *data) return SANE_STATUS_NO_MEM; /* start scan ? */ - if ((deinterlace == NONE && !((dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && s->duplex_rear_valid)) || + if ((deinterlace == NONE && !((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && s->duplex_rear_valid)) || (deinterlace != NONE && !s->duplex_rear_valid)) { /* reserve unit - in the past we did this in open - but the @@ -6820,7 +6824,7 @@ reader_process (void *data) /* setup file i/o for deinterlacing scans or if we are the back page with a flipping duplexer */ if (deinterlace != NONE || - (dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2))) + (dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2))) { if (!s->duplex_rear_valid) { /* create new file for writing */ DBG (3, "reader_process: opening duplex rear file for writing.\n"); @@ -6954,11 +6958,15 @@ reader_process (void *data) /* only EOF on the second stripe, as otherwise the rear page is shorter */ if (status == SANE_STATUS_EOF && deinterlace == STRIPE) { - static int already_eof = 0; - if (!already_eof) { - DBG (5, "reader_process: first EOF on stripe interlace: hiding.\n"); - status = SANE_STATUS_GOOD; - already_eof = 1; + if (dev->inquiry_asic_type > AV_ASIC_C7 && dev->inquiry_asic_type < AV_ASIC_OA980) { + this_read = 0; + } else { + static int already_eof = 0; + if (!already_eof) { + DBG (5, "reader_process: first EOF on stripe interlace: hiding.\n"); + status = SANE_STATUS_GOOD; + already_eof = 1; + } } } @@ -7047,7 +7055,7 @@ reader_process (void *data) DBG (9, "reader_process: after deinterlacing: useful_bytes: %d, stripe_fill: %d\n", useful_bytes, stripe_fill); } - if (dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && !s->duplex_rear_valid) { + if (dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && !s->duplex_rear_valid) { /* Here we flip the image by writing the lines from the end of the file to the beginning. */ unsigned int absline = (processed_bytes - stripe_fill) / s->avdimen.hw_bytes_per_line; unsigned int abslines = absline + useful_bytes / s->avdimen.hw_bytes_per_line; @@ -7454,7 +7462,7 @@ reader_process (void *data) /* Eject film holder and/or release_unit - but only for non-duplex-rear / non-virtual scans. */ if ((deinterlace != NONE && s->duplex_rear_valid) || - ((dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && s->duplex_rear_valid)) + ((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && !(s->page % 2) && s->duplex_rear_valid)) { DBG (1, "reader_process: virtual duplex scan - no device cleanup!\n"); } @@ -7477,7 +7485,7 @@ reader_process (void *data) } } - if ((dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && s->page % 2) { + if ((dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) && s->source_mode == AV_ADF_DUPLEX && s->page % 2) { /* front page of flipping duplex */ if (exit_status == SANE_STATUS_EOF) { if (s->val[OPT_ADF_FLIP].w) { @@ -7891,7 +7899,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle *handle) init_options (s); if (dev->inquiry_duplex_interlaced || dev->scanner_type == AV_FILM || - dev->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX) { + dev->hw->feature_type & AV_ADF_FLIPPING_DUPLEX) { /* Might need at least *DOS (Windows flavour and OS/2) portability fix However, I was told Cygwin (et al.) takes care of it. */ strncpy(s->duplex_rear_fname, "/tmp/avision-rear-XXXXXX", PATH_MAX); @@ -8188,7 +8196,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, dev->y_range.max = SANE_FIX ( dev->inquiry_y_ranges[s->source_mode_dim]); - if (s->hw->hw->feature_type2 & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX) { + if (s->hw->hw->feature_type & AV_ADF_FLIPPING_DUPLEX && s->source_mode == AV_ADF_DUPLEX) { s->opt[OPT_ADF_FLIP].cap &= ~SANE_CAP_INACTIVE; } else { s->opt[OPT_ADF_FLIP].cap |= SANE_CAP_INACTIVE; @@ -8284,16 +8292,9 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters* params) } if (params) { + *params = s->params; /* add background raster lines */ - s->params.lines += s->val[OPT_BACKGROUND].w; - - /* copy structure members */ - params->format = s->params.format; - params->last_frame = s->params.last_frame; - params->bytes_per_line = s->params.bytes_per_line; - params->pixels_per_line = s->params.pixels_per_line; - params->lines = s->params.lines; - params->depth = s->params.depth; + params->lines += s->val[OPT_BACKGROUND].w; } return SANE_STATUS_GOOD; |