Changes in uspace/lib/usbhid/src/hidreport.c [e2dfa86:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hidreport.c
re2dfa86 r9d58539 50 50 #include <usb/hid/hidreport.h> 51 51 52 static int usb_hid_get_report_descriptor(usb_device_t *dev, 52 static int usb_hid_get_report_descriptor(usb_device_t *dev, 53 53 uint8_t **report_desc, size_t *size) 54 54 { … … 61 61 62 62 usb_dp_parser_data_t parser_data = { 63 .data = usb_device_descriptors(dev)->full_config,64 .size = usb_device_descriptors(dev)->full_config_size,63 .data = dev->descriptors.configuration, 64 .size = dev->descriptors.configuration_size, 65 65 .arg = NULL 66 66 }; … … 69 69 * First nested descriptor of the configuration descriptor. 70 70 */ 71 const uint8_t *d = 72 usb_dp_get_nested_descriptor(&parser, &parser_data, 73 usb_device_descriptors(dev)->full_config);71 const uint8_t *d = 72 usb_dp_get_nested_descriptor(&parser, &parser_data, 73 dev->descriptors.configuration); 74 74 75 75 /* … … 77 77 */ 78 78 int i = 0; 79 while (d != NULL && i < usb_device_get_iface_number(dev)) {80 d = usb_dp_get_sibling_descriptor(&parser, &parser_data, 81 usb_device_descriptors(dev)->full_config, d);79 while (d != NULL && i < dev->interface_no) { 80 d = usb_dp_get_sibling_descriptor(&parser, &parser_data, 81 dev->descriptors.configuration, d); 82 82 ++i; 83 83 } … … 85 85 if (d == NULL) { 86 86 usb_log_error("The %d. interface descriptor not found!\n", 87 usb_device_get_iface_number(dev));87 dev->interface_no); 88 88 return ENOENT; 89 89 } … … 99 99 */ 100 100 while (d != NULL && *(d + 1) != USB_DESCTYPE_HID) { 101 d = usb_dp_get_sibling_descriptor(&parser, &parser_data, 101 d = usb_dp_get_sibling_descriptor(&parser, &parser_data, 102 102 iface_desc, d); 103 103 } … … 114 114 } 115 115 116 usb_standard_hid_descriptor_t *hid_desc = 116 usb_standard_hid_descriptor_t *hid_desc = 117 117 (usb_standard_hid_descriptor_t *)d; 118 118 119 uint16_t length = uint16_usb2host(hid_desc->report_desc_info.length);119 uint16_t length = hid_desc->report_desc_info.length; 120 120 size_t actual_size = 0; 121 121 … … 135 135 * Get the descriptor from the device. 136 136 */ 137 int rc = usb_request_get_descriptor( usb_device_get_default_pipe(dev),137 int rc = usb_request_get_descriptor(&dev->ctrl_pipe, 138 138 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_INTERFACE, 139 USB_DESCTYPE_HID_REPORT, 0, usb_device_get_iface_number(dev),139 USB_DESCTYPE_HID_REPORT, 0, dev->interface_no, 140 140 *report_desc, length, &actual_size); 141 141 … … 161 161 } 162 162 163 163 /*----------------------------------------------------------------------------*/ 164 164 165 165 int usb_hid_process_report_descriptor(usb_device_t *dev,
Note:
See TracChangeset
for help on using the changeset viewer.