PATCH: scsi_scan.c: emulate windows behavior

Matthew Dharm (mdharm-kernel@one-eyed-alien.net)
Tue, 13 Nov 2001 10:21:06 -0800


--aVD9QWMuhilNxW9f
Content-Type: multipart/mixed; boundary="k1lZvvs/B4yU6o8G"
Content-Disposition: inline

--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I would have sworn we already patched this, but now I can find no record of
it.

Attached is a one-liner patch to scsi_scan.c, which changes the length of
the INQUIRY data request from 255 bytes to 36 bytes. This subtle change
makes Linux act more like Win/MacOS and other popular OSes, and reduces
incompatibility with a broad range of out-of-spec devices that will simply
die if asked for more than the required minimum of 36 bytes.

Did we patch this before? I can't find it in the l-k archives, but I'm
almost positive we have. I remeber this because this problem plagues some
USB devices, which just crash if you ask for more than 36 bytes of data.

Patch is attached. Please apply.

Matt

--=20
Matthew Dharm Home: mdharm-usb@one-eyed-alien.=
net=20
Maintainer, Linux USB Mass Storage Driver

G: Let me guess, you started on the 'net with AOL, right?
C: WOW! d00d! U r leet!
-- Greg and Customer=20
User Friendly, 2/12/1999

--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="scsi_scan.patch"

--- linux/drivers/scsi/scsi_scan.old Tue Nov 13 10:12:19 2001
+++ linux/drivers/scsi/scsi_scan.c Tue Nov 13 10:13:58 2001
@@ -543,7 +543,7 @@
scsi_cmd[1] = 0; /* SCSI_3 and higher, don't touch */
scsi_cmd[2] = 0;
scsi_cmd[3] = 0;
- scsi_cmd[4] = 255;
+ scsi_cmd[4] = 36; /* 36 bytes, just like Win/MacOS */
scsi_cmd[5] = 0;
SRpnt->sr_cmd_len = 0;
SRpnt->sr_data_direction = SCSI_DATA_READ;

--k1lZvvs/B4yU6o8G--

--aVD9QWMuhilNxW9f
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE78WSSz64nssGU+ykRAtgOAKCUb7m1YaBOltXU8W8mL9DSNK3NrwCghvZX
Grti3poFhKO19Cc4eiIOCzs=
=U1Qd
-----END PGP SIGNATURE-----

--aVD9QWMuhilNxW9f--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/