aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2006-06-24 20:27:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-07-12 19:03:22 -0400
commit883d989a7edf7a62e38e9150990b56209420e9e5 (patch)
tree11b0476d04a21a3fa5a3ab07c6a687ac958a18d3
parent20307949469269ceea6262aaa306dcb55cf43b25 (diff)
[PATCH] USB Storage: US_FL_MAX_SECTORS_64 flag
This patch adds a US_FL_MAX_SECTORS_64 and removes the Genesys special-cases for this that were in scsiglue.c. It also adds the flag to other devices reported to need it. Signed-off-by: Phil Dibowitz <phil@ipom.com> Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/storage/scsiglue.c12
-rw-r--r--drivers/usb/storage/unusual_devs.h16
-rw-r--r--drivers/usb/storage/usb.h4
-rw-r--r--include/linux/usb_usual.h2
4 files changed, 21 insertions, 13 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 5715291ba540..a4b7df9ff8c1 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -112,13 +112,11 @@ static int slave_configure(struct scsi_device *sdev)
112 if (sdev->scsi_level < SCSI_2) 112 if (sdev->scsi_level < SCSI_2)
113 sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 113 sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
114 114
115 /* According to the technical support people at Genesys Logic, 115 /* Many devices have trouble transfering more than 32KB at a time,
116 * devices using their chips have problems transferring more than 116 * while others have trouble with more than 64K. At this time we
117 * 32 KB at a time. In practice people have found that 64 KB 117 * are limiting both to 32K (64 sectores).
118 * works okay and that's what Windows does. But we'll be 118 */
119 * conservative; people can always use the sysfs interface to 119 if ((us->flags & US_FL_MAX_SECTORS_64) &&
120 * increase max_sectors. */
121 if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS &&
122 sdev->request_queue->max_sectors > 64) 120 sdev->request_queue->max_sectors > 64)
123 blk_queue_max_sectors(sdev->request_queue, 64); 121 blk_queue_max_sectors(sdev->request_queue, 64);
124 122
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index c8800651da97..b6a0eb8dc7e2 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -715,18 +715,22 @@ UNUSUAL_DEV( 0x05dc, 0xb002, 0x0000, 0x0113,
715 * They were originally reported by Alexander Oltu 715 * They were originally reported by Alexander Oltu
716 * <alexander@all-2.com> and Peter Marks <peter.marks@turner.com> 716 * <alexander@all-2.com> and Peter Marks <peter.marks@turner.com>
717 * respectively. 717 * respectively.
718 *
719 * US_FL_GO_SLOW and US_FL_MAX_SECTORS_64 added by Phil Dibowitz
720 * <phil@ipom.com> as these flags were made and hard-coded
721 * special-cases were pulled from scsiglue.c.
718 */ 722 */
719UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff, 723UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff,
720 "Genesys Logic", 724 "Genesys Logic",
721 "USB to IDE Optical", 725 "USB to IDE Optical",
722 US_SC_DEVICE, US_PR_DEVICE, NULL, 726 US_SC_DEVICE, US_PR_DEVICE, NULL,
723 US_FL_GO_SLOW ), 727 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
724 728
725UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, 729UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff,
726 "Genesys Logic", 730 "Genesys Logic",
727 "USB to IDE Disk", 731 "USB to IDE Disk",
728 US_SC_DEVICE, US_PR_DEVICE, NULL, 732 US_SC_DEVICE, US_PR_DEVICE, NULL,
729 US_FL_GO_SLOW ), 733 US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
730 734
731/* Reported by Hanno Boeck <hanno@gmx.de> 735/* Reported by Hanno Boeck <hanno@gmx.de>
732 * Taken from the Lycoris Kernel */ 736 * Taken from the Lycoris Kernel */
@@ -1203,6 +1207,14 @@ UNUSUAL_DEV( 0x0ea0, 0x6828, 0x0110, 0x0110,
1203 US_SC_DEVICE, US_PR_DEVICE, NULL, 1207 US_SC_DEVICE, US_PR_DEVICE, NULL,
1204 US_FL_IGNORE_RESIDUE ), 1208 US_FL_IGNORE_RESIDUE ),
1205 1209
1210/* Reported by Benjamin Schiller <sbenni@gmx.de>
1211 * It is also sold by Easylite as DJ 20 */
1212UNUSUAL_DEV( 0x0ed1, 0x7636, 0x0103, 0x0103,
1213 "Typhoon",
1214 "My DJ 1820",
1215 US_SC_DEVICE, US_PR_DEVICE, NULL,
1216 US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64),
1217
1206/* Reported by Michael Stattmann <michael@stattmann.com> */ 1218/* Reported by Michael Stattmann <michael@stattmann.com> */
1207UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, 1219UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000,
1208 "Sony Ericsson", 1220 "Sony Ericsson",
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 5284abe1b5eb..21f3ddbc9080 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -176,8 +176,4 @@ extern void fill_inquiry_response(struct us_data *us,
176#define scsi_unlock(host) spin_unlock_irq(host->host_lock) 176#define scsi_unlock(host) spin_unlock_irq(host->host_lock)
177#define scsi_lock(host) spin_lock_irq(host->host_lock) 177#define scsi_lock(host) spin_lock_irq(host->host_lock)
178 178
179
180/* Vendor ID list for devices that require special handling */
181#define USB_VENDOR_ID_GENESYS 0x05e3 /* Genesys Logic */
182
183#endif 179#endif
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 608487a62c98..f38f43f20fae 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -43,6 +43,8 @@
43 /* Need delay after Command phase */ \ 43 /* Need delay after Command phase */ \
44 US_FLAG(NO_WP_DETECT, 0x00000200) \ 44 US_FLAG(NO_WP_DETECT, 0x00000200) \
45 /* Don't check for write-protect */ \ 45 /* Don't check for write-protect */ \
46 US_FLAG(MAX_SECTORS_64, 0x00000400) \
47 /* Sets max_sectors to 64 */
46 48
47#define US_FLAG(name, value) US_FL_##name = value , 49#define US_FLAG(name, value) US_FL_##name = value ,
48enum { US_DO_ALL_FLAGS }; 50enum { US_DO_ALL_FLAGS };