mustek_usb2: Replace STATUS type with SANE_Status

In some cases, a return value with type SANE_Status was assigned to a
variable with type STATUS. It is easiest to remove the redundant type
here.
escl-add-user-and-password
David Ward 2022-03-02 21:16:47 -05:00
rodzic f71b32c632
commit a519a3529a
6 zmienionych plików z 335 dodań i 348 usunięć

Wyświetl plik

@ -1165,12 +1165,12 @@ IsTAConnected ()
DBG (DBG_FUNC, "StopScan: start\n"); DBG (DBG_FUNC, "StopScan: start\n");
if (Asic_Open (&g_chip, g_pDeviceFile) != STATUS_GOOD) if (Asic_Open (&g_chip, g_pDeviceFile) != SANE_STATUS_GOOD)
{ {
return FALSE; return FALSE;
} }
if (Asic_IsTAConnected (&g_chip, &hasTA) != STATUS_GOOD) if (Asic_IsTAConnected (&g_chip, &hasTA) != SANE_STATUS_GOOD)
{ {
Asic_Close (&g_chip); Asic_Close (&g_chip);
return FALSE; return FALSE;
@ -1199,16 +1199,16 @@ static SANE_Bool
GetKeyStatus (SANE_Byte * pKey) GetKeyStatus (SANE_Byte * pKey)
{ {
SANE_Byte pKeyTemp = 0x00; SANE_Byte pKeyTemp = 0x00;
STATUS status = Asic_CheckFunctionKey (&g_chip, &pKeyTemp); SANE_Status status = Asic_CheckFunctionKey (&g_chip, &pKeyTemp);
DBG (DBG_FUNC, "GetKeyStatus: start\n"); DBG (DBG_FUNC, "GetKeyStatus: start\n");
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_ERR, "GetKeyStatus: Asic_Open is fail\n"); DBG (DBG_ERR, "GetKeyStatus: Asic_Open is fail\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != status) if (SANE_STATUS_GOOD != status)
{ {
DBG (DBG_ERR, "GetKeyStatus: Asic_CheckFunctionKey is fail\n"); DBG (DBG_ERR, "GetKeyStatus: Asic_CheckFunctionKey is fail\n");
return FALSE; return FALSE;
@ -1236,7 +1236,7 @@ GetKeyStatus (SANE_Byte * pKey)
*pKey = 0x05; /*Panel key pressed */ *pKey = 0x05; /*Panel key pressed */
} }
if (STATUS_GOOD != Asic_Close (&g_chip)) if (SANE_STATUS_GOOD != Asic_Close (&g_chip))
{ {
DBG (DBG_ERR, "GetKeyStatus: Asic_Close is fail\n"); DBG (DBG_ERR, "GetKeyStatus: Asic_Close is fail\n");
return FALSE; return FALSE;

Wyświetl plik

@ -256,19 +256,6 @@ typedef struct
} }
Asic, *PAsic; Asic, *PAsic;
typedef enum
{
STATUS_GOOD = 0,
STATUS_CANCELLED,
STATUS_EOF,
STATUS_DEVICE_BUSY,
STATUS_INVAL,
STATUS_MEM_ERROR,
STATUS_IO_ERROR,
STATUS_ACCESS_ERROR
}
STATUS;
/* For ScanObj */ /* For ScanObj */
typedef struct Point typedef struct Point
@ -1211,107 +1198,107 @@ RGBColor;
#define ES01_2CF_VALID_PIXEL_PARAMETER_OF_SEGMENT16 0x2CF #define ES01_2CF_VALID_PIXEL_PARAMETER_OF_SEGMENT16 0x2CF
/* forward declarations */ /* forward declarations */
static STATUS OpenScanChip (PAsic chip); static SANE_Status OpenScanChip (PAsic chip);
static STATUS CloseScanChip (PAsic chip); static SANE_Status CloseScanChip (PAsic chip);
static STATUS SafeInitialChip (PAsic chip); static SANE_Status SafeInitialChip (PAsic chip);
static STATUS DRAM_Test (PAsic chip); static SANE_Status DRAM_Test (PAsic chip);
#if SANE_UNUSED #if SANE_UNUSED
static STATUS SetPowerSave (PAsic chip); static SANE_Status SetPowerSave (PAsic chip);
#endif #endif
static STATUS SetLineTimeAndExposure (PAsic chip); static SANE_Status SetLineTimeAndExposure (PAsic chip);
static STATUS CCDTiming (PAsic chip); static SANE_Status CCDTiming (PAsic chip);
static STATUS IsCarriageHome (PAsic chip, SANE_Bool * LampHome, SANE_Bool * TAHome); static SANE_Status IsCarriageHome (PAsic chip, SANE_Bool * LampHome, SANE_Bool * TAHome);
static STATUS InitTiming (PAsic chip); static SANE_Status InitTiming (PAsic chip);
static STATUS GetChipStatus (PAsic chip, SANE_Byte Selector, SANE_Byte * ChipStatus); static SANE_Status GetChipStatus (PAsic chip, SANE_Byte Selector, SANE_Byte * ChipStatus);
static STATUS SetAFEGainOffset (PAsic chip); static SANE_Status SetAFEGainOffset (PAsic chip);
static STATUS SetLEDTime (PAsic chip); static SANE_Status SetLEDTime (PAsic chip);
static STATUS SetScanMode (PAsic chip, SANE_Byte bScanBits); static SANE_Status SetScanMode (PAsic chip, SANE_Byte bScanBits);
static STATUS SetPackAddress (PAsic chip, unsigned short wXResolution, static SANE_Status SetPackAddress (PAsic chip, unsigned short wXResolution,
unsigned short wWidth, unsigned short wX, double XRatioAdderDouble, unsigned short wWidth, unsigned short wX, double XRatioAdderDouble,
double XRatioTypeDouble, double XRatioTypeDouble,
SANE_Byte byClear_Pulse_Width, SANE_Byte byClear_Pulse_Width,
unsigned short * PValidPixelNumber); unsigned short * PValidPixelNumber);
static STATUS SetExtraSetting (PAsic chip, unsigned short wXResolution, static SANE_Status SetExtraSetting (PAsic chip, unsigned short wXResolution,
unsigned short wCCD_PixelNumber, SANE_Bool isCaribrate); unsigned short wCCD_PixelNumber, SANE_Bool isCaribrate);
/* Forward declarations */ /* Forward declarations */
static STATUS Mustek_SendData (PAsic chip, unsigned short reg, SANE_Byte data); static SANE_Status Mustek_SendData (PAsic chip, unsigned short reg, SANE_Byte data);
static STATUS Mustek_SendData2Byte (PAsic chip, unsigned short reg, SANE_Byte data); static SANE_Status Mustek_SendData2Byte (PAsic chip, unsigned short reg, SANE_Byte data);
static STATUS Mustek_ReceiveData (PAsic chip, SANE_Byte * reg); static SANE_Status Mustek_ReceiveData (PAsic chip, SANE_Byte * reg);
static STATUS Mustek_WriteAddressLineForRegister (PAsic chip, SANE_Byte x); static SANE_Status Mustek_WriteAddressLineForRegister (PAsic chip, SANE_Byte x);
static STATUS WriteIOControl (PAsic chip, unsigned short wValue, unsigned short wIndex, static SANE_Status WriteIOControl (PAsic chip, unsigned short wValue, unsigned short wIndex,
unsigned short wLength, SANE_Byte * lpbuf); unsigned short wLength, SANE_Byte * lpbuf);
static STATUS ReadIOControl (PAsic chip, unsigned short wValue, unsigned short wIndex, static SANE_Status ReadIOControl (PAsic chip, unsigned short wValue, unsigned short wIndex,
unsigned short wLength, SANE_Byte * lpbuf); unsigned short wLength, SANE_Byte * lpbuf);
static STATUS Mustek_DMARead (PAsic chip, unsigned int size, SANE_Byte * lpdata); static SANE_Status Mustek_DMARead (PAsic chip, unsigned int size, SANE_Byte * lpdata);
static STATUS Mustek_DMAWrite (PAsic chip, unsigned int size, SANE_Byte * lpdata); static SANE_Status Mustek_DMAWrite (PAsic chip, unsigned int size, SANE_Byte * lpdata);
static STATUS Mustek_ClearFIFO (PAsic chip); static SANE_Status Mustek_ClearFIFO (PAsic chip);
static STATUS SetRWSize (PAsic chip, SANE_Byte ReadWrite, unsigned int size); static SANE_Status SetRWSize (PAsic chip, SANE_Byte ReadWrite, unsigned int size);
/* Open Scanner by Scanner Name and return Chip Information */ /* Open Scanner by Scanner Name and return Chip Information */
static STATUS Asic_Open (PAsic chip, SANE_Byte *pDeviceName); static SANE_Status Asic_Open (PAsic chip, SANE_Byte *pDeviceName);
/* Close Scanner */ /* Close Scanner */
static STATUS Asic_Close (PAsic chip); static SANE_Status Asic_Close (PAsic chip);
#if SANE_UNUSED #if SANE_UNUSED
/* Release Scanner Resource */ /* Release Scanner Resource */
static STATUS Asic_Release (PAsic chip); static SANE_Status Asic_Release (PAsic chip);
#endif #endif
/* Initialize Scanner Parameters */ /* Initialize Scanner Parameters */
static STATUS Asic_Initialize (PAsic chip); static SANE_Status Asic_Initialize (PAsic chip);
/* Set Scan Window */ /* Set Scan Window */
static STATUS Asic_SetWindow (PAsic chip, SANE_Byte bScanBits, static SANE_Status Asic_SetWindow (PAsic chip, SANE_Byte bScanBits,
unsigned short wXResolution, unsigned short wYResolution, unsigned short wXResolution, unsigned short wYResolution,
unsigned short wX, unsigned short wY, unsigned short wWidth, unsigned short wLength); unsigned short wX, unsigned short wY, unsigned short wWidth, unsigned short wLength);
/* Turn Lamp ON or OFF */ /* Turn Lamp ON or OFF */
static STATUS Asic_TurnLamp (PAsic chip, SANE_Bool isLampOn); static SANE_Status Asic_TurnLamp (PAsic chip, SANE_Bool isLampOn);
/* Turn TA ON or OFF */ /* Turn TA ON or OFF */
static STATUS Asic_TurnTA (PAsic chip, SANE_Bool isTAOn); static SANE_Status Asic_TurnTA (PAsic chip, SANE_Bool isTAOn);
/* Reset some parameter of asic */ /* Reset some parameter of asic */
static STATUS Asic_Reset (PAsic chip); static SANE_Status Asic_Reset (PAsic chip);
/* Set scan source */ /* Set scan source */
static STATUS Asic_SetSource (PAsic chip, LIGHTSOURCE lsLightSource); static SANE_Status Asic_SetSource (PAsic chip, LIGHTSOURCE lsLightSource);
/* Start scanner to scan */ /* Start scanner to scan */
static STATUS Asic_ScanStart (PAsic chip); static SANE_Status Asic_ScanStart (PAsic chip);
/* Stop scanner to scan */ /* Stop scanner to scan */
static STATUS Asic_ScanStop (PAsic chip); static SANE_Status Asic_ScanStop (PAsic chip);
/* Read One Scan Line When Scanning */ /* Read One Scan Line When Scanning */
static STATUS Asic_ReadImage (PAsic chip, SANE_Byte * pBuffer, unsigned short LinesCount); static SANE_Status Asic_ReadImage (PAsic chip, SANE_Byte * pBuffer, unsigned short LinesCount);
#if SANE_UNUSED #if SANE_UNUSED
/* To Check Hard Key */ /* To Check Hard Key */
static STATUS Asic_CheckFunctionKey (PAsic chip, SANE_Byte * key); static SANE_Status Asic_CheckFunctionKey (PAsic chip, SANE_Byte * key);
#endif #endif
/* To Check if TA id connected */ /* To Check if TA id connected */
static STATUS Asic_IsTAConnected (PAsic chip, SANE_Bool *hasTA); static SANE_Status Asic_IsTAConnected (PAsic chip, SANE_Bool *hasTA);
#if SANE_UNUSED #if SANE_UNUSED
/* Download GammaTable to Scanner */ /* Download GammaTable to Scanner */
static STATUS Asic_DownloadGammaTable (PAsic chip, void * lpBuffer); static SANE_Status Asic_DownloadGammaTable (PAsic chip, void * lpBuffer);
#endif #endif
/* For AdjustAD Calculate Scanner*/ /* For AdjustAD Calculate Scanner*/
static STATUS Asic_ReadCalibrationData (PAsic chip, void * pBuffer, static SANE_Status Asic_ReadCalibrationData (PAsic chip, void * pBuffer,
unsigned int dwXferBytes, SANE_Byte bScanBits); unsigned int dwXferBytes, SANE_Byte bScanBits);
/* Set motor move or not */ /* Set motor move or not */
static STATUS Asic_SetMotorType (PAsic chip, SANE_Bool isMotorMove, SANE_Bool isUniformSpeed); static SANE_Status Asic_SetMotorType (PAsic chip, SANE_Bool isMotorMove, SANE_Bool isUniformSpeed);
/* Move Motor Forward or Backward */ /* Move Motor Forward or Backward */
static STATUS Asic_MotorMove (PAsic chip, SANE_Bool isForward, unsigned int dwTotalSteps); static SANE_Status Asic_MotorMove (PAsic chip, SANE_Bool isForward, unsigned int dwTotalSteps);
/* Move Motor to Home. */ /* Move Motor to Home. */
/* If isTA is TRUE, move TA to home, else move Lamp to home */ /* If isTA is TRUE, move TA to home, else move Lamp to home */
static STATUS Asic_CarriageHome (PAsic chip, SANE_Bool isTA); static SANE_Status Asic_CarriageHome (PAsic chip, SANE_Bool isTA);
/* For ShadingTable */ /* For ShadingTable */
static STATUS Asic_SetShadingTable (PAsic chip, unsigned short * lpWhiteShading, static SANE_Status Asic_SetShadingTable (PAsic chip, unsigned short * lpWhiteShading,
unsigned short * lpDarkShading, unsigned short * lpDarkShading,
unsigned short wXResolution, unsigned short wWidth, unsigned short wX); unsigned short wXResolution, unsigned short wWidth, unsigned short wX);
/* Wait motor move to home. isTA no used */ /* Wait motor move to home. isTA no used */
static STATUS Asic_WaitCarriageHome (PAsic chip, SANE_Bool isTA); static SANE_Status Asic_WaitCarriageHome (PAsic chip, SANE_Bool isTA);
/* Wait until asic idle */ /* Wait until asic idle */
static STATUS Asic_WaitUnitReady (PAsic chip); static SANE_Status Asic_WaitUnitReady (PAsic chip);
/* Set Scan Parameter to Scanner */ /* Set Scan Parameter to Scanner */
static STATUS Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution, static SANE_Status Asic_SetCalibrate (PAsic chip, SANE_Byte bScanBits, unsigned short wXResolution,
unsigned short wYResolution, unsigned short wX, unsigned short wY, unsigned short wYResolution, unsigned short wX, unsigned short wY,
unsigned short wWidth, unsigned short wLength, SANE_Bool isShading); unsigned short wWidth, unsigned short wLength, SANE_Bool isShading);
/* Set AFE Parameter to Scanner */ /* Set AFE Parameter to Scanner */
static STATUS Asic_SetAFEGainOffset (PAsic chip); static SANE_Status Asic_SetAFEGainOffset (PAsic chip);
/* ---------------------- asic motor defines -------------------------- */ /* ---------------------- asic motor defines -------------------------- */
@ -1393,27 +1380,27 @@ typedef struct tagLLF_MOTORMOVE
unsigned short wScanBackHomeExtSteps; unsigned short wScanBackHomeExtSteps;
} LLF_MOTORMOVE; } LLF_MOTORMOVE;
static STATUS CalculateMotorTable (LLF_CALCULATEMOTORTABLE * static SANE_Status CalculateMotorTable (LLF_CALCULATEMOTORTABLE *
lpCalculateMotorTable, unsigned short wYResolution); lpCalculateMotorTable, unsigned short wYResolution);
static STATUS LLFCalculateMotorTable (LLF_CALCULATEMOTORTABLE * static SANE_Status LLFCalculateMotorTable (LLF_CALCULATEMOTORTABLE *
lpCalculateMotorTable); lpCalculateMotorTable);
static STATUS LLFSetMotorCurrentAndPhase (PAsic chip, static SANE_Status LLFSetMotorCurrentAndPhase (PAsic chip,
LLF_MOTOR_CURRENT_AND_PHASE * LLF_MOTOR_CURRENT_AND_PHASE *
MotorCurrentAndPhase); MotorCurrentAndPhase);
static STATUS SetMotorStepTable (PAsic chip, LLF_MOTORMOVE * MotorStepsTable, static SANE_Status SetMotorStepTable (PAsic chip, LLF_MOTORMOVE * MotorStepsTable,
unsigned short wStartY, unsigned int dwScanImageSteps, unsigned short wStartY, unsigned int dwScanImageSteps,
unsigned short wYResolution); unsigned short wYResolution);
static STATUS LLFSetMotorTable (PAsic chip, static SANE_Status LLFSetMotorTable (PAsic chip,
LLF_SETMOTORTABLE * LLF_SetMotorTable); LLF_SETMOTORTABLE * LLF_SetMotorTable);
static STATUS SetMotorCurrent (PAsic chip, unsigned short dwMotorSpeed, static SANE_Status SetMotorCurrent (PAsic chip, unsigned short dwMotorSpeed,
LLF_MOTOR_CURRENT_AND_PHASE * CurrentPhase); LLF_MOTOR_CURRENT_AND_PHASE * CurrentPhase);
static STATUS LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove); static SANE_Status LLFMotorMove (PAsic chip, LLF_MOTORMOVE * LLF_MotorMove);
#if SANE_UNUSED #if SANE_UNUSED
static STATUS LLFStopMotorMove (PAsic chip); static SANE_Status LLFStopMotorMove (PAsic chip);
#endif #endif
static STATUS LLFSetRamAddress (PAsic chip, unsigned int dwStartAddr, static SANE_Status LLFSetRamAddress (PAsic chip, unsigned int dwStartAddr,
unsigned int dwEndAddr, SANE_Byte byAccessTarget); unsigned int dwEndAddr, SANE_Byte byAccessTarget);
static STATUS LLFRamAccess (PAsic chip, LLF_RAMACCESS * RamAccess); static SANE_Status LLFRamAccess (PAsic chip, LLF_RAMACCESS * RamAccess);
static STATUS MotorBackHome (PAsic chip, SANE_Byte WaitOrNoWait); static SANE_Status MotorBackHome (PAsic chip, SANE_Byte WaitOrNoWait);
#endif #endif

Wyświetl plik

@ -204,13 +204,13 @@ MustScanner_Init ()
DBG (DBG_FUNC, "MustScanner_Init: Call in\n"); DBG (DBG_FUNC, "MustScanner_Init: Call in\n");
g_chip.firmwarestate = FS_NULL; g_chip.firmwarestate = FS_NULL;
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "MustScanner_Init: Asic_Open return error\n"); DBG (DBG_FUNC, "MustScanner_Init: Asic_Open return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Initialize (&g_chip)) if (SANE_STATUS_GOOD != Asic_Initialize (&g_chip))
{ {
DBG (DBG_FUNC, "MustScanner_Init: Asic_Initialize return error\n"); DBG (DBG_FUNC, "MustScanner_Init: Asic_Initialize return error\n");
return FALSE; return FALSE;
@ -263,7 +263,7 @@ static SANE_Bool
MustScanner_GetScannerState () MustScanner_GetScannerState ()
{ {
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "MustScanner_GetScannerState: Asic_Open return error\n"); DBG (DBG_FUNC, "MustScanner_GetScannerState: Asic_Open return error\n");
return FALSE; return FALSE;
@ -293,20 +293,20 @@ MustScanner_PowerControl (SANE_Bool isLampOn, SANE_Bool isTALampOn)
{ {
SANE_Bool hasTA; SANE_Bool hasTA;
DBG (DBG_FUNC, "MustScanner_PowerControl: Call in\n"); DBG (DBG_FUNC, "MustScanner_PowerControl: Call in\n");
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "MustScanner_PowerControl: Asic_Open return error\n"); DBG (DBG_FUNC, "MustScanner_PowerControl: Asic_Open return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_TurnLamp (&g_chip, isLampOn)) if (SANE_STATUS_GOOD != Asic_TurnLamp (&g_chip, isLampOn))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_PowerControl: Asic_TurnLamp return error\n"); "MustScanner_PowerControl: Asic_TurnLamp return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_IsTAConnected (&g_chip, &hasTA)) if (SANE_STATUS_GOOD != Asic_IsTAConnected (&g_chip, &hasTA))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_PowerControl: Asic_IsTAConnected return error\n"); "MustScanner_PowerControl: Asic_IsTAConnected return error\n");
@ -315,7 +315,7 @@ MustScanner_PowerControl (SANE_Bool isLampOn, SANE_Bool isTALampOn)
if (hasTA) if (hasTA)
{ {
if (STATUS_GOOD != Asic_TurnTA (&g_chip, isTALampOn)) if (SANE_STATUS_GOOD != Asic_TurnTA (&g_chip, isTALampOn))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_PowerControl: Asic_TurnTA return error\n"); "MustScanner_PowerControl: Asic_TurnTA return error\n");
@ -347,20 +347,20 @@ MustScanner_BackHome ()
{ {
DBG (DBG_FUNC, "MustScanner_BackHome: call in \n"); DBG (DBG_FUNC, "MustScanner_BackHome: call in \n");
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "MustScanner_BackHome: Asic_Open return error\n"); DBG (DBG_FUNC, "MustScanner_BackHome: Asic_Open return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_CarriageHome (&g_chip, FALSE)) if (SANE_STATUS_GOOD != Asic_CarriageHome (&g_chip, FALSE))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_BackHome: Asic_CarriageHome return error\n"); "MustScanner_BackHome: Asic_CarriageHome return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_WaitUnitReady (&g_chip)) if (SANE_STATUS_GOOD != Asic_WaitUnitReady (&g_chip))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_BackHome: Asic_WaitUnitReady return error\n"); "MustScanner_BackHome: Asic_WaitUnitReady return error\n");
@ -390,14 +390,14 @@ MustScanner_Prepare (SANE_Byte bScanSource)
{ {
DBG (DBG_FUNC, "MustScanner_Prepare: call in\n"); DBG (DBG_FUNC, "MustScanner_Prepare: call in\n");
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "MustScanner_Prepare: Asic_Open return error\n"); DBG (DBG_FUNC, "MustScanner_Prepare: Asic_Open return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_WaitUnitReady (&g_chip)) if (SANE_STATUS_GOOD != Asic_WaitUnitReady (&g_chip))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_Prepare: Asic_WaitUnitReady return error\n"); "MustScanner_Prepare: Asic_WaitUnitReady return error\n");
@ -407,13 +407,13 @@ MustScanner_Prepare (SANE_Byte bScanSource)
if (SS_Reflective == bScanSource) if (SS_Reflective == bScanSource)
{ {
DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Reflective\n"); DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Reflective\n");
if (STATUS_GOOD != Asic_TurnLamp (&g_chip, TRUE)) if (SANE_STATUS_GOOD != Asic_TurnLamp (&g_chip, TRUE))
{ {
DBG (DBG_FUNC, "MustScanner_Prepare: Asic_TurnLamp return error\n"); DBG (DBG_FUNC, "MustScanner_Prepare: Asic_TurnLamp return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_SetSource (&g_chip, LS_REFLECTIVE)) if (SANE_STATUS_GOOD != Asic_SetSource (&g_chip, LS_REFLECTIVE))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_Prepare: Asic_SetSource return error\n"); "MustScanner_Prepare: Asic_SetSource return error\n");
@ -423,12 +423,12 @@ MustScanner_Prepare (SANE_Byte bScanSource)
else if (SS_Positive == bScanSource) else if (SS_Positive == bScanSource)
{ {
DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Positive\n"); DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Positive\n");
if (STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE)) if (SANE_STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE))
{ {
DBG (DBG_FUNC, "MustScanner_Prepare: Asic_TurnTA return error\n"); DBG (DBG_FUNC, "MustScanner_Prepare: Asic_TurnTA return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_SetSource (&g_chip, LS_POSITIVE)) if (SANE_STATUS_GOOD != Asic_SetSource (&g_chip, LS_POSITIVE))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_Prepare: Asic_SetSource return error\n"); "MustScanner_Prepare: Asic_SetSource return error\n");
@ -439,13 +439,13 @@ MustScanner_Prepare (SANE_Byte bScanSource)
{ {
DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Negative\n"); DBG (DBG_FUNC, "MustScanner_Prepare:ScanSource is SS_Negative\n");
if (STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE)) if (SANE_STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE))
{ {
DBG (DBG_FUNC, "MustScanner_Prepare: Asic_TurnTA return error\n"); DBG (DBG_FUNC, "MustScanner_Prepare: Asic_TurnTA return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_SetSource (&g_chip, LS_NEGATIVE)) if (SANE_STATUS_GOOD != Asic_SetSource (&g_chip, LS_NEGATIVE))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"MustScanner_Prepare: Asic_SetSource return error\n"); "MustScanner_Prepare: Asic_SetSource return error\n");
@ -3023,7 +3023,7 @@ MustScanner_ReadDataFromScanner (void * dummy)
"MustScanner_ReadDataFromScanner: wScanLinesThisBlock=%d\n", "MustScanner_ReadDataFromScanner: wScanLinesThisBlock=%d\n",
wScanLinesThisBlock); wScanLinesThisBlock);
if (STATUS_GOOD != if (SANE_STATUS_GOOD !=
Asic_ReadImage (&g_chip, lpReadImage, wScanLinesThisBlock)) Asic_ReadImage (&g_chip, lpReadImage, wScanLinesThisBlock))
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,

Wyświetl plik

@ -82,31 +82,31 @@ Reflective_Reset ()
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_Open return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_Open return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Reset (&g_chip)) if (SANE_STATUS_GOOD != Asic_Reset (&g_chip))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_Reset return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_Reset return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_SetSource (&g_chip, LS_REFLECTIVE)) if (SANE_STATUS_GOOD != Asic_SetSource (&g_chip, LS_REFLECTIVE))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_SetSource return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_SetSource return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_TurnLamp (&g_chip, TRUE)) if (SANE_STATUS_GOOD != Asic_TurnLamp (&g_chip, TRUE))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_TurnLamp return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_TurnLamp return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Close (&g_chip)) if (SANE_STATUS_GOOD != Asic_Close (&g_chip))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_Close return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_Close return error\n");
return FALSE; return FALSE;
@ -439,7 +439,7 @@ Reflective_SetupScan (COLORMODE ColorMode,
break; break;
} }
if (Asic_Open (&g_chip, g_pDeviceFile) != STATUS_GOOD) if (Asic_Open (&g_chip, g_pDeviceFile) != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, "Reflective_SetupScan: Asic_Open return error\n"); DBG (DBG_FUNC, "Reflective_SetupScan: Asic_Open return error\n");
return FALSE; return FALSE;
@ -1153,7 +1153,7 @@ Reflective_FindTopLeft (unsigned short * lpwStartX, unsigned short * lpwStartY)
Asic_SetCalibrate (&g_chip, 8, wXResolution, wYResolution, 0, 0, wCalWidth, Asic_SetCalibrate (&g_chip, 8, wXResolution, wYResolution, 0, 0, wCalWidth,
wCalHeight, FALSE); wCalHeight, FALSE);
Asic_SetAFEGainOffset (&g_chip); Asic_SetAFEGainOffset (&g_chip);
if (Asic_ScanStart (&g_chip) != STATUS_GOOD) if (Asic_ScanStart (&g_chip) != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, "Reflective_FindTopLeft: Asic_ScanStart return error\n"); DBG (DBG_FUNC, "Reflective_FindTopLeft: Asic_ScanStart return error\n");
free (lpCalData); free (lpCalData);
@ -1162,7 +1162,7 @@ Reflective_FindTopLeft (unsigned short * lpwStartX, unsigned short * lpwStartY)
for (i = 0; i < nScanBlock; i++) for (i = 0; i < nScanBlock; i++)
{ {
if (STATUS_GOOD != if (SANE_STATUS_GOOD !=
Asic_ReadCalibrationData (&g_chip, Asic_ReadCalibrationData (&g_chip,
lpCalData + i * g_dwCalibrationSize, lpCalData + i * g_dwCalibrationSize,
g_dwCalibrationSize, 8)) g_dwCalibrationSize, 8))
@ -1174,7 +1174,7 @@ Reflective_FindTopLeft (unsigned short * lpwStartX, unsigned short * lpwStartY)
} }
} }
if (STATUS_GOOD != if (SANE_STATUS_GOOD !=
Asic_ReadCalibrationData (&g_chip, Asic_ReadCalibrationData (&g_chip,
lpCalData + lpCalData +
(nScanBlock) * g_dwCalibrationSize, (nScanBlock) * g_dwCalibrationSize,
@ -1340,7 +1340,7 @@ Return value:
static SANE_Bool static SANE_Bool
Reflective_LineCalibration16Bits () Reflective_LineCalibration16Bits ()
{ {
STATUS status; SANE_Status status;
SANE_Byte * lpWhiteData; SANE_Byte * lpWhiteData;
SANE_Byte * lpDarkData; SANE_Byte * lpDarkData;
unsigned int dwWhiteTotalSize; unsigned int dwWhiteTotalSize;
@ -1403,7 +1403,7 @@ Reflective_LineCalibration16Bits ()
status = status =
Asic_SetCalibrate (&g_chip, 48, g_XDpi, g_YDpi, g_X, 0, wCalWidth, Asic_SetCalibrate (&g_chip, 48, g_XDpi, g_YDpi, g_X, 0, wCalWidth,
wCalHeight, TRUE); wCalHeight, TRUE);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_SetCalibrate return error \n"); "Reflective_LineCalibration16Bits: Asic_SetCalibrate return error \n");
@ -1415,7 +1415,7 @@ Reflective_LineCalibration16Bits ()
} }
status = Asic_ScanStart (&g_chip); status = Asic_ScanStart (&g_chip);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_ScanStart return error \n"); "Reflective_LineCalibration16Bits: Asic_ScanStart return error \n");
@ -1427,7 +1427,7 @@ Reflective_LineCalibration16Bits ()
status = status =
Asic_ReadCalibrationData (&g_chip, lpWhiteData, dwWhiteTotalSize, 8); Asic_ReadCalibrationData (&g_chip, lpWhiteData, dwWhiteTotalSize, 8);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
free (lpWhiteData); free (lpWhiteData);
free (lpDarkData); free (lpDarkData);
@ -1438,7 +1438,7 @@ Reflective_LineCalibration16Bits ()
/*Read dark level data */ /*Read dark level data */
status = Asic_SetMotorType (&g_chip, FALSE, TRUE); status = Asic_SetMotorType (&g_chip, FALSE, TRUE);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_SetMotorType return error \n"); "Reflective_LineCalibration16Bits: Asic_SetMotorType return error \n");
@ -1451,7 +1451,7 @@ Reflective_LineCalibration16Bits ()
status = status =
Asic_SetCalibrate (&g_chip, 48, g_XDpi, g_YDpi, g_X, 0, wCalWidth, Asic_SetCalibrate (&g_chip, 48, g_XDpi, g_YDpi, g_X, 0, wCalWidth,
wCalHeight, TRUE); wCalHeight, TRUE);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_SetCalibrate return error \n"); "Reflective_LineCalibration16Bits: Asic_SetCalibrate return error \n");
@ -1462,7 +1462,7 @@ Reflective_LineCalibration16Bits ()
} }
status = Asic_TurnLamp (&g_chip, FALSE); status = Asic_TurnLamp (&g_chip, FALSE);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_TurnLamp return error \n"); "Reflective_LineCalibration16Bits: Asic_TurnLamp return error \n");
@ -1475,7 +1475,7 @@ Reflective_LineCalibration16Bits ()
usleep (500000); usleep (500000);
status = Asic_ScanStart (&g_chip); status = Asic_ScanStart (&g_chip);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_ScanStart return error \n"); "Reflective_LineCalibration16Bits: Asic_ScanStart return error \n");
@ -1486,7 +1486,7 @@ Reflective_LineCalibration16Bits ()
} }
status = Asic_ReadCalibrationData (&g_chip, lpDarkData, dwDarkTotalSize, 8); status = Asic_ReadCalibrationData (&g_chip, lpDarkData, dwDarkTotalSize, 8);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_ReadCalibrationData return error \n"); "Reflective_LineCalibration16Bits: Asic_ReadCalibrationData return error \n");
@ -1500,7 +1500,7 @@ Reflective_LineCalibration16Bits ()
/* Turn on lamp */ /* Turn on lamp */
status = Asic_TurnLamp (&g_chip, TRUE); status = Asic_TurnLamp (&g_chip, TRUE);
if (status != STATUS_GOOD) if (status != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Reflective_LineCalibration16Bits: Asic_TurnLamp return error \n"); "Reflective_LineCalibration16Bits: Asic_TurnLamp return error \n");

Wyświetl plik

@ -82,37 +82,37 @@ Transparent_Reset ()
DBG (DBG_FUNC, "Transparent_Reset: scanner has been opened\n"); DBG (DBG_FUNC, "Transparent_Reset: scanner has been opened\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile)) if (SANE_STATUS_GOOD != Asic_Open (&g_chip, g_pDeviceFile))
{ {
DBG (DBG_FUNC, "Transparent_Reset: can not open scanner\n"); DBG (DBG_FUNC, "Transparent_Reset: can not open scanner\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Reset (&g_chip)) if (SANE_STATUS_GOOD != Asic_Reset (&g_chip))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_Reset return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_Reset return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_SetSource (&g_chip, LS_POSITIVE)) if (SANE_STATUS_GOOD != Asic_SetSource (&g_chip, LS_POSITIVE))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_SetSource return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_SetSource return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_TurnLamp (&g_chip, FALSE)) if (SANE_STATUS_GOOD != Asic_TurnLamp (&g_chip, FALSE))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_TurnLamp return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_TurnLamp return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE)) if (SANE_STATUS_GOOD != Asic_TurnTA (&g_chip, TRUE))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_TurnTA return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_TurnTA return error\n");
return FALSE; return FALSE;
} }
if (STATUS_GOOD != Asic_Close (&g_chip)) if (SANE_STATUS_GOOD != Asic_Close (&g_chip))
{ {
DBG (DBG_FUNC, "Reflective_Reset: Asic_Close return error\n"); DBG (DBG_FUNC, "Reflective_Reset: Asic_Close return error\n");
return FALSE; return FALSE;
@ -391,7 +391,7 @@ Transparent_SetupScan (COLORMODE ColorMode, unsigned short XDpi, unsigned short
break; break;
} }
if (Asic_Open (&g_chip, g_pDeviceFile) != STATUS_GOOD) if (Asic_Open (&g_chip, g_pDeviceFile) != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, "Transparent_SetupScan: Asic_Open return error\n"); DBG (DBG_FUNC, "Transparent_SetupScan: Asic_Open return error\n");
return FALSE; return FALSE;
@ -399,13 +399,13 @@ Transparent_SetupScan (COLORMODE ColorMode, unsigned short XDpi, unsigned short
g_bOpened = TRUE; g_bOpened = TRUE;
if (STATUS_GOOD != Asic_TurnLamp (&g_chip, FALSE)) if (SANE_STATUS_GOOD != Asic_TurnLamp (&g_chip, FALSE))
{ {
DBG (DBG_FUNC, "Transparent_SetupScan: Asic_TurnLamp return error\n"); DBG (DBG_FUNC, "Transparent_SetupScan: Asic_TurnLamp return error\n");
return FALSE; return FALSE;
} }
if (Asic_IsTAConnected (&g_chip, &hasTA) != STATUS_GOOD) if (Asic_IsTAConnected (&g_chip, &hasTA) != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, DBG (DBG_FUNC,
"Transparent_SetupScan: Asic_IsTAConnected return error\n"); "Transparent_SetupScan: Asic_IsTAConnected return error\n");
@ -417,7 +417,7 @@ Transparent_SetupScan (COLORMODE ColorMode, unsigned short XDpi, unsigned short
return FALSE; return FALSE;
} }
if (Asic_TurnTA (&g_chip, TRUE) != STATUS_GOOD) if (Asic_TurnTA (&g_chip, TRUE) != SANE_STATUS_GOOD)
{ {
DBG (DBG_FUNC, "Transparent_SetupScan: Asic_TurnTA return error\n"); DBG (DBG_FUNC, "Transparent_SetupScan: Asic_TurnTA return error\n");
return FALSE; return FALSE;