[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-12 Thread David Solomon
I am having terrible problems getting SANE to work with my AVISION
scanner on the NSLU2.  I did compile SANE 1.0.18 for the NSLU2, but
don't think it is the code.  Anyone have any suggestions?

I have the following modules loaded:
root at OpenWrt:/dev# lsmod
Module  Size  Used byNot tainted
usb_storage57035  0
sd_mod 10384  0
scsi_mod   55784  2 usb_storage,sd_mod
usbserial  20336  0
cdc_acm 8068  0
ehci_hcd   25004  0
uhci_hcd   18700  0
ohci_hcd   13348  0
usbcore79548  7
usb_storage,usbserial,cdc_acm,ehci_hcd,uhci_hcd,ohci_hcd

Here are my installed applications:
root at OpenWrt:/dev# ipkg list
base-files-ixp4xx-2.6 - 9-7899 -
bridge - 1.0.6-1 -
busybox - 1.4.2-2 -
dnsmasq - 2.38-1 -
dropbear - 0.49-2 -
hotplug2 - 0.9+r102-1 -
iptables - 1.3.7-1 -
kernel - 2.6.21.5-ixp4xx-1 -
kmod-scsi-core - 2.6.21.5-ixp4xx-1 -
kmod-usb-acm - 2.6.21.5-ixp4xx-1 -
kmod-usb-core - 2.6.21.5-ixp4xx-1 -
kmod-usb-ohci - 2.6.21.5-ixp4xx-1 -
kmod-usb-serial - 2.6.21.5-ixp4xx-1 -
kmod-usb-storage - 2.6.21.5-ixp4xx-1 -
kmod-usb-uhci - 2.6.21.5-ixp4xx-1 -
kmod-usb2 - 2.6.21.5-ixp4xx-1 -
libgcc - 4.1.2-9 -
libjpeg - 6b-1 -
libpthread - 0.9.28-9 -
libusb - 0.1.12-1 -
mtd - 5 -
ppp - 2.4.3-7 -
ppp-mod-pppoe - 2.4.3-7 -
sane-backends - 1.0.18-1-TDS -
sane-libs - 1.0.18-1-TDS -
uclibc - 0.9.28-9 -
udev - 106-1 -
udevtrigger - 106-1 -
usbutils - 0.72-1 -
xinetd - 2.3.13-2 -


I am using the 07-09 kernel (I have also tried todays and the 7.06 release):
root at OpenWrt:/dev# uname -r
2.6.21.5


Here is what is happening with SANE:
root at OpenWrt:/dev# SANE_DEBUG_AVISION=255 SANE_DEBUG_DLL=255
SANE_DEBUG_SANEI_USB=255 scanimage -d avision --resolution=50 >
/tmp/tmp.pmg
[sanei_debug] Setting debug level of dll to 255.
[dll] sane_init: SANE dll backend version 1.0.12 from sane-backends 1.0.18
[dll] sane_init: adding backend `abaton' (preloaded)
[dll] sane_init: adding backend `agfafocus' (preloaded)
[dll] sane_init: adding backend `apple' (preloaded)
[dll] sane_init: adding backend `artec' (preloaded)
[dll] sane_init: adding backend `as6e' (preloaded)
[dll] sane_init: adding backend `avision' (preloaded)
[dll] sane_init: adding backend `bh' (preloaded)
[dll] sane_init: adding backend `canon' (preloaded)
[dll] sane_init: adding backend `canon630u' (preloaded)
[dll] sane_init: adding backend `coolscan' (preloaded)
[dll] sane_init: adding backend `coolscan2' (preloaded)
[dll] sane_init: adding backend `dc25' (preloaded)
[dll] sane_init: adding backend `dmc' (preloaded)
[dll] sane_init: adding backend `epson' (preloaded)
[dll] sane_init: adding backend `fujitsu' (preloaded)
[dll] sane_init: adding backend `genesys' (preloaded)
[dll] sane_init: adding backend `gt68xx' (preloaded)
[dll] sane_init: adding backend `hp' (preloaded)
[dll] sane_init: adding backend `leo' (preloaded)
[dll] sane_init: adding backend `lexmark' (preloaded)
[dll] sane_init: adding backend `matsushita' (preloaded)
[dll] sane_init: adding backend `microtek' (preloaded)
[dll] sane_init: adding backend `microtek2' (preloaded)
[dll] sane_init: adding backend `mustek' (preloaded)
[dll] sane_init: adding backend `mustek_usb' (preloaded)
[dll] sane_init: adding backend `nec' (preloaded)
[dll] sane_init: adding backend `pie' (preloaded)
[dll] sane_init: adding backend `pixma' (preloaded)
[dll] sane_init: adding backend `plustek' (preloaded)
[dll] sane_init: adding backend `plustek_pp' (preloaded)
[dll] sane_init: adding backend `ricoh' (preloaded)
[dll] sane_init: adding backend `s9036' (preloaded)
[dll] sane_init: adding backend `sceptre' (preloaded)
[dll] sane_init: adding backend `sharp' (preloaded)
[dll] sane_init: adding backend `sp15c' (preloaded)
[dll] sane_init: adding backend `st400' (preloaded)
[dll] sane_init: adding backend `tamarack' (preloaded)
[dll] sane_init: adding backend `test' (preloaded)
[dll] sane_init: adding backend `teco1' (preloaded)
[dll] sane_init: adding backend `teco2' (preloaded)
[dll] sane_init: adding backend `teco3' (preloaded)
[dll] sane_init: adding backend `umax' (preloaded)
[dll] sane_init: adding backend `umax_pp' (preloaded)
[dll] sane_init: adding backend `umax1220u' (preloaded)
[dll] sane_init: adding backend `artec_eplus48u' (preloaded)
[dll] sane_init: adding backend `ma1509' (preloaded)
[dll] sane_init: adding backend `ibm' (preloaded)
[dll] sane_init: adding backend `hp5400' (preloaded)
[dll] sane_init: adding backend `u12' (preloaded)
[dll] sane_init: adding backend `snapscan' (preloaded)
[dll] sane_init: adding backend `niash' (preloaded)
[dll] sane_init: adding backend `sm3840' (preloaded)
[dll] sane_init: adding backend `hp4200' (preloaded)
[dll] sane_init: adding backend `sm3600' (preloaded)
[dll] sane_init: adding backend `hp3500' (preloaded)
[dll] sane_init: adding backend `stv680' (preloaded)
[dll] sane_init: adding backend `dc210' (preloaded)
[dll] sane_init: adding backend `dc240' (preload

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-12 Thread m. allan noah
note that i have never really used any avision equipment, but you
might try disabling the gamma table in the conf file. man sane-avision
for more.

allan

On 7/12/07, David Solomon  wrote:
> I am having terrible problems getting SANE to work with my AVISION
> scanner on the NSLU2.  I did compile SANE 1.0.18 for the NSLU2, but
> don't think it is the code.  Anyone have any suggestions?
>
> I have the following modules loaded:
> root at OpenWrt:/dev# lsmod
> Module  Size  Used byNot tainted
> usb_storage57035  0
> sd_mod 10384  0
> scsi_mod   55784  2 usb_storage,sd_mod
> usbserial  20336  0
> cdc_acm 8068  0
> ehci_hcd   25004  0
> uhci_hcd   18700  0
> ohci_hcd   13348  0
> usbcore79548  7
> usb_storage,usbserial,cdc_acm,ehci_hcd,uhci_hcd,ohci_hcd
>
> Here are my installed applications:
> root at OpenWrt:/dev# ipkg list
> base-files-ixp4xx-2.6 - 9-7899 -
> bridge - 1.0.6-1 -
> busybox - 1.4.2-2 -
> dnsmasq - 2.38-1 -
> dropbear - 0.49-2 -
> hotplug2 - 0.9+r102-1 -
> iptables - 1.3.7-1 -
> kernel - 2.6.21.5-ixp4xx-1 -
> kmod-scsi-core - 2.6.21.5-ixp4xx-1 -
> kmod-usb-acm - 2.6.21.5-ixp4xx-1 -
> kmod-usb-core - 2.6.21.5-ixp4xx-1 -
> kmod-usb-ohci - 2.6.21.5-ixp4xx-1 -
> kmod-usb-serial - 2.6.21.5-ixp4xx-1 -
> kmod-usb-storage - 2.6.21.5-ixp4xx-1 -
> kmod-usb-uhci - 2.6.21.5-ixp4xx-1 -
> kmod-usb2 - 2.6.21.5-ixp4xx-1 -
> libgcc - 4.1.2-9 -
> libjpeg - 6b-1 -
> libpthread - 0.9.28-9 -
> libusb - 0.1.12-1 -
> mtd - 5 -
> ppp - 2.4.3-7 -
> ppp-mod-pppoe - 2.4.3-7 -
> sane-backends - 1.0.18-1-TDS -
> sane-libs - 1.0.18-1-TDS -
> uclibc - 0.9.28-9 -
> udev - 106-1 -
> udevtrigger - 106-1 -
> usbutils - 0.72-1 -
> xinetd - 2.3.13-2 -
>
>
> I am using the 07-09 kernel (I have also tried todays and the 7.06 release):
> root at OpenWrt:/dev# uname -r
> 2.6.21.5
>
>
> Here is what is happening with SANE:
> root at OpenWrt:/dev# SANE_DEBUG_AVISION=255 SANE_DEBUG_DLL=255
> SANE_DEBUG_SANEI_USB=255 scanimage -d avision --resolution=50 >
> /tmp/tmp.pmg
> [sanei_debug] Setting debug level of dll to 255.
> [dll] sane_init: SANE dll backend version 1.0.12 from sane-backends 1.0.18
> [dll] sane_init: adding backend `abaton' (preloaded)
> [dll] sane_init: adding backend `agfafocus' (preloaded)
> [dll] sane_init: adding backend `apple' (preloaded)
> [dll] sane_init: adding backend `artec' (preloaded)
> [dll] sane_init: adding backend `as6e' (preloaded)
> [dll] sane_init: adding backend `avision' (preloaded)
> [dll] sane_init: adding backend `bh' (preloaded)
> [dll] sane_init: adding backend `canon' (preloaded)
> [dll] sane_init: adding backend `canon630u' (preloaded)
> [dll] sane_init: adding backend `coolscan' (preloaded)
> [dll] sane_init: adding backend `coolscan2' (preloaded)
> [dll] sane_init: adding backend `dc25' (preloaded)
> [dll] sane_init: adding backend `dmc' (preloaded)
> [dll] sane_init: adding backend `epson' (preloaded)
> [dll] sane_init: adding backend `fujitsu' (preloaded)
> [dll] sane_init: adding backend `genesys' (preloaded)
> [dll] sane_init: adding backend `gt68xx' (preloaded)
> [dll] sane_init: adding backend `hp' (preloaded)
> [dll] sane_init: adding backend `leo' (preloaded)
> [dll] sane_init: adding backend `lexmark' (preloaded)
> [dll] sane_init: adding backend `matsushita' (preloaded)
> [dll] sane_init: adding backend `microtek' (preloaded)
> [dll] sane_init: adding backend `microtek2' (preloaded)
> [dll] sane_init: adding backend `mustek' (preloaded)
> [dll] sane_init: adding backend `mustek_usb' (preloaded)
> [dll] sane_init: adding backend `nec' (preloaded)
> [dll] sane_init: adding backend `pie' (preloaded)
> [dll] sane_init: adding backend `pixma' (preloaded)
> [dll] sane_init: adding backend `plustek' (preloaded)
> [dll] sane_init: adding backend `plustek_pp' (preloaded)
> [dll] sane_init: adding backend `ricoh' (preloaded)
> [dll] sane_init: adding backend `s9036' (preloaded)
> [dll] sane_init: adding backend `sceptre' (preloaded)
> [dll] sane_init: adding backend `sharp' (preloaded)
> [dll] sane_init: adding backend `sp15c' (preloaded)
> [dll] sane_init: adding backend `st400' (preloaded)
> [dll] sane_init: adding backend `tamarack' (preloaded)
> [dll] sane_init: adding backend `test' (preloaded)
> [dll] sane_init: adding backend `teco1' (preloaded)
> [dll] sane_init: adding backend `teco2' (preloaded)
> [dll] sane_init: adding backend `teco3' (preloaded)
> [dll] sane_init: adding backend `umax' (preloaded)
> [dll] sane_init: adding backend `umax_pp' (preloaded)
> [dll] sane_init: adding backend `umax1220u' (preloaded)
> [dll] sane_init: adding backend `artec_eplus48u' (preloaded)
> [dll] sane_init: adding backend `ma1509' (preloaded)
> [dll] sane_init: adding backend `ibm' (preloaded)
> [dll] sane_init: adding backend `hp5400' (preloaded)
> [dll] sane_init: adding backend `u12' (preloaded)
> [dll] sane_init: adding backend `snapscan' (preloaded)
> [dll] 

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-13 Thread Jochen Eisinger
Hi,

that's a common problem of many backends, please file a bug at our
alioth bug tracker. See bug #303681
http://alioth.debian.org/tracker/index.php?func=detail&aid=303681&group_id=30186&atid=410366
for a similar bug.

regards
-- jochen





[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-13 Thread m. allan noah
On 7/13/07, Jochen Eisinger  wrote:
> Hi,
>
> that's a common problem of many backends, please file a bug at our
> alioth bug tracker. See bug #303681
> http://alioth.debian.org/tracker/index.php?func=detail&aid=303681&group_id=30186&atid=410366
> for a similar bug.
>

from looking at the trace, and now the avision code, i cant see that.
no structs seem to be used in the creation of the gamma table, and
there are the propep number (256) of bytes in the output, with no null
padding anywhere in the output.

allan

-- 
"The truth is an offense, but not a sin"



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Allan,

I tried disabling Gamma in the code (couldn't get it work in the
config for some reason).  Now it is having a problem at the sense.
Could this be related to usb issues?  Is udev required when using
libusb?

Here is the new output:
[avision] set_window: [45-46] line-width: 3825
[avision] set_window: [47-48] line-count: 2137

[avision] set_window: [49]bitset2: 10
[avision] set_window: [50]ir exposure time: 0
[avision] set_window: [51-52] r exposure: 0
[avision] set_window: [53-54] g exposure: 0
[avision] set_window: [55-56] b exposure: 0
[avision] set_window: [57]bitset3: 0
[avision] set_window: [58]auto focus: 0
[avision] set_window: [59]line-width (MSB): 0
[avision] set_window: [60]line-count (MSB): 0
[avision] set_window: [61]edge threshold: 0
[avision] set_window: sending command. Bytes: 76
[avision] Timeouts: write: 3, read: 3, status: 1
[avision] try to write cmd, count: 12.
[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
[sanei_usb] : 24 00 00 00 00 00 00 00 4C 00 00 00
$...L...
[sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
[avision] wrote 12 bytes
[avision] try to write src, count: 76.
[sanei_usb] sanei_usb_write_bulk: trying to write 76 bytes

[sanei_usb] : 00 00 00 00 00 00 00 44 00 00 00 96 00 96 00 00
...D
[sanei_usb] 0010: 00 00 00 00 00 00 00 00 27 D9 00 00 42 C9 80 80

'...B...
[sanei_usb] 0020: 80 05 08 00 00 03 00 00 00 00 8C A0 00 00 00 00


[sanei_usb] 0030: FF 18 00 00 E0 FF 00 0E F1 08 59 00 10 00 00 00
..Y.

[sanei_usb] 0040: 00 00 00 00 00 00 00 00 00 00 00 00

[sanei_usb] sanei_usb_write_bulk: wanted 76 bytes, wrote 76 bytes
[avision] wrote 76 bytes
[avision] avision_usb_status: timeout 1, 1 retries
[avision] ==> (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 00

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] <== (bulk read) got: 1, status: 0
[avision] sane_start: due to inquiry no calibration needed!

[avision] sane_start: gamma-table disabled in config - skipped!
[avision] sane_start: starting thread
[avision] reader_process:
[avision] reserve_unit:

[avision] filling command to have a length of 10, was: 6
[avision] Timeouts: write: 3, read: 3, status: 1
[avision] try to write cmd, count: 10.
[sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes

[sanei_usb] : 16 00 00 00 00 00 00 00 00 00

[dll] sane_get_parameters(handle=0x1acc8,params=0xbe99cd30)
[avision] sane_get_parameters:
[dll] sane_read(handle=0x1acc8,data=0x26c28,maxlen=32768,lenp=0xbe99cd60)
[avision] sane_read: max_len: 32768

[sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes
[avision] wrote 10 bytes

[avision] avision_usb_status: timeout 1, 1 retries
[avision] ==> (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes

[sanei_usb] : 02

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] <== (bulk read) got: 1, status: 2
[avision] avision_usb_status: Needs to request sense!

[avision] Error during status read!
[avision] === Try to request sense ===
[avision] try to write 12 bytes

[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes

[sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00


[sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily unavailable
[avision] wrote 0 bytes

[avision] === Got error 9 trying to request sense! ===
[avision] reader_process: reserve_unit failed: Error during device I/O
[avision] sane_read: got 0 bytes, err: 11 Resource temporarily unavailable
[avision] do_eof:
[avision] do_eof: returning 9
scanimage: sane_read: Error during device I/O
[dll] sane_cancel(handle=0x1acc8)
[avision] sane_cancel:
[dll] sane_close(handle=0x1acc8)

[avision] sane_close:
[sanei_usb] sanei_usb_close: closing device 0
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `avision's exit function
[avision] sane_exit:
[dll] sane_exit: finished


David Solomon

On 7/12/07, m. allan noah  wrote:
> note that i have never really used any avision equipment, but you
> might try disabling the gamma table in the conf file. man sane-avision
> for more.
>
> allan
>
> On 7/12/07, David Solomon  wrote:
> > I am having terrible problems getting SANE to work with my AVISION
> > scanner on the NSLU2.  I did compile SANE 1.0.18 for the NSLU2, but
> > don't think it is the code.  Anyone have any suggestions?
> >
> > I have the following modules loaded:
> > root at OpenWrt:/dev# lsmod
> > Module  Size  Used byNot tainted
> > usb_storage57035  0
> > sd_mod 10384  0
> > scsi_mod   55784  2 usb_storage,sd_mod
> > usbserial  20336  0
> > cdc_acm 8068  0
> > ehci_hcd   25004  0
> > uhci_hcd   18700  0
> > ohci_hcd  

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread m. allan noah
my apologies- Jochen appears to have been correct. though the data
payloads are correct (which is what i initially inspected), the
commands before them are built from un-aligned structs, and extended
from 10 to 12 bytes in both cases, IIRC.

i guess you could try adding the gcc specific alignment pragmas,
though that is beyond me. i know such a patch was floating around for
plustek backend.

sorry for the confusion.

allan

On 7/16/07, David Solomon  wrote:
> Allan,
>
> I tried disabling Gamma in the code (couldn't get it work in the
> config for some reason).  Now it is having a problem at the sense.
> Could this be related to usb issues?  Is udev required when using
> libusb?
>
> Here is the new output:
> [avision] set_window: [45-46] line-width: 3825
> [avision] set_window: [47-48] line-count: 2137
>
> [avision] set_window: [49]bitset2: 10
> [avision] set_window: [50]ir exposure time: 0
> [avision] set_window: [51-52] r exposure: 0
> [avision] set_window: [53-54] g exposure: 0
> [avision] set_window: [55-56] b exposure: 0
> [avision] set_window: [57]bitset3: 0
> [avision] set_window: [58]auto focus: 0
> [avision] set_window: [59]line-width (MSB): 0
> [avision] set_window: [60]line-count (MSB): 0
> [avision] set_window: [61]edge threshold: 0
> [avision] set_window: sending command. Bytes: 76
> [avision] Timeouts: write: 3, read: 3, status: 1
> [avision] try to write cmd, count: 12.
> [sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
> [sanei_usb] : 24 00 00 00 00 00 00 00 4C 00 00 00
> $...L...
> [sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
> [avision] wrote 12 bytes
> [avision] try to write src, count: 76.
> [sanei_usb] sanei_usb_write_bulk: trying to write 76 bytes
>
> [sanei_usb] : 00 00 00 00 00 00 00 44 00 00 00 96 00 96 00 00
> ...D
> [sanei_usb] 0010: 00 00 00 00 00 00 00 00 27 D9 00 00 42 C9 80 80
>
> '...B...
> [sanei_usb] 0020: 80 05 08 00 00 03 00 00 00 00 8C A0 00 00 00 00
> 
>
> [sanei_usb] 0030: FF 18 00 00 E0 FF 00 0E F1 08 59 00 10 00 00 00
> ..Y.
>
> [sanei_usb] 0040: 00 00 00 00 00 00 00 00 00 00 00 00
> 
> [sanei_usb] sanei_usb_write_bulk: wanted 76 bytes, wrote 76 bytes
> [avision] wrote 76 bytes
> [avision] avision_usb_status: timeout 1, 1 retries
> [avision] ==> (bulk read) going down ...
> [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
> [sanei_usb] : 00
> 
> [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
> [avision] <== (bulk read) got: 1, status: 0
> [avision] sane_start: due to inquiry no calibration needed!
>
> [avision] sane_start: gamma-table disabled in config - skipped!
> [avision] sane_start: starting thread
> [avision] reader_process:
> [avision] reserve_unit:
>
> [avision] filling command to have a length of 10, was: 6
> [avision] Timeouts: write: 3, read: 3, status: 1
> [avision] try to write cmd, count: 10.
> [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
>
> [sanei_usb] : 16 00 00 00 00 00 00 00 00 00
> 
> [dll] sane_get_parameters(handle=0x1acc8,params=0xbe99cd30)
> [avision] sane_get_parameters:
> [dll] sane_read(handle=0x1acc8,data=0x26c28,maxlen=32768,lenp=0xbe99cd60)
> [avision] sane_read: max_len: 32768
>
> [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes
> [avision] wrote 10 bytes
>
> [avision] avision_usb_status: timeout 1, 1 retries
> [avision] ==> (bulk read) going down ...
> [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
>
> [sanei_usb] : 02
> 
> [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
> [avision] <== (bulk read) got: 1, status: 2
> [avision] avision_usb_status: Needs to request sense!
>
> [avision] Error during status read!
> [avision] === Try to request sense ===
> [avision] try to write 12 bytes
>
> [sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
>
> [sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00
>
> 
> [sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily 
> unavailable
> [avision] wrote 0 bytes
>
> [avision] === Got error 9 trying to request sense! ===
> [avision] reader_process: reserve_unit failed: Error during device I/O
> [avision] sane_read: got 0 bytes, err: 11 Resource temporarily unavailable
> [avision] do_eof:
> [avision] do_eof: returning 9
> scanimage: sane_read: Error during device I/O
> [dll] sane_cancel(handle=0x1acc8)
> [avision] sane_cancel:
> [dll] sane_close(handle=0x1acc8)
>
> [avision] sane_close:
> [sanei_usb] sanei_usb_close: closing device 0
> [dll] sane_exit: exiting
> [dll] sane_exit: calling backend `avision's exit function
> [avision] sane_exit:
> [dll] sane_exit: finished
>
>
> David Solomon
>
> On 7/12/07, m. allan noah  wrote:
> > note that i have never really used any avision equipment, but you
> > might try disabling the gamma table in the conf file. man sane-avision

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Thank you.  I have filed the bug.  Also, I am trying to use some
#pragma pack statements to see if they will work.

David Solomon

On 7/13/07, Jochen Eisinger  wrote:
> Hi,
>
> that's a common problem of many backends, please file a bug at our
> alioth bug tracker. See bug #303681
> http://alioth.debian.org/tracker/index.php?func=detail&aid=303681&group_id=30186&atid=410366
> for a similar bug.
>
> regards
> -- jochen
>
>
>



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
I think you are right.  I am trying some pragma pack statments to see
if they will help.  I looked at some of the plustek_usb header changes
and found that they used: "#define PACKED8  __attribute__
((packed,aligned(1)))" and "#define PACKED16 __attribute__
((packed,aligned(2)))" statements to pack the structures.  I may have
to use these myself, but I am unsure where to add (possible in the
sanei_usb_write_bulk?).

Thank you for the help.  I am going to get up-to-my-elbows in code now.  ;-)

(Sorry for the double emails, but I keep forgetting to hit reply-all.

David Solomon

On 7/16/07, m. allan noah  wrote:
> my apologies- Jochen appears to have been correct. though the data
> payloads are correct (which is what i initially inspected), the
> commands before them are built from un-aligned structs, and extended
> from 10 to 12 bytes in both cases, IIRC.
>
> i guess you could try adding the gcc specific alignment pragmas,
> though that is beyond me. i know such a patch was floating around for
> plustek backend.
>
> sorry for the confusion.
>
> allan
>
> On 7/16/07, David Solomon  wrote:
> > Allan,
> >
> > I tried disabling Gamma in the code (couldn't get it work in the
> > config for some reason).  Now it is having a problem at the sense.
> > Could this be related to usb issues?  Is udev required when using
> > libusb?
> >
> > Here is the new output:
> > [avision] set_window: [45-46] line-width: 3825
> > [avision] set_window: [47-48] line-count: 2137
> >
> > [avision] set_window: [49]bitset2: 10
> > [avision] set_window: [50]ir exposure time: 0
> > [avision] set_window: [51-52] r exposure: 0
> > [avision] set_window: [53-54] g exposure: 0
> > [avision] set_window: [55-56] b exposure: 0
> > [avision] set_window: [57]bitset3: 0
> > [avision] set_window: [58]auto focus: 0
> > [avision] set_window: [59]line-width (MSB): 0
> > [avision] set_window: [60]line-count (MSB): 0
> > [avision] set_window: [61]edge threshold: 0
> > [avision] set_window: sending command. Bytes: 76
> > [avision] Timeouts: write: 3, read: 3, status: 1
> > [avision] try to write cmd, count: 12.
> > [sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
> > [sanei_usb] : 24 00 00 00 00 00 00 00 4C 00 00 00
> > $...L...
> > [sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
> > [avision] wrote 12 bytes
> > [avision] try to write src, count: 76.
> > [sanei_usb] sanei_usb_write_bulk: trying to write 76 bytes
> >
> > [sanei_usb] : 00 00 00 00 00 00 00 44 00 00 00 96 00 96 00 00
> > ...D
> > [sanei_usb] 0010: 00 00 00 00 00 00 00 00 27 D9 00 00 42 C9 80 80
> >
> > '...B...
> > [sanei_usb] 0020: 80 05 08 00 00 03 00 00 00 00 8C A0 00 00 00 00
> > 
> >
> > [sanei_usb] 0030: FF 18 00 00 E0 FF 00 0E F1 08 59 00 10 00 00 00
> > ..Y.
> >
> > [sanei_usb] 0040: 00 00 00 00 00 00 00 00 00 00 00 00
> > 
> > [sanei_usb] sanei_usb_write_bulk: wanted 76 bytes, wrote 76 bytes
> > [avision] wrote 76 bytes
> > [avision] avision_usb_status: timeout 1, 1 retries
> > [avision] ==> (bulk read) going down ...
> > [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
> > [sanei_usb] : 00
> > 
> > [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
> > [avision] <== (bulk read) got: 1, status: 0
> > [avision] sane_start: due to inquiry no calibration needed!
> >
> > [avision] sane_start: gamma-table disabled in config - skipped!
> > [avision] sane_start: starting thread
> > [avision] reader_process:
> > [avision] reserve_unit:
> >
> > [avision] filling command to have a length of 10, was: 6
> > [avision] Timeouts: write: 3, read: 3, status: 1
> > [avision] try to write cmd, count: 10.
> > [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
> >
> > [sanei_usb] : 16 00 00 00 00 00 00 00 00 00
> > 
> > [dll] sane_get_parameters(handle=0x1acc8,params=0xbe99cd30)
> > [avision] sane_get_parameters:
> > [dll] sane_read(handle=0x1acc8,data=0x26c28,maxlen=32768,lenp=0xbe99cd60)
> > [avision] sane_read: max_len: 32768
> >
> > [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes
> > [avision] wrote 10 bytes
> >
> > [avision] avision_usb_status: timeout 1, 1 retries
> > [avision] ==> (bulk read) going down ...
> > [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
> >
> > [sanei_usb] : 02
> > 
> > [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
> > [avision] <== (bulk read) got: 1, status: 2
> > [avision] avision_usb_status: Needs to request sense!
> >
> > [avision] Error during status read!
> > [avision] === Try to request sense ===
> > [avision] try to write 12 bytes
> >
> > [sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
> >
> > [sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00
> >
> > 
> > [sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily 
> > unavailable
> > [avis

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread m. allan noah
On 7/16/07, David Solomon  wrote:
> I think you are right.  I am trying some pragma pack statments to see
> if they will help.  I looked at some of the plustek_usb header changes
> and found that they used: "#define PACKED8  __attribute__
> ((packed,aligned(1)))" and "#define PACKED16 __attribute__
> ((packed,aligned(2)))" statements to pack the structures.  I may have
> to use these myself, but I am unsure where to add (possible in the
> sanei_usb_write_bulk?).
>
> Thank you for the help.  I am going to get up-to-my-elbows in code now.  ;-)
>

no- you want to add them to the command structs in avision.h

allan

-- 
"The truth is an offense, but not a sin"



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Allan,

Do I add them to all of the command structs or just the Avision_Connection?

David Solomon

On 7/16/07, m. allan noah  wrote:
> On 7/16/07, David Solomon  wrote:
> > I think you are right.  I am trying some pragma pack statments to see
> > if they will help.  I looked at some of the plustek_usb header changes
> > and found that they used: "#define PACKED8  __attribute__
> > ((packed,aligned(1)))" and "#define PACKED16 __attribute__
> > ((packed,aligned(2)))" statements to pack the structures.  I may have
> > to use these myself, but I am unsure where to add (possible in the
> > sanei_usb_write_bulk?).
> >
> > Thank you for the help.  I am going to get up-to-my-elbows in code now.  ;-)
> >
>
> no- you want to add them to the command structs in avision.h
>
> allan
>
> --
> "The truth is an offense, but not a sin"
>



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread m. allan noah
this webpage is all i know about it (but google will give more):

http://sig9.com/articles/gcc-packed-structures

allan

On 7/16/07, David Solomon  wrote:
> Allan,
>
> Do I add them to all of the command structs or just the Avision_Connection?
>
> David Solomon
>
> On 7/16/07, m. allan noah  wrote:
> > On 7/16/07, David Solomon  wrote:
> > > I think you are right.  I am trying some pragma pack statments to see
> > > if they will help.  I looked at some of the plustek_usb header changes
> > > and found that they used: "#define PACKED8  __attribute__
> > > ((packed,aligned(1)))" and "#define PACKED16 __attribute__
> > > ((packed,aligned(2)))" statements to pack the structures.  I may have
> > > to use these myself, but I am unsure where to add (possible in the
> > > sanei_usb_write_bulk?).
> > >
> > > Thank you for the help.  I am going to get up-to-my-elbows in code now.  
> > > ;-)
> > >
> >
> > no- you want to add them to the command structs in avision.h
> >
> > allan
> >
> > --
> > "The truth is an offense, but not a sin"
> >
>


-- 
"The truth is an offense, but not a sin"



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Allan,

That is a pretty good find.  Thank you!

David Solomon

On 7/16/07, m. allan noah  wrote:
> this webpage is all i know about it (but google will give more):
>
> http://sig9.com/articles/gcc-packed-structures
>
> allan
>
> On 7/16/07, David Solomon  wrote:
> > Allan,
> >
> > Do I add them to all of the command structs or just the Avision_Connection?
> >
> > David Solomon
> >
> > On 7/16/07, m. allan noah  wrote:
> > > On 7/16/07, David Solomon  wrote:
> > > > I think you are right.  I am trying some pragma pack statments to see
> > > > if they will help.  I looked at some of the plustek_usb header changes
> > > > and found that they used: "#define PACKED8  __attribute__
> > > > ((packed,aligned(1)))" and "#define PACKED16 __attribute__
> > > > ((packed,aligned(2)))" statements to pack the structures.  I may have
> > > > to use these myself, but I am unsure where to add (possible in the
> > > > sanei_usb_write_bulk?).
> > > >
> > > > Thank you for the help.  I am going to get up-to-my-elbows in code now. 
> > > >  ;-)
> > > >
> > >
> > > no- you want to add them to the command structs in avision.h
> > >
> > > allan
> > >
> > > --
> > > "The truth is an offense, but not a sin"
> > >
> >
>
>
> --
> "The truth is an offense, but not a sin"
>



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-17 Thread David Solomon
OK.  I have it scanning, but it looks as though it is failing to close
the scanner.  Sane completes, but the scanner never ejects the paper
and just freezes.  I need to reset the scanner to scan another image.
Here is the end of the output:

[sanei_usb] sanei_usb_read_bulk: wanted 40800 bytes, got 40800 bytes
[avision] read 40800 bytes

[avision] avision_usb_status: timeout 1, 1 retries
[avision] ==> (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 02

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] <== (bulk read) got: 1, status: 2
[avision] avision_usb_status: Needs to request sense!
[avision] Error during status read!
[avision] === Try to request sense ===
[avision] try to write 12 bytes
[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
[sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00


[sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
[avision] wrote 12 bytes

[avision] try to read 22 bytes sense data
[sanei_usb] sanei_usb_read_bulk: trying to read 22 bytes
[sanei_usb] : FF 00 03 00 00 95 6A 0E 00 00 00 00 80 04 00 00
..j.

[sanei_usb] 0010: 00 00 00 00 00 00


[sanei_usb] sanei_usb_read_bulk: wanted 22 bytes, got 22 bytes
[avision] read 22 bytes sense data

[avision] avision_usb_status: timeout 1, 1 retries
[avision] ==> (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 00

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] <== (bulk read) got: 1, status: 0

[avision] sense_handler:
[avision] sense_handler: data:
[avision]   [0] b 377o 255d ffx

[avision]   [1] b   0o   0d  0x

[avision]   [2] 0011b   3o   3d  3x

[avision]   [3] b   0o   0d  0x
[avision]   [4] b   0o   0d  0x

[avision]   [5] 10010101b 225o 149d 95x
[avision]   [6] 01101010b 152o 106d 6ax
[avision]   [7] 1110b  16o  14d  ex

[avision]   [8] b   0o   0d  0x
[avision]   [9] b   0o   0d  0x
[avision]   [10] b   0o   0d  0x
[avision]   [11] b   0o   0d  0x

[avision]   [12] 1000b 200o 128d 80x
[avision]   [13] 0100b   4o   4d  4x

[avision]   [14] b   0o   0d  0x
[avision]   [15] b   0o   0d  0x

[avision]   [16] b   0o   0d  0x
[avision]   [17] b   0o   0d  0x

[avision]   [18] b   0o   0d  0x
[avision]   [19] b   0o   0d  0x

[avision]   [20] b   0o   0d  0x
[avision]   [21] b   0o   0d  0x
[avision] sense_handler: sense code: MEDIUM ERROR (mostly ADF)
[avision] sense_handler: scan has not yet been completed
[avision] sense_handler: correct logical length
[avision] sense_handler: sense code: ADF paper end
[avision] reader_process: read_data failed due to EOF
[avision] reader_process: read_data failed with status: 5
[avision] reader_process: stripe filled: 40800
[avision] reader_process: useful_bytes 40800
[avision] sane_read: got 32768 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 8032 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] reader_process: end of iteration
[avision] reader_process: i/o loop finished
[avision] reader_process: padding with white data
[avision] reader_process: padding line 800 - 2137
[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avi

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-17 Thread David Solomon
Here is my modified avision.h file:

/***
 * SANE - Scanner Access Now Easy.

  avision.h

  This file is part of the SANE package.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
  published by the Free Software Foundation; either version 2 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  MA 02111-1307, USA.

  As a special exception, the authors of SANE give permission for
  additional uses of the libraries contained in this release of SANE.

  The exception is that, if you link a SANE library with other files
  to produce an executable, this does not by itself cause the
  resulting executable to be covered by the GNU General Public
  License.  Your use of that executable is in no way restricted on
  account of linking the SANE library code into it.

  This exception does not, however, invalidate any other reasons why
  the executable file might be covered by the GNU General Public
  License.

  If you submit changes to SANE to the maintainers to be included in
  a subsequent release, you agree by submitting the changes that
  those changes may be distributed with this exception intact.

  *

  This backend is based upon the Tamarack backend and adapted to the Avision
  scanners by Renebe and Meino Cramer.

  Check the avision.c file for detailed copyright and change-log
  information.

/

#ifndef avision_h
#define avision_h

#include 

#ifndef PATH_MAX
# define PATH_MAX 1024
#endif


#define PACKED8  __attribute__ ((packed,aligned(1)))

#define PACKED16 __attribute__ ((packed,aligned(2)))


typedef enum Avision_ConnectionType {
 AV_SCSI,
 AV_USB
} Avision_ConnectionType;

/* information needed for device access */
typedef struct Avision_Connection {
 Avision_ConnectionType connection_type;
 int scsi_fd;  /* SCSI filedescriptor */
 SANE_Int usb_dn;  /* USB (libusb or scanner.c) device number */
 enum {
   AVISION_USB_UNTESTED_STATUS, /* status type untested */
   AVISION_USB_INT_STATUS,  /* interrupt endp. (USB 1.x device) status */
   AVISION_USB_BULK_STATUS  /* bulk endp. (USB 2.0 device) status */
 } usb_status;

} PACKED8 Avision_Connection;

typedef struct Avision_HWEntry {
 const char* scsi_mfg;
 const char* scsi_model;

 int   usb_vendor;
 int   usb_product;

 const char* real_mfg;
 const char* real_model;

 /* feature overwrites */
 enum {
   /* force no calibration */
   AV_NO_CALIB = (1),

   /* force all in one command calibration */
   AV_ONE_CALIB_CMD = (1<<1),

   /* no gamma table */
   AV_NO_GAMMA = (1<<2),

   /* light check is bogus */
   AV_LIGHT_CHECK_BOGUS = (1<<3),

   /* do not use line packing even if line_difference */
   AV_NO_LINE_DIFFERENCE = (1<<4),

   /* if the scan area needs to be forced to A3 */
   AV_FORCE_A3 = (1<<5),

   /* if the scan area and resolution needs to be forced for films */
   AV_FORCE_FILM = (1<<6),

   /* some (?) USB devices like firmware */
   AV_FIRMWARE = (1<<7),

   /* is film scanner - no detection yet */
   AV_FILMSCANNER = (1<<8),

   /* fujitsu adaption */
   AV_FUJITSU = (1<<9),

   /* gray calibration data has to be uploaded on the blue channel ... ? */
   AV_GRAY_CALIB_BLUE = (1<<10),

   /* Interrupt endpoint button readout (so far AV220) */
   AV_INT_BUTTON = (1<<11),

   /* send acceleration table ... */
   AV_ACCEL_TABLE = (1<<12),

   /* non-interlaced scanns up to 300 dpi (AV32xx / AV83xx) */
   AV_NON_INTERLACED_DUPLEX_300 = (1<<13),

   /* do not send 3x3 matrix */
   AV_NO_MATRIX = (1<<14),

   /* force channel-by-channel calibration */
   AV_MULTI_CALIB_CMD = (1<<15),

   /* non color scans are faster with a filter applied (AV32xx) */
   AV_FASTER_WITH_FILTER = (1<<16),

   /* interlaced data with 1 line distance */
   AV_2ND_LINE_INTERLACED = (1<<17),

   /* does not keep the window though it advertices so */
   AV_DOES_NOT_KEEP_WINDOW = (1<<18),

   /* advertises ADF is BGR order, but isn't (or vice versa) */
   AV_ADF_BGR_ORDER_INVERT = (1<<18)

   /* maybe more ...*/
 } feature_type;

} PACKED16 Avision_HWEntry;

typedef enum {
 AV_ASIC_Cx = 0,
 AV_ASIC_C1 = 1,
 AV_ASIC_W1 = 2,
 AV_ASIC_C2 = 3,
 AV_ASIC_C5 = 5,
 AV_ASIC_C6 = 6,
 AV_ASIC_OA980 = 128,
 AV_ASIC_OA982 = 129
} asic_type;

typedef enum {
 AV_THRESHOLDED,
 AV_DITHERED,
 AV_GRAYSCALE,   /*

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-17 Thread David Solomon
I got it working.  I needed to use PACKED8 on the structures in the
avision.c file also.  Moved all of the Avision device structures to
PACKED16.

David Solomon

On 7/16/07, m. allan noah  wrote:
> this webpage is all i know about it (but google will give more):
>
> http://sig9.com/articles/gcc-packed-structures
>
> allan
>
> On 7/16/07, David Solomon  wrote:
> > Allan,
> >
> > Do I add them to all of the command structs or just the Avision_Connection?
> >
> > David Solomon
> >
> > On 7/16/07, m. allan noah  wrote:
> > > On 7/16/07, David Solomon  wrote:
> > > > I think you are right.  I am trying some pragma pack statments to see
> > > > if they will help.  I looked at some of the plustek_usb header changes
> > > > and found that they used: "#define PACKED8  __attribute__
> > > > ((packed,aligned(1)))" and "#define PACKED16 __attribute__
> > > > ((packed,aligned(2)))" statements to pack the structures.  I may have
> > > > to use these myself, but I am unsure where to add (possible in the
> > > > sanei_usb_write_bulk?).
> > > >
> > > > Thank you for the help.  I am going to get up-to-my-elbows in code now. 
> > > >  ;-)
> > > >
> > >
> > > no- you want to add them to the command structs in avision.h
> > >
> > > allan
> > >
> > > --
> > > "The truth is an offense, but not a sin"
> > >
> >
>
>
> --
> "The truth is an offense, but not a sin"
>



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-18 Thread René Rebe
On Tuesday 17 July 2007 18:58:03 David Solomon wrote:
> I got it working.  I needed to use PACKED8 on the structures in the
> avision.c file also.  Moved all of the Avision device structures to
> PACKED16.

Can you please send me a diff(1) of your modificatoins, thanks :-)

Yours,
  Ren?

> David Solomon
> 
> On 7/16/07, m. allan noah  wrote:
> > this webpage is all i know about it (but google will give more):
> >
> > http://sig9.com/articles/gcc-packed-structures
> >
> > allan
> >
> > On 7/16/07, David Solomon  wrote:
> > > Allan,
> > >
> > > Do I add them to all of the command structs or just the 
> > > Avision_Connection?
> > >
> > > David Solomon
> > >
> > > On 7/16/07, m. allan noah  wrote:
> > > > On 7/16/07, David Solomon  wrote:
> > > > > I think you are right.  I am trying some pragma pack statments to see
> > > > > if they will help.  I looked at some of the plustek_usb header changes
> > > > > and found that they used: "#define PACKED8  __attribute__
> > > > > ((packed,aligned(1)))" and "#define PACKED16 __attribute__
> > > > > ((packed,aligned(2)))" statements to pack the structures.  I may have
> > > > > to use these myself, but I am unsure where to add (possible in the
> > > > > sanei_usb_write_bulk?).
> > > > >
> > > > > Thank you for the help.  I am going to get up-to-my-elbows in code 
> > > > > now.  ;-)
> > > > >
> > > >
> > > > no- you want to add them to the command structs in avision.h
> > > >
> > > > allan
> > > >
> > > > --
> > > > "The truth is an offense, but not a sin"
> > > >
> > >
> >
> >
> > --
> > "The truth is an offense, but not a sin"
> >
> 



-- 
  Ren? Rebe - ExactCODE GmbH - Europe, Germany, Berlin
  Gesch?ftsf?hrer: Susanne Klaus, Ren? Rebe
  Sitz: Berlin, Amtsgericht Charlottenburg HRB 105 123 B
  USt-IdNr.: DE251602478
  http://exactcode.de | http://t2-project.org | http://rene.rebe.name



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-23 Thread David Solomon
Here are the diffs:

rx30 at dsolomon-devbox:~/nslu2/downloads/temp/sane-backends-1.0.18/backend$
cat avision.h.diff
*** avision.h.orig  2007-07-23 10:21:01.0 -0400
--- avision.h   2007-07-17 12:07:25.0 -0400
***
*** 57,62 
--- 57,65 
  # define PATH_MAX 1024
  #endif

+ #define PACKED8  __attribute__ ((packed,aligned(1)))
+ #define PACKED16 __attribute__ ((packed,aligned(2)))
+
  typedef enum Avision_ConnectionType {
AV_SCSI,
AV_USB
***
*** 73,79 
  AVISION_USB_BULK_STATUS  /* bulk endp. (USB 2.0 device) status */
} usb_status;

! } Avision_Connection;

  typedef struct Avision_HWEntry {
const char* scsi_mfg;
--- 76,82 
  AVISION_USB_BULK_STATUS  /* bulk endp. (USB 2.0 device) status */
} usb_status;

! } PACKED16 Avision_Connection;

  typedef struct Avision_HWEntry {
const char* scsi_mfg;
***
*** 150,156 
  /* maybe more ...*/
} feature_type;

! } Avision_HWEntry;

  typedef enum {
AV_ASIC_Cx = 0,
--- 153,159 
  /* maybe more ...*/
} feature_type;

! } PACKED16 Avision_HWEntry;

  typedef enum {
AV_ASIC_Cx = 0,
***
*** 260,266 
/* interlaced duplex scan */
SANE_Bool interlaced_duplex;

! } Avision_Dimensions;

  /* this contains our low-level info - not relevant for the SANE interface  */
  typedef struct Avision_Device
--- 263,269 
/* interlaced duplex scan */
SANE_Bool interlaced_duplex;

! } PACKED16 Avision_Dimensions;

  /* this contains our low-level info - not relevant for the SANE interface  */
  typedef struct Avision_Device
***
*** 347,353 
u_int16_t data_dq; /* was ox0A0D - but hangs some new scanners */

Avision_HWEntry* hw;
! } Avision_Device;

  /* all the state relevant for the SANE interface */
  typedef struct Avision_Scanner
--- 350,356 
u_int16_t data_dq; /* was ox0A0D - but hangs some new scanners */

Avision_HWEntry* hw;
! } PACKED16 Avision_Device;

  /* all the state relevant for the SANE interface */
  typedef struct Avision_Scanner
***
*** 390,396 
int write_fds;  /* pipe writing end */
int line;   /* current line number during scan */

! } Avision_Scanner;

  /* Some Avision driver internal defines */
  #define AV_WINID 0
--- 393,399 
int write_fds;  /* pipe writing end */
int line;   /* current line number during scan */

! } PACKED16 Avision_Scanner;

  /* Some Avision driver internal defines */
  #define AV_WINID 0
***
*** 439,445 
u_int8_t pad0 [3];
u_int8_t len;
u_int8_t pad1;
! } command_header;

  typedef struct command_set_window
  {
--- 442,448 
u_int8_t pad0 [3];
u_int8_t len;
u_int8_t pad1;
! } PACKED8 command_header;

  typedef struct command_set_window
  {
***
*** 447,453 
u_int8_t reserved0 [5];
u_int8_t transferlen [3];
u_int8_t control;
! } command_set_window;

  typedef struct command_read
  {
--- 450,456 
u_int8_t reserved0 [5];
u_int8_t transferlen [3];
u_int8_t control;
! } PACKED8 command_set_window;

  typedef struct command_read
  {
***
*** 458,464 
u_int8_t datatypequal [2];
u_int8_t transferlen [3];
u_int8_t control;
! } command_read;

  typedef struct command_scan
  {
--- 461,467 
u_int8_t datatypequal [2];
u_int8_t transferlen [3];
u_int8_t control;
! } PACKED8 command_read;

  typedef struct command_scan
  {
***
*** 467,473 
u_int8_t reserved0 [2];
u_int8_t transferlen;
u_int8_t bitset1;
! } command_scan;

  typedef struct command_send
  {
--- 470,476 
u_int8_t reserved0 [2];
u_int8_t transferlen;
u_int8_t bitset1;
! } PACKED8 command_scan;

  typedef struct command_send
  {
***
*** 478,484 
u_int8_t datatypequal [2];
u_int8_t transferlen [3];
u_int8_t reserved1;
! } command_send;

  typedef struct nvram_data
  {
--- 481,487 
u_int8_t datatypequal [2];
u_int8_t transferlen [3];
u_int8_t reserved1;
! } PACKED8 command_send;

  typedef struct nvram_data
  {
***
*** 513,519 
u_int8_t power_saving_time [2];

u_int8_t reserved [56];
! } nvram_data;


  typedef struct command_set_window_window
--- 516,522 
u_int8_t power_saving_time [2];

u_int8_t reserved [56];
! } PACKED8 nvram_data;


  typedef struct command_set_window_window
***
*** 521,527 
struct {
  u_int8_t reserved0 [6];
  u_int8_t desclen [2];
!   } header;

struct {
  u_int8_t winid;
--- 524,530 
struct {
  u_int8_t reserved0 [6];
  u_int8_t desclen [2];
!   } PACKED8 header;

struct {
  u_int8_t winid;
***
*** 548,554 
  /* Avision specific parameters */
  u_int8_t vendor_specific;
  u_int8_t paralen; /* bytes following after this byte */
!   } descriptor;

struct {

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-23 Thread Rene Rebe
Hi,

thanks, I'll go over them. Btw. nowadays virtually everyone rather
prefers unified diffs (diff -u) - but I can of course also read those :-)

On Monday 23 July 2007 16:25, David Solomon wrote:
> Here are the diffs:
> 
> rx30 at dsolomon-devbox:~/nslu2/downloads/temp/sane-backends-1.0.18/backend$
> cat avision.h.diff
> *** avision.h.orig  2007-07-23 10:21:01.0 -0400
> --- avision.h   2007-07-17 12:07:25.0 -0400
> ***
> *** 57,62 
> --- 57,65 
>   # define PATH_MAX 1024
>   #endif
> 

Yours,

-- 
  Ren? Rebe - ExactCODE GmbH - Europe, Germany, Berlin
  http://exactcode.de | http://t2-project.org | http://rene.rebe.name