kopia lustrzana https://gitlab.com/sane-project/backends
sanei/sanei_scsi.c: improved error handling for Linux
rodzic
820ac413e7
commit
aa85bb0192
|
@ -1,3 +1,6 @@
|
|||
2002-12-07 Abel Deuring <a.deuring@satzbau-gmbh.de>
|
||||
* sanei/sanei_scsi.c: improved error handling
|
||||
|
||||
2002-12-07 Karl Heinz Kremer <khk@khk.net>
|
||||
|
||||
* backend/epson.c: Fixed problem with dropout color
|
||||
|
|
|
@ -2082,7 +2082,15 @@ sanei_scsi_req_wait (void *id)
|
|||
|
||||
/* check for errors, but let the sense_handler decide.... */
|
||||
if ( (req->sgdata.cdb.hdr.result != 0) ||
|
||||
((req->sgdata.cdb.hdr.sense_buffer[0] & 0x7f) != 0))
|
||||
( (req->sgdata.cdb.hdr.sense_buffer[0] & 0x7f) != 0))
|
||||
#ifdef HAVE_SG_TARGET_STATUS
|
||||
/* this is messy... Sometimes it happens that we have
|
||||
a valid looking sense buffer, but the DRIVER_SENSE
|
||||
bit is not set. Moreover, we can check this only for
|
||||
not tooo old SG drivers
|
||||
*/
|
||||
&& (req->sgdata.cdb.hdr.driver_status & DRIVER_SENSE)
|
||||
#endif
|
||||
{
|
||||
SANEI_SCSI_Sense_Handler handler
|
||||
= fd_info[req->fd].sense_handler;
|
||||
|
@ -2151,8 +2159,11 @@ sanei_scsi_req_wait (void *id)
|
|||
{
|
||||
/* check for errors, but let the sense_handler decide.... */
|
||||
if ( ((req->sgdata.sg3.hdr.info & SG_INFO_CHECK) != 0)
|
||||
|| (req->sgdata.sg3.hdr.sb_len_wr > 0 &&
|
||||
((req->sgdata.sg3.sense_buffer[0] & 0x7f) != 0)))
|
||||
|| ( (req->sgdata.sg3.hdr.sb_len_wr > 0)
|
||||
&& ((req->sgdata.sg3.sense_buffer[0] & 0x7f) != 0)
|
||||
&& (req->sgdata.sg3.hdr.driver_status & DRIVER_SENSE)
|
||||
)
|
||||
)
|
||||
{
|
||||
SANEI_SCSI_Sense_Handler handler
|
||||
= fd_info[req->fd].sense_handler;
|
||||
|
@ -2204,7 +2215,8 @@ sanei_scsi_req_wait (void *id)
|
|||
*/
|
||||
else if ( ((req->sgdata.sg3.hdr.status & 0x2a) == 0)
|
||||
&& (req->sgdata.sg3.hdr.host_status == SG_ERR_DID_OK)
|
||||
&& (req->sgdata.sg3.hdr.driver_status == SG_ERR_DRIVER_OK))
|
||||
&& ((req->sgdata.sg3.hdr.driver_status & ~SG_ERR_DRIVER_SENSE)
|
||||
== SG_ERR_DRIVER_OK))
|
||||
status = SANE_STATUS_GOOD;
|
||||
else
|
||||
status = SANE_STATUS_IO_ERROR;
|
||||
|
|
Ładowanie…
Reference in New Issue