[sane-devel] Announce: modifying hp5590 sane driver for scanjet 4570c

Markham thomas markham.thomas at gmail.com
Mon Apr 28 22:03:05 UTC 2008


Hi,
   I've started modifying the hp5590 driver to work with my hp scanjet 4570c
I think the hp5590 is pretty close to the 4570 given the following:
sane-find-scanner -v -v -v
    checking for HP5550/5590/7650 chipset ...
<This USB chip looks like a HP5550/5590/7650 (result from sane-backends
1.0.19)>

found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x1305 [hp
scanjet scanner], chip=HP5550/5590/7650) at libusb:001:005

So I've started modifying the hp5590 backend driver in an attempt to get it
working:

SANE_DEBUG_HP5590=50 scanimage
-L
sanei_debug] Setting debug level of hp5590 to 50.
[hp5590] SANE backed for HP 4570/5550/5590/7650 1.0.2
[hp5590] (c) Ilia Sotnikov <hostcc at gmail.com>
[hp5590] attach_usb_device: Opening USB device
[hp5590] attach_usb_device: USB device opened
[hp5590] hp5590_init_scanner
[hp5590] hp5590_cmd: USB-in-USB: command : 0012
[hp5590] hp5590_control_msg: USB-in-USB: core data: no
[hp5590] hp5590_control_msg: USB-in-USB: sending control msg
[hp5590] hp5590_control_msg: USB-in-USB: checking acknowledge for control
message
[hp5590] hp5590_get_ack
[hp5590] hp5590_get_ack: USB-in-USB: accepted
[hp5590] hp5590_control_msg: USB-in-USB: checking if confirmation was
acknowledged
[hp5590] hp5590_get_ack
[hp5590] hp5590_get_ack: USB-in-USB: accepted
[hp5590] hp5590_verify_last_cmd: USB-in-USB: command verification requested
[hp5590] hp5590_control_msg: USB-in-USB: core data: no
[hp5590] hp5590_control_msg: USB-in-USB: sending control msg
[hp5590] hp5590_control_msg: USB-in-USB: checking acknowledge for control
message
[hp5590] hp5590_get_ack
[hp5590] hp5590_get_ack: USB-in-USB: accepted
[hp5590] hp5590_control_msg: USB-in-USB: checking if confirmation was
acknowledged
[hp5590] hp5590_get_ack
[hp5590] hp5590_get_ack: USB-in-USB: accepted
[hp5590] hp5590_verify_last_cmd: USB-in-USB: command verification 0012, last
command: 0012, core status: 0000
[hp5590] hp5590_verify_last_cmd: USB-in-USB: command verified successfully
[hp5590] init_resp->id: SILITEKIElwood
[hp5590] init_resp->dpi_x: 24585    <--- custom debug msgs i've put in
[hp5590] init_resp->dpi_y: 24585    <--- will have to find out why the dpi
is wrong later
[hp5590] init_resp->id: SILITEKIElwood
[hp5590] init_resp->dpi_x: 24585
[hp5590] init_resp->dpi_y: 24585
[hp5590] hp5590_init_scanner: Vendor id mismatch for scanner HP5550 -
required  'SILITEKIPenguin', got 'SILITEKIElwood'
[hp5590] sane_hp5590_get_devices, local only: 0
[hp5590] Found 0 devices

Now I've modified hp5590_cmds.c
static const struct hp5590_model
hp5590_models[] = {
  {
    SCANNER_HP4570,
    0x03f0, 0x1305, "SILITEKIElwood",
    "4570", "Workgroup scanner"
  },
  {
    SCANNER_HP5550,
    0x03f0, 0x1205, "SILITEKIPenguin",
    "5550", "Workgroup scanner"
  },
  {
    SCANNER_HP5590,
    0x03f0, 0x1705, "SILITEKIPenguin",
    "5590", "Workgroup scanner"
  },
  {
    SCANNER_HP7650,
    0x03f0, 0x1805, "SILITEKIArnold",
    "7650", "Document scanner"
  }
};

and modified hp5590_cmds.h
enum hp_scanner_types
{
  SCANNER_NONE = 0,
  SCANNER_HP4570,
  SCANNER_HP5550,
  SCANNER_HP5590,
  SCANNER_HP7650
};

but my debug method is really slow of building the backend after putting
custom debug statements in and copying the lib out to /usr/lib64/sane then
running scanimage
I would really like to run it under gdb and single step into it so I can
display the structures.
However mastering the tech of using gdb with backend drivers is something I
haven't figured out yet.

  Is there a standalone framework (C program linking to one of the backend
drivers) that I can use to debug my driver?   Or do I figure out why there
are no debug symbols in my CVS copy of the sane backends I built?  Google
searches are failing me on how to debug this driver....  any pointers would
be appreciated!
-- Markham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20080428/23c5cff3/attachment.htm 


More information about the sane-devel mailing list