Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/utils/hwstub/stub/main.c b/utils/hwstub/stub/main.c
- index 8139615..60da717 100644
- --- a/utils/hwstub/stub/main.c
- +++ b/utils/hwstub/stub/main.c
- @@ -86,13 +86,33 @@ static struct usb_interface_descriptor interface_descriptor =
- .bDescriptorType = USB_DT_INTERFACE,
- .bInterfaceNumber = USB_HWSTUB_INTF,
- .bAlternateSetting = 0,
- - .bNumEndpoints = 0,
- + .bNumEndpoints = 2,
- .bInterfaceClass = HWSTUB_CLASS,
- .bInterfaceSubClass = HWSTUB_SUBCLASS,
- .bInterfaceProtocol = HWSTUB_PROTOCOL,
- .iInterface = 3
- };
- +static struct usb_endpoint_descriptor bulkin_descriptor =
- +{
- + .bLength = sizeof(struct usb_endpoint_descriptor),
- + .bDescriptorType = USB_DT_ENDPOINT,
- + .bEndpointAddress = 0x81,
- + .bmAttributes = USB_ENDPOINT_XFER_BULK,
- + .wMaxPacketSize = 512,
- + .bInterval = 0
- +};
- +
- +static struct usb_endpoint_descriptor bulkout_descriptor =
- +{
- + .bLength = sizeof(struct usb_endpoint_descriptor),
- + .bDescriptorType = USB_DT_ENDPOINT,
- + .bEndpointAddress = 0x02,
- + .bmAttributes = USB_ENDPOINT_XFER_BULK,
- + .wMaxPacketSize = 512,
- + .bInterval = 0
- +};
- +
- static const struct usb_string_descriptor usb_string_iManufacturer =
- {
- 24,
- @@ -197,6 +217,14 @@ static void handle_std_dev_desc(struct usb_ctrlrequest *req)
- memcpy(usb_buffer + size, (void *)&interface_descriptor,
- sizeof(interface_descriptor));
- size += sizeof(interface_descriptor);
- + /* blkin ep descriptor */
- + memcpy(usb_buffer + size, (void *)&bulkin_descriptor,
- + sizeof(bulkin_descriptor));
- + size += sizeof(bulkin_descriptor);
- + /* blkout ep descriptor */
- + memcpy(usb_buffer + size, (void *)&bulkout_descriptor,
- + sizeof(bulkout_descriptor));
- + size += sizeof(bulkout_descriptor);
- /* hwstub version */
- memcpy(usb_buffer + size, (void *)&version_descriptor,
- sizeof(version_descriptor));
- Bus 001 Device 032: ID fee1:dead
- Device Descriptor:
- bLength 18
- bDescriptorType 1
- bcdUSB 2.00
- bDeviceClass 0 (Defined at Interface level)
- bDeviceSubClass 0
- bDeviceProtocol 0
- bMaxPacketSize0 64
- idVendor 0xfee1
- idProduct 0xdead
- bcdDevice 4.00
- iManufacturer 1 Rockbox.org
- iProduct 2 Rockbox hardware stub
- iSerial 0
- bNumConfigurations 1
- Configuration Descriptor:
- bLength 9
- bDescriptorType 2
- wTotalLength 127
- bNumInterfaces 1
- bConfigurationValue 1
- iConfiguration 0
- bmAttributes 0xc0
- Self Powered
- MaxPower 200mA
- Interface Descriptor:
- bLength 9
- bDescriptorType 4
- bInterfaceNumber 0
- bAlternateSetting 0
- bNumEndpoints 2
- bInterfaceClass 255 Vendor Specific Class
- bInterfaceSubClass 222
- bInterfaceProtocol 173
- iInterface 3 HWStub
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x81 EP 1 IN
- bmAttributes 2
- Transfer Type Bulk
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0200 1x 512 bytes
- bInterval 0
- Endpoint Descriptor:
- bLength 7
- bDescriptorType 5
- bEndpointAddress 0x02 EP 2 OUT
- bmAttributes 2
- Transfer Type Bulk
- Synch Type None
- Usage Type Data
- wMaxPacketSize 0x0200 1x 512 bytes
- bInterval 0
- ** UNRECOGNIZED: 05 41 04 00 01
- ** 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
- ** 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
- Device Status: 0x0001
- Self Powered
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement