diff options
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/initializers.c | 73 | ||||
-rw-r--r-- | drivers/usb/storage/initializers.h | 1 | ||||
-rw-r--r-- | drivers/usb/storage/libusual.c | 2 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_devs.h | 74 |
4 files changed, 137 insertions, 13 deletions
diff --git a/drivers/usb/storage/initializers.c b/drivers/usb/storage/initializers.c index 5b06f9240d05..ab173b30076e 100644 --- a/drivers/usb/storage/initializers.c +++ b/drivers/usb/storage/initializers.c | |||
@@ -45,6 +45,12 @@ | |||
45 | #include "debug.h" | 45 | #include "debug.h" |
46 | #include "transport.h" | 46 | #include "transport.h" |
47 | 47 | ||
48 | #define RIO_MSC 0x08 | ||
49 | #define RIOP_INIT "RIOP\x00\x01\x08" | ||
50 | #define RIOP_INIT_LEN 7 | ||
51 | #define RIO_SEND_LEN 40 | ||
52 | #define RIO_RECV_LEN 0x200 | ||
53 | |||
48 | /* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target | 54 | /* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target |
49 | * mode */ | 55 | * mode */ |
50 | int usb_stor_euscsi_init(struct us_data *us) | 56 | int usb_stor_euscsi_init(struct us_data *us) |
@@ -91,3 +97,70 @@ int usb_stor_ucr61s2b_init(struct us_data *us) | |||
91 | 97 | ||
92 | return (res ? -1 : 0); | 98 | return (res ? -1 : 0); |
93 | } | 99 | } |
100 | |||
101 | /* Place the Rio Karma into mass storage mode. | ||
102 | * | ||
103 | * The initialization begins by sending 40 bytes starting | ||
104 | * RIOP\x00\x01\x08\x00, which the device will ack with a 512-byte | ||
105 | * packet with the high four bits set and everything else null. | ||
106 | * | ||
107 | * Next, we send RIOP\x80\x00\x08\x00. Each time, a 512 byte response | ||
108 | * must be read, but we must loop until byte 5 in the response is 0x08, | ||
109 | * indicating success. */ | ||
110 | int rio_karma_init(struct us_data *us) | ||
111 | { | ||
112 | int result, partial; | ||
113 | char *recv; | ||
114 | unsigned long timeout; | ||
115 | |||
116 | // us->iobuf is big enough to hold cmd but not receive | ||
117 | if (!(recv = kmalloc(RIO_RECV_LEN, GFP_KERNEL))) | ||
118 | goto die_nomem; | ||
119 | |||
120 | US_DEBUGP("Initializing Karma...\n"); | ||
121 | |||
122 | memset(us->iobuf, 0, RIO_SEND_LEN); | ||
123 | memcpy(us->iobuf, RIOP_INIT, RIOP_INIT_LEN); | ||
124 | |||
125 | result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, | ||
126 | us->iobuf, RIO_SEND_LEN, &partial); | ||
127 | if (result != USB_STOR_XFER_GOOD) | ||
128 | goto die; | ||
129 | |||
130 | result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, | ||
131 | recv, RIO_RECV_LEN, &partial); | ||
132 | if (result != USB_STOR_XFER_GOOD) | ||
133 | goto die; | ||
134 | |||
135 | us->iobuf[4] = 0x80; | ||
136 | us->iobuf[5] = 0; | ||
137 | timeout = jiffies + msecs_to_jiffies(3000); | ||
138 | for (;;) { | ||
139 | US_DEBUGP("Sending init command\n"); | ||
140 | result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, | ||
141 | us->iobuf, RIO_SEND_LEN, &partial); | ||
142 | if (result != USB_STOR_XFER_GOOD) | ||
143 | goto die; | ||
144 | |||
145 | result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, | ||
146 | recv, RIO_RECV_LEN, &partial); | ||
147 | if (result != USB_STOR_XFER_GOOD) | ||
148 | goto die; | ||
149 | |||
150 | if (recv[5] == RIO_MSC) | ||
151 | break; | ||
152 | if (time_after(jiffies, timeout)) | ||
153 | goto die; | ||
154 | msleep(10); | ||
155 | } | ||
156 | US_DEBUGP("Karma initialized.\n"); | ||
157 | kfree(recv); | ||
158 | return 0; | ||
159 | |||
160 | die: | ||
161 | kfree(recv); | ||
162 | die_nomem: | ||
163 | US_DEBUGP("Could not initialize karma.\n"); | ||
164 | return USB_STOR_TRANSPORT_FAILED; | ||
165 | } | ||
166 | |||
diff --git a/drivers/usb/storage/initializers.h b/drivers/usb/storage/initializers.h index 4c1b2bd2e2e4..f9907a5cf129 100644 --- a/drivers/usb/storage/initializers.h +++ b/drivers/usb/storage/initializers.h | |||
@@ -48,3 +48,4 @@ int usb_stor_euscsi_init(struct us_data *us); | |||
48 | /* This function is required to activate all four slots on the UCR-61S2B | 48 | /* This function is required to activate all four slots on the UCR-61S2B |
49 | * flash reader */ | 49 | * flash reader */ |
50 | int usb_stor_ucr61s2b_init(struct us_data *us); | 50 | int usb_stor_ucr61s2b_init(struct us_data *us); |
51 | int rio_karma_init(struct us_data *us); | ||
diff --git a/drivers/usb/storage/libusual.c b/drivers/usb/storage/libusual.c index b28151d1b609..b1ec4a718547 100644 --- a/drivers/usb/storage/libusual.c +++ b/drivers/usb/storage/libusual.c | |||
@@ -116,7 +116,7 @@ EXPORT_SYMBOL_GPL(usb_usual_check_type); | |||
116 | static int usu_probe(struct usb_interface *intf, | 116 | static int usu_probe(struct usb_interface *intf, |
117 | const struct usb_device_id *id) | 117 | const struct usb_device_id *id) |
118 | { | 118 | { |
119 | int type; | 119 | unsigned long type; |
120 | int rc; | 120 | int rc; |
121 | unsigned long flags; | 121 | unsigned long flags; |
122 | 122 | ||
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index dc301e567cfc..31ca92056c27 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -106,6 +106,13 @@ UNUSUAL_DEV( 0x0411, 0x001c, 0x0113, 0x0113, | |||
106 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 106 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
107 | US_FL_FIX_INQUIRY ), | 107 | US_FL_FIX_INQUIRY ), |
108 | 108 | ||
109 | /* Reported by Christian Leber <christian@leber.de> */ | ||
110 | UNUSUAL_DEV( 0x0419, 0xaaf5, 0x0100, 0x0100, | ||
111 | "TrekStor", | ||
112 | "i.Beat 115 2.0", | ||
113 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
114 | US_FL_IGNORE_RESIDUE | US_FL_NOT_LOCKABLE ), | ||
115 | |||
109 | /* Reported by Stefan Werner <dustbln@gmx.de> */ | 116 | /* Reported by Stefan Werner <dustbln@gmx.de> */ |
110 | UNUSUAL_DEV( 0x0419, 0xaaf6, 0x0100, 0x0100, | 117 | UNUSUAL_DEV( 0x0419, 0xaaf6, 0x0100, 0x0100, |
111 | "TrekStor", | 118 | "TrekStor", |
@@ -127,6 +134,14 @@ UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100, | |||
127 | US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ), | 134 | US_SC_SCSI, US_PR_DPCM_USB, NULL, 0 ), |
128 | #endif | 135 | #endif |
129 | 136 | ||
137 | /* Patch submitted by Daniel Drake <dsd@gentoo.org> | ||
138 | * Device reports nonsense bInterfaceProtocol 6 when connected over USB2 */ | ||
139 | UNUSUAL_DEV( 0x0451, 0x5416, 0x0100, 0x0100, | ||
140 | "Neuros Audio", | ||
141 | "USB 2.0 HD 2.5", | ||
142 | US_SC_DEVICE, US_PR_BULK, NULL, | ||
143 | US_FL_NEED_OVERRIDE ), | ||
144 | |||
130 | /* | 145 | /* |
131 | * Pete Zaitcev <zaitcev@yahoo.com>, from Patrick C. F. Ernzer, bz#162559. | 146 | * Pete Zaitcev <zaitcev@yahoo.com>, from Patrick C. F. Ernzer, bz#162559. |
132 | * The key does not actually break, but it returns zero sense which | 147 | * The key does not actually break, but it returns zero sense which |
@@ -137,13 +152,21 @@ UNUSUAL_DEV( 0x0457, 0x0150, 0x0100, 0x0100, | |||
137 | "USB Mass Storage Device", | 152 | "USB Mass Storage Device", |
138 | US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), | 153 | US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), |
139 | 154 | ||
140 | /* Patch submitted by Daniel Drake <dsd@gentoo.org> | 155 | /* |
141 | * Device reports nonsense bInterfaceProtocol 6 when connected over USB2 */ | 156 | * Bohdan Linda <bohdan.linda@gmail.com> |
142 | UNUSUAL_DEV( 0x0451, 0x5416, 0x0100, 0x0100, | 157 | * 1GB USB sticks MyFlash High Speed. I have restricted |
143 | "Neuros Audio", | 158 | * the revision to my model only |
144 | "USB 2.0 HD 2.5", | 159 | */ |
145 | US_SC_DEVICE, US_PR_BULK, NULL, | 160 | UNUSUAL_DEV( 0x0457, 0x0151, 0x0100, 0x0100, |
146 | US_FL_NEED_OVERRIDE ), | 161 | "USB 2.0", |
162 | "Flash Disk", | ||
163 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
164 | US_FL_NOT_LOCKABLE ), | ||
165 | |||
166 | UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101, | ||
167 | "Rio", | ||
168 | "Rio Karma", | ||
169 | US_SC_SCSI, US_PR_BULK, rio_karma_init, 0), | ||
147 | 170 | ||
148 | /* Patch submitted by Philipp Friedrich <philipp@void.at> */ | 171 | /* Patch submitted by Philipp Friedrich <philipp@void.at> */ |
149 | UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, | 172 | UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, |
@@ -424,11 +447,11 @@ UNUSUAL_DEV( 0x054c, 0x0010, 0x0106, 0x0450, | |||
424 | US_FL_SINGLE_LUN | US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ), | 447 | US_FL_SINGLE_LUN | US_FL_NOT_LOCKABLE | US_FL_NO_WP_DETECT ), |
425 | 448 | ||
426 | /* This entry is needed because the device reports Sub=ff */ | 449 | /* This entry is needed because the device reports Sub=ff */ |
427 | UNUSUAL_DEV( 0x054c, 0x0010, 0x0500, 0x0500, | 450 | UNUSUAL_DEV( 0x054c, 0x0010, 0x0500, 0x0600, |
428 | "Sony", | 451 | "Sony", |
429 | "DSC-T1", | 452 | "DSC-T1/T5", |
430 | US_SC_8070, US_PR_DEVICE, NULL, | 453 | US_SC_8070, US_PR_DEVICE, NULL, |
431 | US_FL_SINGLE_LUN ), | 454 | US_FL_SINGLE_LUN ), |
432 | 455 | ||
433 | 456 | ||
434 | /* Reported by wim@geeks.nl */ | 457 | /* Reported by wim@geeks.nl */ |
@@ -730,6 +753,13 @@ UNUSUAL_DEV( 0x0693, 0x0005, 0x0100, 0x0100, | |||
730 | "Flashgate", | 753 | "Flashgate", |
731 | US_SC_SCSI, US_PR_BULK, NULL, 0 ), | 754 | US_SC_SCSI, US_PR_BULK, NULL, 0 ), |
732 | 755 | ||
756 | /* Reported by David Hamilton <niftimusmaximus@lycos.com> */ | ||
757 | UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001, | ||
758 | "Thomson Multimedia Inc.", | ||
759 | "RCA RD1080 MP3 Player", | ||
760 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
761 | US_FL_FIX_CAPACITY ), | ||
762 | |||
733 | UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, | 763 | UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, |
734 | "Sandisk", | 764 | "Sandisk", |
735 | "ImageMate SDDR-05a", | 765 | "ImageMate SDDR-05a", |
@@ -941,6 +971,12 @@ UNUSUAL_DEV( 0x084d, 0x0011, 0x0110, 0x0110, | |||
941 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 971 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
942 | US_FL_BULK32), | 972 | US_FL_BULK32), |
943 | 973 | ||
974 | /* Submitted by Jan De Luyck <lkml@kcore.org> */ | ||
975 | UNUSUAL_DEV( 0x08bd, 0x1100, 0x0000, 0x0000, | ||
976 | "CITIZEN", | ||
977 | "X1DE-USB", | ||
978 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
979 | US_FL_SINGLE_LUN), | ||
944 | 980 | ||
945 | /* Entry needed for flags. Moreover, all devices with this ID use | 981 | /* Entry needed for flags. Moreover, all devices with this ID use |
946 | * bulk-only transport, but _some_ falsely report Control/Bulk instead. | 982 | * bulk-only transport, but _some_ falsely report Control/Bulk instead. |
@@ -1080,6 +1116,13 @@ UNUSUAL_DEV( 0x0dda, 0x0301, 0x0012, 0x0012, | |||
1080 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1116 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1081 | US_FL_IGNORE_RESIDUE ), | 1117 | US_FL_IGNORE_RESIDUE ), |
1082 | 1118 | ||
1119 | /* Reported by Jim McCloskey <mcclosk@ucsc.edu> */ | ||
1120 | UNUSUAL_DEV( 0x0e21, 0x0520, 0x0100, 0x0100, | ||
1121 | "Cowon Systems", | ||
1122 | "iAUDIO M5", | ||
1123 | US_SC_DEVICE, US_PR_BULK, NULL, | ||
1124 | 0 ), | ||
1125 | |||
1083 | /* Submitted by Antoine Mairesse <antoine.mairesse@free.fr> */ | 1126 | /* Submitted by Antoine Mairesse <antoine.mairesse@free.fr> */ |
1084 | UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300, | 1127 | UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300, |
1085 | "USB", | 1128 | "USB", |
@@ -1157,6 +1200,13 @@ UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999, | |||
1157 | US_FL_SINGLE_LUN), | 1200 | US_FL_SINGLE_LUN), |
1158 | #endif | 1201 | #endif |
1159 | 1202 | ||
1203 | /* Reported by Andrew Simmons <andrew.simmons@gmail.com> */ | ||
1204 | UNUSUAL_DEV( 0xed06, 0x4500, 0x0001, 0x0001, | ||
1205 | "DataStor", | ||
1206 | "USB4500 FW1.04", | ||
1207 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1208 | US_FL_FIX_CAPACITY), | ||
1209 | |||
1160 | /* Control/Bulk transport for all SubClass values */ | 1210 | /* Control/Bulk transport for all SubClass values */ |
1161 | USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR), | 1211 | USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR), |
1162 | USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR), | 1212 | USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR), |