1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Copyright (C) 2004 Texas Instruments */
5 * This OTG and Embedded Host list is "Targeted Peripheral List".
6 * It should mostly use of USB_DEVICE() or USB_DEVICE_VER() entries..
8 * YOU _SHOULD_ CHANGE THIS LIST TO MATCH YOUR PRODUCT AND ITS TESTING!
11 static struct usb_device_id productlist_table[] = {
13 /* hubs are optional in OTG, but very handy ... */
14 #define CERT_WITHOUT_HUBS
15 #if defined(CERT_WITHOUT_HUBS)
16 { USB_DEVICE( 0x0000, 0x0000 ), }, /* Root HUB Only*/
18 { USB_DEVICE_INFO(USB_CLASS_HUB, 0, 0), },
19 { USB_DEVICE_INFO(USB_CLASS_HUB, 0, 1), },
20 { USB_DEVICE_INFO(USB_CLASS_HUB, 0, 2), },
23 #ifdef CONFIG_USB_PRINTER /* ignoring nonstatic linkage! */
24 /* FIXME actually, printers are NOT supposed to use device classes;
25 * they're supposed to use interface classes...
27 //{ USB_DEVICE_INFO(7, 1, 1) },
28 //{ USB_DEVICE_INFO(7, 1, 2) },
29 //{ USB_DEVICE_INFO(7, 1, 3) },
32 #ifdef CONFIG_USB_NET_CDCETHER
33 /* Linux-USB CDC Ethernet gadget */
34 //{ USB_DEVICE(0x0525, 0xa4a1), },
35 /* Linux-USB CDC Ethernet + RNDIS gadget */
36 //{ USB_DEVICE(0x0525, 0xa4a2), },
39 #if IS_ENABLED(CONFIG_USB_TEST)
40 /* gadget zero, for testing */
41 //{ USB_DEVICE(0x0525, 0xa4a0), },
45 { USB_DEVICE( 0x1a0a, 0x0101 ), }, /* TEST_SE0_NAK */
46 { USB_DEVICE( 0x1a0a, 0x0102 ), }, /* Test_J */
47 { USB_DEVICE( 0x1a0a, 0x0103 ), }, /* Test_K */
48 { USB_DEVICE( 0x1a0a, 0x0104 ), }, /* Test_PACKET */
49 { USB_DEVICE( 0x1a0a, 0x0105 ), }, /* Test_FORCE_ENABLE */
50 { USB_DEVICE( 0x1a0a, 0x0106 ), }, /* HS_PORT_SUSPEND_RESUME */
51 { USB_DEVICE( 0x1a0a, 0x0107 ), }, /* SINGLE_STEP_GET_DESCRIPTOR setup */
52 { USB_DEVICE( 0x1a0a, 0x0108 ), }, /* SINGLE_STEP_GET_DESCRIPTOR execute */
55 { USB_DEVICE_VER(0x054c,0x0010,0x0410, 0x0500), },
58 //{ USB_DEVICE( 0x0781, 0x5150 ), }, /* SanDisk */
59 //{ USB_DEVICE( 0x05DC, 0x0080 ), }, /* Lexar */
60 //{ USB_DEVICE( 0x4146, 0x9281 ), }, /* IOMEGA */
61 //{ USB_DEVICE( 0x067b, 0x2507 ), }, /* Hammer 20GB External HD */
62 { USB_DEVICE( 0x0EA0, 0x2168 ), }, /* Ours Technology Inc. (BUFFALO ClipDrive)*/
63 //{ USB_DEVICE( 0x0457, 0x0150 ), }, /* Silicon Integrated Systems Corp. */
66 //{ USB_DEVICE( 0x03F0, 0x1102 ), }, /* HP Photosmart 245 */
67 //{ USB_DEVICE( 0x03F0, 0x1302 ), }, /* HP Photosmart 370 Series */
70 //{ USB_DEVICE( 0x0499, 0x3002 ), }, /* YAMAHA YST-MS35D USB Speakers */
71 //{ USB_DEVICE( 0x0672, 0x1041 ), }, /* Labtec USB Headset */
73 { } /* Terminating entry */
76 static inline void report_errors(struct usb_device *dev)
78 /* OTG MESSAGE: report errors here, customize to match your product */
79 dev_info(&dev->dev, "device Vendor:%04x Product:%04x is not supported\n",
80 le16_to_cpu(dev->descriptor.idVendor),
81 le16_to_cpu(dev->descriptor.idProduct));
82 if (USB_CLASS_HUB == dev->descriptor.bDeviceClass){
83 dev_printk(KERN_CRIT, &dev->dev, "Unsupported Hub Topology\n");
85 dev_printk(KERN_CRIT, &dev->dev, "Attached Device is not Supported\n");
90 static int is_targeted(struct usb_device *dev)
92 struct usb_device_id *id = productlist_table;
94 /* HNP test device is _never_ targeted (see OTG spec 6.6.6) */
95 if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&
96 le16_to_cpu(dev->descriptor.idProduct) == 0xbadd))
99 /* OTG PET device is always targeted (see OTG 2.0 ECN 6.4.2) */
100 if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&
101 le16_to_cpu(dev->descriptor.idProduct) == 0x0200))
104 /* NOTE: can't use usb_match_id() since interface caches
105 * aren't set up yet. this is cut/paste from that code.
107 for (id = productlist_table; id->match_flags; id++) {
108 if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
109 id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
112 if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
113 id->idProduct != le16_to_cpu(dev->descriptor.idProduct))
116 /* No need to test id->bcdDevice_lo != 0, since 0 is never
117 greater than any unsigned number. */
118 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
119 (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
122 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
123 (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
126 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
127 (id->bDeviceClass != dev->descriptor.bDeviceClass))
130 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
131 (id->bDeviceSubClass != dev->descriptor.bDeviceSubClass))
134 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
135 (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
139 /* NOTE: can't use usb_match_id() since interface caches
140 * aren't set up yet. this is cut/paste from that code.
142 for (id = productlist_table; id->match_flags; id++) {
145 "ID: V:%04x P:%04x DC:%04x SC:%04x PR:%04x \n",
150 id->bDeviceProtocol);
153 if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
154 id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
157 if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
158 id->idProduct != le16_to_cpu(dev->descriptor.idProduct))
161 /* No need to test id->bcdDevice_lo != 0, since 0 is never
162 greater than any unsigned number. */
163 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
164 (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
167 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
168 (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
171 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
172 (id->bDeviceClass != dev->descriptor.bDeviceClass))
175 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
176 (id->bDeviceSubClass != dev->descriptor.bDeviceSubClass))
179 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
180 (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
187 /* add other match criteria here ... */