kopia lustrzana https://gitlab.com/sane-project/website
167 wiersze
5.0 KiB
HTML
167 wiersze
5.0 KiB
HTML
<!-- received="Thu Jul 31 12:41:37 1997 MST" -->
|
|
<!-- sent="Thu, 31 Jul 1997 15:19:01 -0400" -->
|
|
<!-- name="Michael Sweet" -->
|
|
<!-- email="mike@easysw.com" -->
|
|
<!-- subject="Preliminary SCSI support for SGI IRIX!" -->
|
|
<!-- id="" -->
|
|
<!-- inreplyto="" -->
|
|
<title>sane-devel: Preliminary SCSI support for SGI IRIX!</title>
|
|
<h1>Preliminary SCSI support for SGI IRIX!</h1>
|
|
<b>Michael Sweet</b> (<a href="mailto:mike@easysw.com"><i>mike@easysw.com</i></a>)<br>
|
|
<i>Thu, 31 Jul 1997 15:19:01 -0400</i>
|
|
<p>
|
|
<ul>
|
|
<li> <b>Messages sorted by:</b> <a href="date.html#0">[ date ]</a><a href="index.html#0">[ thread ]</a><a href="subject.html#0">[ subject ]</a><a href="author.html#0">[ author ]</a>
|
|
<!-- next="start" -->
|
|
<li> <b>Next message:</b> <a href="0001.html">Michael Sweet: "Preview Window problems"</a>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
</ul>
|
|
<!-- body="start" -->
|
|
This is a multi-part message in MIME format.<br>
|
|
<p>
|
|
--------------2781446B794B<br>
|
|
Content-Type: text/plain; charset=us-ascii<br>
|
|
Content-Transfer-Encoding: 7bit<br>
|
|
<p>
|
|
OK, attached is a unified DIFF of the changes to sanei_scsi.c for the<br>
|
|
0.62 release of SANE. These changes provide SCSI support for SGI IRIX<br>
|
|
and seem to work with my MUSTEK MFS-6000CX.<br>
|
|
<p>
|
|
I'd appreciate some feedback from other users with SGIs to see if they<br>
|
|
experience any problems with the other scanner drivers.<br>
|
|
<p>
|
|
Enjoy!<br>
|
|
<p>
|
|
<pre>
|
|
--
|
|
________________________________________________________________________
|
|
Mike Sweet Software for SGI and Sun Easy Software Products
|
|
(301) 373-9603 Workstations 44145 Airport View Drive
|
|
mike@easysw.com <a href="http://www.easysw.com">http://www.easysw.com</a> Hollywood, Maryland 20636
|
|
<p>
|
|
SUPPORT THE ANTI-SPAM AMENDMENT! - <a href="http://www.cauce.org">http://www.cauce.org</a>
|
|
<p>
|
|
--------------2781446B794B
|
|
Content-Type: text/plain; charset=us-ascii; name="irix.diffs"
|
|
Content-Transfer-Encoding: 7bit
|
|
Content-Disposition: inline; filename="irix.diffs"
|
|
<p>
|
|
--- sanei/sanei_scsi.c.orig Sat Jul 19 12:51:35 1997
|
|
+++ sanei/sanei_scsi.c Thu Jul 31 15:13:13 1997
|
|
@@ -60,8 +60,13 @@
|
|
#define HPUX_INTERFACE 3
|
|
#define OPENSTEP_INTERFACE 4
|
|
#define DECUNIX_INTERFACE 5
|
|
+#define IRIX_INTERFACE 6
|
|
+#define SOLARIS_INTERFACE 7
|
|
|
|
-#ifdef HAVE_SCSI_SG_H
|
|
+#ifdef __sgi
|
|
+# define USE IRIX_INTERFACE
|
|
+# include <sys/dsreq.h>
|
|
+#elif defined(HAVE_SCSI_SG_H)
|
|
# define USE LINUX_INTERFACE
|
|
# include <scsi/sg.h>
|
|
#else
|
|
@@ -288,6 +293,74 @@
|
|
}
|
|
|
|
|
|
+#if USE == IRIX_INTERFACE
|
|
+SANE_Status
|
|
+sanei_scsi_cmd(int fd,
|
|
+ const void *src,
|
|
+ size_t src_size,
|
|
+ void *dst,
|
|
+ size_t *dst_size)
|
|
+{
|
|
+ dsreq_t scsi_req; /* SCSI request */
|
|
+ unsigned char sensebuf[1024]; /* Request sense buffer */
|
|
+ size_t cdb_size; /* Size of SCSI command */
|
|
+
|
|
+
|
|
+ cdb_size = CDB_SIZE(*(u_char *)src);
|
|
+
|
|
+ memset(&scsi_req, 0, sizeof(scsi_req));
|
|
+
|
|
+ if (dst != NULL)
|
|
+ {
|
|
+ /*
|
|
+ * SCSI command returning/reading data...
|
|
+ */
|
|
+
|
|
+ scsi_req.ds_flags = DSRQ_READ | DSRQ_SENSE;
|
|
+ scsi_req.ds_time = 120 * 1000;
|
|
+ scsi_req.ds_cmdbuf = (caddr_t)src;
|
|
+ scsi_req.ds_cmdlen = cdb_size;
|
|
+ scsi_req.ds_databuf = (caddr_t)dst;
|
|
+ scsi_req.ds_datalen = *dst_size;
|
|
+ scsi_req.ds_sensebuf = (caddr_t)sensebuf;
|
|
+ scsi_req.ds_senselen = sizeof(sensebuf);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ /*
|
|
+ * SCSI command sending/writing data...
|
|
+ */
|
|
+
|
|
+ scsi_req.ds_flags = DSRQ_WRITE | DSRQ_SENSE;
|
|
+ scsi_req.ds_time = 120 * 1000;
|
|
+ scsi_req.ds_cmdbuf = (caddr_t)src;
|
|
+ scsi_req.ds_cmdlen = cdb_size;
|
|
+ scsi_req.ds_databuf = (caddr_t)src + cdb_size;
|
|
+ scsi_req.ds_datalen = src_size - cdb_size;
|
|
+ scsi_req.ds_sensebuf = (caddr_t)sensebuf;
|
|
+ scsi_req.ds_senselen = sizeof(sensebuf);
|
|
+ }
|
|
+
|
|
+ if (ioctl(fd, DS_ENTER, &scsi_req) < 0 ||
|
|
+ scsi_req.ds_status != 0)
|
|
+ {
|
|
+ DBG(1, "sanei_scsi_cmd: SCSI command failed: %s\n", strerror(errno));
|
|
+
|
|
+ if (scsi_req.ds_status == STA_BUSY)
|
|
+ return (SANE_STATUS_DEVICE_BUSY);
|
|
+ else if ((sensebuf[0] & 0x80) && fd_info[fd].sense_handler)
|
|
+ return (*fd_info[fd].sense_handler)(fd, sensebuf);
|
|
+ else
|
|
+ return (SANE_STATUS_IO_ERROR);
|
|
+ };
|
|
+
|
|
+ if (dst_size != NULL)
|
|
+ *dst_size = scsi_req.ds_datasent;
|
|
+
|
|
+ return (SANE_STATUS_GOOD);
|
|
+}
|
|
+#endif /* USE == IRIX_INTERFACE */
|
|
+
|
|
#if USE == LINUX_INTERFACE
|
|
|
|
#include <signal.h>
|
|
@@ -424,6 +497,8 @@
|
|
*idp = req;
|
|
return SANE_STATUS_GOOD;
|
|
}
|
|
+
|
|
+
|
|
|
|
SANE_Status
|
|
sanei_scsi_req_wait (void *id)
|
|
<p>
|
|
--------------2781446B794B--
|
|
<p>
|
|
<pre>
|
|
--
|
|
Source code, list archive, and docs: <a href="http://www.azstarnet.com/~axplinux/sane/">http://www.azstarnet.com/~axplinux/sane/</a>
|
|
To unsubscribe: mail -s unsubscribe <a href="mailto:sane-devel-request@listserv.azstarnet.com">sane-devel-request@listserv.azstarnet.com</a>
|
|
</pre>
|
|
<!-- body="end" -->
|
|
<p>
|
|
<ul>
|
|
<!-- next="start" -->
|
|
<li> <b>Next message:</b> <a href="0001.html">Michael Sweet: "Preview Window problems"</a>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
</ul>
|