GNU Linux-libre 4.9.318-gnu1
[releases.git] / drivers / usb / core / quirks.c
1 /*
2  * USB device quirk handling logic and table
3  *
4  * Copyright (c) 2007 Oliver Neukum
5  * Copyright (c) 2007 Greg Kroah-Hartman <gregkh@suse.de>
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation, version 2.
10  *
11  *
12  */
13
14 #include <linux/usb.h>
15 #include <linux/usb/quirks.h>
16 #include <linux/usb/hcd.h>
17 #include "usb.h"
18
19 /* Lists of quirky USB devices, split in device quirks and interface quirks.
20  * Device quirks are applied at the very beginning of the enumeration process,
21  * right after reading the device descriptor. They can thus only match on device
22  * information.
23  *
24  * Interface quirks are applied after reading all the configuration descriptors.
25  * They can match on both device and interface information.
26  *
27  * Note that the DELAY_INIT and HONOR_BNUMINTERFACES quirks do not make sense as
28  * interface quirks, as they only influence the enumeration process which is run
29  * before processing the interface quirks.
30  *
31  * Please keep the lists ordered by:
32  *      1) Vendor ID
33  *      2) Product ID
34  *      3) Class ID
35  */
36 static const struct usb_device_id usb_quirk_list[] = {
37         /* CBM - Flash disk */
38         { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
39
40         /* WORLDE Controller KS49 or Prodipe MIDI 49C USB controller */
41         { USB_DEVICE(0x0218, 0x0201), .driver_info =
42                         USB_QUIRK_CONFIG_INTF_STRINGS },
43
44         /* WORLDE easy key (easykey.25) MIDI controller  */
45         { USB_DEVICE(0x0218, 0x0401), .driver_info =
46                         USB_QUIRK_CONFIG_INTF_STRINGS },
47
48         /* HP 5300/5370C scanner */
49         { USB_DEVICE(0x03f0, 0x0701), .driver_info =
50                         USB_QUIRK_STRING_FETCH_255 },
51
52         /* HP v222w 16GB Mini USB Drive */
53         { USB_DEVICE(0x03f0, 0x3f40), .driver_info = USB_QUIRK_DELAY_INIT },
54
55         /* Creative SB Audigy 2 NX */
56         { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
57
58         /* USB3503 */
59         { USB_DEVICE(0x0424, 0x3503), .driver_info = USB_QUIRK_RESET_RESUME },
60
61         /* Microsoft Wireless Laser Mouse 6000 Receiver */
62         { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME },
63
64         /* Microsoft LifeCam-VX700 v2.0 */
65         { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
66
67         /* Microsoft Surface Dock Ethernet (RTL8153 GigE) */
68         { USB_DEVICE(0x045e, 0x07c6), .driver_info = USB_QUIRK_NO_LPM },
69
70         /* Cherry Stream G230 2.0 (G85-231) and 3.0 (G85-232) */
71         { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME },
72
73         /* Logitech HD Webcam C270 */
74         { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
75
76         /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */
77         { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
78         { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
79         { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
80         { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT },
81         { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT },
82
83         /* Logitech ConferenceCam CC3000e */
84         { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
85         { USB_DEVICE(0x046d, 0x0848), .driver_info = USB_QUIRK_DELAY_INIT },
86
87         /* Logitech PTZ Pro Camera */
88         { USB_DEVICE(0x046d, 0x0853), .driver_info = USB_QUIRK_DELAY_INIT },
89
90         /* Logitech Screen Share */
91         { USB_DEVICE(0x046d, 0x086c), .driver_info = USB_QUIRK_NO_LPM },
92
93         /* Logitech Quickcam Fusion */
94         { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
95
96         /* Logitech Quickcam Orbit MP */
97         { USB_DEVICE(0x046d, 0x08c2), .driver_info = USB_QUIRK_RESET_RESUME },
98
99         /* Logitech Quickcam Pro for Notebook */
100         { USB_DEVICE(0x046d, 0x08c3), .driver_info = USB_QUIRK_RESET_RESUME },
101
102         /* Logitech Quickcam Pro 5000 */
103         { USB_DEVICE(0x046d, 0x08c5), .driver_info = USB_QUIRK_RESET_RESUME },
104
105         /* Logitech Quickcam OEM Dell Notebook */
106         { USB_DEVICE(0x046d, 0x08c6), .driver_info = USB_QUIRK_RESET_RESUME },
107
108         /* Logitech Quickcam OEM Cisco VT Camera II */
109         { USB_DEVICE(0x046d, 0x08c7), .driver_info = USB_QUIRK_RESET_RESUME },
110
111         /* Logitech Harmony 700-series */
112         { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },
113
114         /* Philips PSC805 audio device */
115         { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
116
117         /* Plantronic Audio 655 DSP */
118         { USB_DEVICE(0x047f, 0xc008), .driver_info = USB_QUIRK_RESET_RESUME },
119
120         /* Plantronic Audio 648 USB */
121         { USB_DEVICE(0x047f, 0xc013), .driver_info = USB_QUIRK_RESET_RESUME },
122
123         /* Artisman Watchdog Dongle */
124         { USB_DEVICE(0x04b4, 0x0526), .driver_info =
125                         USB_QUIRK_CONFIG_INTF_STRINGS },
126
127         /* Microchip Joss Optical infrared touchboard device */
128         { USB_DEVICE(0x04d8, 0x000c), .driver_info =
129                         USB_QUIRK_CONFIG_INTF_STRINGS },
130
131         /* CarrolTouch 4000U */
132         { USB_DEVICE(0x04e7, 0x0009), .driver_info = USB_QUIRK_RESET_RESUME },
133
134         /* CarrolTouch 4500U */
135         { USB_DEVICE(0x04e7, 0x0030), .driver_info = USB_QUIRK_RESET_RESUME },
136
137         /* Samsung Android phone modem - ID conflict with SPH-I500 */
138         { USB_DEVICE(0x04e8, 0x6601), .driver_info =
139                         USB_QUIRK_CONFIG_INTF_STRINGS },
140
141         /* Elan Touchscreen */
142         { USB_DEVICE(0x04f3, 0x0089), .driver_info =
143                         USB_QUIRK_DEVICE_QUALIFIER },
144
145         { USB_DEVICE(0x04f3, 0x009b), .driver_info =
146                         USB_QUIRK_DEVICE_QUALIFIER },
147
148         { USB_DEVICE(0x04f3, 0x010c), .driver_info =
149                         USB_QUIRK_DEVICE_QUALIFIER },
150
151         { USB_DEVICE(0x04f3, 0x0125), .driver_info =
152                         USB_QUIRK_DEVICE_QUALIFIER },
153
154         { USB_DEVICE(0x04f3, 0x016f), .driver_info =
155                         USB_QUIRK_DEVICE_QUALIFIER },
156
157         { USB_DEVICE(0x04f3, 0x0381), .driver_info =
158                         USB_QUIRK_NO_LPM },
159
160         { USB_DEVICE(0x04f3, 0x21b8), .driver_info =
161                         USB_QUIRK_DEVICE_QUALIFIER },
162
163         /* Roland SC-8820 */
164         { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
165
166         /* Edirol SD-20 */
167         { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
168
169         /* Alcor Micro Corp. Hub */
170         { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME },
171
172         /* appletouch */
173         { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
174
175         /* Genesys Logic hub, internally used by KY-688 USB 3.1 Type-C Hub */
176         { USB_DEVICE(0x05e3, 0x0612), .driver_info = USB_QUIRK_NO_LPM },
177
178         /* ELSA MicroLink 56K */
179         { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_RESET_RESUME },
180
181         /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */
182         { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM },
183
184         /* Avision AV600U */
185         { USB_DEVICE(0x0638, 0x0a13), .driver_info =
186           USB_QUIRK_STRING_FETCH_255 },
187
188         /* Saitek Cyborg Gold Joystick */
189         { USB_DEVICE(0x06a3, 0x0006), .driver_info =
190                         USB_QUIRK_CONFIG_INTF_STRINGS },
191
192         /* Agfa SNAPSCAN 1212U */
193         { USB_DEVICE(0x06bd, 0x0001), .driver_info = USB_QUIRK_RESET_RESUME },
194
195         /* Guillemot Webcam Hercules Dualpix Exchange (2nd ID) */
196         { USB_DEVICE(0x06f8, 0x0804), .driver_info = USB_QUIRK_RESET_RESUME },
197
198         /* Guillemot Webcam Hercules Dualpix Exchange*/
199         { USB_DEVICE(0x06f8, 0x3005), .driver_info = USB_QUIRK_RESET_RESUME },
200
201         /* Guillemot Hercules DJ Console audio card (BZ 208357) */
202         { USB_DEVICE(0x06f8, 0xb000), .driver_info =
203                         USB_QUIRK_ENDPOINT_BLACKLIST },
204
205         /* Midiman M-Audio Keystation 88es */
206         { USB_DEVICE(0x0763, 0x0192), .driver_info = USB_QUIRK_RESET_RESUME },
207
208         /* SanDisk Ultra Fit and Ultra Flair */
209         { USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM },
210         { USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM },
211
212         /* M-Systems Flash Disk Pioneers */
213         { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
214
215         /* Baum Vario Ultra */
216         { USB_DEVICE(0x0904, 0x6101), .driver_info =
217                         USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL },
218         { USB_DEVICE(0x0904, 0x6102), .driver_info =
219                         USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL },
220         { USB_DEVICE(0x0904, 0x6103), .driver_info =
221                         USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL },
222
223         /* Keytouch QWERTY Panel keyboard */
224         { USB_DEVICE(0x0926, 0x3333), .driver_info =
225                         USB_QUIRK_CONFIG_INTF_STRINGS },
226
227         /* Kingston DataTraveler 3.0 */
228         { USB_DEVICE(0x0951, 0x1666), .driver_info = USB_QUIRK_NO_LPM },
229
230         /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
231         { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
232
233         /* ELMO L-12F document camera */
234         { USB_DEVICE(0x09a1, 0x0028), .driver_info = USB_QUIRK_DELAY_CTRL_MSG },
235
236         /* Broadcom BCM92035DGROM BT dongle */
237         { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
238
239         /* MAYA44USB sound device */
240         { USB_DEVICE(0x0a92, 0x0091), .driver_info = USB_QUIRK_RESET_RESUME },
241
242         /* ASUS Base Station(T100) */
243         { USB_DEVICE(0x0b05, 0x17e0), .driver_info =
244                         USB_QUIRK_IGNORE_REMOTE_WAKEUP },
245
246         /* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/
247         { USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
248
249         /* Realtek hub in Dell WD19 (Type-C) */
250         { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },
251         { USB_DEVICE(0x0bda, 0x5487), .driver_info = USB_QUIRK_RESET_RESUME },
252
253         /* Generic RTL8153 based ethernet adapters */
254         { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM },
255
256         /* SONiX USB DEVICE Touchpad */
257         { USB_DEVICE(0x0c45, 0x7056), .driver_info =
258                         USB_QUIRK_IGNORE_REMOTE_WAKEUP },
259
260         /* Action Semiconductor flash disk */
261         { USB_DEVICE(0x10d6, 0x2200), .driver_info =
262                         USB_QUIRK_STRING_FETCH_255 },
263
264         /* SKYMEDI USB_DRIVE */
265         { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
266
267         /* Razer - Razer Blade Keyboard */
268         { USB_DEVICE(0x1532, 0x0116), .driver_info =
269                         USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
270
271         /* Lenovo ThinkPad USB-C Dock Gen2 Ethernet (RTL8153 GigE) */
272         { USB_DEVICE(0x17ef, 0xa387), .driver_info = USB_QUIRK_NO_LPM },
273
274         /* BUILDWIN Photo Frame */
275         { USB_DEVICE(0x1908, 0x1315), .driver_info =
276                         USB_QUIRK_HONOR_BNUMINTERFACES },
277
278         /* Protocol and OTG Electrical Test Device */
279         { USB_DEVICE(0x1a0a, 0x0200), .driver_info =
280                         USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
281
282         /* Corsair K70 RGB */
283         { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT |
284           USB_QUIRK_DELAY_CTRL_MSG },
285
286         /* Corsair Strafe */
287         { USB_DEVICE(0x1b1c, 0x1b15), .driver_info = USB_QUIRK_DELAY_INIT |
288           USB_QUIRK_DELAY_CTRL_MSG },
289
290         /* Corsair Strafe RGB */
291         { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
292           USB_QUIRK_DELAY_CTRL_MSG },
293
294         /* Corsair K70 LUX RGB */
295         { USB_DEVICE(0x1b1c, 0x1b33), .driver_info = USB_QUIRK_DELAY_INIT },
296
297         /* Corsair K70 LUX */
298         { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
299
300         /* Corsair K70 RGB RAPDIFIRE */
301         { USB_DEVICE(0x1b1c, 0x1b38), .driver_info = USB_QUIRK_DELAY_INIT |
302           USB_QUIRK_DELAY_CTRL_MSG },
303
304         /* MIDI keyboard WORLDE MINI */
305         { USB_DEVICE(0x1c75, 0x0204), .driver_info =
306                         USB_QUIRK_CONFIG_INTF_STRINGS },
307
308         /* Acer C120 LED Projector */
309         { USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM },
310
311         /* Blackmagic Design Intensity Shuttle */
312         { USB_DEVICE(0x1edb, 0xbd3b), .driver_info = USB_QUIRK_NO_LPM },
313
314         /* Blackmagic Design UltraStudio SDI */
315         { USB_DEVICE(0x1edb, 0xbd4f), .driver_info = USB_QUIRK_NO_LPM },
316
317         /* Hauppauge HVR-950q */
318         { USB_DEVICE(0x2040, 0x7200), .driver_info =
319                         USB_QUIRK_CONFIG_INTF_STRINGS },
320
321         /* Raydium Touchscreen */
322         { USB_DEVICE(0x2386, 0x3114), .driver_info = USB_QUIRK_NO_LPM },
323
324         { USB_DEVICE(0x2386, 0x3119), .driver_info = USB_QUIRK_NO_LPM },
325
326         { USB_DEVICE(0x2386, 0x350e), .driver_info = USB_QUIRK_NO_LPM },
327
328         /* DJI CineSSD */
329         { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
330
331         /* DELL USB GEN2 */
332         { USB_DEVICE(0x413c, 0xb062), .driver_info = USB_QUIRK_NO_LPM | USB_QUIRK_RESET_RESUME },
333
334         /* VCOM device */
335         { USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
336
337         /* INTEL VALUE SSD */
338         { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
339
340         /* novation SoundControl XL */
341         { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME },
342
343         { }  /* terminating entry must be last */
344 };
345
346 static const struct usb_device_id usb_interface_quirk_list[] = {
347         /* Logitech UVC Cameras */
348         { USB_VENDOR_AND_INTERFACE_INFO(0x046d, USB_CLASS_VIDEO, 1, 0),
349           .driver_info = USB_QUIRK_RESET_RESUME },
350
351         { }  /* terminating entry must be last */
352 };
353
354 static const struct usb_device_id usb_amd_resume_quirk_list[] = {
355         /* Lenovo Mouse with Pixart controller */
356         { USB_DEVICE(0x17ef, 0x602e), .driver_info = USB_QUIRK_RESET_RESUME },
357
358         /* Pixart Mouse */
359         { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME },
360         { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME },
361         { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME },
362         { USB_DEVICE(0x03f0, 0x2b4a), .driver_info = USB_QUIRK_RESET_RESUME },
363
364         /* Logitech Optical Mouse M90/M100 */
365         { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME },
366
367         { }  /* terminating entry must be last */
368 };
369
370 /*
371  * Entries for blacklisted endpoints that should be ignored when parsing
372  * configuration descriptors.
373  *
374  * Matched for devices with USB_QUIRK_ENDPOINT_BLACKLIST.
375  */
376 static const struct usb_device_id usb_endpoint_blacklist[] = {
377         { USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x01 },
378         { USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x81 },
379         { }
380 };
381
382 bool usb_endpoint_is_blacklisted(struct usb_device *udev,
383                 struct usb_host_interface *intf,
384                 struct usb_endpoint_descriptor *epd)
385 {
386         const struct usb_device_id *id;
387         unsigned int address;
388
389         for (id = usb_endpoint_blacklist; id->match_flags; ++id) {
390                 if (!usb_match_device(udev, id))
391                         continue;
392
393                 if (!usb_match_one_id_intf(udev, intf, id))
394                         continue;
395
396                 address = id->driver_info;
397                 if (address == epd->bEndpointAddress)
398                         return true;
399         }
400
401         return false;
402 }
403
404 static bool usb_match_any_interface(struct usb_device *udev,
405                                     const struct usb_device_id *id)
406 {
407         unsigned int i;
408
409         for (i = 0; i < udev->descriptor.bNumConfigurations; ++i) {
410                 struct usb_host_config *cfg = &udev->config[i];
411                 unsigned int j;
412
413                 for (j = 0; j < cfg->desc.bNumInterfaces; ++j) {
414                         struct usb_interface_cache *cache;
415                         struct usb_host_interface *intf;
416
417                         cache = cfg->intf_cache[j];
418                         if (cache->num_altsetting == 0)
419                                 continue;
420
421                         intf = &cache->altsetting[0];
422                         if (usb_match_one_id_intf(udev, intf, id))
423                                 return true;
424                 }
425         }
426
427         return false;
428 }
429
430 static int usb_amd_resume_quirk(struct usb_device *udev)
431 {
432         struct usb_hcd *hcd;
433
434         hcd = bus_to_hcd(udev->bus);
435         /* The device should be attached directly to root hub */
436         if (udev->level == 1 && hcd->amd_resume_bug == 1)
437                 return 1;
438
439         return 0;
440 }
441
442 static u32 __usb_detect_quirks(struct usb_device *udev,
443                                const struct usb_device_id *id)
444 {
445         u32 quirks = 0;
446
447         for (; id->match_flags; id++) {
448                 if (!usb_match_device(udev, id))
449                         continue;
450
451                 if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_INFO) &&
452                     !usb_match_any_interface(udev, id))
453                         continue;
454
455                 quirks |= (u32)(id->driver_info);
456         }
457
458         return quirks;
459 }
460
461 /*
462  * Detect any quirks the device has, and do any housekeeping for it if needed.
463  */
464 void usb_detect_quirks(struct usb_device *udev)
465 {
466         udev->quirks = __usb_detect_quirks(udev, usb_quirk_list);
467
468         /*
469          * Pixart-based mice would trigger remote wakeup issue on AMD
470          * Yangtze chipset, so set them as RESET_RESUME flag.
471          */
472         if (usb_amd_resume_quirk(udev))
473                 udev->quirks |= __usb_detect_quirks(udev,
474                                 usb_amd_resume_quirk_list);
475
476         if (udev->quirks)
477                 dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
478                         udev->quirks);
479
480 #ifdef CONFIG_USB_DEFAULT_PERSIST
481         if (!(udev->quirks & USB_QUIRK_RESET))
482                 udev->persist_enabled = 1;
483 #else
484         /* Hubs are automatically enabled for USB-PERSIST */
485         if (udev->descriptor.bDeviceClass == USB_CLASS_HUB)
486                 udev->persist_enabled = 1;
487 #endif  /* CONFIG_USB_DEFAULT_PERSIST */
488 }
489
490 void usb_detect_interface_quirks(struct usb_device *udev)
491 {
492         u32 quirks;
493
494         quirks = __usb_detect_quirks(udev, usb_interface_quirk_list);
495         if (quirks == 0)
496                 return;
497
498         dev_dbg(&udev->dev, "USB interface quirks for this device: %x\n",
499                 quirks);
500         udev->quirks |= quirks;
501 }