sane-project-website/old-archive/1998-06/0216.html

413 wiersze
10 KiB
HTML

<!-- received="Mon Jun 29 08:27:53 1998 PDT" -->
<!-- sent="Mon, 29 Jun 1998 17:24:47 +0200 (CEST)" -->
<!-- name="Holger Frahm" -->
<!-- email="frahm@itp.uni-hannover.de" -->
<!-- subject="Epson GT9500 on AIX 4.2.1" -->
<!-- id="199806291524.RAA21354@wega.itp.uni-hannover.de" -->
<!-- inreplyto="" -->
<title>sane-devel: Epson GT9500 on AIX 4.2.1</title>
<h1>Epson GT9500 on AIX 4.2.1</h1>
<b>Holger Frahm</b> (<a href="mailto:frahm@itp.uni-hannover.de"><i>frahm@itp.uni-hannover.de</i></a>)<br>
<i>Mon, 29 Jun 1998 17:24:47 +0200 (CEST)</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#216">[ date ]</a><a href="index.html#216">[ thread ]</a><a href="subject.html#216">[ subject ]</a><a href="author.html#216">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0217.html">Warren Early: "Link to Sane development"</a>
<li> <b>Previous message:</b> <a href="0215.html">Christian Müller: "Color Problems with SANE 0.73 and Microtek Scanmaker E6"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
--ELM899133886-22328-0_<br>
Content-Type: text/plain; charset=US-ASCII<br>
Content-Transfer-Encoding: 7bit<br>
<p>
We managed to get the sane-epson library of sane-0.73 to work for an<br>
Epson GT9500 scanner on AIX 4.2.1 with<br>
CC=cc ./configure --disable-shared<br>
using the patch appended.<br>
<p>
(Note that this _includes_ a patch by Christian Bucher for a GT9000<br>
which has been posted earlier this month).<br>
<p>
<pre>
--
Holger Frahm email: <a href="mailto:frahm@itp.uni-hannover.de">frahm@itp.uni-hannover.de</a>
WWW: <a href="http://www.itp.uni-hannover.de/~frahm">http://www.itp.uni-hannover.de/~frahm</a>
Phone: +49 (511) 762-2234, FAX: +49 (511) 762-3023
<p>
--ELM899133886-22328-0_
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: attachment; filename=epson.2.patch
Content-Description: /tmp/epson.2.patch
Content-Transfer-Encoding: 7bit
<p>
*** backend/epson.c.orig Mon Jun 29 17:01:22 1998
--- backend/epson.c Mon Jun 29 17:14:30 1998
***************
*** 60,65 ****
--- 60,66 ----
#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;
+ #include &lt;ctype.h&gt;
#include &lt;sane/sane.h&gt;
#include &lt;sane/saneopts.h&gt;
***************
*** 97,102 ****
--- 98,106 ----
#define EPSON_LEVEL_B1 2
#define EPSON_LEVEL_B2 3
#define EPSON_LEVEL_B3 4
+ #define EPSON_LEVEL_B4 5
+ #define EPSON_LEVEL_B5 6
+ #define EPSON_LEVEL_B6 7
#define EPSON_LEVEL_DEFAULT EPSON_LEVEL_B3
***************
*** 130,135 ****
--- 134,145 ----
{"B2", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1}
,
{"B3", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
+ ,
+ {"B4", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
+ ,
+ {"B5", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
+ ,
+ {"B6", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
};
/* TODO: speed */
***************
*** 147,153 ****
cmd[4] = buf_size;
memcpy (cmd + 6, buf, buf_size);
! if (SANE_STATUS_GOOD == (*status = sanei_scsi_cmd (fd, cmd, sizeof (cmd) + buf_size, NULL, NULL)))
return buf_size;
return 0;
--- 157,163 ----
cmd[4] = buf_size;
memcpy (cmd + 6, buf, buf_size);
! if (SANE_STATUS_GOOD == (*status = sanei_scsi_cmd (fd, cmd, 6 + buf_size, NULL, NULL)))
return buf_size;
return 0;
***************
*** 157,162 ****
--- 167,183 ----
send (Epson_Scanner * s, const void *buf, size_t buf_size, SANE_Status * status)
{
+ DBG( 3, "send buf, size = %u\n", buf_size);
+ /*
+ {
+ size_t k;
+ const char * s = buf;
+
+ for( k = 0; k &lt; buf_size; k++) {
+ DBG( 3, "buf[%u] %02x %c\n", k, s[ k], isprint( s[ k]) ? s[ k] : '.');
+ }
+ }
+ */
if (s-&gt;hw-&gt;is_scsi)
{
return scsi_write (s-&gt;fd, buf, buf_size, status);
***************
*** 196,209 ****
static int
receive (Epson_Scanner * s, void *buf, size_t buf_size, SANE_Status * status)
{
if (s-&gt;hw-&gt;is_scsi)
{
! return scsi_read (s-&gt;fd, buf, buf_size, status);
}
else
{
- int n;
if (buf_size == (n = sanei_pio_read (s-&gt;fd, buf, buf_size)))
*status = SANE_STATUS_GOOD;
--- 217,230 ----
static int
receive (Epson_Scanner * s, void *buf, size_t buf_size, SANE_Status * status)
{
+ int n;
if (s-&gt;hw-&gt;is_scsi)
{
! n = scsi_read (s-&gt;fd, buf, buf_size, status);
}
else
{
if (buf_size == (n = sanei_pio_read (s-&gt;fd, buf, buf_size)))
*status = SANE_STATUS_GOOD;
***************
*** 210,220 ****
else
*status = SANE_STATUS_INVAL;
- return n;
}
! /* never reached */
}
static SANE_Status
inquiry (int fd, int page_code, void *buf, size_t * buf_size)
--- 231,251 ----
else
*status = SANE_STATUS_INVAL;
}
! DBG( 3, "receive buf, expected = %u, got = %u\n", buf_size, n);
! /*
! {
! int k;
! const char * s = buf;
!
! for( k = 0; k &lt; n; k++) {
! DBG( 3, "buf[%u] %02x %c\n", k, s[ k], isprint( s[ k]) ? s[ k] : '.');
! }
}
+ */
+ return n;
+ }
static SANE_Status
inquiry (int fd, int page_code, void *buf, size_t * buf_size)
***************
*** 557,563 ****
u_char status;
u_short count;
! u_char buf[0];
}
EpsonHdrRec, *EpsonHdr;
--- 588,594 ----
u_char status;
u_short count;
! u_char buf[1];
}
EpsonHdrRec, *EpsonHdr;
***************
*** 571,577 ****
u_char type;
u_char level;
! u_char buf[0];
}
EpsonIdentRec, *EpsonIdent;
--- 602,608 ----
u_char type;
u_char level;
! u_char buf[1];
}
EpsonIdentRec, *EpsonIdent;
***************
*** 598,612 ****
if (SANE_STATUS_GOOD != *status)
return (EpsonHdr) 0;
! buf = (u_char *) head;
! receive (s, buf, 1, status);
if (SANE_STATUS_GOOD != *status)
return (EpsonHdr) 0;
- buf++;
! DBG (4, "code %02x\n", (int) head-&gt;code);
switch (head-&gt;code)
{
--- 629,649 ----
if (SANE_STATUS_GOOD != *status)
return (EpsonHdr) 0;
! buf = (u_char *) head;
+ if( s-&gt;hw-&gt;is_scsi) {
+ receive (s, buf, 4, status);
+ /* buf += 4;*/
+ } else {
+ receive (s, buf, 1, status);
+ buf += 1;
+ }
+
if (SANE_STATUS_GOOD != *status)
return (EpsonHdr) 0;
! DBG (4, "code 0x%02x\n", (int) head-&gt;code);
switch (head-&gt;code)
{
***************
*** 626,638 ****
break;
case STX:
- receive (s, buf, 3, status);
if (SANE_STATUS_GOOD != *status)
return (EpsonHdr) 0;
- /* buf += 3; */
-
DBG (4, "status %02x\n", (int) head-&gt;status);
DBG (4, "count %d\n", (int) head-&gt;count);
--- 663,679 ----
break;
case STX:
+ if( s-&gt;hw-&gt;is_scsi) {
+ /* nope */
+ } else {
+ receive (s, buf, 3, status);
+ /* buf += 3;*/
+ }
+
if (SANE_STATUS_GOOD != *status)
return (EpsonHdr) 0;
DBG (4, "status %02x\n", (int) head-&gt;status);
DBG (4, "count %d\n", (int) head-&gt;count);
***************
*** 709,721 ****
}
if (buf[0] != TYPE_PROCESSOR
! || strncmp (buf + 8, "EPSON", 5) != 0
! || strncmp (buf + 16, "SCANNER ", 8) != 0)
! {
! DBG (1, "attach: device doesn't look like an Epson scanner\n");
! myclose (s);
! return SANE_STATUS_INVAL;
! }
}
else
{
--- 750,764 ----
}
if (buf[0] != TYPE_PROCESSOR
! || strncmp (buf + 8, "EPSON", 5) != 0
! || (strncmp (buf + 16, "SCANNER ", 8) != 0 &amp;&amp;
! strncmp (buf + 14, "SCANNER ", 8) != 0))
! {
! DBG (1, "attach: device doesn't look like an Epson scanner\n");
! myclose (s);
! return SANE_STATUS_INVAL;
! }
!
}
else
{
***************
*** 731,752 ****
{
EpsonIdent ident = (EpsonIdent) command (s, "\033I", 2, &amp;status);
! u_char *buf = ident-&gt;buf;
int n, k;
! DBG (1, "type %3c %02x\n", ident-&gt;type, ident-&gt;type);
! DBG (1, "level %3c %02x\n", ident-&gt;level, ident-&gt;level);
! s-&gt;hw-&gt;res_list_size = 0;
s-&gt;hw-&gt;res_list = (SANE_Int *) calloc (s-&gt;hw-&gt;res_list_size, sizeof (SANE_Int));
if (NULL == s-&gt;hw-&gt;res_list)
{
! DBG (0, "problem\n");
exit (0);
}
! for (n = ident-&gt;count; n; n -= k, buf += k)
{
switch (*buf)
{
--- 774,801 ----
{
EpsonIdent ident = (EpsonIdent) command (s, "\033I", 2, &amp;status);
! u_char *buf;
int n, k;
! if( NULL == ident) {
! DBG (0, "ident failed\n");
! return status;
! }
!
! DBG (1, "type %3c 0x%02x\n", ident-&gt;type, ident-&gt;type);
! DBG (1, "level %3c 0x%02x\n", ident-&gt;level, ident-&gt;level);
! /* HF s-&gt;hw-&gt;res_list_size = 0; */
! s-&gt;hw-&gt;res_list_size = 1;
s-&gt;hw-&gt;res_list = (SANE_Int *) calloc (s-&gt;hw-&gt;res_list_size, sizeof (SANE_Int));
if (NULL == s-&gt;hw-&gt;res_list)
{
! DBG (0, "no mem\n");
exit (0);
}
! for (n = ident-&gt;count, buf = ident-&gt;buf; n; n -= k, buf += k)
{
switch (*buf)
{
***************
*** 759,765 ****
if (NULL == s-&gt;hw-&gt;res_list)
{
! DBG (0, "problem\n");
exit (0);
}
--- 808,814 ----
if (NULL == s-&gt;hw-&gt;res_list)
{
! DBG (0, "no mem\n");
exit (0);
}
<p>
--ELM899133886-22328-0_--
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0217.html">Warren Early: "Link to Sane development"</a>
<li> <b>Previous message:</b> <a href="0215.html">Christian Müller: "Color Problems with SANE 0.73 and Microtek Scanmaker E6"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>