sane-project-website/old-archive/2000-01/0187.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=&lt;388B82C2.4DABD0EA@rapp-informatik.de&gt;"><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>
&nbsp;&nbsp;&nbsp;&nbsp;cannon.c
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;snapscan-sources.c
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;os=-sco3.2v2
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;
<BR>
+ -7.1.* | sysv4.2uw*)
<BR>
+ os=-unixware
<BR>
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
<BR>
+ ;;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-udk*)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;
<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys/scanio.h scsi.h sys/scsi.h sys/scsicmd.h sys/scsiio.h \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bsd/dev/scsireg.h scsi/sg.h /usr/src/linux/include/scsi/sg.h io/cam/cam.h \
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>
&nbsp;
<BR>
&nbsp;dnl Checks for typedefs, structures, and compiler characteristics.
<BR>
&nbsp;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>
&nbsp;/* Define if you have the &lt;sys/scsi.h&gt; header file. */
<BR>
&nbsp;#undef HAVE_SYS_SCSI_H
<BR>
&nbsp;
<BR>
+/* Define if you have the &lt;sys/sdi_comm.h&gt; header file. */
<BR>
+#undef HAVE_SYS_SDI_COMM_H
<BR>
+
<BR>
+/* Define if you have the &lt;sys/passthrudef.h.h&gt; header file. */
<BR>
+#undef HAVE_SYS_PASSTHRUDEF_H
<BR>
+
<BR>
&nbsp;/* Define if you have the &lt;sys/scsi/targets/scgio.h&gt; header file. */
<BR>
&nbsp;#undef HAVE_SYS_SCSI_TARGETS_SCGIO_H
<BR>
&nbsp;
<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>
&nbsp;#define AIX_GSC_INTERFACE 11
<BR>
&nbsp;#define DOMAINOS_INTERFACE 12
<BR>
&nbsp;#define FREEBSD_CAM_INTERFACE 13
<BR>
+#define SYSVR4_INTERFACE 14
<BR>
+#define SCO_UW71_INTERFACE 15
<BR>
&nbsp;
<BR>
&nbsp;#if defined (HAVE_SCSI_SG_H)
<BR>
&nbsp;# define USE LINUX_INTERFACE
<BR>
@@ -114,6 +116,20 @@
<BR>
&nbsp;# include &lt;invent.h&gt;
<BR>
&nbsp;#elif defined (HAVE_SYS_SCSI_H)
<BR>
&nbsp;# include &lt;sys/scsi.h&gt;
<BR>
+# ifdef HAVE_SYS_SDI_COMM_H
<BR>
+# ifdef HAVE_SYS_PASSTHRUDEF_H
<BR>
+# define USE SCO_UW71_INTERFACE
<BR>
+# include &lt;sys/scsi.h&gt;
<BR>
+# include &lt;sys/sdi_edt.h&gt;
<BR>
+# include &lt;sys/sdi.h&gt;
<BR>
+# include &lt;sys/passthrudef.h&gt;
<BR>
+#else
<BR>
+# define USE SYSVR4_INTERFACE /* Unixware 2.x tested */
<BR>
+# define HAVE_SYSV_DRIVER
<BR>
+# include &lt;sys/sdi_edt.h&gt;
<BR>
+# include &lt;sys/sdi_comm.h&gt;
<BR>
+#endif
<BR>
+# else
<BR>
&nbsp;# ifdef SCTL_READ
<BR>
&nbsp;# define USE HPUX_INTERFACE
<BR>
&nbsp;# else
<BR>
@@ -122,6 +138,7 @@
<BR>
&nbsp;# include &lt;gscdds.h&gt;
<BR>
&nbsp;# else
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* This happens for AIX without gsc and possibly other platforms... */
<BR>
+# endif
<BR>
&nbsp;# endif
<BR>
&nbsp;# endif
<BR>
&nbsp;#elif defined (HAVE_OS2_H)
<BR>
@@ -177,6 +194,16 @@
<BR>
&nbsp;# define MAX_DATA SG_BIG_BUFF
<BR>
&nbsp;#endif
<BR>
&nbsp;
<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>
&nbsp;#if USE == OPENSTEP_INTERFACE
<BR>
&nbsp;# define MAX_DATA (120*1024)
<BR>
&nbsp;#endif
<BR>
@@ -841,6 +868,31 @@
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return SANE_STATUS_INVAL;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}
<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, &quot;/dev/passthru0:%d,%d,%d,%d&quot;, &amp;bus, &amp;cnt, &amp;id, &amp;lun) != 4)
<BR>
+ {
<BR>
+ DBG (1, &quot;sanei_scsi_open: device name %s is not a valid\n&quot;,
<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, &amp;dev_addr, PT_EXCLUSIVE, &amp;pt_handle)!=0)
<BR>
+ {
<BR>
+ DBG (1, &quot;sanei_scsi_open: pt_open failed: %s!\n&quot;, strerror(errno));
<BR>
+ return SANE_STATUS_INVAL;
<BR>
+ }
<BR>
+ else
<BR>
+ fd = (int)pt_handle;
<BR>
+ }
<BR>
&nbsp;#else
<BR>
&nbsp;#if defined(SGIOCSTL) || (USE == SOLARIS_INTERFACE)
<BR>
&nbsp;&nbsp;&nbsp;{
<BR>
@@ -952,6 +1004,10 @@
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return SANE_STATUS_INVAL;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;#endif
<BR>
+#if USE == SYSVR4_INTERFACE
<BR>
+ memset(lastrcmd,0,16); /* reinitialize last read command block */
<BR>
+#endif
<BR>
+
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;if (fdp)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*fdp = fd;
<BR>
@@ -1996,6 +2052,72 @@
<BR>
&nbsp;}
<BR>
&nbsp;#endif /* USE == SCO_OS5_INTERFACE */
<BR>
&nbsp;
<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 &lt; 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 &amp;&amp; *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 &lt;= 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, &amp;elapsed, &amp;compcode,
<BR>
+ &amp;status, sense_buffer, sizeof(sense_buffer)) != 0)
<BR>
+ {
<BR>
+ DBG (1, &quot;sanei_scsi_cmd: pt_send failed: %s!\n&quot;, strerror(errno));
<BR>
+ }
<BR>
+ else
<BR>
+ {
<BR>
+ DBG (2, &quot;sanei_scsi_cmd completed with: compcode = %x, status = %x\n&quot;,
<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, &quot;Sense Data:\n&quot;);
<BR>
+ for (i=0; i&lt;sizeof(sense_buffer); i++)
<BR>
+ DBG (2, &quot;%.2X &quot;, sense_buffer[i]);
<BR>
+ DBG (2, &quot;\n&quot;);
<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>
&nbsp;#if USE == OS2_INTERFACE
<BR>
&nbsp;
<BR>
&nbsp;#define WE_HAVE_FIND_DEVICES
<BR>
@@ -2752,3 +2874,148 @@
<BR>
&nbsp;}
<BR>
&nbsp;
<BR>
&nbsp;#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=&lt;388B82C2.4DABD0EA@rapp-informatik.de&gt;">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 (&amp;cmd, 0, 16);
<BR>
+ sb_ptr = &amp;sb;
<BR>
+ sb_ptr-&gt;sb_type = ISCB_TYPE;
<BR>
+ cp = (char *) src;
<BR>
+ DBG(1, &quot;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&quot;, 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-&gt;ss_lun = 0;
<BR>
+ sb_ptr-&gt;SCB.sc_cmdpt = SCS_AD(scs);
<BR>
+ sb_ptr-&gt;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-&gt;sm_lun = 0;
<BR>
+ sb_ptr-&gt;SCB.sc_cmdpt = SCM_AD(scm);
<BR>
+ sb_ptr-&gt;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-&gt;sv_lun = 0;
<BR>
+ sb_ptr-&gt;SCB.sc_cmdpt = SCV_AD(scv);
<BR>
+ sb_ptr-&gt;SCB.sc_cmdsz = SCV_SZ;
<BR>
+ break;
<BR>
+ }
<BR>
+ if (dst_size &amp;&amp; *dst_size)
<BR>
+ {
<BR>
+ assert (cdb_size == src_size);
<BR>
+ sb_ptr-&gt;SCB.sc_mode = SCB_READ;
<BR>
+ sb_ptr-&gt;SCB.sc_datapt = dst;
<BR>
+ sb_ptr-&gt;SCB.sc_datasz = *dst_size;
<BR>
+ }
<BR>
+ else
<BR>
+ {
<BR>
+ assert (cdb_size &lt;= src_size);
<BR>
+ sb_ptr-&gt;SCB.sc_mode = SCB_WRITE;
<BR>
+ sb_ptr-&gt;SCB.sc_datapt = (char *) src + cdb_size;
<BR>
+ if ( (sb_ptr-&gt;SCB.sc_datasz = src_size - cdb_size) &gt; 0 ) {
<BR>
+ sb_ptr-&gt;SCB.sc_mode = SCB_WRITE;
<BR>
+ } else {
<BR>
+ /* also use READ mode if the backends have write with length 0 */
<BR>
+ sb_ptr-&gt;SCB.sc_mode = SCB_READ;
<BR>
+ }
<BR>
+ }
<BR>
+ sb_ptr-&gt;SCB.sc_time = 60000; /* 1 min timeout */
<BR>
+ DBG(1, &quot;sanei_scsi_cmd: sc_mode = %d, sc_cmdsz = %d, sc_datasz = %d\n&quot;,
<BR>
+ sb_ptr-&gt;SCB.sc_mode, sb_ptr-&gt;SCB.sc_cmdsz, sb_ptr-&gt;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) &lt; 0) {
<BR>
+ return SANE_STATUS_DEVICE_BUSY;
<BR>
+ }
<BR>
+ break;
<BR>
+ case SS_READ:
<BR>
+ case SM_READ:
<BR>
+ if (*dst_size &gt; 0x2048) {
<BR>
+ sb_ptr-&gt;SCB.sc_datapt = NULL;
<BR>
+ sb_ptr-&gt;SCB.sc_datasz = 0;
<BR>
+ if (memcmp(sb_ptr-&gt;SCB.sc_cmdpt,lastrcmd,sb_ptr-&gt;SCB.sc_cmdsz) ) {
<BR>
+ /* set the command block for the next read or write */
<BR>
+ memcpy(lastrcmd,sb_ptr-&gt;SCB.sc_cmdpt,sb_ptr-&gt;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(&quot;sanei-scsi:UW-driver read &quot;);
<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(&quot;sanei-scsi:UW-driver read &quot;);
<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) &lt; 0)
<BR>
+ {
<BR>
+ DBG(1, &quot;sanei_scsi_cmd: ioctl(SDI_SEND) FAILED: %s\n&quot;,
<BR>
+ strerror (errno));
<BR>
+ return SANE_STATUS_IO_ERROR;
<BR>
+ }
<BR>
+ if (dst_size) *dst_size = sb_ptr-&gt;SCB.sc_datasz;
<BR>
+#ifdef UWSUPPORTED /* at this time not supported by driver */
<BR>
+ if (sb_ptr-&gt;SCB.sc_comp_code != SDI_ASW ) {
<BR>
+ DBG(1, &quot;sanei_scsi_cmd: scsi_cmd failture %x\n&quot;,sb_ptr-&gt;SCB.sc_comp_code);
<BR>
+ if (sb_ptr-&gt;SCB.sc_comp_code == SDI_CKSTAT &amp;&amp; sb_ptr-&gt;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 *)&amp;sb_ptr-&gt;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=&lt;388B82C2.4DABD0EA@rapp-informatik.de&gt;">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>