[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
On Thu, 2011-03-17 at 06:22, stef wrote: > Hello, > > I've applied it. > > Thanks, > Stef Thank you for your help. In the long run, though, I think your suggestion about 'uint8_t value[2]' is probably better (and more elegant). Regards, Olaf
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
Le Wednesday 16 March 2011 23:34:18 Olaf Zimmermann, vous avez ?crit : > On Wed, 2011-03-16 at 21:20, stef wrote: > > Hello, > > > > patch will be welcome. I didn't knew bsuint16, and it seems no backend > > > > use it. > > ;-) > > *** backend/genesys_low.c.orig Wed Mar 16 11:10:54 2011 > --- backend/genesys_low.c Wed Mar 16 20:38:14 2011 > *** > *** 65,70 > --- 65,79 > #include "../include/_stdint.h" > #include "genesys_low.h" > > + uint16_t bsuint16(uint16_t v) > + { > + #ifdef WORDS_BIGENDIAN > + return (v << 8) | (v >> 8); > + #else > + return(v); > + #endif > + } > + > /* > > */ > /* functions calling ASIC specific > functions */ > /* > > */ > *** > *** 262,272 >reg, sane_strstatus (status)); > return status; > } > ! *val=value & 0xff; > DBG( DBG_io2, > "sanei_genesys_read_hregister(0x%02x)=0x%02x\n",reg,value & 0xff); > > /* check usb link status */ > ! if((value & 0xff00) != 0x5500) > { > DBG (DBG_error,"sanei_genesys_read_hregister: invalid read, > scanner unplugged ?\n"); > status=SANE_STATUS_IO_ERROR; > --- 271,281 >reg, sane_strstatus (status)); > return status; > } > ! *val=bsuint16(value) & 0xff; > DBG( DBG_io2, > "sanei_genesys_read_hregister(0x%02x)=0x%02x\n",reg,value & 0xff); > > /* check usb link status */ > ! if((bsuint16(value) & 0xff00) != 0x5500) > { > DBG (DBG_error,"sanei_genesys_read_hregister: invalid read, > scanner unplugged ?\n"); > status=SANE_STATUS_IO_ERROR; > *** > *** 384,394 >reg, sane_strstatus (status)); > return status; > } > ! *val=value & 0xff; > DBG( DBG_io2, > "sanei_genesys_read_gl847_register(0x%02x)=0x%02x\n",reg,value & 0xff); > > /* check usb link status */ > ! if((value & 0xff00) != 0x5500) > { > DBG (DBG_error,"sanei_genesys_read_gl847_register: invalid read, > scanner unplugged ?\n"); > status=SANE_STATUS_IO_ERROR; > --- 393,403 >reg, sane_strstatus (status)); > return status; > } > ! *val=bsuint16(value) & 0xff; > DBG( DBG_io2, > "sanei_genesys_read_gl847_register(0x%02x)=0x%02x\n",reg,value & 0xff); > > /* check usb link status */ > ! if((bsuint16(value) & 0xff00) != 0x5500) > { > DBG (DBG_error,"sanei_genesys_read_gl847_register: invalid read, > scanner unplugged ?\n"); > status=SANE_STATUS_IO_ERROR; Hello, I've applied it. Thanks, Stef
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
On Wed, 2011-03-16 at 21:20, stef wrote: > Hello, > > patch will be welcome. I didn't knew bsuint16, and it seems no backend > use it. ;-) *** backend/genesys_low.c.orig Wed Mar 16 11:10:54 2011 --- backend/genesys_low.c Wed Mar 16 20:38:14 2011 *** *** 65,70 --- 65,79 #include "../include/_stdint.h" #include "genesys_low.h" + uint16_t bsuint16(uint16_t v) + { + #ifdef WORDS_BIGENDIAN + return (v << 8) | (v >> 8); + #else + return(v); + #endif + } + /* */ /* functions calling ASIC specific functions */ /* */ *** *** 262,272 reg, sane_strstatus (status)); return status; } ! *val=value & 0xff; DBG( DBG_io2, "sanei_genesys_read_hregister(0x%02x)=0x%02x\n",reg,value & 0xff); /* check usb link status */ ! if((value & 0xff00) != 0x5500) { DBG (DBG_error,"sanei_genesys_read_hregister: invalid read, scanner unplugged ?\n"); status=SANE_STATUS_IO_ERROR; --- 271,281 reg, sane_strstatus (status)); return status; } ! *val=bsuint16(value) & 0xff; DBG( DBG_io2, "sanei_genesys_read_hregister(0x%02x)=0x%02x\n",reg,value & 0xff); /* check usb link status */ ! if((bsuint16(value) & 0xff00) != 0x5500) { DBG (DBG_error,"sanei_genesys_read_hregister: invalid read, scanner unplugged ?\n"); status=SANE_STATUS_IO_ERROR; *** *** 384,394 reg, sane_strstatus (status)); return status; } ! *val=value & 0xff; DBG( DBG_io2, "sanei_genesys_read_gl847_register(0x%02x)=0x%02x\n",reg,value & 0xff); /* check usb link status */ ! if((value & 0xff00) != 0x5500) { DBG (DBG_error,"sanei_genesys_read_gl847_register: invalid read, scanner unplugged ?\n"); status=SANE_STATUS_IO_ERROR; --- 393,403 reg, sane_strstatus (status)); return status; } ! *val=bsuint16(value) & 0xff; DBG( DBG_io2, "sanei_genesys_read_gl847_register(0x%02x)=0x%02x\n",reg,value & 0xff); /* check usb link status */ ! if((bsuint16(value) & 0xff00) != 0x5500) { DBG (DBG_error,"sanei_genesys_read_gl847_register: invalid read, scanner unplugged ?\n"); status=SANE_STATUS_IO_ERROR;
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
Le Wednesday 16 March 2011 15:34:17 Olaf Zimmermann, vous avez ?crit : > On Tue, 2011-03-15 at 22:18, stef wrote: > > Le Tuesday 15 March 2011 14:27:14 Olaf Zimmermann, vous avez ?crit : > Ouf! > [Back to English:] > As it turns out, that was the sole problem - > all that is required is byte swapping in four places in genesys_low.c > (i.e. lines 265,269,387, and 391: replace 'value' with something like > 'bsuint16(value)' ); everything else appears to be working as perfectly > as can be expected for a scanner in this price class. > Question: > Would there be a point in me creating a proper patch, or do you think > there is insufficient demand for this? > > Regards, > Olaf > Hello, patch will be welcome. I didn't knew bsuint16, and it seems no backend use it. I was thinking to replace the 'uint16_t value' by 'uint8_t value[2]' and use the array instead of using mask, which I'm sure will compile on any platform. Regards, Stef
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
On Tue, 2011-03-15 at 22:18, stef wrote: > Le Tuesday 15 March 2011 14:27:14 Olaf Zimmermann, vous avez ?crit : Ouf! [Back to English:] As it turns out, that was the sole problem - all that is required is byte swapping in four places in genesys_low.c (i.e. lines 265,269,387, and 391: replace 'value' with something like 'bsuint16(value)' ); everything else appears to be working as perfectly as can be expected for a scanner in this price class. Question: Would there be a point in me creating a proper patch, or do you think there is insufficient demand for this? Regards, Olaf > Hello, > > the following test is failing in sanei_genesys_read_gl847_register(): > if((value & 0xff00) != 0x5500) > { > DBG (DBG_error,"sanei_genesys_read_gl847_register: invalid read, > scanner > unplugged ?\n"); > status=SANE_STATUS_IO_ERROR; > } > > While the bytes (00 55) from USB are correct. I think this is an > endianess issue in code. What is the CPU running the code ? > > Regards, > Stef
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
Hello, On Tue, Mar 15, 2011 at 10:18 PM, stef wrote: > > ? ? ? ?While the bytes (00 55) from USB are correct. I think this is an > endianess issue in code. What is the CPU running the code ? FWIW, SPARC cpus are big-endian: http://en.wikipedia.org/wiki/SPARC HTH -- Regards, Torfinn Ingolfsen
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
Le Tuesday 15 March 2011 14:27:14 Olaf Zimmermann, vous avez ?crit : > Scanimage (32-bit build) conks out at genesys_low.c, line 391 > (value=0xffbfe3ef, according to my debugger; looks odd). > Output from scanimage is as follows: > [snip] > [genesys_gl124] gl124_init: value=0x00 > [genesys_gl124] gl124_init: device is USB2.0 > [sanei_usb] sanei_usb_control_msg: rtype = 0xc0, req = 4, value = 142, > index = 1570, len = 2 > usb_control_msg(): > usb_send_msg(): > requesttype 0xc0 > request0x4 > value 0x8e > index 0x622 > size 0x2 > usb_do_io(): size=0x8 flag=1 > data dump: > c0 04 8e 00 22 06 02 00 > usb_do_io(): amount=8 > usb_send_msg(): rval=8 > usb_do_io(): size=0x2 flag=0 > data dump: > 00 55 > usb_do_io(): amount=2 > usb_control_msg(): additional 0x2 bytes > [sanei_usb] 000 00 55 .U > > [genesys_low] sanei_genesys_read_gl847_register(0x06)=0x55 > [genesys_low] sanei_genesys_read_gl847_register: invalid read, scanner > unplugged ? > scanimage: open of device genesys:libusb:/dev/usb:4a9.1909/0 failed: > Error during device I/O > [dll] sane_exit: exiting > [snip] > BTW, the scanner works elsewhere (MS), same cable etc. > Any suggestions? > > > -- > sane-devel mailing list: sane-devel at lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/sane-devel > Unsubscribe: Send mail with subject "unsubscribe your_password" > to sane-devel-request at lists.alioth.debian.org Hello, the following test is failing in sanei_genesys_read_gl847_register(): if((value & 0xff00) != 0x5500) { DBG (DBG_error,"sanei_genesys_read_gl847_register: invalid read, scanner unplugged ?\n"); status=SANE_STATUS_IO_ERROR; } While the bytes (00 55) from USB are correct. I think this is an endianess issue in code. What is the CPU running the code ? Regards, Stef
[sane-devel] CanoScan Lide 110 on Solaris 10 (10/09) SPARC
Scanimage (32-bit build) conks out at genesys_low.c, line 391 (value=0xffbfe3ef, according to my debugger; looks odd). Output from scanimage is as follows: [snip] [genesys_gl124] gl124_init: value=0x00 [genesys_gl124] gl124_init: device is USB2.0 [sanei_usb] sanei_usb_control_msg: rtype = 0xc0, req = 4, value = 142, index = 1570, len = 2 usb_control_msg(): usb_send_msg(): requesttype 0xc0 request0x4 value 0x8e index 0x622 size 0x2 usb_do_io(): size=0x8 flag=1 data dump: c0 04 8e 00 22 06 02 00 usb_do_io(): amount=8 usb_send_msg(): rval=8 usb_do_io(): size=0x2 flag=0 data dump: 00 55 usb_do_io(): amount=2 usb_control_msg(): additional 0x2 bytes [sanei_usb] 000 00 55 .U [genesys_low] sanei_genesys_read_gl847_register(0x06)=0x55 [genesys_low] sanei_genesys_read_gl847_register: invalid read, scanner unplugged ? scanimage: open of device genesys:libusb:/dev/usb:4a9.1909/0 failed: Error during device I/O [dll] sane_exit: exiting [snip] BTW, the scanner works elsewhere (MS), same cable etc. Any suggestions?