aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r--drivers/usb/storage/onetouch.c1
-rw-r--r--drivers/usb/storage/scsiglue.c31
-rw-r--r--drivers/usb/storage/sddr09.c2
-rw-r--r--drivers/usb/storage/unusual_devs.h61
-rw-r--r--drivers/usb/storage/usb.c23
5 files changed, 78 insertions, 40 deletions
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c
index e565d3d2ab29..6d3dad3d1dae 100644
--- a/drivers/usb/storage/onetouch.c
+++ b/drivers/usb/storage/onetouch.c
@@ -33,7 +33,6 @@
33#include <linux/init.h> 33#include <linux/init.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/usb_ch9.h>
37#include <linux/usb/input.h> 36#include <linux/usb/input.h>
38#include "usb.h" 37#include "usb.h"
39#include "onetouch.h" 38#include "onetouch.h"
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index e1072d52d641..70234f5dbeeb 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -110,23 +110,6 @@ static int slave_configure(struct scsi_device *sdev)
110 * the end, scatter-gather buffers follow page boundaries. */ 110 * the end, scatter-gather buffers follow page boundaries. */
111 blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); 111 blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
112 112
113 /* Set the SCSI level to at least 2. We'll leave it at 3 if that's
114 * what is originally reported. We need this to avoid confusing
115 * the SCSI layer with devices that report 0 or 1, but need 10-byte
116 * commands (ala ATAPI devices behind certain bridges, or devices
117 * which simply have broken INQUIRY data).
118 *
119 * NOTE: This means /dev/sg programs (ala cdrecord) will get the
120 * actual information. This seems to be the preference for
121 * programs like that.
122 *
123 * NOTE: This also means that /proc/scsi/scsi and sysfs may report
124 * the actual value or the modified one, depending on where the
125 * data comes from.
126 */
127 if (sdev->scsi_level < SCSI_2)
128 sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
129
130 /* Many devices have trouble transfering more than 32KB at a time, 113 /* Many devices have trouble transfering more than 32KB at a time,
131 * while others have trouble with more than 64K. At this time we 114 * while others have trouble with more than 64K. At this time we
132 * are limiting both to 32K (64 sectores). 115 * are limiting both to 32K (64 sectores).
@@ -176,7 +159,9 @@ static int slave_configure(struct scsi_device *sdev)
176 * a Get-Max-LUN request, we won't lose much by setting the 159 * a Get-Max-LUN request, we won't lose much by setting the
177 * revision level down to 2. The only devices that would be 160 * revision level down to 2. The only devices that would be
178 * affected are those with sparse LUNs. */ 161 * affected are those with sparse LUNs. */
179 sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 162 if (sdev->scsi_level > SCSI_2)
163 sdev->sdev_target->scsi_level =
164 sdev->scsi_level = SCSI_2;
180 165
181 /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable 166 /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable
182 * Hardware Error) when any low-level error occurs, 167 * Hardware Error) when any low-level error occurs,
@@ -194,6 +179,16 @@ static int slave_configure(struct scsi_device *sdev)
194 sdev->use_10_for_ms = 1; 179 sdev->use_10_for_ms = 1;
195 } 180 }
196 181
182 /* The CB and CBI transports have no way to pass LUN values
183 * other than the bits in the second byte of a CDB. But those
184 * bits don't get set to the LUN value if the device reports
185 * scsi_level == 0 (UNKNOWN). Hence such devices must necessarily
186 * be single-LUN.
187 */
188 if ((us->protocol == US_PR_CB || us->protocol == US_PR_CBI) &&
189 sdev->scsi_level == SCSI_UNKNOWN)
190 us->max_lun = 0;
191
197 /* Some devices choke when they receive a PREVENT-ALLOW MEDIUM 192 /* Some devices choke when they receive a PREVENT-ALLOW MEDIUM
198 * REMOVAL command, so suppress those commands. */ 193 * REMOVAL command, so suppress those commands. */
199 if (us->flags & US_FL_NOT_LOCKABLE) 194 if (us->flags & US_FL_NOT_LOCKABLE)
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index fb8bacaae27c..e3528eca29a5 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -646,7 +646,7 @@ sddr09_read_sg_test_only(struct us_data *us) {
646 return result; 646 return result;
647 } 647 }
648 648
649 buf = (unsigned char *) kmalloc(bulklen, GFP_NOIO); 649 buf = kmalloc(bulklen, GFP_NOIO);
650 if (!buf) 650 if (!buf)
651 return -ENOMEM; 651 return -ENOMEM;
652 652
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index db8b26012c75..f49a62fc32d2 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -153,6 +153,13 @@ UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,
153 US_SC_DEVICE, US_PR_DEVICE, NULL, 153 US_SC_DEVICE, US_PR_DEVICE, NULL,
154 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ), 154 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
155 155
156/* Reported by <honkkis@gmail.com> */
157UNUSUAL_DEV( 0x0421, 0x0433, 0x0100, 0x0100,
158 "Nokia",
159 "E70",
160 US_SC_DEVICE, US_PR_DEVICE, NULL,
161 US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),
162
156/* Reported by Jon Hart <Jon.Hart@web.de> */ 163/* Reported by Jon Hart <Jon.Hart@web.de> */
157UNUSUAL_DEV( 0x0421, 0x0434, 0x0100, 0x0100, 164UNUSUAL_DEV( 0x0421, 0x0434, 0x0100, 0x0100,
158 "Nokia", 165 "Nokia",
@@ -190,6 +197,13 @@ UNUSUAL_DEV( 0x0421, 0x047c, 0x0370, 0x0370,
190 US_SC_DEVICE, US_PR_DEVICE, NULL, 197 US_SC_DEVICE, US_PR_DEVICE, NULL,
191 US_FL_MAX_SECTORS_64 ), 198 US_FL_MAX_SECTORS_64 ),
192 199
200/* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */
201UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452,
202 "Nokia",
203 "Nokia 6233",
204 US_SC_DEVICE, US_PR_DEVICE, NULL,
205 US_FL_MAX_SECTORS_64 ),
206
193/* Reported by Alex Corcoles <alex@corcoles.net> */ 207/* Reported by Alex Corcoles <alex@corcoles.net> */
194UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, 208UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370,
195 "Nokia", 209 "Nokia",
@@ -247,6 +261,18 @@ UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101,
247 US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), 261 US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0),
248#endif 262#endif
249 263
264/*
265 * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.)
266 * Reported by Pete Zaitcev <zaitcev@redhat.com>
267 * This device chokes on both version of MODE SENSE which we have, so
268 * use_10_for_ms is not effective, and we use US_FL_NO_WP_DETECT.
269 */
270UNUSUAL_DEV( 0x046b, 0xff40, 0x0100, 0x0100,
271 "AMI",
272 "Virtual Floppy",
273 US_SC_DEVICE, US_PR_DEVICE, NULL,
274 US_FL_NO_WP_DETECT),
275
250/* Patch submitted by Philipp Friedrich <philipp@void.at> */ 276/* Patch submitted by Philipp Friedrich <philipp@void.at> */
251UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, 277UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100,
252 "Kyocera", 278 "Kyocera",
@@ -547,7 +573,7 @@ UNUSUAL_DEV( 0x054c, 0x002b, 0x0100, 0x0110,
547#endif 573#endif
548 574
549/* Submitted by Olaf Hering, <olh@suse.de> SuSE Bugzilla #49049 */ 575/* Submitted by Olaf Hering, <olh@suse.de> SuSE Bugzilla #49049 */
550UNUSUAL_DEV( 0x054c, 0x002c, 0x0501, 0x0501, 576UNUSUAL_DEV( 0x054c, 0x002c, 0x0501, 0x2000,
551 "Sony", 577 "Sony",
552 "USB Floppy Drive", 578 "USB Floppy Drive",
553 US_SC_DEVICE, US_PR_DEVICE, NULL, 579 US_SC_DEVICE, US_PR_DEVICE, NULL,
@@ -721,7 +747,7 @@ UNUSUAL_DEV( 0x05ac, 0x1204, 0x0000, 0x9999,
721 "Apple", 747 "Apple",
722 "iPod", 748 "iPod",
723 US_SC_DEVICE, US_PR_DEVICE, NULL, 749 US_SC_DEVICE, US_PR_DEVICE, NULL,
724 US_FL_FIX_CAPACITY ), 750 US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE ),
725 751
726UNUSUAL_DEV( 0x05ac, 0x1205, 0x0000, 0x9999, 752UNUSUAL_DEV( 0x05ac, 0x1205, 0x0000, 0x9999,
727 "Apple", 753 "Apple",
@@ -1299,13 +1325,6 @@ UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000,
1299 US_SC_DEVICE, US_PR_DEVICE, NULL, 1325 US_SC_DEVICE, US_PR_DEVICE, NULL,
1300 US_FL_FIX_CAPACITY ), 1326 US_FL_FIX_CAPACITY ),
1301 1327
1302/* Reported by Jan Mate <mate@fiit.stuba.sk> */
1303UNUSUAL_DEV( 0x0fce, 0xe030, 0x0000, 0x0000,
1304 "Sony Ericsson",
1305 "P990i",
1306 US_SC_DEVICE, US_PR_DEVICE, NULL,
1307 US_FL_FIX_CAPACITY ),
1308
1309/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu> 1328/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
1310 * Tested on hardware version 1.10. 1329 * Tested on hardware version 1.10.
1311 * Entry is needed only for the initializer function override. 1330 * Entry is needed only for the initializer function override.
@@ -1328,6 +1347,15 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x0100,
1328 US_SC_DEVICE, US_PR_DEVICE, NULL, 1347 US_SC_DEVICE, US_PR_DEVICE, NULL,
1329 US_FL_IGNORE_RESIDUE ), 1348 US_FL_IGNORE_RESIDUE ),
1330 1349
1350/* This prevents the kernel from detecting the virtual cd-drive with the
1351 * Windows drivers. <johann.wilhelm@student.tugraz.at>
1352*/
1353UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0xffff,
1354 "HUAWEI",
1355 "E220 USB-UMTS Install",
1356 US_SC_DEVICE, US_PR_DEVICE, NULL,
1357 US_FL_IGNORE_DEVICE),
1358
1331/* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */ 1359/* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */
1332UNUSUAL_DEV( 0x132b, 0x000b, 0x0001, 0x0001, 1360UNUSUAL_DEV( 0x132b, 0x000b, 0x0001, 0x0001,
1333 "Minolta", 1361 "Minolta",
@@ -1342,6 +1370,21 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x0110,
1342 US_SC_DEVICE, US_PR_DEVICE, NULL, 1370 US_SC_DEVICE, US_PR_DEVICE, NULL,
1343 US_FL_IGNORE_RESIDUE ), 1371 US_FL_IGNORE_RESIDUE ),
1344 1372
1373/* Reported by Francesco Foresti <frafore@tiscali.it> */
1374UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201,
1375 "Super Top",
1376 "IDE DEVICE",
1377 US_SC_DEVICE, US_PR_DEVICE, NULL,
1378 US_FL_IGNORE_RESIDUE ),
1379
1380/* Reported by Robert Schedel <r.schedel@yahoo.de>
1381 * Note: this is a 'super top' device like the above 14cd/6600 device */
1382UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
1383 "Teac",
1384 "HD-35PUK-B",
1385 US_SC_DEVICE, US_PR_DEVICE, NULL,
1386 US_FL_IGNORE_RESIDUE ),
1387
1345/* patch submitted by Davide Perini <perini.davide@dpsoftware.org> 1388/* patch submitted by Davide Perini <perini.davide@dpsoftware.org>
1346 * and Renato Perini <rperini@email.it> 1389 * and Renato Perini <rperini@email.it>
1347 */ 1390 */
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 70644506651f..7e7ec29782f1 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -731,26 +731,27 @@ static int get_pipes(struct us_data *us)
731 struct usb_endpoint_descriptor *ep_int = NULL; 731 struct usb_endpoint_descriptor *ep_int = NULL;
732 732
733 /* 733 /*
734 * Find the endpoints we need. 734 * Find the first endpoint of each type we need.
735 * We are expecting a minimum of 2 endpoints - in and out (bulk). 735 * We are expecting a minimum of 2 endpoints - in and out (bulk).
736 * An optional interrupt is OK (necessary for CBI protocol). 736 * An optional interrupt-in is OK (necessary for CBI protocol).
737 * We will ignore any others. 737 * We will ignore any others.
738 */ 738 */
739 for (i = 0; i < altsetting->desc.bNumEndpoints; i++) { 739 for (i = 0; i < altsetting->desc.bNumEndpoints; i++) {
740 ep = &altsetting->endpoint[i].desc; 740 ep = &altsetting->endpoint[i].desc;
741 741
742 /* Is it a BULK endpoint? */
743 if (usb_endpoint_xfer_bulk(ep)) { 742 if (usb_endpoint_xfer_bulk(ep)) {
744 /* BULK in or out? */ 743 if (usb_endpoint_dir_in(ep)) {
745 if (usb_endpoint_dir_in(ep)) 744 if (!ep_in)
746 ep_in = ep; 745 ep_in = ep;
747 else 746 } else {
748 ep_out = ep; 747 if (!ep_out)
748 ep_out = ep;
749 }
749 } 750 }
750 751
751 /* Is it an interrupt endpoint? */ 752 else if (usb_endpoint_is_int_in(ep)) {
752 else if (usb_endpoint_xfer_int(ep)) { 753 if (!ep_int)
753 ep_int = ep; 754 ep_int = ep;
754 } 755 }
755 } 756 }
756 757