summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-02-14 22:04:19 -0500
committerJody McIntyre <scjody@modernduck.com>2006-02-23 00:29:31 -0500
commita80614d1adba903a1e5cb22bf14ebc640fc2ba4c (patch)
tree353e980f946f22cd49805794da70ff221981a8fb /drivers/ieee1394
parent35bdddb83f62978b5fad82a14fbfd78cc3a5a60c (diff)
downloadop-kernel-dev-a80614d1adba903a1e5cb22bf14ebc640fc2ba4c.zip
op-kernel-dev-a80614d1adba903a1e5cb22bf14ebc640fc2ba4c.tar.gz
sbp2: update 36byte inquiry workaround (fix compatibility regression)
Since about Linux 2.6.14, sbp2's inquiry workaround did not work anymore due to changes in the SCSI layer. Update it to become effective again. Testing one of the two known affected bridges has shown that skip_ms_page_8 is required as well. Also, make force_inquiry_hack tunable via /sys/module/sbp2/parameters. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com> (cherry picked from 99496037c6744fd938ffb8ccfc8fc91762322ff8 commit)
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/sbp2.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 0672224..eca92eb 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -137,15 +137,15 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)"
/*
* SCSI inquiry hack for really badly behaved sbp2 devices. Turn this on
* if your sbp2 device is not properly handling the SCSI inquiry command.
- * This hack makes the inquiry look more like a typical MS Windows
- * inquiry.
+ * This hack makes the inquiry look more like a typical MS Windows inquiry
+ * by enforcing 36 byte inquiry and avoiding access to mode_sense page 8.
*
* If force_inquiry_hack=1 is required for your device to work,
* please submit the logged sbp2_firmware_revision value of this device to
* the linux1394-devel mailing list.
*/
static int force_inquiry_hack;
-module_param(force_inquiry_hack, int, 0444);
+module_param(force_inquiry_hack, int, 0644);
MODULE_PARM_DESC(force_inquiry_hack, "Force SCSI inquiry hack (default = 0)");
/*
@@ -264,18 +264,17 @@ static struct hpsb_protocol_driver sbp2_driver = {
},
};
-
-/* List of device firmware's that require a forced 36 byte inquiry. */
+/*
+ * List of device firmwares that require the inquiry hack.
+ * Yields a few false positives but did not break other devices so far.
+ */
static u32 sbp2_broken_inquiry_list[] = {
- 0x00002800, /* Stefan Richter <richtest@bauwesen.tu-cottbus.de> */
+ 0x00002800, /* Stefan Richter <stefanr@s5r6.in-berlin.de> */
/* DViCO Momobay CX-1 */
0x00000200 /* Andreas Plesch <plesch@fas.harvard.edu> */
/* QPS Fire DVDBurner */
};
-#define NUM_BROKEN_INQUIRY_DEVS \
- (sizeof(sbp2_broken_inquiry_list)/sizeof(*sbp2_broken_inquiry_list))
-
/**************************************
* General utility functions
**************************************/
@@ -1575,7 +1574,7 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
/* Check for a blacklisted set of devices that require us to force
* a 36 byte host inquiry. This can be overriden as a module param
* (to force all hosts). */
- for (i = 0; i < NUM_BROKEN_INQUIRY_DEVS; i++) {
+ for (i = 0; i < ARRAY_SIZE(sbp2_broken_inquiry_list); i++) {
if ((firmware_revision & 0xffff00) ==
sbp2_broken_inquiry_list[i]) {
SBP2_WARN("Node " NODE_BUS_FMT ": Using 36byte inquiry workaround",
@@ -2022,18 +2021,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
}
/*
- * The scsi stack sends down a request_bufflen which does not match the
- * length field in the scsi cdb. This causes some sbp2 devices to
- * reject this inquiry command. Fix the request_bufflen.
- */
- if (*cmd == INQUIRY) {
- if (force_inquiry_hack || scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK)
- request_bufflen = cmd[4] = 0x24;
- else
- request_bufflen = cmd[4];
- }
-
- /*
* Now actually fill in the comamnd orb and sbp2 s/g list
*/
sbp2_create_command_orb(scsi_id, command, cmd, SCpnt->use_sg,
@@ -2489,7 +2476,16 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
{
- ((struct scsi_id_instance_data *)sdev->host->hostdata[0])->sdev = sdev;
+ struct scsi_id_instance_data *scsi_id =
+ (struct scsi_id_instance_data *)sdev->host->hostdata[0];
+
+ scsi_id->sdev = sdev;
+
+ if (force_inquiry_hack ||
+ scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK) {
+ sdev->inquiry_len = 36;
+ sdev->skip_ms_page_8 = 1;
+ }
return 0;
}
OpenPOWER on IntegriCloud