usbroothubdes.h 3.5 KB

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