blob: adb70cd6af2d5027ec76390bb0364cb674d13bbf [file] [log] [blame]
Stephen Warreneb838e72014-02-13 21:15:18 -07001/*
2 * USB virtual root hub descriptors
3 *
4 * (C) Copyright 2014
5 * Stephen Warren swarren@wwwdotorg.org
6 *
7 * Based on ohci-hcd.c
8 *
9 * SPDX-License-Identifier: GPL-2.0+
10 */
11
12#ifndef __USBROOTHUBDES_H__
13#define __USBROOTHUBDES_H__
14
15/* Device descriptor */
16static __u8 root_hub_dev_des[] = {
17 0x12, /* __u8 bLength; */
18 0x01, /* __u8 bDescriptorType; Device */
19 0x10, /* __u16 bcdUSB; v1.1 */
20 0x01,
21 0x09, /* __u8 bDeviceClass; HUB_CLASSCODE */
22 0x00, /* __u8 bDeviceSubClass; */
23 0x00, /* __u8 bDeviceProtocol; */
24 0x08, /* __u8 bMaxPacketSize0; 8 Bytes */
25 0x00, /* __u16 idVendor; */
26 0x00,
27 0x00, /* __u16 idProduct; */
28 0x00,
29 0x00, /* __u16 bcdDevice; */
30 0x00,
31 0x00, /* __u8 iManufacturer; */
32 0x01, /* __u8 iProduct; */
33 0x00, /* __u8 iSerialNumber; */
34 0x01, /* __u8 bNumConfigurations; */
35};
36
37/* Configuration descriptor */
38static __u8 root_hub_config_des[] = {
39 0x09, /* __u8 bLength; */
40 0x02, /* __u8 bDescriptorType; Configuration */
41 0x19, /* __u16 wTotalLength; */
42 0x00,
43 0x01, /* __u8 bNumInterfaces; */
44 0x01, /* __u8 bConfigurationValue; */
45 0x00, /* __u8 iConfiguration; */
46 0x40, /* __u8 bmAttributes;
47 * Bit 7: Bus-powered
48 * 6: Self-powered,
49 * 5 Remote-wakwup,
50 * 4..0: resvd
51 */
52 0x00, /* __u8 MaxPower; */
53 /* interface */
54 0x09, /* __u8 if_bLength; */
55 0x04, /* __u8 if_bDescriptorType; Interface */
56 0x00, /* __u8 if_bInterfaceNumber; */
57 0x00, /* __u8 if_bAlternateSetting; */
58 0x01, /* __u8 if_bNumEndpoints; */
59 0x09, /* __u8 if_bInterfaceClass; HUB_CLASSCODE */
60 0x00, /* __u8 if_bInterfaceSubClass; */
61 0x00, /* __u8 if_bInterfaceProtocol; */
62 0x00, /* __u8 if_iInterface; */
63 /* endpoint */
64 0x07, /* __u8 ep_bLength; */
65 0x05, /* __u8 ep_bDescriptorType; Endpoint */
66 0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */
67 0x03, /* __u8 ep_bmAttributes; Interrupt */
68 0x02, /* __u16 ep_wMaxPacketSize; ((MAX_ROOT_PORTS + 1) / 8 */
69 0x00,
70 0xff, /* __u8 ep_bInterval; 255 ms */
71};
72
73#ifdef WANT_USB_ROOT_HUB_HUB_DES
74static unsigned char root_hub_hub_des[] = {
75 0x09, /* __u8 bLength; */
76 0x29, /* __u8 bDescriptorType; Hub-descriptor */
77 0x02, /* __u8 bNbrPorts; */
78 0x00, /* __u16 wHubCharacteristics; */
79 0x00,
80 0x01, /* __u8 bPwrOn2pwrGood; 2ms */
81 0x00, /* __u8 bHubContrCurrent; 0 mA */
82 0x00, /* __u8 DeviceRemovable; *** 7 Ports max *** */
83 0xff, /* __u8 PortPwrCtrlMask; *** 7 ports max *** */
84};
85#endif
86
87static unsigned char root_hub_str_index0[] = {
88 0x04, /* __u8 bLength; */
89 0x03, /* __u8 bDescriptorType; String-descriptor */
90 0x09, /* __u8 lang ID */
91 0x04, /* __u8 lang ID */
92};
93
94static unsigned char root_hub_str_index1[] = {
95 32, /* __u8 bLength; */
96 0x03, /* __u8 bDescriptorType; String-descriptor */
97 'U', /* __u8 Unicode */
98 0, /* __u8 Unicode */
99 '-', /* __u8 Unicode */
100 0, /* __u8 Unicode */
101 'B', /* __u8 Unicode */
102 0, /* __u8 Unicode */
103 'o', /* __u8 Unicode */
104 0, /* __u8 Unicode */
105 'o', /* __u8 Unicode */
106 0, /* __u8 Unicode */
107 't', /* __u8 Unicode */
108 0, /* __u8 Unicode */
109 ' ', /* __u8 Unicode */
110 0, /* __u8 Unicode */
111 'R', /* __u8 Unicode */
112 0, /* __u8 Unicode */
113 'o', /* __u8 Unicode */
114 0, /* __u8 Unicode */
115 'o', /* __u8 Unicode */
116 0, /* __u8 Unicode */
117 't', /* __u8 Unicode */
118 0, /* __u8 Unicode */
119 ' ', /* __u8 Unicode */
120 0, /* __u8 Unicode */
121 'H', /* __u8 Unicode */
122 0, /* __u8 Unicode */
123 'u', /* __u8 Unicode */
124 0, /* __u8 Unicode */
125 'b', /* __u8 Unicode */
126 0, /* __u8 Unicode */
127};
128
129#endif