Advertisement
Guest User

Untitled

a guest
Sep 12th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. diff --git a/utils/hwstub/stub/main.c b/utils/hwstub/stub/main.c
  2. index 8139615..60da717 100644
  3. --- a/utils/hwstub/stub/main.c
  4. +++ b/utils/hwstub/stub/main.c
  5. @@ -86,13 +86,33 @@ static struct usb_interface_descriptor interface_descriptor =
  6. .bDescriptorType = USB_DT_INTERFACE,
  7. .bInterfaceNumber = USB_HWSTUB_INTF,
  8. .bAlternateSetting = 0,
  9. - .bNumEndpoints = 0,
  10. + .bNumEndpoints = 2,
  11. .bInterfaceClass = HWSTUB_CLASS,
  12. .bInterfaceSubClass = HWSTUB_SUBCLASS,
  13. .bInterfaceProtocol = HWSTUB_PROTOCOL,
  14. .iInterface = 3
  15. };
  16.  
  17. +static struct usb_endpoint_descriptor bulkin_descriptor =
  18. +{
  19. + .bLength = sizeof(struct usb_endpoint_descriptor),
  20. + .bDescriptorType = USB_DT_ENDPOINT,
  21. + .bEndpointAddress = 0x81,
  22. + .bmAttributes = USB_ENDPOINT_XFER_BULK,
  23. + .wMaxPacketSize = 512,
  24. + .bInterval = 0
  25. +};
  26. +
  27. +static struct usb_endpoint_descriptor bulkout_descriptor =
  28. +{
  29. + .bLength = sizeof(struct usb_endpoint_descriptor),
  30. + .bDescriptorType = USB_DT_ENDPOINT,
  31. + .bEndpointAddress = 0x02,
  32. + .bmAttributes = USB_ENDPOINT_XFER_BULK,
  33. + .wMaxPacketSize = 512,
  34. + .bInterval = 0
  35. +};
  36. +
  37. static const struct usb_string_descriptor usb_string_iManufacturer =
  38. {
  39. 24,
  40. @@ -197,6 +217,14 @@ static void handle_std_dev_desc(struct usb_ctrlrequest *req)
  41. memcpy(usb_buffer + size, (void *)&interface_descriptor,
  42. sizeof(interface_descriptor));
  43. size += sizeof(interface_descriptor);
  44. + /* blkin ep descriptor */
  45. + memcpy(usb_buffer + size, (void *)&bulkin_descriptor,
  46. + sizeof(bulkin_descriptor));
  47. + size += sizeof(bulkin_descriptor);
  48. + /* blkout ep descriptor */
  49. + memcpy(usb_buffer + size, (void *)&bulkout_descriptor,
  50. + sizeof(bulkout_descriptor));
  51. + size += sizeof(bulkout_descriptor);
  52. /* hwstub version */
  53. memcpy(usb_buffer + size, (void *)&version_descriptor,
  54. sizeof(version_descriptor));
  55.  
  56.  
  57.  
  58.  
  59.  
  60. Bus 001 Device 032: ID fee1:dead
  61. Device Descriptor:
  62. bLength 18
  63. bDescriptorType 1
  64. bcdUSB 2.00
  65. bDeviceClass 0 (Defined at Interface level)
  66. bDeviceSubClass 0
  67. bDeviceProtocol 0
  68. bMaxPacketSize0 64
  69. idVendor 0xfee1
  70. idProduct 0xdead
  71. bcdDevice 4.00
  72. iManufacturer 1 Rockbox.org
  73. iProduct 2 Rockbox hardware stub
  74. iSerial 0
  75. bNumConfigurations 1
  76. Configuration Descriptor:
  77. bLength 9
  78. bDescriptorType 2
  79. wTotalLength 127
  80. bNumInterfaces 1
  81. bConfigurationValue 1
  82. iConfiguration 0
  83. bmAttributes 0xc0
  84. Self Powered
  85. MaxPower 200mA
  86. Interface Descriptor:
  87. bLength 9
  88. bDescriptorType 4
  89. bInterfaceNumber 0
  90. bAlternateSetting 0
  91. bNumEndpoints 2
  92. bInterfaceClass 255 Vendor Specific Class
  93. bInterfaceSubClass 222
  94. bInterfaceProtocol 173
  95. iInterface 3 HWStub
  96. Endpoint Descriptor:
  97. bLength 7
  98. bDescriptorType 5
  99. bEndpointAddress 0x81 EP 1 IN
  100. bmAttributes 2
  101. Transfer Type Bulk
  102. Synch Type None
  103. Usage Type Data
  104. wMaxPacketSize 0x0200 1x 512 bytes
  105. bInterval 0
  106. Endpoint Descriptor:
  107. bLength 7
  108. bDescriptorType 5
  109. bEndpointAddress 0x02 EP 2 OUT
  110. bmAttributes 2
  111. Transfer Type Bulk
  112. Synch Type None
  113. Usage Type Data
  114. wMaxPacketSize 0x0200 1x 512 bytes
  115. bInterval 0
  116. ** UNRECOGNIZED: 05 41 04 00 01
  117. ** UNRECOGNIZED: 1a 42 00 00 00 60 a0 46 00 00 fc 1d 00 60 00 28 00 00 a0 46 00 60 60 b9 ff 00
  118. ** UNRECOGNIZED: 40 43 52 4b 32 37 52 6f 63 6b 63 68 69 70 20 52 4b 32 37 58 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  119. Device Status: 0x0001
  120. Self Powered
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement