umass_quirks.c revision 1.8.2.6 1 1.8.2.6 nathanw /* $NetBSD: umass_quirks.c,v 1.8.2.6 2002/09/17 21:21:35 nathanw Exp $ */
2 1.8.2.2 nathanw
3 1.8.2.2 nathanw /*
4 1.8.2.2 nathanw * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 1.8.2.2 nathanw * All rights reserved.
6 1.8.2.2 nathanw *
7 1.8.2.2 nathanw * This code is derived from software contributed to The NetBSD Foundation
8 1.8.2.2 nathanw * by MAEKAWA Masahide (gehenna (at) NetBSD.org).
9 1.8.2.2 nathanw *
10 1.8.2.2 nathanw * Redistribution and use in source and binary forms, with or without
11 1.8.2.2 nathanw * modification, are permitted provided that the following conditions
12 1.8.2.2 nathanw * are met:
13 1.8.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
14 1.8.2.2 nathanw * notice, this list of conditions and the following disclaimer.
15 1.8.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
16 1.8.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
17 1.8.2.2 nathanw * documentation and/or other materials provided with the distribution.
18 1.8.2.2 nathanw * 3. All advertising materials mentioning features or use of this software
19 1.8.2.2 nathanw * must display the following acknowledgement:
20 1.8.2.2 nathanw * This product includes software developed by the NetBSD
21 1.8.2.2 nathanw * Foundation, Inc. and its contributors.
22 1.8.2.2 nathanw * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.8.2.2 nathanw * contributors may be used to endorse or promote products derived
24 1.8.2.2 nathanw * from this software without specific prior written permission.
25 1.8.2.2 nathanw *
26 1.8.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.8.2.2 nathanw * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.8.2.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.8.2.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.8.2.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.8.2.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.8.2.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.8.2.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.8.2.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.8.2.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.8.2.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
37 1.8.2.2 nathanw */
38 1.8.2.2 nathanw
39 1.8.2.2 nathanw #include <sys/param.h>
40 1.8.2.2 nathanw #include <sys/systm.h>
41 1.8.2.2 nathanw #include <sys/device.h>
42 1.8.2.2 nathanw #include <sys/buf.h>
43 1.8.2.2 nathanw
44 1.8.2.2 nathanw #include <dev/scsipi/scsipi_all.h> /* for scsiconf.h below */
45 1.8.2.2 nathanw #include <dev/scsipi/scsiconf.h> /* for quirks defines */
46 1.8.2.2 nathanw
47 1.8.2.2 nathanw #include <dev/usb/usb.h>
48 1.8.2.2 nathanw #include <dev/usb/usbdi.h>
49 1.8.2.2 nathanw #include <dev/usb/usbdevs.h>
50 1.8.2.2 nathanw
51 1.8.2.2 nathanw #include <dev/usb/umassvar.h>
52 1.8.2.2 nathanw #include <dev/usb/umass_quirks.h>
53 1.8.2.2 nathanw
54 1.8.2.2 nathanw Static usbd_status umass_init_insystem(struct umass_softc *);
55 1.8.2.2 nathanw Static usbd_status umass_init_shuttle(struct umass_softc *);
56 1.8.2.2 nathanw
57 1.8.2.2 nathanw Static void umass_fixup_sony(struct umass_softc *);
58 1.8.2.2 nathanw Static void umass_fixup_yedata(struct umass_softc *);
59 1.8.2.2 nathanw
60 1.8.2.2 nathanw Static const struct umass_quirk umass_quirks[] = {
61 1.8.2.5 nathanw { { USB_VENDOR_DMI, USB_PRODUCT_DMI_SA2_0 },
62 1.8.2.5 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
63 1.8.2.5 nathanw 0,
64 1.8.2.5 nathanw PQUIRK_NOMODESENSE,
65 1.8.2.5 nathanw UMATCH_VENDOR_PRODUCT,
66 1.8.2.5 nathanw NULL, NULL
67 1.8.2.5 nathanw },
68 1.8.2.5 nathanw
69 1.8.2.2 nathanw { { USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100 },
70 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
71 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
72 1.8.2.2 nathanw PQUIRK_NOTUR | PQUIRK_NOSENSE,
73 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
74 1.8.2.2 nathanw NULL, NULL
75 1.8.2.2 nathanw },
76 1.8.2.2 nathanw
77 1.8.2.2 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE },
78 1.8.2.2 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
79 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
80 1.8.2.2 nathanw PQUIRK_NOTUR,
81 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
82 1.8.2.2 nathanw umass_init_insystem, NULL
83 1.8.2.2 nathanw },
84 1.8.2.2 nathanw
85 1.8.2.2 nathanw { { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP100 },
86 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
87 1.8.2.2 nathanw 0,
88 1.8.2.2 nathanw PQUIRK_NOTUR,
89 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
90 1.8.2.2 nathanw NULL, NULL
91 1.8.2.2 nathanw },
92 1.8.2.2 nathanw
93 1.8.2.2 nathanw { { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP250 },
94 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
95 1.8.2.2 nathanw 0,
96 1.8.2.2 nathanw PQUIRK_NOTUR,
97 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
98 1.8.2.2 nathanw NULL, NULL
99 1.8.2.2 nathanw },
100 1.8.2.2 nathanw
101 1.8.2.2 nathanw { { USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM },
102 1.8.2.2 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
103 1.8.2.2 nathanw 0,
104 1.8.2.2 nathanw 0,
105 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
106 1.8.2.2 nathanw NULL, NULL
107 1.8.2.2 nathanw },
108 1.8.2.2 nathanw
109 1.8.2.2 nathanw { { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY },
110 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
111 1.8.2.6 nathanw UMASS_QUIRK_NO_MAX_LUN,
112 1.8.2.2 nathanw PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK | PQUIRK_NOBIGMODESENSE,
113 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
114 1.8.2.2 nathanw NULL, NULL
115 1.8.2.2 nathanw },
116 1.8.2.2 nathanw
117 1.8.2.2 nathanw { { USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C1 },
118 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
119 1.8.2.2 nathanw UMASS_QUIRK_WRONG_CSWSIG,
120 1.8.2.2 nathanw 0,
121 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
122 1.8.2.2 nathanw NULL, NULL
123 1.8.2.2 nathanw },
124 1.8.2.2 nathanw
125 1.8.2.3 nathanw { { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MD2 },
126 1.8.2.3 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
127 1.8.2.3 nathanw 0,
128 1.8.2.3 nathanw PQUIRK_NOMODESENSE,
129 1.8.2.3 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
130 1.8.2.3 nathanw NULL, NULL
131 1.8.2.3 nathanw },
132 1.8.2.3 nathanw
133 1.8.2.3 nathanw { { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MD1II },
134 1.8.2.3 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
135 1.8.2.3 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
136 1.8.2.3 nathanw PQUIRK_NOMODESENSE,
137 1.8.2.3 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
138 1.8.2.3 nathanw NULL, NULL
139 1.8.2.3 nathanw },
140 1.8.2.3 nathanw
141 1.8.2.2 nathanw { { USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R },
142 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
143 1.8.2.2 nathanw 0,
144 1.8.2.2 nathanw 0,
145 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
146 1.8.2.2 nathanw NULL, NULL
147 1.8.2.2 nathanw },
148 1.8.2.2 nathanw
149 1.8.2.2 nathanw { { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB },
150 1.8.2.2 nathanw UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
151 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
152 1.8.2.2 nathanw PQUIRK_NOTUR,
153 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
154 1.8.2.2 nathanw umass_init_shuttle, NULL
155 1.8.2.2 nathanw },
156 1.8.2.2 nathanw
157 1.8.2.2 nathanw { { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_ZIOMMC },
158 1.8.2.2 nathanw UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
159 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
160 1.8.2.2 nathanw PQUIRK_NOTUR,
161 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
162 1.8.2.2 nathanw NULL, NULL
163 1.8.2.2 nathanw },
164 1.8.2.2 nathanw
165 1.8.2.2 nathanw { { USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC },
166 1.8.2.4 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_UFI,
167 1.8.2.4 nathanw UMASS_QUIRK_FORCE_SHORT_INQUIRY | UMASS_QUIRK_RS_NO_CLEAR_UA,
168 1.8.2.4 nathanw PQUIRK_NOMODESENSE,
169 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
170 1.8.2.4 nathanw NULL, NULL
171 1.8.2.2 nathanw },
172 1.8.2.2 nathanw
173 1.8.2.2 nathanw { { USB_VENDOR_SONY, USB_PRODUCT_ANY },
174 1.8.2.4 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
175 1.8.2.2 nathanw 0,
176 1.8.2.2 nathanw 0,
177 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
178 1.8.2.2 nathanw NULL, umass_fixup_sony
179 1.8.2.2 nathanw },
180 1.8.2.2 nathanw
181 1.8.2.2 nathanw { { USB_VENDOR_TEAC, USB_PRODUCT_TEAC_FD05PUB },
182 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
183 1.8.2.2 nathanw 0,
184 1.8.2.2 nathanw PQUIRK_NOMODESENSE,
185 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
186 1.8.2.2 nathanw NULL, NULL
187 1.8.2.2 nathanw },
188 1.8.2.2 nathanw
189 1.8.2.5 nathanw { { USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_XXX1100 },
190 1.8.2.5 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
191 1.8.2.5 nathanw 0,
192 1.8.2.5 nathanw 0,
193 1.8.2.5 nathanw UMATCH_VENDOR_PRODUCT,
194 1.8.2.5 nathanw NULL, NULL
195 1.8.2.5 nathanw },
196 1.8.2.5 nathanw
197 1.8.2.2 nathanw { { USB_VENDOR_YANO, USB_PRODUCT_YANO_U640MO },
198 1.8.2.2 nathanw UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
199 1.8.2.2 nathanw UMASS_QUIRK_FORCE_SHORT_INQUIRY,
200 1.8.2.2 nathanw 0,
201 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
202 1.8.2.2 nathanw NULL, NULL
203 1.8.2.2 nathanw },
204 1.8.2.2 nathanw
205 1.8.2.2 nathanw { { USB_VENDOR_YEDATA, USB_PRODUCT_YEDATA_FLASHBUSTERU },
206 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
207 1.8.2.2 nathanw UMASS_QUIRK_RS_NO_CLEAR_UA,
208 1.8.2.2 nathanw PQUIRK_NOMODESENSE,
209 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT_REV,
210 1.8.2.2 nathanw NULL, umass_fixup_yedata
211 1.8.2.2 nathanw },
212 1.8.2.2 nathanw
213 1.8.2.3 nathanw { { USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_S304 },
214 1.8.2.3 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
215 1.8.2.3 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
216 1.8.2.3 nathanw 0,
217 1.8.2.3 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
218 1.8.2.3 nathanw NULL, NULL
219 1.8.2.3 nathanw },
220 1.8.2.3 nathanw
221 1.8.2.3 nathanw { { USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_X },
222 1.8.2.3 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
223 1.8.2.3 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
224 1.8.2.3 nathanw 0,
225 1.8.2.3 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
226 1.8.2.3 nathanw NULL, NULL
227 1.8.2.3 nathanw },
228 1.8.2.3 nathanw
229 1.8.2.4 nathanw { { USB_VENDOR_PEN, USB_PRODUCT_PEN_USBDISK },
230 1.8.2.4 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
231 1.8.2.4 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
232 1.8.2.4 nathanw 0,
233 1.8.2.4 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
234 1.8.2.4 nathanw NULL, NULL
235 1.8.2.4 nathanw },
236 1.8.2.4 nathanw
237 1.8.2.2 nathanw /* InSystem Design ATA over USB devices */
238 1.8.2.2 nathanw { { USB_VENDOR_ATI, USB_PRODUCT_ATI2_205 },
239 1.8.2.2 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
240 1.8.2.2 nathanw 0,
241 1.8.2.2 nathanw 0,
242 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
243 1.8.2.2 nathanw NULL, NULL
244 1.8.2.2 nathanw },
245 1.8.2.2 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ATAPI },
246 1.8.2.2 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
247 1.8.2.2 nathanw 0,
248 1.8.2.2 nathanw 0,
249 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
250 1.8.2.2 nathanw NULL, NULL
251 1.8.2.2 nathanw },
252 1.8.2.2 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_DRIVEV2_5 },
253 1.8.2.2 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
254 1.8.2.2 nathanw 0,
255 1.8.2.2 nathanw 0,
256 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
257 1.8.2.2 nathanw NULL, NULL
258 1.8.2.2 nathanw },
259 1.8.2.2 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ADAPTERV2 },
260 1.8.2.2 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
261 1.8.2.2 nathanw 0,
262 1.8.2.2 nathanw 0,
263 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
264 1.8.2.2 nathanw NULL, NULL
265 1.8.2.2 nathanw },
266 1.8.2.2 nathanw { { USB_VENDOR_SONY, USB_PRODUCT_SONY_DRIVEV2 },
267 1.8.2.2 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
268 1.8.2.2 nathanw 0,
269 1.8.2.2 nathanw 0,
270 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
271 1.8.2.2 nathanw NULL, NULL
272 1.8.2.2 nathanw },
273 1.8.2.5 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_IDEUSB2 },
274 1.8.2.5 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
275 1.8.2.5 nathanw 0,
276 1.8.2.5 nathanw PQUIRK_NOMODESENSE,
277 1.8.2.5 nathanw UMATCH_VENDOR_PRODUCT,
278 1.8.2.5 nathanw NULL, NULL
279 1.8.2.5 nathanw },
280 1.8.2.6 nathanw { { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND5010 },
281 1.8.2.6 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
282 1.8.2.6 nathanw 0,
283 1.8.2.6 nathanw PQUIRK_NOMODESENSE | PQUIRK_FORCELUNS,
284 1.8.2.6 nathanw UMATCH_VENDOR_PRODUCT,
285 1.8.2.6 nathanw NULL, NULL
286 1.8.2.6 nathanw },
287 1.8.2.2 nathanw };
288 1.8.2.2 nathanw
289 1.8.2.2 nathanw const struct umass_quirk *
290 1.8.2.2 nathanw umass_lookup(u_int16_t vendor, u_int16_t product)
291 1.8.2.2 nathanw {
292 1.8.2.2 nathanw return ((const struct umass_quirk *)
293 1.8.2.2 nathanw usb_lookup(umass_quirks, vendor, product));
294 1.8.2.2 nathanw }
295 1.8.2.2 nathanw
296 1.8.2.2 nathanw Static usbd_status
297 1.8.2.2 nathanw umass_init_insystem(struct umass_softc *sc)
298 1.8.2.2 nathanw {
299 1.8.2.2 nathanw usbd_status err;
300 1.8.2.2 nathanw
301 1.8.2.2 nathanw err = usbd_set_interface(sc->sc_iface, 1);
302 1.8.2.2 nathanw if (err) {
303 1.8.2.2 nathanw DPRINTF(UDMASS_USB,
304 1.8.2.2 nathanw ("%s: could not switch to Alt Interface 1\n",
305 1.8.2.2 nathanw USBDEVNAME(sc->sc_dev)));
306 1.8.2.2 nathanw return (err);
307 1.8.2.2 nathanw }
308 1.8.2.2 nathanw
309 1.8.2.2 nathanw return (USBD_NORMAL_COMPLETION);
310 1.8.2.2 nathanw }
311 1.8.2.2 nathanw
312 1.8.2.2 nathanw Static usbd_status
313 1.8.2.2 nathanw umass_init_shuttle(struct umass_softc *sc)
314 1.8.2.2 nathanw {
315 1.8.2.2 nathanw usb_device_request_t req;
316 1.8.2.2 nathanw u_int8_t status[2];
317 1.8.2.2 nathanw
318 1.8.2.2 nathanw /* The Linux driver does this */
319 1.8.2.2 nathanw req.bmRequestType = UT_READ_VENDOR_DEVICE;
320 1.8.2.2 nathanw req.bRequest = 1;
321 1.8.2.2 nathanw USETW(req.wValue, 0);
322 1.8.2.2 nathanw USETW(req.wIndex, sc->sc_ifaceno);
323 1.8.2.2 nathanw USETW(req.wLength, sizeof(status));
324 1.8.2.2 nathanw
325 1.8.2.2 nathanw return (usbd_do_request(sc->sc_udev, &req, &status));
326 1.8.2.2 nathanw }
327 1.8.2.2 nathanw
328 1.8.2.2 nathanw Static void
329 1.8.2.2 nathanw umass_fixup_sony(struct umass_softc *sc)
330 1.8.2.2 nathanw {
331 1.8.2.2 nathanw usb_interface_descriptor_t *id;
332 1.8.2.2 nathanw
333 1.8.2.2 nathanw id = usbd_get_interface_descriptor(sc->sc_iface);
334 1.8.2.2 nathanw if (id->bInterfaceSubClass == 0xff) {
335 1.8.2.2 nathanw sc->sc_cmd = UMASS_CPROTO_RBC;
336 1.8.2.2 nathanw }
337 1.8.2.2 nathanw }
338 1.8.2.2 nathanw
339 1.8.2.2 nathanw Static void
340 1.8.2.2 nathanw umass_fixup_yedata(struct umass_softc *sc)
341 1.8.2.2 nathanw {
342 1.8.2.2 nathanw usb_device_descriptor_t *dd;
343 1.8.2.2 nathanw
344 1.8.2.2 nathanw dd = usbd_get_device_descriptor(sc->sc_udev);
345 1.8.2.2 nathanw
346 1.8.2.2 nathanw /*
347 1.8.2.2 nathanw * Revisions < 1.28 do not handle the interrupt endpoint very well.
348 1.8.2.2 nathanw */
349 1.8.2.2 nathanw if (UGETW(dd->bcdDevice) < 0x128)
350 1.8.2.2 nathanw sc->sc_wire = UMASS_WPROTO_CBI;
351 1.8.2.2 nathanw else
352 1.8.2.2 nathanw sc->sc_wire = UMASS_WPROTO_CBI_I;
353 1.8.2.2 nathanw
354 1.8.2.2 nathanw /*
355 1.8.2.2 nathanw * Revisions < 1.28 do not have the TEST UNIT READY command
356 1.8.2.2 nathanw * Revisions == 1.28 have a broken TEST UNIT READY
357 1.8.2.2 nathanw */
358 1.8.2.2 nathanw if (UGETW(dd->bcdDevice) <= 0x128)
359 1.8.2.2 nathanw sc->sc_busquirks |= PQUIRK_NOTUR;
360 1.8.2.2 nathanw }
361