Moved to version 0.39 - minor fixes and additional models supported now.

DEVEL_2_0_BRANCH-1
Gerhard Jaeger 2001-04-14 15:06:43 +00:00
rodzic 9ca93884d1
commit 92b4f8dc1b
4 zmienionych plików z 71 dodań i 50 usunięć

Wyświetl plik

@ -9,7 +9,7 @@
* original code taken from sane-0.71
* Copyright (C) 1997 Hypercore Software Design, Ltd.
* also based on the work done by Rick Bronson
* Copyright (C) 2000 Gerhard Jaeger <g.jaeger@earthling.net>
* Copyright (C) 2000/2001 Gerhard Jaeger <g.jaeger@earthling.net>
*.............................................................................
* History:
* 0.30 - initial version
@ -36,6 +36,7 @@
* some minor fixes
* removed dropout stuff
* removed some warning conditions
* 0.39 - added stuff to use the backend completely in user mode
*
*.............................................................................
*
@ -209,16 +210,18 @@ static int drvopen( const char *dev_name )
int handle;
unsigned short version = _PTDRV_IOCTL_VERSION;
_INIT(0x378,190,15);
DBG( _DBG_INFO, "drvopen()\n" );
if ((handle = open(dev_name, O_RDONLY)) < 0) {
if ((handle = _OPEN(dev_name)) < 0) {
DBG(_DBG_ERROR, "open: can't open %s as a device\n", dev_name);
return handle;
}
result = ioctl(handle, _PTDRV_OPEN_DEVICE, &version );
result = _IOCTL( handle, _PTDRV_OPEN_DEVICE, &version );
if( result < 0 ) {
close( handle );
_CLOSE( handle );
DBG( _DBG_ERROR, "ioctl PT_DRV_OPEN_DEVICE failed(%d)\n", result );
if( -9019 == result )
DBG( _DBG_ERROR,"Version problem, please recompile driver!\n" );
@ -249,10 +252,10 @@ static SANE_Status drvclose( int handle )
* don't check the return values, simply do it and close the driver
*/
int_cnt = 0;
ioctl( handle, _PTDRV_STOP_SCAN, &int_cnt );
ioctl( handle, _PTDRV_CLOSE_DEVICE, 0);
_IOCTL( handle, _PTDRV_STOP_SCAN, &int_cnt );
_IOCTL( handle, _PTDRV_CLOSE_DEVICE, 0);
close( handle );
_CLOSE( handle );
}
return SANE_STATUS_GOOD;
@ -373,7 +376,7 @@ static int reader_process( Plustek_Scanner *scanner, int pipe_fd )
}
/* here we read all data from the driver... */
status = (unsigned long)read( scanner->hw->fd, scanner->buf, data_length );
status = (unsigned long)_READ( scanner->hw->fd, scanner->buf, data_length );
/* on error, there's no need to clean up, as this is done by the parent */
if((int)status < 0 ) {
@ -415,7 +418,7 @@ static SANE_Status do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe )
/* tell the driver to stop scanning */
if( -1 != scanner->hw->fd ) {
int_cnt = 1;
ioctl( scanner->hw->fd, _PTDRV_STOP_SCAN, &int_cnt );
_IOCTL( scanner->hw->fd, _PTDRV_STOP_SCAN, &int_cnt );
}
/* kill our child process and wait until done */
@ -458,7 +461,8 @@ static SANE_Status limitResolution( Plustek_Device *dev )
* Note: the limit for the Asic 96001/3 models is limited to the
* X-Resolution
*/
if( _ASIC_IS_98001 == dev->caps.AsicID ) {
if((_ASIC_IS_98003 == dev->caps.AsicID) ||
(_ASIC_IS_98001 == dev->caps.AsicID)) {
dev->dpi_range.max = lens.rDpiY.wPhyMax;
} else {
dev->dpi_range.max = lens.rDpiX.wPhyMax;
@ -660,24 +664,24 @@ static SANE_Status attach( const char *dev_name, Plustek_Device **devp )
return SANE_STATUS_IO_ERROR;
}
result = ioctl( handle, _PTDRV_GET_CAPABILITIES, &scaps);
result = _IOCTL( handle, _PTDRV_GET_CAPABILITIES, &scaps);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_GET_CAPABILITIES failed(%d)\n", result);
close(handle);
_CLOSE(handle);
return SANE_STATUS_IO_ERROR;
}
result = ioctl( handle, _PTDRV_GET_LENSINFO, &lens);
result = _IOCTL( handle, _PTDRV_GET_LENSINFO, &lens);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_GET_LENSINFO failed(%d)\n", result );
close(handle);
_CLOSE(handle);
return SANE_STATUS_IO_ERROR;
}
/* did we fail on connection? */
if( _NO_BASE == scaps.wIOBase ) {
DBG( _DBG_ERROR, "failed to find Plustek scanner\n" );
close(handle);
_CLOSE(handle);
return SANE_STATUS_INVAL;
}
@ -718,7 +722,7 @@ static SANE_Status attach( const char *dev_name, Plustek_Device **devp )
if (NULL == dev->res_list) {
DBG( _DBG_ERROR, "alloc fail, resolution problem\n" );
close(handle);
_CLOSE(handle);
return SANE_STATUS_INVAL;
}
@ -786,7 +790,11 @@ SANE_Status sane_init( SANE_Int *version_code, SANE_Auth_Callback authorize )
return attach("/dev/pt_drv", 0);
}
#if V_REV >= 3
while (sanei_config_read( dev_name, sizeof(dev_name), fp)) {
#else
while (fgets(dev_name, sizeof(dev_name), fp)) {
#endif
DBG( _DBG_SANE_INIT, "sane_init, >%s<\n", dev_name);
if( dev_name[0] == '#') /* ignore line comments */
@ -834,6 +842,8 @@ void sane_exit( void )
free( dev );
}
_DOWN();
auth = NULL;
first_dev = NULL;
first_handle = NULL;
@ -1136,7 +1146,7 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option,
} else {
s->opt[OPT_MODE].constraint.string_list = mode_list;
}
s->val[OPT_MODE].w = 3; /* _COLOR_TRUE24 */
s->val[OPT_MODE].w = 3; /* COLOR_TRUE24 */
} else {
@ -1162,11 +1172,11 @@ SANE_Status sane_control_option( SANE_Handle handle, SANE_Int option,
if( s->hw->caps.dwFlag & SFLAG_TPA ) {
s->opt[OPT_MODE].constraint.string_list =
&mode_9800x_list[_TPAModeSupportMin];
} else {
} else {
s->opt[OPT_MODE].constraint.string_list =
&mode_list[_TPAModeSupportMin];
}
s->val[OPT_MODE].w = 1; /* _COLOR_TRUE24 */
s->val[OPT_MODE].w = 0; /* COLOR_24 is the default */
}
s->opt[OPT_HALFTONE].cap |= SANE_CAP_INACTIVE;
@ -1303,24 +1313,24 @@ SANE_Status sane_start( SANE_Handle handle )
return SANE_STATUS_IO_ERROR;
}
result = ioctl( s->hw->fd, _PTDRV_GET_CAPABILITIES, &scaps);
result = _IOCTL( s->hw->fd, _PTDRV_GET_CAPABILITIES, &scaps);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_GET_CAPABILITIES failed(%d)\n", result);
close( s->hw->fd );
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
result = ioctl( s->hw->fd, _PTDRV_GET_LENSINFO, &lens);
result = _IOCTL( s->hw->fd, _PTDRV_GET_LENSINFO, &lens);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_GET_LENSINFO failed(%d)\n", result );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
/* did we fail on connection? */
if (scaps.wIOBase == _NO_BASE ) {
DBG( _DBG_ERROR, "failed to find Plustek scanner\n" );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_INVAL;
}
@ -1394,17 +1404,17 @@ SANE_Status sane_start( SANE_Handle handle )
cb.ucmd.cInf.ImgDef.wLens = scaps.wLens;
result = ioctl( s->hw->fd, _PTDRV_PUT_IMAGEINFO, &cb);
result = _IOCTL( s->hw->fd, _PTDRV_PUT_IMAGEINFO, &cb);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_PUT_IMAGEINFO failed(%d)\n", result );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
result = ioctl(s->hw->fd, _PTDRV_GET_CROPINFO, &crop);
result = _IOCTL(s->hw->fd, _PTDRV_GET_CROPINFO, &crop);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_GET_CROPINFO failed(%d)\n", result );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
@ -1449,17 +1459,17 @@ SANE_Status sane_start( SANE_Handle handle )
DBG( _DBG_SANE_INIT, "bright %i contrast %i\n", cb.ucmd.sInf.siBrightness,
cb.ucmd.sInf.siContrast);
result = ioctl(s->hw->fd, _PTDRV_SET_ENV, &cb.ucmd.sInf);
result = _IOCTL(s->hw->fd, _PTDRV_SET_ENV, &cb.ucmd.sInf);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_SET_ENV failed(%d)\n", result );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
result = ioctl(s->hw->fd, _PTDRV_START_SCAN, &start);
result = _IOCTL(s->hw->fd, _PTDRV_START_SCAN, &start);
if( result < 0 ) {
DBG( _DBG_ERROR, "ioctl _PTDRV_START_SCAN failed(%d)\n", result );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
@ -1470,7 +1480,7 @@ SANE_Status sane_start( SANE_Handle handle )
s->buf = realloc( s->buf, (s->params.lines) * s->params.bytes_per_line );
if( NULL == s->buf ) {
DBG( _DBG_ERROR, "realloc failed\n" );
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_NO_MEM;
}
@ -1486,7 +1496,7 @@ SANE_Status sane_start( SANE_Handle handle )
if( pipe(fds) < 0 ) {
DBG( _DBG_ERROR, "ERROR: could not create pipe\n" );
s->scanning = SANE_FALSE;
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}
@ -1497,7 +1507,7 @@ SANE_Status sane_start( SANE_Handle handle )
if( s->reader_pid < 0 ) {
DBG( _DBG_ERROR, "ERROR: could not create child process\n" );
s->scanning = SANE_FALSE;
close(s->hw->fd);
_CLOSE( s->hw->fd );
return SANE_STATUS_IO_ERROR;
}

Wyświetl plik

@ -10,7 +10,7 @@
;
:backend "plustek" ; name of backend
:version "0.38" ; version of backend
:version "0.39" ; version of backend
:status :stable ; :alpha, :beta, :stable, :new
:manpage "sane-plustek" ; name of manpage (if it exists)
@ -54,6 +54,10 @@
:interface "Parport (SPP, EPP)"
:comment "OK"
:model "OpticPro 1236P"
:interface "Parport (SPP, EPP)"
:comment "OK - reported as OpticPro 12000P/96000P"
:model "OpticPro 12000P/96000P"
:interface "Parport (SPP, EPP)"
:comment "OK"
@ -80,15 +84,15 @@
:model "OpticPro P8"
:interface "Parport"
:comment "Not supported."
:comment "Not tested."
:model "OpticPro P12"
:interface "Parport"
:comment "Not supported."
:interface "Parport (SPP, EPP)"
:comment "OK"
:model "OpticPro PT12"
:interface "Parport"
:comment "Not supported."
:interface "Parport (SPP, EPP)"
:comment "OK."
:model "OpticPro 19200S"
:interface "SCSI"

Wyświetl plik

@ -9,10 +9,7 @@
*
* original code taken from sane-0.71
* Copyright (C) 1997 Hypercore Software Design, Ltd.
*
* modifications
* Copyright (C) 1998 Christian Bucher
* Copyright (C) 1998 Kling & Hautzinger GmbH
* Copyright (C) 2000/2001 Gerhard Jaeger <g.jaeger@earthling.net>
* Last Update:
* Gerhard Jaeger <g.jaeger@earthling.net>
*.............................................................................
@ -32,6 +29,7 @@
* 0.38 - added caps to struct Plustek_Device
* added exit code to struct Plustek_Scanner
* removed dropout stuff
* 0.39 - no changes
*
*.............................................................................
*

Wyświetl plik

@ -1,4 +1,4 @@
.TH sane-plustek 5 "30 November 2000"
.TH sane-plustek 5 "09 April 2001"
.IX sane-plustek
.SH NAME
sane-plustek - SANE backend for Plustek parallel port flatbed scanners
@ -18,6 +18,10 @@ Model: ASIC: Properties:
.br
---------------------- ----- ------------------------
.br
OpticPro PT12 98003 600x1200 dpi 36bit 512Kb
.br
OpticPro P12 98003 600x1200 dpi 36bit 512Kb
.br
OpticPro 9636T/12000T 98001 600x1200 dpi 36bit 512Kb
.br
OpticPro 12000P Turbo 98001 600x1200 dpi 36bit 512Kb
@ -28,6 +32,8 @@ OpticPro 9636P 98001 600x1200 dpi 36bit 512Kb
.br
OpticPro 12000P/96000P 96003 600x1200 dpi 30bit 128Kb
.br
OpticPro 1236P 96003 600x1200 dpi 30bit 128Kb
.br
OpticPro 9600P 96003 600x1200 dpi 30bit 128Kb
.br
OpticPro 9630P/FBIV 96003 600x1200 dpi 30bit 128Kb
@ -166,6 +172,13 @@ specifies the behaviour when unloading the driver, 1 --> switch
lamps off, 0 --> do not change lamp status
.RE
.PP
slowIO=s
.RS
.I s
specifies which I/O functions the driver should use, 1 --> use
delayed functions, 0 --> use the non-delayed ones
.RE
.PP
mov=m
.RS
.I m
@ -309,10 +322,6 @@ ASIC 98001 based models:
.br
correctly.
.br
* The gray mode for transparency and negative sources will
.br
not work correctly.
.br
* There is currently no way to distinguish a model with
.br
and without transpareny unit.