lkml.org 
[lkml]   [2010]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [USB] Use normalized sense when emulating autosense
On Thu, 21 Oct 2010, Luben Tuikov wrote:

> This patch solves two things:
> 1) Enables autosense emulation code to correctly
> interpret descriptor format sense data, and
> 2) Fixes a bug whereby the autosense emulation
> code would overwrite descriptor format sense data
> with SENSE KEY HARDWARE ERROR in fixed format, to
> incorrectly look like this:

...

> @@ -794,12 +793,7 @@ Retry_Sense:
> * everything worked or that there was an unspecified
> * problem. We have to decide which.
> */
> - if ( /* Filemark 0, ignore EOM, ILI 0, no sense */
> - (srb->sense_buffer[2] & 0xaf) == 0 &&
> - /* No ASC or ASCQ */
> - srb->sense_buffer[12] == 0 &&
> - srb->sense_buffer[13] == 0) {
> -
> + if (sshdr.sense_key == 0 && sshdr.asc == 0 && sshdr.ascq == 0) {
> /* If things are really okay, then let's show that.
> * Zero out the sense buffer so the higher layers
> * won't realize we did an unsolicited auto-sense.

What about the Filemark and ILI tests? You mustn't get rid of them;
they are needed for tape drives.

Alan Stern



\
 
 \ /
  Last update: 2010-10-22 16:35    [W:0.052 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site