ZETA changes for SnapScan backend

merge-requests/1/head
Oliver Schwartz 2005-07-18 17:37:37 +00:00
rodzic 1276d174e7
commit 260f7d83eb
4 zmienionych plików z 51 dodań i 11 usunięć

Wyświetl plik

@ -1,3 +1,9 @@
2005-07-15 Oliver Schwartz <Oliver.Schwartz@gmx.de>
* backend/snapscan-mutex.c backend/snapscan-usb.c: Changes to support
SANE on ZETA.
* backend/snapscan-scsi.c: Fix compiler warnings.
---- FEATURE FREEZE FOR SANE 1.0.16 ---
2005-07-17 Henning Meier-Geinitz <henning@meier-geinitz.de>
@ -32,7 +38,7 @@
libtool needs -no-undefined. Various VPATH fixes.
Check for <be/drivers/USB_scanner.h>, but not used yet.
No S_IFSOCK (sockets are fds to /dev/net/api). Stub pio code, untested.
Patch from François Revol <revol@free.fr>.
Patch from Fran<EFBFBD>is Revol <revol@free.fr>.
2005-07-15 Oliver Schwartz <Oliver.Schwartz@gmx.de>

Wyświetl plik

@ -39,7 +39,35 @@
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice.*/
#if defined USE_PTHREAD || defined HAVE_OS2_H
#if defined __BEOS__
#include <OS.h>
#define snapscan_mutex_t sem_id
static int snapscani_mutex_open(snapscan_mutex_t* a_sem, const char* dev UNUSEDARG)
{
*a_sem = create_sem(1, "snapscan_mutex");
return 1;
}
static void snapscani_mutex_close(snapscan_mutex_t* a_sem)
{
delete_sem(*a_sem);
}
static void snapscani_mutex_lock(snapscan_mutex_t* a_sem)
{
acquire_sem(*a_sem);
}
static void snapscani_mutex_unlock(snapscan_mutex_t* a_sem)
{
release_sem(*a_sem);
}
#elif defined USE_PTHREAD || defined HAVE_OS2_H
#include <pthread.h>
#define snapscan_mutex_t pthread_mutex_t

Wyświetl plik

@ -1079,7 +1079,7 @@ static SANE_Status calibrate_2480 (SnapScan_Scanner *pss)
/* allocate memory for bins, all the red, then green, then blue */
bins = (int *) malloc (num_bins * sizeof (int));
if (!bins) {
DBG (DL_MAJOR_ERROR, "%s: out of memory allocating bins, %d bytes.", me, num_bins * sizeof (int));
DBG (DL_MAJOR_ERROR, "%s: out of memory allocating bins, %ld bytes.", me, (u_long)num_bins * sizeof (int));
return SANE_STATUS_NO_MEM;
}
@ -1087,7 +1087,7 @@ static SANE_Status calibrate_2480 (SnapScan_Scanner *pss)
expected_read_bytes = PIXELS_PER_LINE_2480 * 3 * 4;
buf = (u_char *) malloc (expected_read_bytes);
if (!buf) {
DBG (DL_MAJOR_ERROR, "%s: out of memory allocating calibration, %d bytes.", me, expected_read_bytes);
DBG (DL_MAJOR_ERROR, "%s: out of memory allocating calibration, %ld bytes.", me, (u_long)expected_read_bytes);
free (bins);
return SANE_STATUS_NO_MEM;
}
@ -1384,6 +1384,9 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
/*
* $Log$
* Revision 1.32 2005/07/18 17:37:37 oliver-guest
* ZETA changes for SnapScan backend
*
* Revision 1.31 2004/12/09 23:21:48 oliver-guest
* Added quality calibration for Epson 2480 (by Simon Munton)
*
@ -1470,7 +1473,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
* - Guard against TL_X < BR_X and TL_Y < BR_Y
*
* Revision 1.21 2001/10/21 08:49:37 oliverschwartz
* correct number of scan lines for calibration thanks to Mikko Työläjärvi
* correct number of scan lines for calibration thanks to Mikko Ty<EFBFBD><EFBFBD><EFBFBD>vi
*
* Revision 1.20 2001/10/12 20:54:04 oliverschwartz
* enable gamma correction for Snapscan 1236, e20 and e50 scanners

Wyświetl plik

@ -76,7 +76,7 @@
/* Global variables */
static snapscan_mutex_t sem_id;
static snapscan_mutex_t snapscan_mutex;
static sense_handler_type usb_sense_handler;
static void* usb_pss;
@ -139,11 +139,11 @@ static SANE_Status atomic_usb_cmd(int fd, const void *src, size_t src_size,
sigprocmask(SIG_BLOCK, &all, &oldset);
/* Make sure we are alone */
snapscani_mutex_lock(&sem_id);
snapscani_mutex_lock(&snapscan_mutex);
status = usb_cmd(fd,src,src_size,dst,dst_size);
snapscani_mutex_unlock(&sem_id);
snapscani_mutex_unlock(&snapscan_mutex);
/* Now it is ok to be killed */
sigprocmask(SIG_SETMASK, &oldset, NULL);
@ -159,7 +159,7 @@ static SANE_Status snapscani_usb_open(const char *dev, int *fdp,
DBG (DL_CALL_TRACE, "%s(%s)\n", me, dev);
if(!snapscani_mutex_open(&sem_id, dev)) {
if(!snapscani_mutex_open(&snapscan_mutex, dev)) {
DBG (DL_MAJOR_ERROR, "%s: Can't get semaphore\n", me);
return SANE_STATUS_INVAL;
}
@ -223,7 +223,7 @@ static void snapscani_usb_close(int fd) {
}
urb_counters->read_urbs = 0;
urb_counters->write_urbs = 0;
snapscani_mutex_close(&sem_id);
snapscani_mutex_close(&snapscan_mutex);
sanei_usb_close(fd);
}
@ -493,7 +493,7 @@ static SANE_Status usb_request_sense(SnapScan_Scanner *pss) {
return status;
}
#if defined USE_PTHREAD || defined HAVE_OS2_H
#if defined USE_PTHREAD || defined HAVE_OS2_H || defined __BEOS__
static SANE_Status snapscani_usb_shm_init(void)
{
unsigned int shm_size = sizeof(struct urb_counters_t);
@ -563,6 +563,9 @@ static void snapscani_usb_shm_exit(void)
#endif
/*
* $Log$
* Revision 1.20 2005/07/18 17:37:37 oliver-guest
* ZETA changes for SnapScan backend
*
* Revision 1.19 2004/10/03 17:34:36 hmg-guest
* 64 bit platform fixes (bug #300799).
*