SM3840: Added SM4800, PPC endianness fix, Makefile deps fix

merge-requests/1/head
Earle F. Philhower III 2005-03-16 08:09:19 +00:00
rodzic b2852924f2
commit e1da48acae
7 zmienionych plików z 53 dodań i 7 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
2005-03-16 Earle F. Philhower III <earle@ziplabel.com>
* backend/sm3840.c backend/sm3840_scan.c backend/sm3840.conf
backend/Makefile.in doc/descriptions/sm3840.desc
doc/sane-sm3840.man: Added ScanMaker 4800 USB ID and
documentation, fixed PPC endianness problems, fixed
Makefile dependencies for sm3840 driver
2005-03-13 Henning Meier-Geinitz <henning@meier-geinitz.de> 2005-03-13 Henning Meier-Geinitz <henning@meier-geinitz.de>
* doc/descriptions/unsupported.desc * doc/descriptions/unsupported.desc

Wyświetl plik

@ -400,6 +400,7 @@ libsane-sm3600.la: ../sanei/sanei_constrain_value.lo
libsane-sm3840.la: ../sanei/sanei_config2.lo libsane-sm3840.la: ../sanei/sanei_config2.lo
libsane-sm3840.la: ../sanei/sanei_constrain_value.lo libsane-sm3840.la: ../sanei/sanei_constrain_value.lo
libsane-sm3840.la: ../sanei/sanei_usb.lo libsane-sm3840.la: ../sanei/sanei_usb.lo
libsane-sm3840.la: ../sanei/sanei_scsi.lo
libsane-snapscan.la: ../sanei/sanei_config2.lo libsane-snapscan.la: ../sanei/sanei_config2.lo
libsane-snapscan.la: ../sanei/sanei_constrain_value.lo libsane-snapscan.la: ../sanei/sanei_constrain_value.lo
libsane-snapscan.la: ../sanei/sanei_scsi.lo libsane-snapscan.la: ../sanei/sanei_scsi.lo

Wyświetl plik

@ -493,7 +493,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
static SANE_Status static SANE_Status
add_sm3840_device (SANE_String_Const devname) add_sm_device (SANE_String_Const devname, SANE_String_Const modname)
{ {
SM3840_Device *dev; SM3840_Device *dev;
@ -503,7 +503,7 @@ add_sm3840_device (SANE_String_Const devname)
memset (dev, 0, sizeof (*dev)); memset (dev, 0, sizeof (*dev));
dev->sane.name = strdup (devname); dev->sane.name = strdup (devname);
dev->sane.model = "ScanMaker 3840"; dev->sane.model = modname;
dev->sane.vendor = "Microtek"; dev->sane.vendor = "Microtek";
dev->sane.type = "flatbed scanner"; dev->sane.type = "flatbed scanner";
++num_devices; ++num_devices;
@ -513,6 +513,19 @@ add_sm3840_device (SANE_String_Const devname)
return (SANE_STATUS_GOOD); return (SANE_STATUS_GOOD);
} }
static SANE_Status
add_sm3840_device (SANE_String_Const devname)
{
return add_sm_device (devname, "ScanMaker 3840");
}
static SANE_Status
add_sm4800_device (SANE_String_Const devname)
{
return add_sm_device (devname, "ScanMaker 4800");
}
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
SANE_Status SANE_Status
sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
@ -532,7 +545,10 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
first_dev = NULL; first_dev = NULL;
num_devices = 0; num_devices = 0;
/* If we get enough scanners should use an array, but for now */
/* do it one-by-one... */
sanei_usb_find_devices (0x05da, 0x30d4, add_sm3840_device); sanei_usb_find_devices (0x05da, 0x30d4, add_sm3840_device);
sanei_usb_find_devices (0x05da, 0x30cf, add_sm4800_device);
if (devlist) if (devlist)
free (devlist); free (devlist);

Wyświetl plik

@ -1,3 +1,5 @@
# usb vendor product # usb vendor product
# Microtek ScanMaker 3840 ID # Microtek ScanMaker 3840 ID
usb 0x05da 0x30d4 usb 0x05da 0x30d4
# Microtek ScanMaker 4800 ID
usb 0x05da 0x30cf

Wyświetl plik

@ -128,7 +128,9 @@ main (int argc, char *argv[])
params.width = rightin - leftin; params.width = rightin - leftin;
prepare_params (&params); prepare_params (&params);
udev = find_device (0x05da, 0x30d4); udev = find_device (0x05da, 0x30d4); /* 3840 */
if (!udev)
udev = find_device (0x05da, 0x30cf); /* 4800 */
if (!udev) if (!udev)
fprintf (stderr, "Unable to open scanner.\n"); fprintf (stderr, "Unable to open scanner.\n");
else else
@ -420,6 +422,7 @@ setup_scan (usb_dev_handle * udev, SM3840_Params * p)
len = len =
usb_bulk_read (udev, 1, (unsigned char *) whitebalance, usb_bulk_read (udev, 1, (unsigned char *) whitebalance,
whitebalancesize, rd_timeout); whitebalancesize, rd_timeout);
fix_endian_short (whitebalance, whitebalancesize/2);
if (!donered) if (!donered)
{ {
red = (whitebalance[0] + whitebalance[3] + whitebalance[6]) / 3; red = (whitebalance[0] + whitebalance[3] + whitebalance[6]) / 3;
@ -485,6 +488,7 @@ setup_scan (usb_dev_handle * udev, SM3840_Params * p)
len = len =
usb_bulk_read (udev, 1, (unsigned char *) whitebalance, usb_bulk_read (udev, 1, (unsigned char *) whitebalance,
whitebalancesize, rd_timeout); whitebalancesize, rd_timeout);
fix_endian_short (whitebalance, whitebalancesize/2);
if (!donered) if (!donered)
{ {
red = red =
@ -599,6 +603,7 @@ setup_scan (usb_dev_handle * udev, SM3840_Params * p)
write_vctl (udev, 0x0c, 0x0001, 0x0000, 0x00); write_vctl (udev, 0x0c, 0x0001, 0x0000, 0x00);
record_mem (udev, (unsigned char **) (void *)&whitescan, record_mem (udev, (unsigned char **) (void *)&whitescan,
(5632 * 2 * 3 * (dpi == 1200 ? 2 : 1)) * 4); (5632 * 2 * 3 * (dpi == 1200 ? 2 : 1)) * 4);
fix_endian_short (whitescan, (5632 * 2 * 3 * (dpi == 1200 ? 2 : 1)) * 2);
write_regs (udev, 5, 0x83, 0x00, 0xa3, 0xff, 0xa4, 0xff, 0xa1, 0xff, 0xa2, write_regs (udev, 5, 0x83, 0x00, 0xa3, 0xff, 0xa4, 0xff, 0xa1, 0xff, 0xa2,
0xff); 0xff);
write_vctl (udev, 0x0c, 0x0001, 0x0000, 0x00); write_vctl (udev, 0x0c, 0x0001, 0x0000, 0x00);

Wyświetl plik

@ -11,7 +11,7 @@
; See doc/descriptions.txt for details. ; See doc/descriptions.txt for details.
:backend "sm3840" ; name of backend :backend "sm3840" ; name of backend
:version "1.0" ; version of backend (or "unmaintained") :version "1.1" ; version of backend (or "unmaintained")
:new :yes ; Is the backend new to this SANE release? :new :yes ; Is the backend new to this SANE release?
; :yes or :no ; :yes or :no
:manpage "sane-sm3840" ; name of manpage (if it exists) :manpage "sane-sm3840" ; name of manpage (if it exists)
@ -38,6 +38,16 @@
; or "Proprietary". ; or "Proprietary".
:comment "8 and 16 bit, color and grayscale" ; comment about the model :comment "8 and 16 bit, color and grayscale" ; comment about the model
:model "ScanMaker 4800" ; name models for above-specified mfg.
:status :good ; :minimal, :basic, :good, :complete
; :untested, or :unsupported
:interface "USB" ; interface type of the device:
; "SCSI", "USB", "Parport (EPP)",
; "Parport (SPP)", "Parport (ECP)",
; "Serial port", "IEEE-1394", "JetDirect",
; or "Proprietary".
:comment "Same hardware as SM3840, different color box" ; comment
; :comment and :url specifiers are optional after :mfg, :model, :desc, ; :comment and :url specifiers are optional after :mfg, :model, :desc,
; and at the top-level. ; and at the top-level.

Wyświetl plik

@ -1,4 +1,4 @@
.TH sane-sm3840 5 "Feb 6, 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy" .TH sane-sm3840 5 "Mar 15, 2005" "@PACKAGEVERSION@" "SANE Scanner Access Now Easy"
.IX sane-sm3840 .IX sane-sm3840
.SH NAME .SH NAME
sane-sm3840 \- SANE backend for Microtek scanners with SCAN08 USB chip sane-sm3840 \- SANE backend for Microtek scanners with SCAN08 USB chip
@ -12,15 +12,20 @@ USB chip.
There exist backends for Microtek scanners with SCSI command set. There exist backends for Microtek scanners with SCSI command set.
Refer to sane-microtek(5) and sane-microtek2(5) for details. Refer to sane-microtek(5) and sane-microtek2(5) for details.
.PP .PP
There also exists a Microtek 3600 series driver, see sane-sm3600(5) for
details.
.PP
At present, the following At present, the following
scanners are known positively to work with this backend: scanners are known positively to work with this backend:
.PP .PP
.RS .RS
Vendor Product id: Remark: Vendor Product ID: Remark:
.br .br
-------- -------------- ----------- -------- -------------- -----------
.br .br
Microtek ScanMaker 3840 all modes ok Microtek ScanMaker 3840 All modes OK
.br
Microtek ScanMaker 4800 All modes OK
.RE .RE
.PP .PP
If you own a Microtek scanner with the SCAN08 chip other than the ones If you own a Microtek scanner with the SCAN08 chip other than the ones