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

Reply via email to