public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: unusual_devs fixups
@ 2003-06-16  3:49 Matthew Dharm
  0 siblings, 0 replies; only message in thread
From: Matthew Dharm @ 2003-06-16  3:49 UTC (permalink / raw)
  To: USB Developers, Greg KH, Linux SCSI list, torvalds

[-- Attachment #1: Type: text/plain, Size: 3162 bytes --]

(Resend due to error in address for linux-scsi.)

This patch moves the initialization of the struct scsi_device fields
use_10_for_ms and use_10_for_rw into a central place.  This allows the
host's slave_configure() function to change them (with effect).  This also
collapses two identical sections of code into a single one.

This patch is needed by usb-storage, so we can resolve some Babble
problems, some device-crashing problems, and remove a great deal of
troublesome mode-sense-translation code.

This patch is made against one of Greg K-H's USB trees, but it should apply
with little-or-no fuzz against a Linus tree or a linux-scsi tree.

Linus, please apply.

Matt


# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1963  -> 1.1964 
#	   drivers/scsi/sr.c	1.46    -> 1.47   
#	   drivers/scsi/sd.c	1.49    -> 1.50   
#	drivers/scsi/scsi_scan.c	1.39    -> 1.40   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/15	mdharm@zen.san.one-eyed-alien.net	1.1964
# Move the setting of the use_10_for_ms and use_10_for_rw members of struct
# scsi_device to between where the structure is created and where
# slave_configure() is called.
# 
# This allows slave_configure() to manipulate the variables while
# simultaneously moves two pieces of identical code into one common place.
# --------------------------------------------
#
diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
--- a/drivers/scsi/scsi_scan.c	Sun Jun 15 20:38:43 2003
+++ b/drivers/scsi/scsi_scan.c	Sun Jun 15 20:38:43 2003
@@ -686,6 +686,9 @@
 	 * function */
 	sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
 
+	sdev->use_10_for_rw = 1;
+	sdev->use_10_for_ms = 0;
+
 	if(sdev->host->hostt->slave_configure)
 		sdev->host->hostt->slave_configure(sdev);
 
diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c
--- a/drivers/scsi/sd.c	Sun Jun 15 20:38:43 2003
+++ b/drivers/scsi/sd.c	Sun Jun 15 20:38:43 2003
@@ -1265,8 +1265,6 @@
 	if (sdkp->media_present)
 		sd_read_cache_type(sdkp, disk->disk_name, SRpnt, buffer);
 		
-	SRpnt->sr_device->use_10_for_rw = 1;
-	SRpnt->sr_device->use_10_for_ms = 0;
 	SRpnt->sr_device->remap = 1;
 
  leave:
diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c
--- a/drivers/scsi/sr.c	Sun Jun 15 20:38:43 2003
+++ b/drivers/scsi/sr.c	Sun Jun 15 20:38:43 2003
@@ -524,8 +524,6 @@
 	sprintf(cd->cdi.name, "sr%d", minor);
 
 	sdev->sector_size = 2048;	/* A guess, just in case */
-	sdev->use_10_for_rw = 1;
-	sdev->use_10_for_ms = 0;
 	sdev->remap = 1;
 
 	/* FIXME: need to handle a get_capabilities failure properly ?? */
-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Sir, for the hundreth time, we do NOT carry 600-round boxes of belt-fed 
suction darts!
					-- Salesperson to Greg
User Friendly, 12/30/1997

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-16  3:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-16  3:49 PATCH: unusual_devs fixups Matthew Dharm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox