summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-02-23 02:03:16 +0100
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-27 23:31:07 -0600
commit6d73c8514da241c6b1b8d710a6294786604d7142 (patch)
tree896fdd4d3f2d7094dc75a774f8ae2128d0fcb1c5 /drivers/scsi/scsi_lib.c
parentfc25307d06f524d6c04b371b236dc9e62186058c (diff)
downloadlwn-6d73c8514da241c6b1b8d710a6294786604d7142.tar.gz
lwn-6d73c8514da241c6b1b8d710a6294786604d7142.zip
[SCSI] scsi_lib: fix recognition of cache type of Initio SBP-2 bridges
Regardless what mode page was asked for, Initio INIC-14x0 and INIC-2430 always return page 6 without mode page headers. Try to recognise this as a special case in scsi_mode_sense and setting the mode sense headers accordingly. Signed-off-by: Al Viro <viro@ftp.linux.org.uk> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1fe4fd83e305..eab303d148d8 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1892,8 +1892,16 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
}
if(scsi_status_is_good(result)) {
- data->header_length = header_length;
- if(use_10_for_ms) {
+ if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b &&
+ (modepage == 6 || modepage == 8))) {
+ /* Initio breakage? */
+ header_length = 0;
+ data->length = 13;
+ data->medium_type = 0;
+ data->device_specific = 0;
+ data->longlba = 0;
+ data->block_descriptor_length = 0;
+ } else if(use_10_for_ms) {
data->length = buffer[0]*256 + buffer[1] + 2;
data->medium_type = buffer[2];
data->device_specific = buffer[3];
@@ -1906,6 +1914,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
data->device_specific = buffer[2];
data->block_descriptor_length = buffer[3];
}
+ data->header_length = header_length;
}
return result;