umass_quirks.c revision 1.8.2.7 1 1.8.2.7 nathanw /* $NetBSD: umass_quirks.c,v 1.8.2.7 2002/10/18 02:44: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_yedata(struct umass_softc *);
58 1.8.2.2 nathanw
59 1.8.2.2 nathanw Static const struct umass_quirk umass_quirks[] = {
60 1.8.2.7 nathanw { { USB_VENDOR_ATI, USB_PRODUCT_ATI2_205 },
61 1.8.2.7 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
62 1.8.2.7 nathanw 0,
63 1.8.2.7 nathanw 0,
64 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
65 1.8.2.7 nathanw NULL, NULL
66 1.8.2.7 nathanw },
67 1.8.2.7 nathanw
68 1.8.2.7 nathanw { { USB_VENDOR_DMI, USB_PRODUCT_DMI_SA2_0 },
69 1.8.2.5 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
70 1.8.2.7 nathanw 0,
71 1.8.2.7 nathanw PQUIRK_NOMODESENSE,
72 1.8.2.5 nathanw UMATCH_VENDOR_PRODUCT,
73 1.8.2.5 nathanw NULL, NULL
74 1.8.2.5 nathanw },
75 1.8.2.5 nathanw
76 1.8.2.2 nathanw { { USB_VENDOR_FUJIPHOTO, USB_PRODUCT_FUJIPHOTO_MASS0100 },
77 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
78 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
79 1.8.2.2 nathanw PQUIRK_NOTUR | PQUIRK_NOSENSE,
80 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
81 1.8.2.2 nathanw NULL, NULL
82 1.8.2.2 nathanw },
83 1.8.2.2 nathanw
84 1.8.2.7 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ADAPTERV2 },
85 1.8.2.7 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
86 1.8.2.7 nathanw 0,
87 1.8.2.7 nathanw 0,
88 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
89 1.8.2.7 nathanw NULL, NULL
90 1.8.2.7 nathanw },
91 1.8.2.7 nathanw
92 1.8.2.7 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_ATAPI },
93 1.8.2.7 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
94 1.8.2.7 nathanw 0,
95 1.8.2.7 nathanw 0,
96 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
97 1.8.2.7 nathanw NULL, NULL
98 1.8.2.7 nathanw },
99 1.8.2.7 nathanw
100 1.8.2.7 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_DRIVEV2_5 },
101 1.8.2.7 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
102 1.8.2.7 nathanw 0,
103 1.8.2.7 nathanw 0,
104 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
105 1.8.2.7 nathanw NULL, NULL
106 1.8.2.7 nathanw },
107 1.8.2.7 nathanw
108 1.8.2.7 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_IDEUSB2 },
109 1.8.2.7 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
110 1.8.2.7 nathanw 0,
111 1.8.2.7 nathanw PQUIRK_NOMODESENSE,
112 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
113 1.8.2.7 nathanw NULL, NULL
114 1.8.2.7 nathanw },
115 1.8.2.7 nathanw
116 1.8.2.2 nathanw { { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE },
117 1.8.2.2 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
118 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
119 1.8.2.2 nathanw PQUIRK_NOTUR,
120 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
121 1.8.2.2 nathanw umass_init_insystem, NULL
122 1.8.2.2 nathanw },
123 1.8.2.2 nathanw
124 1.8.2.2 nathanw { { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP100 },
125 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
126 1.8.2.2 nathanw 0,
127 1.8.2.2 nathanw PQUIRK_NOTUR,
128 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
129 1.8.2.2 nathanw NULL, NULL
130 1.8.2.2 nathanw },
131 1.8.2.2 nathanw
132 1.8.2.2 nathanw { { USB_VENDOR_IOMEGA, USB_PRODUCT_IOMEGA_ZIP250 },
133 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
134 1.8.2.2 nathanw 0,
135 1.8.2.2 nathanw PQUIRK_NOTUR,
136 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
137 1.8.2.2 nathanw NULL, NULL
138 1.8.2.2 nathanw },
139 1.8.2.2 nathanw
140 1.8.2.2 nathanw { { USB_VENDOR_MICROTECH, USB_PRODUCT_MICROTECH_DPCM },
141 1.8.2.2 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
142 1.8.2.2 nathanw 0,
143 1.8.2.2 nathanw 0,
144 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
145 1.8.2.2 nathanw NULL, NULL
146 1.8.2.2 nathanw },
147 1.8.2.2 nathanw
148 1.8.2.7 nathanw { { USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_S304 },
149 1.8.2.7 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
150 1.8.2.7 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
151 1.8.2.7 nathanw 0,
152 1.8.2.7 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
153 1.8.2.7 nathanw NULL, NULL
154 1.8.2.7 nathanw },
155 1.8.2.7 nathanw
156 1.8.2.7 nathanw { { USB_VENDOR_MINOLTA, USB_PRODUCT_MINOLTA_X },
157 1.8.2.7 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
158 1.8.2.7 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
159 1.8.2.7 nathanw 0,
160 1.8.2.7 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
161 1.8.2.7 nathanw NULL, NULL
162 1.8.2.7 nathanw },
163 1.8.2.7 nathanw
164 1.8.2.2 nathanw { { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY },
165 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
166 1.8.2.6 nathanw UMASS_QUIRK_NO_MAX_LUN,
167 1.8.2.2 nathanw PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK | PQUIRK_NOBIGMODESENSE,
168 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
169 1.8.2.2 nathanw NULL, NULL
170 1.8.2.2 nathanw },
171 1.8.2.2 nathanw
172 1.8.2.7 nathanw { { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND5010 },
173 1.8.2.7 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
174 1.8.2.7 nathanw 0,
175 1.8.2.7 nathanw PQUIRK_NOMODESENSE | PQUIRK_FORCELUNS,
176 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
177 1.8.2.7 nathanw NULL, NULL
178 1.8.2.7 nathanw },
179 1.8.2.7 nathanw
180 1.8.2.2 nathanw { { USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C1 },
181 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
182 1.8.2.2 nathanw UMASS_QUIRK_WRONG_CSWSIG,
183 1.8.2.2 nathanw 0,
184 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
185 1.8.2.2 nathanw NULL, NULL
186 1.8.2.2 nathanw },
187 1.8.2.2 nathanw
188 1.8.2.7 nathanw { { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MD1II },
189 1.8.2.7 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
190 1.8.2.7 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
191 1.8.2.7 nathanw PQUIRK_NOMODESENSE,
192 1.8.2.7 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
193 1.8.2.7 nathanw NULL, NULL
194 1.8.2.7 nathanw },
195 1.8.2.7 nathanw
196 1.8.2.3 nathanw { { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MD2 },
197 1.8.2.3 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
198 1.8.2.3 nathanw 0,
199 1.8.2.3 nathanw PQUIRK_NOMODESENSE,
200 1.8.2.3 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
201 1.8.2.3 nathanw NULL, NULL
202 1.8.2.3 nathanw },
203 1.8.2.3 nathanw
204 1.8.2.7 nathanw { { USB_VENDOR_PEN, USB_PRODUCT_PEN_USBDISK },
205 1.8.2.3 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
206 1.8.2.3 nathanw UMASS_QUIRK_NO_MAX_LUN | UMASS_QUIRK_NO_START_STOP,
207 1.8.2.7 nathanw 0,
208 1.8.2.3 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
209 1.8.2.3 nathanw NULL, NULL
210 1.8.2.3 nathanw },
211 1.8.2.3 nathanw
212 1.8.2.7 nathanw { { USB_VENDOR_PQI, USB_PRODUCT_PQI_TRAVELFLASH },
213 1.8.2.7 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
214 1.8.2.7 nathanw 0,
215 1.8.2.7 nathanw PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK,
216 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
217 1.8.2.7 nathanw NULL, NULL
218 1.8.2.7 nathanw },
219 1.8.2.7 nathanw
220 1.8.2.2 nathanw { { USB_VENDOR_SCANLOGIC, USB_PRODUCT_SCANLOGIC_SL11R },
221 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
222 1.8.2.2 nathanw 0,
223 1.8.2.2 nathanw 0,
224 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
225 1.8.2.2 nathanw NULL, NULL
226 1.8.2.2 nathanw },
227 1.8.2.2 nathanw
228 1.8.2.2 nathanw { { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_EUSB },
229 1.8.2.2 nathanw UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
230 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
231 1.8.2.2 nathanw PQUIRK_NOTUR,
232 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
233 1.8.2.2 nathanw umass_init_shuttle, NULL
234 1.8.2.2 nathanw },
235 1.8.2.2 nathanw
236 1.8.2.2 nathanw { { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_ZIOMMC },
237 1.8.2.2 nathanw UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
238 1.8.2.2 nathanw UMASS_QUIRK_NO_START_STOP,
239 1.8.2.2 nathanw PQUIRK_NOTUR,
240 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
241 1.8.2.2 nathanw NULL, NULL
242 1.8.2.2 nathanw },
243 1.8.2.2 nathanw
244 1.8.2.7 nathanw { { USB_VENDOR_SONY, USB_PRODUCT_SONY_DRIVEV2 },
245 1.8.2.7 nathanw UMASS_WPROTO_BBB, UMASS_CPROTO_ISD_ATA,
246 1.8.2.7 nathanw 0,
247 1.8.2.7 nathanw 0,
248 1.8.2.7 nathanw UMATCH_VENDOR_PRODUCT,
249 1.8.2.7 nathanw NULL, NULL
250 1.8.2.7 nathanw },
251 1.8.2.7 nathanw
252 1.8.2.2 nathanw { { USB_VENDOR_SONY, USB_PRODUCT_SONY_MSC },
253 1.8.2.4 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_UFI,
254 1.8.2.4 nathanw UMASS_QUIRK_FORCE_SHORT_INQUIRY | UMASS_QUIRK_RS_NO_CLEAR_UA,
255 1.8.2.4 nathanw PQUIRK_NOMODESENSE,
256 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
257 1.8.2.4 nathanw NULL, NULL
258 1.8.2.2 nathanw },
259 1.8.2.2 nathanw
260 1.8.2.2 nathanw { { USB_VENDOR_TEAC, USB_PRODUCT_TEAC_FD05PUB },
261 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
262 1.8.2.2 nathanw 0,
263 1.8.2.2 nathanw PQUIRK_NOMODESENSE,
264 1.8.2.2 nathanw UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
265 1.8.2.2 nathanw NULL, NULL
266 1.8.2.2 nathanw },
267 1.8.2.2 nathanw
268 1.8.2.5 nathanw { { USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_XXX1100 },
269 1.8.2.5 nathanw UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
270 1.8.2.5 nathanw 0,
271 1.8.2.5 nathanw 0,
272 1.8.2.5 nathanw UMATCH_VENDOR_PRODUCT,
273 1.8.2.5 nathanw NULL, NULL
274 1.8.2.5 nathanw },
275 1.8.2.5 nathanw
276 1.8.2.2 nathanw { { USB_VENDOR_YANO, USB_PRODUCT_YANO_U640MO },
277 1.8.2.2 nathanw UMASS_WPROTO_CBI_I, UMASS_CPROTO_ATAPI,
278 1.8.2.2 nathanw UMASS_QUIRK_FORCE_SHORT_INQUIRY,
279 1.8.2.2 nathanw 0,
280 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT,
281 1.8.2.2 nathanw NULL, NULL
282 1.8.2.2 nathanw },
283 1.8.2.2 nathanw
284 1.8.2.2 nathanw { { USB_VENDOR_YEDATA, USB_PRODUCT_YEDATA_FLASHBUSTERU },
285 1.8.2.2 nathanw UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
286 1.8.2.2 nathanw UMASS_QUIRK_RS_NO_CLEAR_UA,
287 1.8.2.2 nathanw PQUIRK_NOMODESENSE,
288 1.8.2.2 nathanw UMATCH_VENDOR_PRODUCT_REV,
289 1.8.2.2 nathanw NULL, umass_fixup_yedata
290 1.8.2.2 nathanw },
291 1.8.2.2 nathanw };
292 1.8.2.2 nathanw
293 1.8.2.2 nathanw const struct umass_quirk *
294 1.8.2.2 nathanw umass_lookup(u_int16_t vendor, u_int16_t product)
295 1.8.2.2 nathanw {
296 1.8.2.2 nathanw return ((const struct umass_quirk *)
297 1.8.2.2 nathanw usb_lookup(umass_quirks, vendor, product));
298 1.8.2.2 nathanw }
299 1.8.2.2 nathanw
300 1.8.2.2 nathanw Static usbd_status
301 1.8.2.2 nathanw umass_init_insystem(struct umass_softc *sc)
302 1.8.2.2 nathanw {
303 1.8.2.2 nathanw usbd_status err;
304 1.8.2.2 nathanw
305 1.8.2.2 nathanw err = usbd_set_interface(sc->sc_iface, 1);
306 1.8.2.2 nathanw if (err) {
307 1.8.2.2 nathanw DPRINTF(UDMASS_USB,
308 1.8.2.2 nathanw ("%s: could not switch to Alt Interface 1\n",
309 1.8.2.2 nathanw USBDEVNAME(sc->sc_dev)));
310 1.8.2.2 nathanw return (err);
311 1.8.2.2 nathanw }
312 1.8.2.2 nathanw
313 1.8.2.2 nathanw return (USBD_NORMAL_COMPLETION);
314 1.8.2.2 nathanw }
315 1.8.2.2 nathanw
316 1.8.2.2 nathanw Static usbd_status
317 1.8.2.2 nathanw umass_init_shuttle(struct umass_softc *sc)
318 1.8.2.2 nathanw {
319 1.8.2.2 nathanw usb_device_request_t req;
320 1.8.2.2 nathanw u_int8_t status[2];
321 1.8.2.2 nathanw
322 1.8.2.2 nathanw /* The Linux driver does this */
323 1.8.2.2 nathanw req.bmRequestType = UT_READ_VENDOR_DEVICE;
324 1.8.2.2 nathanw req.bRequest = 1;
325 1.8.2.2 nathanw USETW(req.wValue, 0);
326 1.8.2.2 nathanw USETW(req.wIndex, sc->sc_ifaceno);
327 1.8.2.2 nathanw USETW(req.wLength, sizeof(status));
328 1.8.2.2 nathanw
329 1.8.2.2 nathanw return (usbd_do_request(sc->sc_udev, &req, &status));
330 1.8.2.2 nathanw }
331 1.8.2.2 nathanw
332 1.8.2.2 nathanw Static void
333 1.8.2.2 nathanw umass_fixup_yedata(struct umass_softc *sc)
334 1.8.2.2 nathanw {
335 1.8.2.2 nathanw usb_device_descriptor_t *dd;
336 1.8.2.2 nathanw
337 1.8.2.2 nathanw dd = usbd_get_device_descriptor(sc->sc_udev);
338 1.8.2.2 nathanw
339 1.8.2.2 nathanw /*
340 1.8.2.2 nathanw * Revisions < 1.28 do not handle the interrupt endpoint very well.
341 1.8.2.2 nathanw */
342 1.8.2.2 nathanw if (UGETW(dd->bcdDevice) < 0x128)
343 1.8.2.2 nathanw sc->sc_wire = UMASS_WPROTO_CBI;
344 1.8.2.2 nathanw else
345 1.8.2.2 nathanw sc->sc_wire = UMASS_WPROTO_CBI_I;
346 1.8.2.2 nathanw
347 1.8.2.2 nathanw /*
348 1.8.2.2 nathanw * Revisions < 1.28 do not have the TEST UNIT READY command
349 1.8.2.2 nathanw * Revisions == 1.28 have a broken TEST UNIT READY
350 1.8.2.2 nathanw */
351 1.8.2.2 nathanw if (UGETW(dd->bcdDevice) <= 0x128)
352 1.8.2.2 nathanw sc->sc_busquirks |= PQUIRK_NOTUR;
353 1.8.2.2 nathanw }
354