[sane-devel] FreeBSD and Microtek Scanmaker II

abel deuring a.deuring@satzbau-gmbh.de
Mon, 23 Jun 2003 00:50:56 +0200


>  >are you sure that the Linux SCSI system (or FreeBSD) tries to issue a
>  >REQUEST SENSE, if it can't "connect" to device? (If I find enough time,
> I'm not exactly sure what is going on in this particular situation.
> Last winter, a user (Shawn Rutledge) was really helpful in tracking
>  down lost sense codes.  The backend sense handler was getting called with
>  all zeros, as here.  By slogging through debug output from the driver for
>  the SCSI card in the kernel logs, it was apparent that the REQUEST SENSE
>  was indeed issued.  I then dug into the mid-level scsi driver and found
>  at least one place where the results were being thrown away.
> The moral to the story is that I don't trust the error codes returned by
>  the Linux SCSI system --- since it thinks that the results of the REQUEST
>  SENSE are invalid, it decides that there must be some other problem.
>  The trigger for this behavior is the peculiar sense codes from Microtek
>  scanners.

OK, so we have indeed a flaw in the Linux SCSI system... I assume that 
the scanners identify themselves as SCSI 1 devices, where these short 
sense data blocks are normal.

Did you try to issue REQUEST SENSE explicitly from the backend, where 
this looks reasonable? This may not work with every Linux adapter driver 
(IIRC, older versions of the aha152x driver did not like user land 
REQUEST SENSE commands), so it should be possible to turn them off with 
an option.