diff --git a/backend/plustek-pp.h b/backend/plustek-pp.h
index cf3e53554..a4f8f0717 100644
--- a/backend/plustek-pp.h
+++ b/backend/plustek-pp.h
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek flatbed scanners.
- *.............................................................................
- */
-
/** @file plustek-pp.h
* @brief Definitions for the backend.
*
@@ -15,6 +10,8 @@
*
* History:
* - 0.01 - initial version
+ * - 0.43 - bumped up version to reflect the former module code version
+ * - removed Version from ScannerCaps
* .
*
* This file is part of the SANE package.
@@ -421,14 +418,13 @@ typedef struct {
} RANGE, *PRANGE;
typedef struct {
- RANGE rDataType; /* available scan modes */
- unsigned long dwFlag; /* refer to SECTION (1.2) */
- unsigned short wIOBase; /* refer to SECTION (1.3) */
- unsigned short wMaxExtentX; /* scanarea width */
- unsigned short wMaxExtentY; /* scanarea height */
- unsigned short AsicID; /* copy of RegAsicID */
- unsigned short Model; /* model as best we can determine */
- unsigned short Version; /* drivers version */
+ RANGE rDataType; /* available scan modes */
+ unsigned long dwFlag; /* refer to SECTION (1.2) */
+ unsigned short wIOBase; /* refer to SECTION (1.3) */
+ unsigned short wMaxExtentX; /* scanarea width */
+ unsigned short wMaxExtentY; /* scanarea height */
+ unsigned short AsicID; /* copy of RegAsicID */
+ unsigned short Model; /* model as best we can determine */
} ScannerCaps, *pScannerCaps;
typedef struct {
diff --git a/backend/plustek-pp_dac.c b/backend/plustek-pp_dac.c
index b7ba97306..6a5f5c614 100644
--- a/backend/plustek-pp_dac.c
+++ b/backend/plustek-pp_dac.c
@@ -1,9 +1,4 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
-/* @file plustek-pp_dac.c -
+/* @file plustek-pp_dac.c
* @brief all the shading function formerly found in shading.c.
* don't ask me why I called this file dac.c...
*
@@ -30,6 +25,7 @@
* - 0.40 - disabled the A3I stuff
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_dbg.h b/backend/plustek-pp_dbg.h
index bfba47bf8..c53d6e691 100644
--- a/backend/plustek-pp_dbg.h
+++ b/backend/plustek-pp_dbg.h
@@ -1,13 +1,8 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_dbg.h - definition of some debug macros
- *.............................................................................
+/** @file plustek-pp_dbg.c
+ * @brief definition of some debug macros
*
* Copyright (C) 2000-2004 Gerhard Jaeger
*
- *.............................................................................
- *
* This file is part of the SANE package.
*
* This program is free software; you can redistribute it and/or
@@ -66,7 +61,7 @@
#ifdef DEBUG
# ifndef __KERNEL__
# include
-# define _ASSERT(x) assert(x)
+# define _ASSERT(x) assert(x)
# else
# define _ASSERT(x)
# endif
diff --git a/backend/plustek-pp_detect.c b/backend/plustek-pp_detect.c
index 51d70a66f..e75a270a6 100644
--- a/backend/plustek-pp_detect.c
+++ b/backend/plustek-pp_detect.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_detect.c
* @brief automatic scanner detection
*
@@ -28,6 +23,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_genericio.c b/backend/plustek-pp_genericio.c
index f4cd0acb8..73e048ffc 100644
--- a/backend/plustek-pp_genericio.c
+++ b/backend/plustek-pp_genericio.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_genericio.c
* @brief all i/o functions
*
@@ -35,6 +30,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_hwdefs.h b/backend/plustek-pp_hwdefs.h
index 98cd70e22..2672380f9 100644
--- a/backend/plustek-pp_hwdefs.h
+++ b/backend/plustek-pp_hwdefs.h
@@ -1,15 +1,11 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_hwdefs.h - different definitions for describing the
- * scanner hardware
- *.............................................................................
+/* @file plustek-pp_hwdefs.h
+ * @brief different definitions for describing the scanner hardware
*
* based on sources acquired from Plustek Inc.
* Copyright (C) 1998 Plustek Inc.
* Copyright (C) 2000-2004 Gerhard Jaeger
* also based on the work done by Rick Bronson
- *.............................................................................
+ *
* History:
* 0.30 - initial version
* 0.31 - corrected the values of _GAIN_P98_HIGH, _GAIN_P96_HIGH and _GAIN_LOW
@@ -31,6 +27,7 @@
* 0.40 - no changes
* 0.41 - added _OVR_PLUSTEK_4800P definition
* 0.42 - added _OVR_PRIMAX_4800D30 definition
+ * 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_image.c b/backend/plustek-pp_image.c
index 2b143d773..1525797f9 100644
--- a/backend/plustek-pp_image.c
+++ b/backend/plustek-pp_image.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_image.c
* @brief functions to convert scanner data into image data
*
@@ -37,6 +32,8 @@
* - 0.41 - no changes
* - 0.42 - fixed a problem for the 12bit modes fo ASIC9800x based devices
* - changed include names
+ * - 0.43 - removed floating point stuff
+ * - cleanup
* .
*
* This file is part of the SANE package.
@@ -106,8 +103,7 @@ static ThreshDef xferSpeed[4] = {
/*************************** local functions *********************************/
-/*.............................................................................
- * return the correct DPI-value
+/** return the correct DPI-value
* The ASIC 96001/3 models are limited to an optical resolution of 300 Dpi
* so itīs necessary to scale in X and Y direction (see scale.c)!
*/
@@ -281,9 +277,8 @@ static Bool fnReadOutScanner( pScanData ps )
}
}
-/*.............................................................................
- * Interpolates the gray data by using averaged the continuous pixels
- */
+/** Interpolates the gray data by using averaged the continuous pixels
+ */
static void fnP96GrayDirect( pScanData ps, pVoid pBuf, pVoid pImg, ULong bl )
{
pUChar src, dest;
@@ -295,13 +290,12 @@ static void fnP96GrayDirect( pScanData ps, pVoid pBuf, pVoid pImg, ULong bl )
*dest = ps->pbMapRed [*src];
}
-/*.............................................................................
- * This routine used in the condition:
- * 1) The data type is B/W or GrayScale.
- * 2) The required horizontal resolution doesn't exceed the optic spec.
- * 3) The required vertical resolution exceeds the optic spec.
- * So, the vertcal lines have to average with previous line to smooth the
- * image.
+/** This routine used in the condition:
+ * 1) The data type is B/W or GrayScale.
+ * 2) The required horizontal resolution doesn't exceed the optic spec.
+ * 3) The required vertical resolution exceeds the optic spec.
+ * So, the vertcal lines have to average with previous line to smooth the
+ * image.
*/
static void fnDataDirect( pScanData ps, pVoid pBuf, pVoid pImg, ULong bl )
{
@@ -309,8 +303,7 @@ static void fnDataDirect( pScanData ps, pVoid pBuf, pVoid pImg, ULong bl )
memcpy( pBuf, pImg, bl );
}
-/*.............................................................................
- * According to dither matrix to convert the input gray scale data into
+/** According to dither matrix to convert the input gray scale data into
* one-bit data.
*/
static void fnHalftoneDirect0( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
@@ -337,8 +330,7 @@ static void fnHalftoneDirect0( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
ps->dwDitherIndex = (ps->dwDitherIndex + 8) & 0x3f;
}
-/*.............................................................................
- * use random generator to make halftoning
+/** use random generator to make halftoning
*/
static void fnHalftoneDirect1( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
{
@@ -365,8 +357,7 @@ static void fnHalftoneDirect1( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
}
}
-/*.............................................................................
- * Merges the color planes to pixels style without enlarge operation.
+/** Merges the color planes to pixels style without enlarge operation.
*/
static void fnP98ColorDirect( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
{
@@ -400,8 +391,7 @@ static void fnP96ColorDirect( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
}
}
-/*.............................................................................
- * Merges the color planes to pixels style without enlarge operation.
+/** Merges the color planes to pixels style without enlarge operation.
* The scanner returns the pixel data in Motorola-Format, so we have to swap
*/
static void fnP98Color48( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
@@ -423,8 +413,7 @@ static void fnP98Color48( pScanData ps, pVoid pb, pVoid pImg, ULong bL )
}
}
-/*.............................................................................
- * prepare for scanning
+/** prepare for scanning
*/
static int imageP98SetupScanSettings( pScanData ps, pScanInfo pInf )
{
@@ -527,8 +516,7 @@ static int imageP98SetupScanSettings( pScanData ps, pScanInfo pInf )
return _OK;
}
-/*.............................................................................
- *
+/**
*/
static void imageP98DoCopyBuffer( pScanData ps, pUChar pImage )
{
@@ -539,8 +527,7 @@ static void imageP98DoCopyBuffer( pScanData ps, pUChar pImage )
ps->pFilterBuf = ps->pProcessingBuf;
}
-/*.............................................................................
- *
+/**
*/
static Bool imageP98CopyToFilterBuffer( pScanData ps, pUChar pImage )
{
@@ -562,11 +549,10 @@ static Bool imageP98CopyToFilterBuffer( pScanData ps, pUChar pImage )
return _TRUE;
}
-/*.............................................................................
- *
+/**
*/
static void imageP98UnSharpCompare( pScanData ps, Byte Center,
- Byte Neighbour, pLong pdwNewValue )
+ Byte Neighbour, pLong pdwNewValue )
{
Byte b;
@@ -579,8 +565,7 @@ static void imageP98UnSharpCompare( pScanData ps, Byte Center,
}
}
-/*.............................................................................
- *
+/**
*/
static void imageP98DoFilter( pScanData ps, pUChar pPut )
{
@@ -621,8 +606,7 @@ static void imageP98DoFilter( pScanData ps, pUChar pPut )
}
}
-/*.............................................................................
- *
+/**
*/
static Bool imageP98DataIsReady( pScanData ps )
{
@@ -632,7 +616,7 @@ static Bool imageP98DataIsReady( pScanData ps )
ps->bMoveDataOutFlag = _DataAfterRefreshState;
b = (ps->DataInf.wPhyDataType >= COLOR_TRUE24) ?
- _BLUE_DATA_READY : _GREEN_DATA_READY;
+ _BLUE_DATA_READY : _GREEN_DATA_READY;
while( _TRUE ) {
ps->dwColorRunIndex ++;
@@ -687,8 +671,7 @@ static Bool imageP98DataIsReady( pScanData ps )
return _TRUE;
}
-/*.............................................................................
- * here we wait for one data-line
+/** here we wait for one data-line
*/
static Bool imageP98001ReadOneImageLine( pScanData ps )
{
@@ -732,8 +715,7 @@ static Bool imageP98001ReadOneImageLine( pScanData ps )
return _FALSE;
}
-/*.............................................................................
- * calculate the image properties according to the scanmode
+/** calculate the image properties according to the scanmode
*/
static void imageP98GetInfo( pScanData ps, pImgDef pImgInf )
{
@@ -751,8 +733,9 @@ static void imageP98GetInfo( pScanData ps, pImgDef pImgInf )
DBG( DBG_LOW, "crArea.cx = %u, crArea.cy = %u\n",
pImgInf->crArea.cx, pImgInf->crArea.cy );
- ps->DataInf.XYRatio = (double)ps->DataInf.xyPhyDpi.y/
- (double)ps->DataInf.xyPhyDpi.x;
+ ps->DataInf.XYRatio = 1000 * ps->DataInf.xyPhyDpi.y/ps->DataInf.xyPhyDpi.x;
+ DBG( DBG_LOW, "xyDpi.x = %u, xyDpi.y = %u, XYRatio = %lu\n",
+ pImgInf->xyDpi.x, pImgInf->xyDpi.y, ps->DataInf.XYRatio );
ps->DataInf.dwAppLinesPerArea = (ULong)pImgInf->crArea.cy *
pImgInf->xyDpi.y / _MEASURE_BASE;
@@ -850,8 +833,7 @@ static void imageP98GetInfo( pScanData ps, pImgDef pImgInf )
DBG( DBG_LOW, "Physical Bytes = %lu\n", ps->DataInf.dwPhysBytesPerLine );
}
-/*.............................................................................
- *
+/**
*/
static void imageP96GetInfo( pScanData ps, pImgDef pImgInf )
{
@@ -869,11 +851,9 @@ static void imageP96GetInfo( pScanData ps, pImgDef pImgInf )
DBG( DBG_LOW, "crArea.cx = %u, crArea.cy = %u\n",
pImgInf->crArea.cx, pImgInf->crArea.cy );
- ps->DataInf.XYRatio = (double)ps->DataInf.xyPhyDpi.y/
- (double)ps->DataInf.xyPhyDpi.x;
-
- DBG( DBG_LOW, "xyDpi.x = %u, xyDpi.y = %u\n",
- pImgInf->xyDpi.x, pImgInf->xyDpi.y );
+ ps->DataInf.XYRatio = 1000 * ps->DataInf.xyPhyDpi.y/ps->DataInf.xyPhyDpi.x;
+ DBG( DBG_LOW, "xyDpi.x = %u, xyDpi.y = %u, XYRatio = %lu\n",
+ pImgInf->xyDpi.x, pImgInf->xyDpi.y, ps->DataInf.XYRatio );
ps->DataInf.dwAppLinesPerArea = (ULong)pImgInf->crArea.cy *
pImgInf->xyDpi.y / _MEASURE_BASE;
@@ -955,8 +935,7 @@ static void imageP96GetInfo( pScanData ps, pImgDef pImgInf )
DBG( DBG_LOW, "Physical Bytes = %lu\n", ps->DataInf.dwPhysBytesPerLine );
}
-/*.............................................................................
- * here we wait for one data-line
+/** here we wait for one data-line
*/
static Bool imageP96ReadOneImageLine( pScanData ps )
{
@@ -1137,8 +1116,7 @@ static Bool imageP96ReadOneImageLine( pScanData ps )
return _FALSE;
}
-/*.............................................................................
- * prepare for scanning
+/** prepare for scanning
*/
static int imageP96SetupScanSettings( pScanData ps, pScanInfo pInf )
{
@@ -1195,8 +1173,7 @@ static int imageP96SetupScanSettings( pScanData ps, pScanInfo pInf )
return _OK;
}
-/*.............................................................................
- *
+/**
*/
static Bool imageP98003DataIsReady( pScanData ps )
{
@@ -1251,8 +1228,7 @@ static Bool imageP98003DataIsReady( pScanData ps )
return _FALSE;
}
-/*.............................................................................
- *
+/**
*/
static Bool imageP98003ReadOneImageLine( pScanData ps )
{
@@ -1327,8 +1303,7 @@ static Bool imageP98003ReadOneImageLine( pScanData ps )
return _FALSE;
}
-/*.............................................................................
- *
+/**
*/
static void imageP98003SetupScanStateVariables( pScanData ps, ULong index )
{
@@ -1418,8 +1393,7 @@ static void imageP98003SetupScanStateVariables( pScanData ps, ULong index )
}
}
-/*.............................................................................
- * PrepareScanningVariables() !!!
+/** PrepareScanningVariables() !!!
*/
static int imageP98003SetupScanSettings( pScanData ps, pScanInfo pInf )
{
diff --git a/backend/plustek-pp_io.c b/backend/plustek-pp_io.c
index d6a811b8f..c34b9c04f 100644
--- a/backend/plustek-pp_io.c
+++ b/backend/plustek-pp_io.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustekpp-io.c
* @brief as the name says, here we have all the I/O
* functions according to the parallel port hardware
@@ -24,6 +19,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_map.c b/backend/plustek-pp_map.c
index d27239266..8afeb3279 100644
--- a/backend/plustek-pp_map.c
+++ b/backend/plustek-pp_map.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_map.c
* @brief functions to create and manipulate lookup tables.
*
@@ -30,6 +25,7 @@
* - 0.41 - no changes
* - 0.42 - made MapAdjust global
* - changed include names
+ * - 0.43 - cleanup, removed floating point stuff
* .
*
* This file is part of the SANE package.
@@ -122,7 +118,7 @@ static void mapSetDitherMap( pScanData ps )
for( i = 0; i < _DITHERSIZE; i++ ) {
pDither[i] = pDitherSource[i];
- }
+ }
}
/** nothing more to say
@@ -149,7 +145,7 @@ static void mapInvertMap( pScanData ps )
*/
static void mapInvertDitherMap( pScanData ps )
{
- if( ps->DataInf.dwScanFlag & SCANDEF_Inverse ) {
+ if( ps->DataInf.dwScanFlag & SCANDEF_Inverse ) {
ULong dw;
pULong pDither = (pULong)ps->a_bDitherPattern;
@@ -208,7 +204,7 @@ _LOC void MapSetupDither( pScanData ps )
{
DBG( DBG_LOW, "MapSetupDither() - %u\n", ps->DataInf.wAppDataType );
- if( COLOR_HALFTONE == ps->DataInf.wAppDataType ) {
+ if( COLOR_HALFTONE == ps->DataInf.wAppDataType ) {
mapSetDitherMap( ps );
if (ps->DataInf.dwScanFlag & SCANDEF_Inverse)
@@ -220,9 +216,9 @@ _LOC void MapSetupDither( pScanData ps )
*/
_LOC void MapAdjust( pScanData ps, int which )
{
- ULong i, tabLen;
- pULong pdw;
- double b, c, dw, tmp;
+ ULong i, tabLen, dw;
+ ULong *pdw;
+ long b, c, tmp;
DBG( DBG_LOW, "MapAdjust(%u)\n", which );
@@ -232,45 +228,42 @@ _LOC void MapAdjust( pScanData ps, int which )
tabLen = 256;
}
- /*
- * adjust brightness (b) and contrast (c) using the function:
- *
- * sī(x,y) = (s(x,y) + b) * c
+ /* adjust brightness (b) and contrast (c) using the function:
+ * s'(x,y) = (s(x,y) + b) * c
* b = [-127, 127]
* c = [0,2]
*/
- /*
- * scale brightness and contrast...
+ /* scale brightness and contrast...
*/
- b = ((double)ps->wBrightness * 192.0)/100.0;
- c = ((double)ps->wContrast + 100.0)/100.0;
+ b = ps->wBrightness * 192;
+ c = ps->wContrast + 100;
- DBG( DBG_LOW, "brightness = %i -> %i\n", ps->wBrightness, (UChar)b);
- DBG( DBG_LOW, "contrast*100 = %i -> %i\n", ps->wContrast, (int)(c*100));
+ DBG( DBG_LOW, "brightness = %i -> %i\n", ps->wBrightness, (UChar)(b/100));
+ DBG( DBG_LOW, "contrast*100 = %i -> %i\n", ps->wContrast, (int)(c));
for( i = 0; i < tabLen; i++ ) {
if((_MAP_MASTER == which) || (_MAP_RED == which)) {
- tmp = ((double)(ps->a_bMapTable[i] + b)) * c;
+ tmp = ((((long)ps->a_bMapTable[i] * 100) + b) *c ) / 10000;
if( tmp < 0 ) tmp = 0;
if( tmp > 255 ) tmp = 255;
- ps->a_bMapTable[i] = (UChar)tmp;
- }
+ ps->a_bMapTable[i] = (UChar)tmp;
+ }
if((_MAP_MASTER == which) || (_MAP_GREEN == which)) {
- tmp = ((double)(ps->a_bMapTable[tabLen+i] + b)) * c;
+ tmp = ((((long)ps->a_bMapTable[tabLen+i] * 100) + b) * c) / 10000;
if( tmp < 0 ) tmp = 0;
if( tmp > 255 ) tmp = 255;
ps->a_bMapTable[tabLen+i] = (UChar)tmp;
}
if((_MAP_MASTER == which) || (_MAP_BLUE == which)) {
- tmp = ((double)(ps->a_bMapTable[tabLen*2+i] + b)) * c;
+ tmp = ((((long)ps->a_bMapTable[tabLen*2+i] * 100) + b) * c) / 10000;
if( tmp < 0 ) tmp = 0;
if( tmp > 255 ) tmp = 255;
- ps->a_bMapTable[tabLen*2+i] = (UChar)tmp;
- }
+ ps->a_bMapTable[tabLen*2+i] = (UChar)tmp;
+ }
}
if( ps->DataInf.dwScanFlag & SCANDEF_Negative ) {
diff --git a/backend/plustek-pp_misc.c b/backend/plustek-pp_misc.c
index d1e460d6f..2e95f5be4 100644
--- a/backend/plustek-pp_misc.c
+++ b/backend/plustek-pp_misc.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_misc.c
* @brief here we have some helpful functions
*
@@ -36,6 +31,7 @@
* - changed include names
* - 0.43 - added LINUX_26 stuff
* - minor fixes
+ * - removed floating point stuff
* .
*
* This file is part of the SANE package.
@@ -471,12 +467,9 @@ _LOC int MiscReinitStruct( pScanData ps )
return _E_NULLPTR;
memset( ps, 0, sizeof(ScanData));
-
- /*
- * first init all constant stuff in ScanData
- */
- ps->sCaps.Version = ((_PTDRV_V1 << 8) | _PTDRV_V0);
+ /* first init all constant stuff in ScanData
+ */
ps->bCurrentSpeed = 1;
ps->pbMapRed = ps->a_bMapTable;
ps->pbMapGreen = &ps->a_bMapTable[256];
@@ -618,7 +611,7 @@ _LOC _INL void MiscStartTimer( pTimerDef timer , unsigned long us)
gettimeofday(&start_time, NULL);
#endif
- *timer = start_time.tv_sec * 1e6 + start_time.tv_usec + us;
+ *timer = start_time.tv_sec * 1000000 + start_time.tv_usec + us;
}
/** Checks if a timer has been expired or not. In Kernel-mode, the scheduler
@@ -637,7 +630,7 @@ _LOC _INL int MiscCheckTimer( pTimerDef timer )
gettimeofday(¤t_time, NULL);
#endif
- if (current_time.tv_sec * 1e6 + current_time.tv_usec > *timer) {
+ if (current_time.tv_sec * 1000000 + current_time.tv_usec > *timer) {
return _E_TIMEOUT;
} else {
#ifdef __KERNEL__
diff --git a/backend/plustek-pp_models.c b/backend/plustek-pp_models.c
index 9ec567ac0..55029db42 100644
--- a/backend/plustek-pp_models.c
+++ b/backend/plustek-pp_models.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_models.c
* @brief model specific stuff
*
@@ -38,6 +33,7 @@
* - 0.42 - added SFLAG_CUSTOM_GAMMA to capabilities
* - added _OVR_PRIMAX_4800D30 switch
* - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_motor.c b/backend/plustek-pp_motor.c
index 074a16c9b..fc8e0a867 100644
--- a/backend/plustek-pp_motor.c
+++ b/backend/plustek-pp_motor.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_motor.c
* @brief all functions for motor control
*
@@ -40,6 +35,7 @@
* - 0.40 - changed back to build 0.39-3 (disabled A3I stuff)
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_p12.c b/backend/plustek-pp_p12.c
index f703c3844..cf627d09b 100644
--- a/backend/plustek-pp_p12.c
+++ b/backend/plustek-pp_p12.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_p12.c
* @brief p12 and pt12 specific stuff
*
@@ -16,6 +11,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - removed setting of ps->sCaps.dwFlag in p12InitiateComponentModel()
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_p12ccd.c b/backend/plustek-pp_p12ccd.c
index 48a9890ee..178cb2e5e 100644
--- a/backend/plustek-pp_p12ccd.c
+++ b/backend/plustek-pp_p12ccd.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_p12ccd.c
* @brief here we have the whole code to intialize the CCD and DAC stuff
*
@@ -18,6 +13,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_p48xx.c b/backend/plustek-pp_p48xx.c
index 1f0233914..744b6f1c2 100644
--- a/backend/plustek-pp_p48xx.c
+++ b/backend/plustek-pp_p48xx.c
@@ -1,18 +1,12 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_p48xx.c
* @brief here we have all functionality according to the ASIC96001/3 based
* models.
- *.............................................................................
*
* based on sources acquired from Plustek Inc.
* Copyright (C) 1998 Plustek Inc.
* Copyright (C) 2000-2004 Gerhard Jaeger
* also based on the work done by Rick Bronson
- *.............................................................................
+ *
* History:
* - 0.30 - initial version
* - 0.31 - fixed a bug for the return value in p48xxDoTest
@@ -40,6 +34,7 @@
* - 0.40 - disabled A3I stuff
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_p9636.c b/backend/plustek-pp_p9636.c
index 358564dd5..0c3fcfd3e 100644
--- a/backend/plustek-pp_p9636.c
+++ b/backend/plustek-pp_p9636.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_p9636.c
* @brief here we have all functionality according to the p9636t
*
@@ -36,6 +31,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_procfs.c b/backend/plustek-pp_procfs.c
index 05dc75662..7c245c02d 100644
--- a/backend/plustek-pp_procfs.c
+++ b/backend/plustek-pp_procfs.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_procfs.c
* @brief this is the interface to the proc filesystem
*
@@ -15,6 +10,8 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - replace _PTDRV_VERx by _PTDRV_VERSTR
+ * - cleanup
* .
*
* This file is part of the SANE package.
@@ -66,15 +63,14 @@
/****************************** static vars **********************************/
-/*
- * for the proc filesystem
+/** for the proc filesystem
*/
extern struct proc_dir_entry proc_root;
static struct proc_dir_entry *base = NULL;
static struct proc_dir_entry *binfo = NULL;
static ULong devcount;
-/* parallel port modes... */
+/** parallel port modes... */
static char *procfsPortModes[] = {
"EPP",
"SPP",
@@ -84,7 +80,7 @@ static char *procfsPortModes[] = {
NULL
};
-/* CCD-Types (as for ASIC 98001 based series) */
+/** CCD-Types (as for ASIC 98001 based series) */
static TabDef procfsCCDTypes98001[] = {
{ _CCD_3797, "3797" },
@@ -96,7 +92,7 @@ static TabDef procfsCCDTypes98001[] = {
{ -1 , "unknown" }
};
-/* CCD-Types (as for ASIC 98003 based series) */
+/** CCD-Types (as for ASIC 98003 based series) */
static TabDef procfsCCDTypes98003[] = {
{ _CCD_3797, "3797" },
@@ -110,12 +106,10 @@ static TabDef procfsCCDTypes98003[] = {
{ -1 , "unknown" }
};
-
/****************************** local functions ******************************/
#ifndef LINUX_24
-/*.............................................................................
- * This is called as the fill_inode function when an inode
+/** This is called as the fill_inode function when an inode
* is going into (fill = 1) or out of service (fill = 0).
*
* Note: only the top-level directory needs to do this; if
@@ -128,8 +122,7 @@ static void procfsFillFunc( struct inode *inode, int fill )
}
#endif
-/*.............................................................................
- * returns a pointer to the port-mode string
+/** returns a pointer to the port-mode string
*/
static const char* procfsGetMode( int mode )
{
@@ -139,14 +132,13 @@ static const char* procfsGetMode( int mode )
return procfsPortModes[mode];
}
-/*.............................................................................
- * determines CCD-Type string
+/** determines CCD-Type string
*/
static const char* procfsGetCCDType( pScanData ps )
{
- int i;
- int ccd_id = ps->Device.bCCDID;
- pTabDef tab = procfsCCDTypes98001;
+ int i;
+ int ccd_id = ps->Device.bCCDID;
+ pTabDef tab = procfsCCDTypes98001;
if( _IS_ASIC98(ps->sCaps.AsicID)) {
@@ -168,33 +160,30 @@ static const char* procfsGetCCDType( pScanData ps )
return "NEC/TOSHIBA Type";
}
- /* return the last entry if nothing applies! */
- return tab[(sizeof(procfsCCDTypes98001)/sizeof(TabDef)-1)].desc;
+ /* return the last entry if nothing applies! */
+ return tab[(sizeof(procfsCCDTypes98001)/sizeof(TabDef)-1)].desc;
}
-/*.............................................................................
- * will be called when reading the proc filesystem:
+/** will be called when reading the proc filesystem:
* cat /proc/pt_drv/info
*/
static int procfsBInfoReadProc( char *buf, char **start, off_t offset,
- int count, int *eof, void *data )
+ int count, int *eof, void *data )
{
int len = 0;
- len += sprintf( buf, "Plustek Flatbed Scanner Driver version %d.%d-%d\n",
- _PTDRV_V1, _PTDRV_V0, _PTDRV_BUILD );
+ len += sprintf( buf, "Plustek Flatbed Scanner Driver version "_PTDRV_VERSTR"\n" );
len += sprintf( buf + len, "Devices : %lu\n", *((pULong)data) );
- len += sprintf( buf + len, "IOCTL-Version: 0x%08x\n", _PTDRV_IOCTL_VERSION );
+ len += sprintf( buf + len, "IOCTL-Version: 0x%08x\n",_PTDRV_IOCTL_VERSION);
return len;
}
-/*.............................................................................
- * will be called when reading the proc filesystem:
+/** will be called when reading the proc filesystem:
* cat /proc/pt_drv/deviceX/info
*/
static int procfsInfoReadProc( char *buf, char **start, off_t offset,
- int count, int *eof, void *data )
+ int count, int *eof, void *data )
{
int len = 0;
pScanData ps = (pScanData)data;
@@ -221,12 +210,11 @@ static int procfsInfoReadProc( char *buf, char **start, off_t offset,
return len;
}
-/*.............................................................................
- * will be called when reading the proc filesystem:
+/** will be called when reading the proc filesystem:
* cat /proc/pt_drv/devicex/buttony
*/
static int procfsButtonsReadProc( char *buf, char **start, off_t offset,
- int count, int *eof, void *data )
+ int count, int *eof, void *data )
{
Byte b;
int bc = 0;
@@ -236,7 +224,7 @@ static int procfsButtonsReadProc( char *buf, char **start, off_t offset,
if( NULL != ps ) {
bc = ps->Device.buttons;
}
-
+
/* Check the buttons... */
if( 0 != bc ) {
@@ -259,11 +247,10 @@ static int procfsButtonsReadProc( char *buf, char **start, off_t offset,
return len;
}
-/*.............................................................................
- * create a procfs entry
+/** create a procfs entry
*/
static struct proc_dir_entry *new_entry( const char *name, mode_t mode,
- struct proc_dir_entry *parent )
+ struct proc_dir_entry *parent )
{
#ifndef LINUX_24
int len;
@@ -310,11 +297,10 @@ static struct proc_dir_entry *new_entry( const char *name, mode_t mode,
return ent;
}
-/*.............................................................................
- * shutdown one proc fs entry
+/** shutdown one proc fs entry
*/
static inline void destroy_proc_entry( struct proc_dir_entry *root,
- struct proc_dir_entry **d )
+ struct proc_dir_entry **d )
{
#ifndef LINUX_24
proc_unregister( root, (*d)->low_ino );
@@ -328,8 +314,7 @@ static inline void destroy_proc_entry( struct proc_dir_entry *root,
*d = NULL;
}
-/*.............................................................................
- * shutdown the proc-tree for one device
+/** shutdown the proc-tree for one device
*/
static void destroy_proc_tree( pScanData ps )
{
@@ -357,8 +342,7 @@ static void destroy_proc_tree( pScanData ps )
/*************************** exported functions ******************************/
-/*.............................................................................
- * initialize our proc-fs stuff
+/** initialize our proc-fs stuff
*/
int ProcFsInitialize( void )
{
@@ -380,8 +364,7 @@ int ProcFsInitialize( void )
return _OK;
}
-/*.............................................................................
- * cleanup the base entry
+/** cleanup the base entry
*/
void ProcFsShutdown( void )
{
@@ -398,8 +381,7 @@ void ProcFsShutdown( void )
devcount = 0;
}
-/*.............................................................................
- * will be called for each device, that has been found
+/** will be called for each device, that has been found
*/
void ProcFsRegisterDevice( pScanData ps )
{
@@ -448,8 +430,7 @@ error_exit:
destroy_proc_tree( ps );
}
-/*.............................................................................
- * cleanup the proc-fs for a certain device
+/** cleanup the proc-fs for a certain device
*/
void ProcFsUnregisterDevice( pScanData ps )
{
@@ -477,6 +458,6 @@ void ProcFsUnregisterDevice( pScanData ps )
#endif
-#endif /* guard __KERNEL__ */
+#endif /* guard __KERNEL__ */
/* END PLUSTEK-PP_PROCFS.C ..................................................*/
diff --git a/backend/plustek-pp_procs.h b/backend/plustek-pp_procs.h
index e0f59e0b0..f6fd6fed0 100644
--- a/backend/plustek-pp_procs.h
+++ b/backend/plustek-pp_procs.h
@@ -1,15 +1,11 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_procs.h
- * here are the prototypes of all exported functions
- *.............................................................................
+/** @file plustek-pp_procs.h
+ * @brief here are the prototypes of all exported functions
*
* based on sources acquired from Plustek Inc.
* Copyright (C) 1998 Plustek Inc.
* Copyright (C) 2000-2004 Gerhard Jaeger
* also based on the work done by Rick Bronson
- *.............................................................................
+ *
* History:
* 0.30 - initial version
* 0.31 - no changes
@@ -32,6 +28,7 @@
* 0.40 - no changes
* 0.41 - no changes
* 0.42 - added MapAdjust
+ * 0.43 - no changes
* .
*
* This file is part of the SANE package.
@@ -249,8 +246,8 @@ _LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf );
* implementation in plustek-pp_procfs.c (Kernel-mode only)
*/
#ifdef __KERNEL__
-int ProcFsInitialize ( void );
-void ProcFsShutdown ( void );
+int ProcFsInitialize ( void );
+void ProcFsShutdown ( void );
void ProcFsRegisterDevice ( pScanData ps );
void ProcFsUnregisterDevice( pScanData ps );
#endif
diff --git a/backend/plustek-pp_ptdrv.c b/backend/plustek-pp_ptdrv.c
index 5beb7b91d..8b4d6fd7e 100644
--- a/backend/plustek-pp_ptdrv.c
+++ b/backend/plustek-pp_ptdrv.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_ptdrv.c
* @brief this is the driver interface
*
@@ -54,8 +49,9 @@
* - changed ioctl call to PutImage
* - 0.42 - added _PTDRV_SETMAP functionality
* - improved the cancel functionality
- * - added LINUX_26 stuff
+ * - 0.43 - added LINUX_26 stuff
* - changed include names
+ * - changed version string stuff
* .
*
* This file is part of the SANE package.
@@ -99,12 +95,13 @@
*/
#ifdef __KERNEL__
# include
+# include
# ifdef CONFIG_DEVFS_FS
-# ifdef LINUX_26
-# error "DEVFS not supported for this kernel-version"
-# endif
# include
+# if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,69))
+# define DEVFS_26_STYLE
+# endif
# endif
#endif
@@ -151,8 +148,8 @@ static UShort forceMode[_MAX_PTDEVS] = { 0, 0, 0, 0 };
#endif
-/* timers for warmup checks */
-static TimerDef toTimer[_MAX_PTDEVS];
+/* timers for warmup checks */
+static TimerDef toTimer[_MAX_PTDEVS];
#ifndef __KERNEL__
static Bool PtDrvInitialized = _FALSE;
@@ -167,8 +164,7 @@ static struct timer_list tl[_MAX_PTDEVS];
/* for calculation of the timer expiration */
extern volatile ULong jiffies;
-/*
- * the parameter interface
+/* the parameter interface
*/
#if ((LINUX_VERSION_CODE > 0x020111) && defined(MODULE))
MODULE_AUTHOR("Gerhard Jaeger ");
@@ -202,7 +198,7 @@ MODULE_PARM_DESC(forceMode, "0 = use auto detection, "
"1 = use SPP mode, 2 = use EPP mode");
#endif
-#ifdef CONFIG_DEVFS_FS
+#if (defined(CONFIG_DEVFS_FS) && !defined(DEVFS_26_STYLE))
static devfs_handle_t devfs_handle = NULL;
#endif
@@ -1328,7 +1324,7 @@ static int ptdrvRead( pScanData ps, pUChar buffer, int count )
}
/* if we have to do some scaling, we need another buffer... */
- if( ps->DataInf.XYRatio > 1.0 ) {
+ if( ps->DataInf.XYRatio > 1000 ) {
scaleBuf = _KALLOC( ps->DataInf.dwAppPhyBytesPerLine, GFP_KERNEL);
if ( NULL == scaleBuf ) {
@@ -1559,14 +1555,14 @@ int init_module( void )
UInt i;
int retval = _OK;
int result = _OK;
-#ifdef CONFIG_DEVFS_FS
+#if (defined(CONFIG_DEVFS_FS) && !defined(DEVFS_26_STYLE))
char controlname[24];
#endif
DBG( DBG_HIGH, "*********************************************\n" );
DBG( DBG_HIGH, "pt_drv: init_module()\n" );
-#ifdef CONFIG_DEVFS_FS
+#if (defined(CONFIG_DEVFS_FS) && !defined(DEVFS_26_STYLE))
devfs_handle = devfs_mk_dir(NULL, "scanner", NULL);
if( devfs_register_chrdev(_PTDRV_MAJOR, _DRV_NAME, &pt_drv_fops)) {
#else
@@ -1577,15 +1573,12 @@ int init_module( void )
_PTDRV_MAJOR);
return -EIO;
}
+ printk( KERN_INFO "pt_drv : driver version "_PTDRV_VERSTR"\n" );
- printk( KERN_INFO "pt_drv : driver version %d.%d-%d\n",
- _PTDRV_V1, _PTDRV_V0, _PTDRV_BUILD );
-
- /* register for proc_fs */
+ /* register the proc_fs */
ProcFsInitialize();
- /*
- * go through the list of defined ports and try to find a device
+ /* go through the list of defined ports and try to find a device
*/
devCount = 0;
for( i = 0; i < _MAX_PTDEVS; i++ ) {
@@ -1597,11 +1590,17 @@ int init_module( void )
PtDrvDevices[i]->flags |= _PTDRV_INITALIZED;
#ifdef CONFIG_DEVFS_FS
+# ifndef DEVFS_26_STYLE
sprintf( controlname, "scanner/pt_drv%d", devCount );
devfs_register( NULL, controlname,
DEVFS_FL_DEFAULT, _PTDRV_MAJOR, 0,
(S_IFCHR | S_IRUGO | S_IWUGO | S_IFCHR),
&pt_drv_fops, NULL );
+# else /* DEVFS_26_STYLE */
+ devfs_mk_cdev(MKDEV(_PTDRV_MAJOR, devCount),
+ (S_IFCHR | S_IRUGO | S_IWUGO | S_IFCHR),
+ "scanner/pt_drv%d", devCount);
+# endif
#endif
ProcFsRegisterDevice( PtDrvDevices[i] );
@@ -1619,7 +1618,7 @@ int init_module( void )
*/
if( devCount == 0 ) {
-#ifdef CONFIG_DEVFS_FS
+#if (defined(CONFIG_DEVFS_FS) && !defined(DEVFS_26_STYLE))
devfs_unregister_chrdev( _PTDRV_MAJOR, _DRV_NAME );
#else
unregister_chrdev( _PTDRV_MAJOR, _DRV_NAME );
@@ -1652,7 +1651,7 @@ void cleanup_module( void )
{
UInt i;
pScanData ps;
-#ifdef CONFIG_DEVFS_FS
+#if (defined(CONFIG_DEVFS_FS) && !defined(DEVFS_26_STYLE))
char controlname[24];
devfs_handle_t master;
#endif
@@ -1666,17 +1665,21 @@ void cleanup_module( void )
if ( NULL != ps ) {
#ifdef CONFIG_DEVFS_FS
+# ifndef DEVFS_26_STYLE
sprintf( controlname, "scanner/pt_drv%d", i );
master = devfs_find_handle( NULL,controlname, 0, 0,
DEVFS_SPECIAL_CHR, 0 );
devfs_unregister( master );
+# else
+ devfs_remove("scanner/pt_drv%d", i);
+# endif
#endif
ptdrvShutdown( ps );
ProcFsUnregisterDevice( ps );
}
}
-#ifdef CONFIG_DEVFS_FS
+#if (defined(CONFIG_DEVFS_FS) && !defined(DEVFS_26_STYLE))
devfs_unregister_chrdev( _PTDRV_MAJOR, _DRV_NAME );
#else
unregister_chrdev( _PTDRV_MAJOR, _DRV_NAME );
diff --git a/backend/plustek-pp_scale.c b/backend/plustek-pp_scale.c
index 0fd2b043f..295a5665c 100644
--- a/backend/plustek-pp_scale.c
+++ b/backend/plustek-pp_scale.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_scale.c
* @brief Scaling functionality
*
@@ -20,6 +15,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - cleanup, removed floating point stuff
* .
*
* This file is part of the SANE package.
@@ -81,35 +77,33 @@ _LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf )
#endif
/* scale... */
- izoom = (int)(1.0/ps->DataInf.XYRatio * 1000);
+ izoom = (int)(1000000/ps->DataInf.XYRatio);
switch( ps->DataInf.wAppDataType ) {
case COLOR_BW : step = 0; break;
case COLOR_HALFTONE: step = 0; break;
case COLOR_256GRAY : step = 1; break;
- case COLOR_TRUE24 : step = 3; break; /*NOTE: COLOR_TRUE32 is the same !*/
+ case COLOR_TRUE24 : step = 3; break; /*NOTE: COLOR_TRUE32 is the same !*/
case COLOR_TRUE48 : step = 6; break;
- default : step = 99; break;
+ default : step = 99; break;
}
- /*
- * when not supported, only copy the data
+ /* when not supported, only copy the data
*/
if( 99 == step ) {
memcpy( outBuf, inBuf, ps->DataInf.dwAppBytesPerLine );
return;
}
- /*
- * now scale...
+ /* now scale...
*/
+ ddax = 0;
+ x = 0;
if( 0 == step ) {
- /*
- * binary scaling
+
+ /* binary scaling
*/
- ddax = 0;
- x = 0;
memset( outBuf, 0, ps->DataInf.dwAppBytesPerLine );
for( i = 0; i < ps->DataInf.dwPhysBytesPerLine*8; i++ ) {
@@ -131,11 +125,8 @@ _LOC void ScaleX( pScanData ps, pUChar inBuf, pUChar outBuf )
} else {
- /*
- * color and gray scaling
+ /* color and gray scaling
*/
- ddax = 0;
- x = 0;
for( i = 0; i < ps->DataInf.dwPhysBytesPerLine*step; i+=step ) {
ddax -= 1000;
diff --git a/backend/plustek-pp_scan.h b/backend/plustek-pp_scan.h
index 9e3289abc..1fee02f39 100644
--- a/backend/plustek-pp_scan.h
+++ b/backend/plustek-pp_scan.h
@@ -1,11 +1,8 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_scan.h - the global header for the plustek driver
- *.............................................................................
+/* @file plustek-pp_scan.h
+ * @brief the global header for the plustek driver
*
* Copyright (C) 2000-2004 Gerhard Jaeger
- *.............................................................................
+ *
* History:
* 0.30 - initial version
* 0.31 - no changes
@@ -22,6 +19,7 @@
* 0.40 - no changes
* 0.41 - no changes
* 0.42 - changed include names
+ * 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_scandata.h b/backend/plustek-pp_scandata.h
index ead479cab..e03dc60be 100644
--- a/backend/plustek-pp_scandata.h
+++ b/backend/plustek-pp_scandata.h
@@ -1,9 +1,6 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_scandata.h - here we define the ScanData structure...
- * and a lot of register settings
- *.............................................................................
+/* @file plustek-pp_scandata.h
+ * @brief here we define the ScanData structure...
+ * and a lot of register settings
*
* based on sources acquired from Plustek Inc.
* Copyright (C) 1998 Plustek Inc.
@@ -14,39 +11,41 @@
* 0.30 - initial version
* 0.31 - no changes
* 0.32 - added fWarmupNeeded to struct ScanData
- * - removed function FillDataToColorTable from struct ScanData
- * - removed dwLampDelay from struct ScanData
+ * - removed function FillDataToColorTable from struct ScanData
+ * - removed dwLampDelay from struct ScanData
* 0.33 - cosmetic changes
- * - removed PositionLamp from structure
- * - added dwLastPortMode to struct ScanData
+ * - removed PositionLamp from structure
+ * - added dwLastPortMode to struct ScanData
* 0.34 - removed WaitBack() function from pScanData structure
- * removed wStayMaxStep from pScanData structure
+ * - removed wStayMaxStep from pScanData structure
* 0.35 - removed SetInitialGainRAM from pScanData structure
- * changed ModelStr list
+ * - changed ModelStr list
* 0.36 - added some defines for the ASIC 96001 (model 4800)
- * added wDither to DataInfo structure
- * removed dwPreferSize from struct ScannerCaps
- * cleanup
- * moved all stuff that is used by the backend and the driver
+ * - added wDither to DataInfo structure
+ * - removed dwPreferSize from struct ScannerCaps
+ * - cleanup
+ * - moved all stuff that is used by the backend and the driver
* to plustek-share.h which is in the backend directory
- * added ModelOverride parameter to struct
- * added strcut pardevice to struct
+ * - added ModelOverride parameter to struct
+ * - added strcut pardevice to struct
* 0.37 - added bIODelay for SPP/BIDI port operations
- * added ReadData to struct
- * added ProcDirDef
- * added ButtonCount
- * removed RegisterToScanner from struct
- * removed MaxDpiByInterpolation from struct
+ * - added ReadData to struct
+ * - added ProcDirDef
+ * - added ButtonCount
+ * - removed RegisterToScanner from struct
+ * - removed MaxDpiByInterpolation from struct
* 0.38 - added function PutToIdleMode() to struct
- * added function Calibration() to struct
- * changed interface of the ReInitAsic() function
- * major changes: moved a lot of stuff to hwdefs.h
- * added IO, Device, Shade, Scan and Bufs to struct
+ * - added function Calibration() to struct
+ * - changed interface of the ReInitAsic() function
+ * - major changes: moved a lot of stuff to hwdefs.h
+ * - added IO, Device, Shade, Scan and Bufs to struct
* 0.39 - added forceMode to struct
- * added f97003, b97003DarkR, b97003DarkB, b97003DarkG to struct
+ * - added f97003, b97003DarkR, b97003DarkB, b97003DarkG to struct
* 0.40 - no changes
* 0.41 - no changes
* 0.42 - no changes
+ * 0.43 - changed type of XYRatio from double to long
+ * - cleanup
* .
*
* This file is part of the SANE package.
@@ -127,10 +126,9 @@ typedef struct {
short siBrightness;
-/*
- * CHANGE added these vars for scaling
+/* CHANGE added these vars for scaling
*/
- double XYRatio;
+ long XYRatio;
ULong dwPhysBytesPerLine;
/*
diff --git a/backend/plustek-pp_sysdep.h b/backend/plustek-pp_sysdep.h
index c4b91263a..6a0d3ce7e 100644
--- a/backend/plustek-pp_sysdep.h
+++ b/backend/plustek-pp_sysdep.h
@@ -1,13 +1,9 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_sysdep.h
- * a trial to centralize changes between the different
- * kernel-versions some stuff is maybe not relevant, but anyway...
- *.............................................................................
+/* @file plustek-pp_sysdep.h
+ * @brief a trial to centralize changes between the different
+ * kernel-versions some stuff is maybe not relevant, but anyway...
*
* Copyright (C) 2000-2004 Gerhard Jaeger
- *.............................................................................
+ *
* History:
* 0.30 - initial version
* 0.38 - added this header
@@ -17,6 +13,7 @@
* 0.42 - added _GET_TIME
* - added LINUX_26 for new kernel
* - added _MINOR
+ * 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_tpa.c b/backend/plustek-pp_tpa.c
index bef254f82..7d67b7a24 100644
--- a/backend/plustek-pp_tpa.c
+++ b/backend/plustek-pp_tpa.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/* @file plustek-pp_tpa.c
* @brief Here we find some adjustments according to the scan source.
* This file is ASIC P9800x specific
@@ -27,6 +22,7 @@
* - 0.40 - no changes
* - 0.41 - no changes
* - 0.42 - changed include names
+ * - 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_types.h b/backend/plustek-pp_types.h
index a01d47b8d..b94dfc221 100644
--- a/backend/plustek-pp_types.h
+++ b/backend/plustek-pp_types.h
@@ -1,11 +1,8 @@
-/*.............................................................................
- * Project : linux driver for Plustek parallel-port scanners
- *.............................................................................
- * File: plustek-pp_types.h - some typedefs and error codes
- *.............................................................................
+/* @file plustek-pp_types.h
+ * @brief some typedefs and error codes
*
* Copyright (C) 2000-2004 Gerhard Jaeger
- *.............................................................................
+ *
* History:
* 0.30 - initial version
* 0.31 - no changes
@@ -26,6 +23,7 @@
* 0.40 - moved _VAR_NOT_USED and TabDef to plustek-share.h
* 0.41 - no changes
* 0.42 - moved errorcodes to plustek-share.h
+ * 0.43 - no changes
* .
*
* This file is part of the SANE package.
diff --git a/backend/plustek-pp_wrapper.c b/backend/plustek-pp_wrapper.c
index 2d2437422..7a940051d 100644
--- a/backend/plustek-pp_wrapper.c
+++ b/backend/plustek-pp_wrapper.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek flatbed scanners.
- *.............................................................................
- */
-
/** @file plustek-pp_wrapper.c
* @brief The interface to the parport driver-code and the kernel module.
*
@@ -14,10 +9,8 @@
* - 0.41 - added _PTDRV_ADJUST call
* - 0.42 - added setmap function
* - fixed the stopscan problem, that causes a crash in the kernel module
- * - 0.43 - no changes
- * - 0.44 - added initialized setting
- * - 0.45 - no changes
- * - 0.46 - cleanup
+ * - 0.43 - added initialized setting
+ * - cleanup
* .
*
* This file is part of the SANE package.
@@ -314,7 +307,7 @@ static int ppDev_setMap( Plustek_Device *dev, SANE_Word *map,
if( map[i] > 0xFF )
buf[i] = 0xFF;
- }
+ }
m.map = buf;
@@ -349,7 +342,7 @@ static int ppDev_stopScan( Plustek_Device *dev, int *mode )
else
ioctl( dev->fd, _PTDRV_CLOSE_DEVICE, 0);
}else
- sleep( 1 );
+ sleep( 1 );
return retval;
}
diff --git a/backend/plustek_pp.c b/backend/plustek_pp.c
index 6d82b09de..29dfe9d4e 100644
--- a/backend/plustek_pp.c
+++ b/backend/plustek_pp.c
@@ -1,8 +1,3 @@
-/*.............................................................................
- * Project : SANE library for Plustek parallelport flatbed scanners.
- *.............................................................................
- */
-
/** @file plustek_pp.c
* @brief SANE backend for Plustek parallelport scanner
*
@@ -15,6 +10,7 @@
*
* History:
* - 0.01 - initial version, imported from the kernel-module 0.42-11
+ * - 0.43 - bumped up version to reflect the former module code version
*.
*
* This file is part of the SANE package.
@@ -62,7 +58,7 @@
*/
#ifdef _AIX
-# include "../include/lalloca.h" /* MUST come first for AIX! */
+# include "../include/lalloca.h" /* MUST come first for AIX! */
#endif
#include "../include/sane/config.h"
@@ -87,7 +83,7 @@
#include "../include/sane/sanei.h"
#include "../include/sane/saneopts.h"
-#define BACKEND_VERSION "0.01-9"
+#define BACKEND_VERSION "0.43-4"
#define BACKEND_NAME plustek_pp
#include "../include/sane/sanei_backend.h"
#include "../include/sane/sanei_config.h"
@@ -123,10 +119,6 @@ MODELSTR;
# define DEBUG
#endif
-/* needed to statisfy the module code ... */
-#define _PTDRV_V0 0
-#define _PTDRV_V1 44
-
/* I know this is in general no good idea, but it works */
# include "plustek-pp_io.c"
# include "plustek-pp_dac.c"
@@ -628,14 +620,14 @@ static SANE_Status initGammaSettings( Plustek_Scanner *s )
static void checkGammaSettings( Plustek_Scanner *s )
{
int i, j;
-
- for( i = 0; i < 4 ; i++ ) {
+
+ for( i = 0; i < 4 ; i++ ) {
for( j = 0; j < s->gamma_length; j++ ) {
if( s->gamma_table[i][j] > s->gamma_range.max ) {
s->gamma_table[i][j] = s->gamma_range.max;
}
- }
- }
+ }
+ }
}
/** initialize the options for the backend according to the device we have
@@ -649,7 +641,7 @@ static SANE_Status init_options( Plustek_Scanner *s )
for( i = 0; i < NUM_OPTIONS; ++i ) {
s->opt[i].size = sizeof (SANE_Word);
s->opt[i].cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
- }
+ }
s->opt[OPT_NUM_OPTS].name = SANE_NAME_NUM_OPTIONS;
s->opt[OPT_NUM_OPTS].title = SANE_TITLE_NUM_OPTIONS;
@@ -676,12 +668,12 @@ static SANE_Status init_options( Plustek_Scanner *s )
s->opt[OPT_MODE].constraint_type = SANE_CONSTRAINT_STRING_LIST;
if((_ASIC_IS_98001 == s->hw->caps.AsicID) ||
- (_ASIC_IS_98003 == s->hw->caps.AsicID)) {
+ (_ASIC_IS_98003 == s->hw->caps.AsicID)) {
s->opt[OPT_MODE].constraint.string_list = mode_9800x_list;
} else {
s->opt[OPT_MODE].constraint.string_list = mode_list;
}
- s->val[OPT_MODE].w = 3; /* Color */
+ s->val[OPT_MODE].w = 3; /* Color */
/* scan source */
s->opt[OPT_EXT_MODE].name = SANE_NAME_SCAN_SOURCE;
@@ -1066,23 +1058,20 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf,
DBG( _DBG_ERROR, "failed to find Plustek scanner\n" );
dev->close(dev);
return SANE_STATUS_INVAL;
- }
+ }
/* save the info we got from the driver */
DBG( _DBG_INFO, "Scanner information:\n" );
if( dev->caps.Model < MODEL_UNKNOWN ) {
-
- dev->sane.model = ModelStr[dev->caps.Model];
- } else {
-
- dev->sane.model = ModelStr[0];
- }
-
- DBG( _DBG_INFO, "Vendor : %s\n", dev->sane.vendor );
- DBG( _DBG_INFO, "Model : %s\n", dev->sane.model );
+ dev->sane.model = ModelStr[dev->caps.Model];
+ } else {
+ dev->sane.model = ModelStr[0];
+ }
+
+ DBG( _DBG_INFO, "Vendor : %s\n", dev->sane.vendor );
+ DBG( _DBG_INFO, "Model : %s\n", dev->sane.model );
DBG( _DBG_INFO, "Asic : 0x%02x\n", dev->caps.AsicID );
DBG( _DBG_INFO, "Flags : 0x%08lx\n", dev->caps.dwFlag );
- DBG( _DBG_INFO, "Version: 0x%08x\n", dev->caps.Version );
dev->max_x = dev->caps.wMaxExtentX*MM_PER_INCH/_MEASURE_BASE;
dev->max_y = dev->caps.wMaxExtentY*MM_PER_INCH/_MEASURE_BASE;
@@ -1096,7 +1085,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf,
return SANE_STATUS_INVAL;
}
- /* build up the resolution table */
+ /* build up the resolution table */
dev->res_list_size = 0;
for( cntr = _DEF_DPI; cntr <= lens.rDpiX.wMax; cntr += 25 ) {
dev->res_list_size++;
@@ -1115,7 +1104,7 @@ static SANE_Status attach( const char *dev_name, pCnfDef cnf,
first_dev = dev;
if (devp)
- *devp = dev;
+ *devp = dev;
return SANE_STATUS_GOOD;
}