kopia lustrzana https://gitlab.com/sane-project/backends
rodzic
99dcba3669
commit
379684a3ed
|
@ -345,9 +345,9 @@ typedef const struct mode_param
|
||||||
#define _PTDRV_GET_CROPINFO _IOR('x', 5, CropInfo) /* get crop */
|
#define _PTDRV_GET_CROPINFO _IOR('x', 5, CropInfo) /* get crop */
|
||||||
#define _PTDRV_SET_ENV _IOWR('x',6, ScanInfo) /* set env. */
|
#define _PTDRV_SET_ENV _IOWR('x',6, ScanInfo) /* set env. */
|
||||||
#define _PTDRV_START_SCAN _IOR('x', 7, StartScan) /* start scan */
|
#define _PTDRV_START_SCAN _IOR('x', 7, StartScan) /* start scan */
|
||||||
#define _PTDRV_STOP_SCAN _IOWR('x', 8, int) /* stop scan */
|
#define _PTDRV_STOP_SCAN _IOWR('x', 8, short) /* stop scan */
|
||||||
#define _PTDRV_CLOSE_DEVICE _IO('x', 9) /* close */
|
#define _PTDRV_CLOSE_DEVICE _IO('x', 9) /* close */
|
||||||
#define _PTDRV_ACTION_BUTTON _IOR('x', 10, int) /* rd act. button*/
|
#define _PTDRV_ACTION_BUTTON _IOR('x', 10, unsigned char)/* rd act. button*/
|
||||||
#define _PTDRV_ADJUST _IOR('x', 11, AdjDef) /* adjust driver */
|
#define _PTDRV_ADJUST _IOR('x', 11, AdjDef) /* adjust driver */
|
||||||
#define _PTDRV_SETMAP _IOR('x', 12, MapDef) /* download gamma*/
|
#define _PTDRV_SETMAP _IOR('x', 12, MapDef) /* download gamma*/
|
||||||
|
|
||||||
|
@ -572,9 +572,9 @@ typedef struct Plustek_Device
|
||||||
int (*putImgInfo) ( struct Plustek_Device*, pImgDef );
|
int (*putImgInfo) ( struct Plustek_Device*, pImgDef );
|
||||||
int (*setScanEnv) ( struct Plustek_Device*, pScanInfo );
|
int (*setScanEnv) ( struct Plustek_Device*, pScanInfo );
|
||||||
int (*setMap) ( struct Plustek_Device*, SANE_Word*,
|
int (*setMap) ( struct Plustek_Device*, SANE_Word*,
|
||||||
SANE_Word, SANE_Word );
|
SANE_Word, SANE_Word );
|
||||||
int (*startScan) ( struct Plustek_Device*, pStartScan );
|
int (*startScan) ( struct Plustek_Device*, pStartScan );
|
||||||
int (*stopScan) ( struct Plustek_Device*, int* );
|
int (*stopScan) ( struct Plustek_Device*, short* );
|
||||||
int (*readImage) ( struct Plustek_Device*, SANE_Byte*, unsigned long );
|
int (*readImage) ( struct Plustek_Device*, SANE_Byte*, unsigned long );
|
||||||
|
|
||||||
int (*prepare) ( struct Plustek_Device*, SANE_Byte* );
|
int (*prepare) ( struct Plustek_Device*, SANE_Byte* );
|
||||||
|
|
|
@ -301,30 +301,30 @@ static int getUserPtr(const pVoid useraddr, pVoid where, UInt size )
|
||||||
switch (size)
|
switch (size)
|
||||||
{
|
{
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
case 1:
|
case sizeof(u_char):
|
||||||
GET_USER_RET(*(u_char *)where, (u_char *) useraddr, -EFAULT);
|
GET_USER_RET(*(u_char *)where, (u_char *) useraddr, -EFAULT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case sizeof(u_short):
|
||||||
GET_USER_RET(*(u_short *)where, (u_short *) useraddr, -EFAULT);
|
GET_USER_RET(*(u_short *)where, (u_short *) useraddr, -EFAULT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case sizeof(u_long):
|
||||||
GET_USER_RET(*(u_long *)where, (u_long *) useraddr, -EFAULT);
|
GET_USER_RET(*(u_long *)where, (u_long *) useraddr, -EFAULT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
copy_from_user(where, useraddr, size);
|
copy_from_user(where, useraddr, size);
|
||||||
#else
|
#else
|
||||||
case 1:
|
case sizeof(UChar):
|
||||||
*(pUChar)where = *(pUChar)useraddr;
|
*(pUChar)where = *(pUChar)useraddr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case sizeof(UShort):
|
||||||
*(pUShort)where = *(pUShort)useraddr;
|
*(pUShort)where = *(pUShort)useraddr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case sizeof(ULong):
|
||||||
*(pULong)where = *(pULong)useraddr;
|
*(pULong)where = *(pULong)useraddr;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -388,23 +388,23 @@ static int putUserVal(const ULong value, pVoid useraddr, UInt size)
|
||||||
switch (size) {
|
switch (size) {
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
case 1:
|
case sizeof(u_char):
|
||||||
PUT_USER_RET((u_char)value, (u_char *) useraddr, -EFAULT);
|
PUT_USER_RET((u_char)value, (u_char *) useraddr, -EFAULT);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case sizeof(u_short):
|
||||||
PUT_USER_RET((u_short)value, (u_short *) useraddr, -EFAULT);
|
PUT_USER_RET((u_short)value, (u_short *) useraddr, -EFAULT);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case sizeof(u_long):
|
||||||
PUT_USER_RET((u_long)value, (u_long *) useraddr, -EFAULT);
|
PUT_USER_RET((u_long)value, (u_long *) useraddr, -EFAULT);
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
case 1:
|
case sizeof(UChar):
|
||||||
*(pUChar)useraddr = (UChar)value;
|
*(pUChar)useraddr = (UChar)value;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case sizeof(UShort):
|
||||||
*(pUShort)useraddr = (UShort)value;
|
*(pUShort)useraddr = (UShort)value;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case sizeof(ULong):
|
||||||
*(pULong)useraddr = (ULong)value;
|
*(pULong)useraddr = (ULong)value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -947,6 +947,7 @@ static int ptdrvShutdown( pScanData ps )
|
||||||
*/
|
*/
|
||||||
static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg )
|
static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg )
|
||||||
{
|
{
|
||||||
|
UChar val;
|
||||||
UShort dir;
|
UShort dir;
|
||||||
UShort version;
|
UShort version;
|
||||||
UInt size;
|
UInt size;
|
||||||
|
@ -1239,7 +1240,7 @@ static int ptdrvIoctl( pScanData ps, UInt cmd, pVoid arg )
|
||||||
*/
|
*/
|
||||||
case _PTDRV_ACTION_BUTTON:
|
case _PTDRV_ACTION_BUTTON:
|
||||||
DBG( DBG_LOW, "ioctl(_PTDRV_ACTION_BUTTON)\n" );
|
DBG( DBG_LOW, "ioctl(_PTDRV_ACTION_BUTTON)\n" );
|
||||||
argVal = IODataRegisterFromScanner( ps, ps->RegStatus );
|
val = IODataRegisterFromScanner( ps, ps->RegStatus );
|
||||||
retval = putUserVal( argVal, arg, size );
|
retval = putUserVal( argVal, arg, size );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -323,7 +323,7 @@ static int ppDev_setMap( Plustek_Device *dev, SANE_Word *map,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
static int ppDev_stopScan( Plustek_Device *dev, int *mode )
|
static int ppDev_stopScan( Plustek_Device *dev, short *mode )
|
||||||
{
|
{
|
||||||
int retval, tmp;
|
int retval, tmp;
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
#include "../include/sane/sanei.h"
|
#include "../include/sane/sanei.h"
|
||||||
#include "../include/sane/saneopts.h"
|
#include "../include/sane/saneopts.h"
|
||||||
|
|
||||||
#define BACKEND_VERSION "0.43-8"
|
#define BACKEND_VERSION "0.43-9"
|
||||||
#define BACKEND_NAME plustek_pp
|
#define BACKEND_NAME plustek_pp
|
||||||
#include "../include/sane/sanei_backend.h"
|
#include "../include/sane/sanei_backend.h"
|
||||||
#include "../include/sane/sanei_config.h"
|
#include "../include/sane/sanei_config.h"
|
||||||
|
@ -271,7 +271,7 @@ static int drvopen( Plustek_Device *dev )
|
||||||
*/
|
*/
|
||||||
static SANE_Status drvclose( Plustek_Device *dev )
|
static SANE_Status drvclose( Plustek_Device *dev )
|
||||||
{
|
{
|
||||||
int int_cnt;
|
short int_cnt;
|
||||||
|
|
||||||
if( dev->fd >= 0 ) {
|
if( dev->fd >= 0 ) {
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ static SANE_Status do_cancel( Plustek_Scanner *scanner, SANE_Bool closepipe )
|
||||||
{
|
{
|
||||||
struct SIGACTION act;
|
struct SIGACTION act;
|
||||||
pid_t res;
|
pid_t res;
|
||||||
int int_cnt;
|
short int_cnt;
|
||||||
|
|
||||||
DBG( _DBG_PROC,"do_cancel\n" );
|
DBG( _DBG_PROC,"do_cancel\n" );
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue