* backend/canon_dr.[ch], backend/canon_dr-cmd.h: backend v15 thru v18

- add byte-oriented duplex interlace code
- add RRGGBB color interlace code
- add basic support for DR-2580C, DR-2050C, DR-2080C, DR-2510C
- add more unknown setwindow bits
- add support for 16 byte status packets
- clean do_usb_cmd error handling (call reset more often)
- set status packet size from config file
- rewrite config file parsing to reset options after each scanner
- add config options for vendor, model, version
- dont call inquiry if those 3 options are set
- remove default config file from code
- add initial gray deinterlacing code for DR-2510C
- rename do_usb_reset to do_usb_clear
* doc/descriptions/canon_dr.desc: backend v18, update model status
* backend/canon_dr.conf.in: added better comments and new options
merge-requests/1/head
m. allan noah 2009-03-22 02:56:45 +00:00
rodzic 110b81d946
commit cd0b09ddf4
6 zmienionych plików z 612 dodań i 251 usunięć

Wyświetl plik

@ -1,3 +1,21 @@
2009-03-21 m. allan noah <kitno455 a t gmail d o t com>
* backend/canon_dr.[ch], backend/canon_dr-cmd.h: backend v15 thru v18
- add byte-oriented duplex interlace code
- add RRGGBB color interlace code
- add basic support for DR-2580C, DR-2050C, DR-2080C, DR-2510C
- add more unknown setwindow bits
- add support for 16 byte status packets
- clean do_usb_cmd error handling (call reset more often)
- set status packet size from config file
- rewrite config file parsing to reset options after each scanner
- add config options for vendor, model, version
- dont call inquiry if those 3 options are set
- remove default config file from code
- add initial gray deinterlacing code for DR-2510C
- rename do_usb_reset to do_usb_clear
* doc/descriptions/canon_dr.desc: backend v18, update model status
* backend/canon_dr.conf.in: added better comments and new options
2009-03-21 Pierre Willenbrock <pierre@pirsoft.dnsalias.org>
* backend/genesys_devices.c: Enable Motor again for combined
dark/bright calibration, fix calculation of pixel number used in

Wyświetl plik

@ -11,7 +11,7 @@
#define USB_HEADER_LEN 12
#define USB_COMMAND_LEN 12
#define USB_STATUS_LEN 4
#define USB_STATUS_LEN_MAX 32
#define USB_STATUS_OFFSET 0
#define USB_COMMAND_TIME 30000
#define USB_DATA_TIME 30000
@ -125,9 +125,9 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define IN_periph_devtype_unknown 0x1f
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0)
#define IN_recognized 0x02
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08)
#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010)
#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04)
/* the VPD response */
#define get_IN_page_length(in) in[0x04]
@ -338,6 +338,16 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define CANCEL_code 0xd8
#define CANCEL_len 6
/* ==================================================================== */
/* Coarse Calibration */
#define COR_CAL_code 0xe1
#define COR_CAL_len 10
#define set_CC_xferlen(sb, len) putnbyte(sb + 0x06, len, 3)
/* the payload */
#define CC_pay_len 0x20
/* ==================================================================== */
/* window descriptor macros for SET_WINDOW and GET_WINDOW */
@ -358,7 +368,7 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define set_WD_Xres(sb, val) putnbyte(sb + 0x02, val, 2)
#define get_WD_Xres(sb) getnbyte(sb + 0x02, 2)
/* 0x04,0x05 - X resolution in dpi */
/* 0x04,0x05 - Y resolution in dpi */
#define set_WD_Yres(sb, val) putnbyte(sb + 0x04, val, 2)
#define get_WD_Yres(sb) getnbyte(sb + 0x04, 2)
@ -417,8 +427,8 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
/* 0x1d - Reverse image, reserved area, padding type */
#define set_WD_rif(sb, val) setbitfield(sb + 0x1d, 1, 7, val)
#define get_WD_rif(sb) getbitfield(sb + 0x1d, 1, 7)
#define set_WD_reserved(sb, val) setbitfield(sb + 0x1d, 1, 5, val)
#define get_WD_reserved(sb) getbitfield(sb + 0x1d, 1, 5)
#define set_WD_reserved(sb, val) sb[0x1d] = val
#define get_WD_reserved(sb) sb[0x1d]
/* 0x1e,0x1f - Bit ordering */
#define set_WD_bitorder(sb, val) putnbyte(sb + 0x1e, val, 2)
@ -444,6 +454,9 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
/* 0x28-0x2c - vendor unique */
/* FIXME: more params here? */
#define set_WD_reserved2(sb, val) sb[0x2a] = val
#define get_WD_reserved2(sb) sb[0x2a]
/* ==================================================================== */

Plik diff jest za duży Load Diff

Wyświetl plik

@ -1,11 +1,29 @@
# NOTE: any 'option' lines only apply to
# scanners discovered later in this file
#######################################################################
# NOTE: 'option' lines only apply to the devices found by
# the NEXT 'usb' or 'scsi' line. You may repeat the option line if
# required for multiple scanners of different models/connections.
# to set data buffer size, in bytes
# the value ranges from 4096 - infinity
# but you may have scanning problems with
# a value larger than 65536 (the default)
option buffer-size 65536
#######################################################################
# Some machines are incapable of providing basic inquiry info, and will
# lock up if asked for it. The driver will not ask for this info if all
# three of these options are provided. They should NOT be used unless
# you know for sure that your machine requires it.
# NOTE: the vendor and model must be correct. The version need not.
#option vendor-name CANON
#option model-name DR-2050C
#option version-name XXXX
#######################################################################
# Set data buffer size, in bytes. The value ranges from 4096 - infinity
# but you may have scanning problems with a value larger than default (64k)
#option buffer-size 65536
#######################################################################
# Most scanners use a 4 byte status, but some use 16
#option status-length 4
#######################################################################
# SCSI scanners:
# To search for any CANON scsi device, if name starts with 'CR' or 'DR'
scsi CANON CR
@ -14,6 +32,9 @@ scsi CANON DR
# To use a specific scsi device
#scsi /dev/sg1
#######################################################################
# USB scanners:
# For Canon scanners connected via USB on a known device (kernel driver):
#usb /dev/usb/scanner0
@ -22,9 +43,13 @@ scsi CANON DR
# NOTE: if you have to add your device here- please send the id and model
# to the author via email, so it can be included in next version. kitno455 at
# gmail dot com - with Fujitsu in the subject line
# gmail dot com - with canon_dr in the subject line
# DR-2080C
# DR-2080C (uses weird protocol)
option vendor-name CANON
option model-name DR-2080C
option version-name XXXX
option status-length 16
usb 0x04a9 0x1601
# CR-180
@ -48,7 +73,11 @@ usb 0x04a9 0x1608
# DR-3080CII
usb 0x04a9 0x1609
# DR-2050C/SP
# DR-2050C/SP (uses weird protocol)
option vendor-name CANON
option model-name DR-2050C
option version-name XXXX
option status-length 16
usb 0x04a9 0x160a
# DR-7580

Wyświetl plik

@ -112,6 +112,7 @@ struct scanner
int max_x_basic;
int max_y_basic;
/*FIXME: 4 more unknown values here*/
int can_grayscale;
int can_halftone;
int can_monochrome;
@ -143,8 +144,15 @@ struct scanner
int has_comp_JPEG;
int has_buffer;
int invert_tly; /* weird bug in some smaller scanners */
int unknown_byte; /* weird byte, required, meaning unknown */
int unknown_byte2; /* weird byte, required, meaning unknown */
size_t status_length; /* usually 4, sometimes 16 */
int color_interlace; /* different models interlace colors differently */
int duplex_interlace; /* different models interlace sides differently */
int head_interlace; /* different models interlace heads differently */
int jpeg_interlace; /* different models interlace jpeg sides differently */
int reverse_by_mode[6]; /* mode specific */
@ -264,7 +272,6 @@ struct scanner
int bytes_tx[2];
unsigned char * buffers[2];
int fds[2];
/* --------------------------------------------------------------------- */
/* values used by the command and data sending functions (scsi/usb) */
@ -321,16 +328,22 @@ enum {
#define COLOR_WHITE 1
#define COLOR_BLACK 2
#define COLOR_INTERLACE_UNK 0
#define COLOR_INTERLACE_RGB 1
#define COLOR_INTERLACE_BGR 2
#define COLOR_INTERLACE_RRGGBB 3
#define HEAD_INTERLACE_NONE 0
#define HEAD_INTERLACE_2510 1
#define DUPLEX_INTERLACE_NONE 0
#define DUPLEX_INTERLACE_ALT 1
#define COLOR_INTERLACE_RGB 0
#define COLOR_INTERLACE_BGR 1
#define COLOR_INTERLACE_RRGGBB 2
#define CROP_RELATIVE 0
#define CROP_ABSOLUTE 1
#define DUPLEX_INTERLACE_NONE 0
#define DUPLEX_INTERLACE_ALT 1
#define DUPLEX_INTERLACE_BYTE 2
#define JPEG_INTERLACE_ALT 0
#define JPEG_INTERLACE_NONE 1
#define CROP_RELATIVE 0
#define CROP_ABSOLUTE 1
/* ------------------------------------------------------------------------- */
@ -428,7 +441,7 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime,
unsigned char * inBuff, size_t * inLen
);
static SANE_Status do_usb_reset(struct scanner *s, int runRS);
static SANE_Status do_usb_clear(struct scanner *s, int runRS);
static SANE_Status wait_scanner (struct scanner *s);
@ -451,14 +464,17 @@ static SANE_Status start_scan (struct scanner *s);
static SANE_Status cancel(struct scanner *s);
static SANE_Status read_from_scanner(struct scanner *s, int side);
static SANE_Status read_from_scanner_duplex(struct scanner *s);
static SANE_Status copy_buffer(struct scanner *s, unsigned char * buf, int len, int side);
static SANE_Status copy_buffer_2510(struct scanner *s, unsigned char * buf, int len, int side);
static SANE_Status read_from_buffer(struct scanner *s, SANE_Byte * buf, SANE_Int max_len, SANE_Int * len, int side);
static SANE_Status setup_buffers (struct scanner *s);
static void hexdump (int level, char *comment, unsigned char *p, int l);
static void default_globals (void);
static size_t maxStringSize (const SANE_String_Const strings[]);

Wyświetl plik

@ -11,7 +11,7 @@
:backend "canon_dr" ; name of backend
:url "http://www.thebility.com/canon/"
:version "13" ; version of backend
:version "18" ; version of backend
:manpage "sane-canon_dr" ; name of manpage (if it exists)
:comment "New backend as of SANE release 1.1.0, testers needed, see manpage"
:devicetype :scanner ; start of a list of devices....
@ -62,8 +62,8 @@
:model "DR-2050C"
:interface "USB"
:usbid "0x04a9" "0x160a"
:status :untested
:comment "Please test!"
:status :basic
:comment ""
:model "DR-2050SP"
:interface "USB"
@ -74,20 +74,20 @@
:model "DR-2080C"
:interface "USB SCSI"
:usbid "0x04a9" "0x1601"
:status :untested
:comment "Please test!"
:status :basic
:comment ""
:model "DR-2510C"
:interface "USB"
:usbid "0x1083" "0x1617"
:status :untested
:comment "Please test!"
:status :basic
:comment "Only simplex gray works, requires user to always scan full-width."
:model "DR-2580C"
:interface "USB SCSI"
:usbid "0x04a9" "0x1608"
:status :untested
:comment "Please test!"
:status :basic
:comment "Gray and color, simplex and duplex working. Poor calibration."
:model "DR-3010C"
:interface "USB"
@ -125,7 +125,7 @@
:interface "USB"
:usbid "0x1083" "0x1614"
:status :good
:comment ""
:comment "Multistream unsupported"
:model "DR4080U"
:interface "USB"