kopia lustrzana https://gitlab.com/sane-project/website
824 wiersze
18 KiB
HTML
824 wiersze
18 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>sane-devel: Re: Unstable development version moving to test pha</TITLE>
|
|
<META NAME="Author" CONTENT="Wolfgang Rapp (wolfgang@rapp-informatik.de)">
|
|
<META NAME="Subject" CONTENT="Re: Unstable development version moving to test phase">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: Unstable development version moving to test phase</H1>
|
|
<!-- received="Sun Jan 23 12:39:22 2000" -->
|
|
<!-- isoreceived="20000123203922" -->
|
|
<!-- sent="Sun, 23 Jan 2000 23:37:54 +0100" -->
|
|
<!-- isosent="20000123223754" -->
|
|
<!-- name="Wolfgang Rapp" -->
|
|
<!-- email="wolfgang@rapp-informatik.de" -->
|
|
<!-- subject="Re: Unstable development version moving to test phase" -->
|
|
<!-- id="388B82C2.4DABD0EA@rapp-informatik.de" -->
|
|
<!-- inreplyto="200001200124.JAA31859@minerva.cc.uit.no" -->
|
|
<STRONG>From:</STRONG> Wolfgang Rapp (<A HREF="mailto:wolfgang@rapp-informatik.de?Subject=Re:%20Unstable%20development%20version%20moving%20to%20test%20phase&In-Reply-To=<388B82C2.4DABD0EA@rapp-informatik.de>"><EM>wolfgang@rapp-informatik.de</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Sun Jan 23 2000 - 14:37:54 PST
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0188.html">Enno Wein: "Nikon coolscan LS-2000"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0186.html">Wolfgang Rapp: "Re: Unstable development version moving to test phase"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0161.html">Petter Reinholdtsen: "Unstable development version moving to test phase"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0195.html">Petter Reinholdtsen: "Re: Unstable development version moving to test phase"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#187">[ date ]</A>
|
|
<A HREF="index.html#187">[ thread ]</A>
|
|
<A HREF="subject.html#187">[ subject ]</A>
|
|
<A HREF="author.html#187">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hello
|
|
<BR>
|
|
attached is the patch for the Unixware Port against sane-devel-19991212
|
|
<BR>
|
|
for UW2.x and UW7.
|
|
<BR>
|
|
<P>Will somebody be able to put it in the CVS.
|
|
<BR>
|
|
<P>There are already some small compile problems in backends
|
|
<BR>
|
|
cannon.c
|
|
<BR>
|
|
snapscan-sources.c
|
|
<BR>
|
|
umax.c
|
|
<BR>
|
|
solved in build 14 from Olivers home page.
|
|
<BR>
|
|
<P>An please are so kind to omit the C++ comment stile using //.
|
|
<BR>
|
|
Not all C compilers will accept this.
|
|
<BR>
|
|
<P>I'll check the bachends in 20000123 against Compilation on Unixware.
|
|
<BR>
|
|
<P>So long
|
|
<BR>
|
|
Wolfgang
|
|
<BR>
|
|
<P>
|
|
<BR><P>
|
|
--- config.sub.org Fri Jan 7 10:33:57 2000
|
|
<BR>
|
|
+++ config.sub Fri Jan 7 10:47:37 2000
|
|
<BR>
|
|
@@ -131,6 +131,10 @@
|
|
<BR>
|
|
os=-sco3.2v2
|
|
<BR>
|
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
|
<BR>
|
|
;;
|
|
<BR>
|
|
+ -7.1.* | sysv4.2uw*)
|
|
<BR>
|
|
+ os=-unixware
|
|
<BR>
|
|
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
|
<BR>
|
|
+ ;;
|
|
<BR>
|
|
-udk*)
|
|
<BR>
|
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
|
<BR>
|
|
;;
|
|
<BR>
|
|
--- configure.in.org Wed Jan 5 08:25:13 2000
|
|
<BR>
|
|
+++ configure.in Fri Jan 7 10:27:45 2000
|
|
<BR>
|
|
@@ -44,7 +44,7 @@
|
|
<BR>
|
|
sys/scanio.h scsi.h sys/scsi.h sys/scsicmd.h sys/scsiio.h \
|
|
<BR>
|
|
bsd/dev/scsireg.h scsi/sg.h /usr/src/linux/include/scsi/sg.h io/cam/cam.h \
|
|
<BR>
|
|
camlib.h os2.h sys/socket.h sys/io.h asm/io.h gscdds.h sys/hw.h \
|
|
<BR>
|
|
- sys/types.h sys/scsi/sgdefs.h sys/scsi/targets/scgio.h apollo/scsi.h)
|
|
<BR>
|
|
+ sys/types.h sys/scsi/sgdefs.h sys/scsi/targets/scgio.h apollo/scsi.h sys/sdi_comm.h sys/passthrudef.h)
|
|
<BR>
|
|
|
|
<BR>
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
<BR>
|
|
AC_C_CONST
|
|
<BR>
|
|
--- include/sane/config.h.in.org Wed Jan 5 12:03:35 2000
|
|
<BR>
|
|
+++ include/sane/config.h.in Fri Jan 7 10:30:33 2000
|
|
<BR>
|
|
@@ -248,6 +248,12 @@
|
|
<BR>
|
|
/* Define if you have the <sys/scsi.h> header file. */
|
|
<BR>
|
|
#undef HAVE_SYS_SCSI_H
|
|
<BR>
|
|
|
|
<BR>
|
|
+/* Define if you have the <sys/sdi_comm.h> header file. */
|
|
<BR>
|
|
+#undef HAVE_SYS_SDI_COMM_H
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+/* Define if you have the <sys/passthrudef.h.h> header file. */
|
|
<BR>
|
|
+#undef HAVE_SYS_PASSTHRUDEF_H
|
|
<BR>
|
|
+
|
|
<BR>
|
|
/* Define if you have the <sys/scsi/targets/scgio.h> header file. */
|
|
<BR>
|
|
#undef HAVE_SYS_SCSI_TARGETS_SCGIO_H
|
|
<BR>
|
|
|
|
<BR>
|
|
--- sanei/sanei_scsi.c.org Wed Jan 5 08:09:42 2000
|
|
<BR>
|
|
+++ sanei/sanei_scsi.c Fri Jan 7 10:32:54 2000
|
|
<BR>
|
|
@@ -73,6 +73,8 @@
|
|
<BR>
|
|
#define AIX_GSC_INTERFACE 11
|
|
<BR>
|
|
#define DOMAINOS_INTERFACE 12
|
|
<BR>
|
|
#define FREEBSD_CAM_INTERFACE 13
|
|
<BR>
|
|
+#define SYSVR4_INTERFACE 14
|
|
<BR>
|
|
+#define SCO_UW71_INTERFACE 15
|
|
<BR>
|
|
|
|
<BR>
|
|
#if defined (HAVE_SCSI_SG_H)
|
|
<BR>
|
|
# define USE LINUX_INTERFACE
|
|
<BR>
|
|
@@ -114,6 +116,20 @@
|
|
<BR>
|
|
# include <invent.h>
|
|
<BR>
|
|
#elif defined (HAVE_SYS_SCSI_H)
|
|
<BR>
|
|
# include <sys/scsi.h>
|
|
<BR>
|
|
+# ifdef HAVE_SYS_SDI_COMM_H
|
|
<BR>
|
|
+# ifdef HAVE_SYS_PASSTHRUDEF_H
|
|
<BR>
|
|
+# define USE SCO_UW71_INTERFACE
|
|
<BR>
|
|
+# include <sys/scsi.h>
|
|
<BR>
|
|
+# include <sys/sdi_edt.h>
|
|
<BR>
|
|
+# include <sys/sdi.h>
|
|
<BR>
|
|
+# include <sys/passthrudef.h>
|
|
<BR>
|
|
+#else
|
|
<BR>
|
|
+# define USE SYSVR4_INTERFACE /* Unixware 2.x tested */
|
|
<BR>
|
|
+# define HAVE_SYSV_DRIVER
|
|
<BR>
|
|
+# include <sys/sdi_edt.h>
|
|
<BR>
|
|
+# include <sys/sdi_comm.h>
|
|
<BR>
|
|
+#endif
|
|
<BR>
|
|
+# else
|
|
<BR>
|
|
# ifdef SCTL_READ
|
|
<BR>
|
|
# define USE HPUX_INTERFACE
|
|
<BR>
|
|
# else
|
|
<BR>
|
|
@@ -122,6 +138,7 @@
|
|
<BR>
|
|
# include <gscdds.h>
|
|
<BR>
|
|
# else
|
|
<BR>
|
|
/* This happens for AIX without gsc and possibly other platforms... */
|
|
<BR>
|
|
+# endif
|
|
<BR>
|
|
# endif
|
|
<BR>
|
|
# endif
|
|
<BR>
|
|
#elif defined (HAVE_OS2_H)
|
|
<BR>
|
|
@@ -177,6 +194,16 @@
|
|
<BR>
|
|
# define MAX_DATA SG_BIG_BUFF
|
|
<BR>
|
|
#endif
|
|
<BR>
|
|
|
|
<BR>
|
|
+#if USE == SYSVR4_INTERFACE
|
|
<BR>
|
|
+# define MAX_DATA 56*1024 /* don't increase or kernel will dump
|
|
<BR>
|
|
+ * tested with adsl, adsa and umax backend
|
|
<BR>
|
|
+ * it depends on the lowend scsi
|
|
<BR>
|
|
+ * drivers . But the most restriction
|
|
<BR>
|
|
+ * is in the UNIXWARE KERNEL witch do
|
|
<BR>
|
|
+ * not allow more then 64kB DMA transfers */
|
|
<BR>
|
|
+static char lastrcmd[16]; /* hold command block of last read command */
|
|
<BR>
|
|
+#endif
|
|
<BR>
|
|
+
|
|
<BR>
|
|
#if USE == OPENSTEP_INTERFACE
|
|
<BR>
|
|
# define MAX_DATA (120*1024)
|
|
<BR>
|
|
#endif
|
|
<BR>
|
|
@@ -841,6 +868,31 @@
|
|
<BR>
|
|
return SANE_STATUS_INVAL;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
}
|
|
<BR>
|
|
+#elif USE == SCO_UW71_INTERFACE
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ pt_scsi_address_t dev_addr;
|
|
<BR>
|
|
+ pt_handle_t pt_handle;
|
|
<BR>
|
|
+ int bus, cnt, id, lun;
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (sscanf(dev, "/dev/passthru0:%d,%d,%d,%d", &bus, &cnt, &id, &lun) != 4)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ DBG (1, "sanei_scsi_open: device name %s is not a valid\n",
|
|
<BR>
|
|
+ strerror (errno));
|
|
<BR>
|
|
+ return SANE_STATUS_INVAL;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ dev_addr.psa_bus = bus;
|
|
<BR>
|
|
+ dev_addr.psa_controller = cnt;
|
|
<BR>
|
|
+ dev_addr.psa_target = id;
|
|
<BR>
|
|
+ dev_addr.psa_lun = lun;
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (pt_open(PASSTHRU_SCSI_ADDRESS, &dev_addr, PT_EXCLUSIVE, &pt_handle)!=0)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ DBG (1, "sanei_scsi_open: pt_open failed: %s!\n", strerror(errno));
|
|
<BR>
|
|
+ return SANE_STATUS_INVAL;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ else
|
|
<BR>
|
|
+ fd = (int)pt_handle;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
#else
|
|
<BR>
|
|
#if defined(SGIOCSTL) || (USE == SOLARIS_INTERFACE)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
@@ -952,6 +1004,10 @@
|
|
<BR>
|
|
return SANE_STATUS_INVAL;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
#endif
|
|
<BR>
|
|
+#if USE == SYSVR4_INTERFACE
|
|
<BR>
|
|
+ memset(lastrcmd,0,16); /* reinitialize last read command block */
|
|
<BR>
|
|
+#endif
|
|
<BR>
|
|
+
|
|
<BR>
|
|
|
|
<BR>
|
|
if (fdp)
|
|
<BR>
|
|
*fdp = fd;
|
|
<BR>
|
|
@@ -1996,6 +2052,72 @@
|
|
<BR>
|
|
}
|
|
<BR>
|
|
#endif /* USE == SCO_OS5_INTERFACE */
|
|
<BR>
|
|
|
|
<BR>
|
|
+#if USE == SCO_UW71_INTERFACE
|
|
<BR>
|
|
+SANE_Status
|
|
<BR>
|
|
+sanei_scsi_cmd (int fd, const void *src, size_t src_size,
|
|
<BR>
|
|
+ void *dst, size_t * dst_size)
|
|
<BR>
|
|
+{
|
|
<BR>
|
|
+ static u_char sense_buffer[24];
|
|
<BR>
|
|
+ struct scb cmdblk;
|
|
<BR>
|
|
+ time_t elapsed;
|
|
<BR>
|
|
+ uint_t compcode, status;
|
|
<BR>
|
|
+ int cdb_size, mode;
|
|
<BR>
|
|
+ int i;
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (fd < 0)
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ cmdblk.sc_cmdpt = (caddr_t) src;
|
|
<BR>
|
|
+ cdb_size = CDB_SIZE (*(u_char *) src);
|
|
<BR>
|
|
+ cmdblk.sc_cmdsz = cdb_size;
|
|
<BR>
|
|
+ cmdblk.sc_time = 60000; /* 60 secs */
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (dst_size && *dst_size)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ assert (cdb_size == src_size);
|
|
<BR>
|
|
+ cmdblk.sc_datapt = (caddr_t) dst;
|
|
<BR>
|
|
+ cmdblk.sc_datasz = *dst_size;
|
|
<BR>
|
|
+ mode = SCB_READ;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ else
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ assert (cdb_size <= src_size);
|
|
<BR>
|
|
+ cmdblk.sc_datapt = (char *) src + cdb_size;
|
|
<BR>
|
|
+ cmdblk.sc_datasz = src_size - cdb_size;
|
|
<BR>
|
|
+ mode = SCB_WRITE;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ if (pt_send(fd, cmdblk.sc_cmdpt, cmdblk.sc_cmdsz, cmdblk.sc_datapt,
|
|
<BR>
|
|
+ cmdblk.sc_datasz, mode, cmdblk.sc_time, &elapsed, &compcode,
|
|
<BR>
|
|
+ &status, sense_buffer, sizeof(sense_buffer)) != 0)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ DBG (1, "sanei_scsi_cmd: pt_send failed: %s!\n", strerror(errno));
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ else
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ DBG (2, "sanei_scsi_cmd completed with: compcode = %x, status = %x\n",
|
|
<BR>
|
|
+ compcode, status);
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ switch (compcode)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ case SDI_ASW: /* All seems well */
|
|
<BR>
|
|
+ return SANE_STATUS_GOOD;
|
|
<BR>
|
|
+ case SDI_CKSTAT:
|
|
<BR>
|
|
+ DBG (2, "Sense Data:\n");
|
|
<BR>
|
|
+ for (i=0; i<sizeof(sense_buffer); i++)
|
|
<BR>
|
|
+ DBG (2, "%.2X ", sense_buffer[i]);
|
|
<BR>
|
|
+ DBG (2, "\n");
|
|
<BR>
|
|
+ if (fd_info[fd].sense_handler)
|
|
<BR>
|
|
+ return (*fd_info[fd].sense_handler) (fd, sense_buffer,
|
|
<BR>
|
|
+ fd_info[fd].sense_handler_arg);
|
|
<BR>
|
|
+ /* fall through */
|
|
<BR>
|
|
+ default:
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+}
|
|
<BR>
|
|
+#endif /* USE == SCO_UW71_INTERFACE */
|
|
<BR>
|
|
+
|
|
<BR>
|
|
#if USE == OS2_INTERFACE
|
|
<BR>
|
|
|
|
<BR>
|
|
#define WE_HAVE_FIND_DEVICES
|
|
<BR>
|
|
@@ -2752,3 +2874,148 @@
|
|
<BR>
|
|
}
|
|
<BR>
|
|
|
|
<BR>
|
|
#endif /* WE_HAVE_FIND_DEVICES */
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+#if USE == SYSVR4_INTERFACE
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+/*
|
|
<BR>
|
|
+ * UNIXWARE 2.x interface
|
|
<BR>
|
|
+ * (c) R=I+S Rapp Informatik System Germany
|
|
<BR>
|
|
+ * Email: <A HREF="mailto:wolfgang@rapp-informatik.de?Subject=Re:%20Unstable%20development%20version%20moving%20to%20test%20phase&In-Reply-To=<388B82C2.4DABD0EA@rapp-informatik.de>">wolfgang@rapp-informatik.de</A>
|
|
<BR>
|
|
+ *
|
|
<BR>
|
|
+ * The driver version should run with other scsi componets like disk
|
|
<BR>
|
|
+ * attached to the same controller at the same time.
|
|
<BR>
|
|
+ *
|
|
<BR>
|
|
+ * Attention : This port needs a sane kernel driver for Unixware 2.x
|
|
<BR>
|
|
+ * The driver is available in binary pkgadd format
|
|
<BR>
|
|
+ * Plese mail me.
|
|
<BR>
|
|
+ *
|
|
<BR>
|
|
+ */
|
|
<BR>
|
|
+SANE_Status
|
|
<BR>
|
|
+sanei_scsi_cmd (int fd, const void * src, size_t src_size,
|
|
<BR>
|
|
+ void * dst, size_t * dst_size)
|
|
<BR>
|
|
+{
|
|
<BR>
|
|
+ struct sb sb, *sb_ptr; /* Command block and pointer */
|
|
<BR>
|
|
+ struct scs *scs; /* group 6 command pointer */
|
|
<BR>
|
|
+ struct scm *scm; /* group 10 command pointer */
|
|
<BR>
|
|
+ struct scv *scv; /* group 12 command pointer */
|
|
<BR>
|
|
+ char sense[32]; /* for call of sens req */
|
|
<BR>
|
|
+ char cmd[16]; /* global for right alignment */
|
|
<BR>
|
|
+ char * cp;
|
|
<BR>
|
|
+ size_t cdb_size;
|
|
<BR>
|
|
+
|
|
<BR>
|
|
+ cdb_size = CDB_SIZE (*(u_char *) src);
|
|
<BR>
|
|
+ memset (&cmd, 0, 16);
|
|
<BR>
|
|
+ sb_ptr = &sb;
|
|
<BR>
|
|
+ sb_ptr->sb_type = ISCB_TYPE;
|
|
<BR>
|
|
+ cp = (char *) src;
|
|
<BR>
|
|
+ DBG(1, "cdb_size = %d src = {0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x ...}\n", cdb_size,
|
|
<BR>
|
|
+ cp[0],cp[1],cp[2],cp[3],cp[4],cp[5],cp[6],cp[7],cp[8],cp[9]);
|
|
<BR>
|
|
+ switch (cdb_size) {
|
|
<BR>
|
|
+ default:
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ case 6:
|
|
<BR>
|
|
+ scs = (struct scs *) cmd;
|
|
<BR>
|
|
+ memcpy(SCS_AD(scs),src,SCS_SZ);
|
|
<BR>
|
|
+ scs->ss_lun = 0;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_cmdpt = SCS_AD(scs);
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_cmdsz = SCS_SZ;
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ case 10:
|
|
<BR>
|
|
+ scm = (struct scm *) cmd;
|
|
<BR>
|
|
+ memcpy(SCM_AD(scm),src,SCM_SZ);
|
|
<BR>
|
|
+ scm->sm_lun = 0;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_cmdpt = SCM_AD(scm);
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_cmdsz = SCM_SZ;
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ case 12:
|
|
<BR>
|
|
+ scv = (struct scv *) cmd;
|
|
<BR>
|
|
+ memcpy(SCV_AD(scv),src,SCV_SZ);
|
|
<BR>
|
|
+ scv->sv_lun = 0;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_cmdpt = SCV_AD(scv);
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_cmdsz = SCV_SZ;
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ if (dst_size && *dst_size)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ assert (cdb_size == src_size);
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_mode = SCB_READ;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_datapt = dst;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_datasz = *dst_size;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ else
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ assert (cdb_size <= src_size);
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_mode = SCB_WRITE;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_datapt = (char *) src + cdb_size;
|
|
<BR>
|
|
+ if ( (sb_ptr->SCB.sc_datasz = src_size - cdb_size) > 0 ) {
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_mode = SCB_WRITE;
|
|
<BR>
|
|
+ } else {
|
|
<BR>
|
|
+ /* also use READ mode if the backends have write with length 0 */
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_mode = SCB_READ;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_time = 60000; /* 1 min timeout */
|
|
<BR>
|
|
+ DBG(1, "sanei_scsi_cmd: sc_mode = %d, sc_cmdsz = %d, sc_datasz = %d\n",
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_mode, sb_ptr->SCB.sc_cmdsz, sb_ptr->SCB.sc_datasz);
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ /* do read write by normal read or write system calls */
|
|
<BR>
|
|
+ /* the driver will lock process in momory and do optimized transfer */
|
|
<BR>
|
|
+ cp = (char *) src;
|
|
<BR>
|
|
+ switch (*cp) {
|
|
<BR>
|
|
+ case 0x0: /* test unit ready */
|
|
<BR>
|
|
+ if (ioctl(fd, SS_TEST, NULL) < 0) {
|
|
<BR>
|
|
+ return SANE_STATUS_DEVICE_BUSY;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ case SS_READ:
|
|
<BR>
|
|
+ case SM_READ:
|
|
<BR>
|
|
+ if (*dst_size > 0x2048) {
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_datapt = NULL;
|
|
<BR>
|
|
+ sb_ptr->SCB.sc_datasz = 0;
|
|
<BR>
|
|
+ if (memcmp(sb_ptr->SCB.sc_cmdpt,lastrcmd,sb_ptr->SCB.sc_cmdsz) ) {
|
|
<BR>
|
|
+ /* set the command block for the next read or write */
|
|
<BR>
|
|
+ memcpy(lastrcmd,sb_ptr->SCB.sc_cmdpt,sb_ptr->SCB.sc_cmdsz);
|
|
<BR>
|
|
+ if (!ioctl (fd, SDI_SEND, sb_ptr)) {
|
|
<BR>
|
|
+ *dst_size = read(fd , dst, *dst_size);
|
|
<BR>
|
|
+ if (*dst_size == -1) {
|
|
<BR>
|
|
+ perror("sanei-scsi:UW-driver read ");
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ } else {
|
|
<BR>
|
|
+ *dst_size = read(fd , dst, *dst_size);
|
|
<BR>
|
|
+ if (*dst_size == -1) {
|
|
<BR>
|
|
+ perror("sanei-scsi:UW-driver read ");
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ /* fall through for small read */
|
|
<BR>
|
|
+ default:
|
|
<BR>
|
|
+ if (ioctl (fd, SDI_SEND, sb_ptr) < 0)
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ DBG(1, "sanei_scsi_cmd: ioctl(SDI_SEND) FAILED: %s\n",
|
|
<BR>
|
|
+ strerror (errno));
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ if (dst_size) *dst_size = sb_ptr->SCB.sc_datasz;
|
|
<BR>
|
|
+#ifdef UWSUPPORTED /* at this time not supported by driver */
|
|
<BR>
|
|
+ if (sb_ptr->SCB.sc_comp_code != SDI_ASW ) {
|
|
<BR>
|
|
+ DBG(1, "sanei_scsi_cmd: scsi_cmd failture %x\n",sb_ptr->SCB.sc_comp_code);
|
|
<BR>
|
|
+ if (sb_ptr->SCB.sc_comp_code == SDI_CKSTAT && sb_ptr->SCB.sc_status == S_CKCON)
|
|
<BR>
|
|
+ if (fd_info[fd].sense_handler) {
|
|
<BR>
|
|
+ void *arg = fd_info[fd].sense_handler_arg;
|
|
<BR>
|
|
+ return (*fd_info[fd].sense_handler) (fd, (u_char *)&sb_ptr->SCB.sc_link, arg);
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ return SANE_STATUS_IO_ERROR;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+#endif
|
|
<BR>
|
|
+ break;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ return SANE_STATUS_GOOD;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+}
|
|
<BR>
|
|
+#endif /* USE == SYSVR4_INTERFACE */
|
|
<BR>
|
|
<P><P><P><PRE>
|
|
--
|
|
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
|
|
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20Unstable%20development%20version%20moving%20to%20test%20phase&In-Reply-To=<388B82C2.4DABD0EA@rapp-informatik.de>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0188.html">Enno Wein: "Nikon coolscan LS-2000"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0186.html">Wolfgang Rapp: "Re: Unstable development version moving to test phase"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0161.html">Petter Reinholdtsen: "Unstable development version moving to test phase"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0195.html">Petter Reinholdtsen: "Re: Unstable development version moving to test phase"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#187">[ date ]</A>
|
|
<A HREF="index.html#187">[ thread ]</A>
|
|
<A HREF="subject.html#187">[ subject ]</A>
|
|
<A HREF="author.html#187">[ author ]</A>
|
|
</UL>
|
|
<!-- trailer="footer" -->
|
|
<HR NOSHADE>
|
|
<P>
|
|
<SMALL>
|
|
<EM>
|
|
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
|
|
: <EM>Sun Jan 23 2000 - 12:40:09 PST</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|