From 13babf9dab82b530138a40d9cc4d74886bb0ccbf Mon Sep 17 00:00:00 2001 From: Gerhard Jaeger Date: Thu, 16 Feb 2006 08:11:55 +0000 Subject: [PATCH] * doc/plustek/Plustek-PARPORT.changes: Update. * backend/plustek_pp.c: Bumped build number. * backend/plustek-pp_ptdrv.c backend/plustek-pp_detec.c: Fixed bug, that prevents backend from working, when the device is another parport than parport0 - spotted by Christoph Steinbruchel. --- ChangeLog | 10 +++++-- backend/plustek-pp_detect.c | 44 ++++++++++++++--------------- backend/plustek-pp_ptdrv.c | 16 ++++++----- backend/plustek_pp.c | 4 +-- doc/plustek/Plustek-PARPORT.changes | 5 ++++ 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3bb28ff8b..f9d528498 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-02-16 Gerhard Jaeger + + * doc/plustek/Plustek-PARPORT.changes: Update. + * backend/plustek_pp.c: Bumped build number. + * backend/plustek-pp_ptdrv.c backend/plustek-pp_detec.c: + Fixed bug, that prevents backend from working, when the device + is another parport than parport0 - spotted by Christoph Steinbruchel. + 2006-02-14 Gerhard Jaeger * doc/u12/U12.changes: Update. @@ -5,8 +13,6 @@ * backend/u12-hw.c: SoftwareReset is now disabled in cancelSequence when the device is a Genius scanner. -Fixed CanoScan N1220U settings. - 2006-02-13 Stéphane Voltz * backend/genesys_gl646.c: disabled power saving for gl646. diff --git a/backend/plustek-pp_detect.c b/backend/plustek-pp_detect.c index e75a270a6..33cab5024 100644 --- a/backend/plustek-pp_detect.c +++ b/backend/plustek-pp_detect.c @@ -3,7 +3,7 @@ * * based on sources acquired from Plustek Inc. * Copyright (C) 1998 Plustek Inc. - * Copyright (C) 2000-2004 Gerhard Jaeger + * Copyright (C) 2000-2006 Gerhard Jaeger * also based on the work done by Rick Bronson * * History: @@ -23,7 +23,7 @@ * - 0.40 - no changes * - 0.41 - no changes * - 0.42 - changed include names - * - 0.43 - no changes + * - 0.43 - cleanup * . *
* This file is part of the SANE package. @@ -75,10 +75,10 @@ */ static void detectResetPort( pScanData ps ) { - UChar control; + UChar control; + + DBG( DBG_HIGH, "ResetPort()\n" ); - DBG( DBG_HIGH, "ResetPort()\n" ); - control = _INB_CTRL( ps ); _DO_UDELAY( 2 ); @@ -102,12 +102,12 @@ static int detectScannerConnection( pScanData ps ) DBG( DBG_LOW, "Ctrlport = 0x%04x\n", ps->IO.pbControlPort ); #endif - detectResetPort( ps ); + detectResetPort( ps ); /* * as we're called during InitPorts, we can be sure * to operate in EPP-mode (hopefuly ;-) - */ + */ control = _INB_CTRL( ps ); /* @@ -155,36 +155,34 @@ static int detectScannerConnection( pScanData ps ) data, status, ps->IO.portBase ); if( data != status ) { + _ASSERT( ps->ReadWriteTest ); - /* - * here we try to detect the operation speed of our - * parallel port - * if we have tested all the stuff and had no success, retval - * will contain the error-code + /* + * here we try to detect the operation speed of our parallel + * port if we have tested all the stuff and had no success, + * retval will contain the error-code */ for( ps->IO.delay = 0; ps->IO.delay < 5; ps->IO.delay++ ) { retval = ps->ReadWriteTest( ps ); - /* break on OK or when the ASIC detection fails */ - if((_OK == retval) || (_E_NO_ASIC == retval)) + /* break on OK or when the ASIC detection fails */ + if((_OK == retval) || (_E_NO_ASIC == retval)) break; } } } } - /* - * work on the result - */ + /* work on the result */ if ( _OK == retval ) { #ifdef __KERNEL__ - ps->sCaps.wIOBase = ps->IO.pbSppDataPort; + ps->sCaps.wIOBase = ps->IO.pbSppDataPort; #else - ps->sCaps.wIOBase = ps->pardev; + ps->sCaps.wIOBase = ps->pardev; #endif - ps->PutToIdleMode( ps ); + ps->PutToIdleMode( ps ); } else { ps->sCaps.wIOBase = _NO_BASE; @@ -198,7 +196,7 @@ static int detectScannerConnection( pScanData ps ) DBG( DBG_HIGH, "detectScannerConnection() returns %i.\n", retval ); - return retval; + return retval; } /** we need some memory... @@ -436,9 +434,9 @@ _LOC int DetectScanner( pScanData ps, int mode ) /* read Register 0x18 (AsicID Register) of Asic9800x based devices */ #ifdef _ASIC_98001_SIM #ifdef __KERNEL__ - _PRINT( + _PRINT( #else - DBG( DBG_HIGH, + DBG( DBG_HIGH, #endif "!!!! WARNING, SW-Emulation active !!!!\n" ); asic = _ASIC_IS_98001; diff --git a/backend/plustek-pp_ptdrv.c b/backend/plustek-pp_ptdrv.c index aed3a40f8..a59ab5eaf 100644 --- a/backend/plustek-pp_ptdrv.c +++ b/backend/plustek-pp_ptdrv.c @@ -3,7 +3,7 @@ * * based on sources acquired from Plustek Inc. * Copyright (C) 1998 Plustek Inc. - * Copyright (C) 2000-2004 Gerhard Jaeger + * Copyright (C) 2000-2006 Gerhard Jaeger * also based on the work done by Rick Bronson * * History: @@ -694,6 +694,8 @@ static int ptdrvOpenDevice( pScanData ps ) struct pardevice *pd; struct parport *pp; ProcDirDef procDir; +#else + int pd; #endif /* @@ -701,10 +703,10 @@ static int ptdrvOpenDevice( pScanData ps ) */ #ifdef __KERNEL__ flags = ps->flags; - pd = ps->pardev; pp = ps->pp; procDir = ps->procDir; #endif + pd = ps->pardev; iobase = ps->sCaps.wIOBase; asic = ps->sCaps.AsicID; lastStat = ps->bLastLampStatus; @@ -722,13 +724,13 @@ static int ptdrvOpenDevice( pScanData ps ) */ #ifdef __KERNEL__ ps->flags = flags; - ps->pardev = pd; ps->pp = pp; ps->procDir = procDir; #endif + ps->pardev = pd; ps->bLastLampStatus = lastStat; ps->IO.lastPortMode = lastMode; - ps->devno = devno; + ps->devno = devno; #ifdef __KERNEL__ if( _TRUE == slowIO[devno] ) { @@ -799,10 +801,10 @@ static int ptdrvInit( int devno ) #endif ps->ModelOverride = mov[devno]; ps->warmup = warmup[devno]; - ps->lampoff = lampoff[devno]; - ps->lOffonEnd = lOffonEnd[devno]; + ps->lampoff = lampoff[devno]; + ps->lOffonEnd = lOffonEnd[devno]; ps->IO.forceMode = forceMode[devno]; - ps->devno = devno; + ps->devno = devno; /* assign it right here, to allow correct shutdown */ PtDrvDevices[devno] = ps; diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c index 8b651c397..0a98b1f9c 100644 --- a/backend/plustek_pp.c +++ b/backend/plustek_pp.c @@ -6,7 +6,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-2005 Gerhard Jaeger
+ * Copyright (C) 2000-2006 Gerhard Jaeger
* * History: * - 0.01 - initial version, imported from the kernel-module 0.42-11 @@ -83,7 +83,7 @@ #include "../include/sane/sanei.h" #include "../include/sane/saneopts.h" -#define BACKEND_VERSION "0.43-9" +#define BACKEND_VERSION "0.43-10" #define BACKEND_NAME plustek_pp #include "../include/sane/sanei_backend.h" #include "../include/sane/sanei_config.h" diff --git a/doc/plustek/Plustek-PARPORT.changes b/doc/plustek/Plustek-PARPORT.changes index 99f0e9ed9..2545b3837 100644 --- a/doc/plustek/Plustek-PARPORT.changes +++ b/doc/plustek/Plustek-PARPORT.changes @@ -155,3 +155,8 @@ Version 0.43-8 08/10/2005 Version 0.43-9 11/14/2005 1.0 Fixed sizeof(long) issue for 64bit platforms, see bug #302195 + +Version 0.43-10 02/16/2006 + 1.0 Fixed bug, that prevents backend from working, when the + device is connected to parport1 or higher, parport0 works. + Bug spotted by Christoph Steinbruchel.