diff options
author | Ben Efros <ben@pc-doctor.com> | 2008-11-18 16:31:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-07 12:59:55 -0500 |
commit | 1537e0ad944acf3a4c2b311a646d7993b89499f7 (patch) | |
tree | 991031a1d14089ba4a0794806c9d702d9764941b /drivers/usb/storage/scsiglue.c | |
parent | a658367dae9dc572480f41817dbe1088a1a049ee (diff) |
USB: storage devices and SAT
Add the SANE SENSE flag to indicate that a device is capable of handling
more than 18-bytes of sense data. This functionality is required for
USB-ATA bridges implementing SAT. A future patch will actually enable this
function for several devices.
The logic behind this is that we can detect support for SANE_SENSE in a few ways:
1) ATA PASS THROUGH (12) or (16) execute successfully
2) SPC-3 or higher is in use
3) A previous CHECK CONDITION occurred with sense format 70-73 and had
a length greater than 18-bytes total
Signed-off-by: Ben Efros <ben@pc-doctor.com>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 09779f6a8179..1b35e011a34f 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -170,6 +170,10 @@ static int slave_configure(struct scsi_device *sdev) | |||
170 | if (us->fflags & US_FL_CAPACITY_HEURISTICS) | 170 | if (us->fflags & US_FL_CAPACITY_HEURISTICS) |
171 | sdev->guess_capacity = 1; | 171 | sdev->guess_capacity = 1; |
172 | 172 | ||
173 | /* assume SPC3 or latter devices support sense size > 18 */ | ||
174 | if (sdev->scsi_level > SCSI_SPC_2) | ||
175 | us->fflags |= US_FL_SANE_SENSE; | ||
176 | |||
173 | /* Some devices report a SCSI revision level above 2 but are | 177 | /* Some devices report a SCSI revision level above 2 but are |
174 | * unable to handle the REPORT LUNS command (for which | 178 | * unable to handle the REPORT LUNS command (for which |
175 | * support is mandatory at level 3). Since we already have | 179 | * support is mandatory at level 3). Since we already have |