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