[sane-devel] All sane frontends segfault with my HP 5200C

Henning Meier-Geinitz henning@meier-geinitz.de
Fri, 8 Feb 2002 22:31:46 +0100


Hi,

On Sun, Feb 03, 2002 at 01:06:12PM -0500, Douglas Gilbert wrote:
> The sg ioctl SG_GET_SCSI_ID yields the same information as
> 
> SCSI_IOCTL_GET_IDLUN plus the SCSI device type. SANE should
> be only interested in SCSI device types:
>   - SCANNER (6)
>   - PROCESSOR (3) [HP scanners prefer this type]

Can anyone write a patch for this so we can test it? I won't touch
sanei_scsi.c with all it's different paths for different systems. Way
to complex for me :-)

> Just a suggestion ... once SANE spots a SCSI, USB, parport
> etc. scanner it should hold open a file descriptor to it. If
> the scanner is hot unplugged you should get a sensible
> error message next time you try to access it (e.g. ENODEV).
> By keeping a fd open to a device the module subsystem
> (or the user) is inhibited from "autocleaning" the module
> away. If that happens then the next time you open /dev/sg2
> (for example) it may not be the scanner you expect it to
> be! SANE could then have a high level function to rescan
> for devices. Hooks could also be added so hotplug (and unplug)
> alerts could be consumed sensibly. A common case would be
> users power cycling their scanners.

Maybe an idea for SANE2. But all backends must be rewritten for this
to work.

Bye,
  Henning