[sane-devel] Problem with empty sense buffer in sanei_scsi (linux+hpusbscsi+vuescan)?

Jose Paulo Moitinho de Almeida moitinho at civil.ist.utl.pt
Mon Oct 15 09:57:01 BST 2001


On Monday 15 October 2001 02:37, Douglas Gilbert wrote:
> Jose Paulo Moitinho de Almeida wrote:
> > On Thursday 04 October 2001 21:01, abel deuring wrote:
>......
> >
> > masked_status 8 driver_status 0
>
> Paulo,
> The problem starts here, a masked_status of 8 corresponds
> to a SCSI status of INTERMEDIATE. This implies the command
> sent to the scanner had the link bit set in the control
> field which is the last byte in every command descriptor
> block. Perhaps the SANE backend driver wanted to invoke
> linked commands, more likely, it is a mistake by the
> backend driver. 

I think that Ed Hamrick is the right person top clarify this. 

> .....
>
> Perhaps you could look upstream and see if that link
> bit on the SCSI command is being set for a good reason.
>

I can tell that it is a film scanner and it was positioning the head...

> > Should sg.c be modified, so that when SG_INFO_CHECK is set, the
> > initialisation of the sense_buffer is done?
>
> I have just put some more words in the sg documentation
> (soon to be at: http://www.torque.net/sg/p/sg_v3_ho.html )
> to emphasize that SG_INFO_CHECK does not always imply that
> there will be a sense buffer.


> > The possibility that there may be a problem somewhere else should not be
> > excluded either. I am using a driver which is "fresh from the oven".
>

I can add that I had exactly the same result using the now "officially 
experimental" version of hpusbscsi that is in 2.4.12. Just adding the 
following patch to drivers/scsi/sg.c vuescan works fine. I know that I am not 
correcting the true source of the error!

----------------------------------------------
>*** sg.c.orig	Sun Oct 14 18:38:05 2001
--- sg.c	Sun Oct 14 18:37:19 2001
***************
*** 477,482 ****
--- 477,485 ----
      	goto err_out;
      }
      hp->sb_len_wr = 0;
+ #if 1
+     memset(hp->sbp, 0, 8);
+ #endif
      if ((hp->mx_sb_len > 0) && hp->sbp) {
  	if ((CHECK_CONDITION & hp->masked_status) ||
  	    (DRIVER_SENSE & hp->driver_status)) {
----------------------------------------------

> abel deuring <adeuring at gmx.net> wrote:
> > Maybe, but I think that older versions of the SG driver
> > do not return the length of sense data read from a device.
> > (Douglas, can you confirm this?)
>
> Abel,
> Yes, that is correct. To get around this, apps like cdrecord
> and paranoia would pre-fill the sense buffer with zeroes and
> then look for a change when the command completed.
>

Would that be an alternative, or is it better to try Abel's patch?


Regards

Ze Paulo



More information about the sane-devel mailing list