Changeset 8b68bdf in mainline
- Timestamp:
- 2013-01-27T00:42:35Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fd9b3a67
- Parents:
- 35bc430
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
r35bc430 r8b68bdf 359 359 /* Get number of possible configurations from device descriptor */ 360 360 const size_t configuration_count = 361 usb_device ->descriptors.device.configuration_count;361 usb_device_get_device_descriptor(usb_device)->configuration_count; 362 362 usb_log_debug("Hub has %zu configurations.\n", configuration_count); 363 363 … … 367 367 } 368 368 369 if (usb_device->descriptors.configuration_size 370 < sizeof(usb_standard_configuration_descriptor_t)) { 369 // TODO: Make sure that the cast is correct 370 size_t config_size = 0; 371 const usb_standard_configuration_descriptor_t *config_descriptor = 372 usb_device_get_configuration_descriptor(usb_device, &config_size); 373 374 if (config_size < sizeof(usb_standard_configuration_descriptor_t)) { 371 375 usb_log_error("Configuration descriptor is not big enough" 372 376 " to fit standard configuration descriptor.\n"); … … 374 378 } 375 379 376 // TODO: Make sure that the cast is correct377 const usb_standard_configuration_descriptor_t *config_descriptor378 = (usb_standard_configuration_descriptor_t *)379 usb_device->descriptors.configuration;380 380 381 381 /* Set configuration. Use the configuration that was in -
uspace/lib/usbhid/src/hidreport.c
r35bc430 r8b68bdf 60 60 }; 61 61 62 size_t desc_size = 0; 63 const void *desc = 64 usb_device_get_configuration_descriptor(dev, &desc_size); 65 62 66 usb_dp_parser_data_t parser_data = { 63 .data = de v->descriptors.configuration,64 .size = de v->descriptors.configuration_size,67 .data = desc, 68 .size = desc_size, 65 69 .arg = NULL 66 70 }; … … 70 74 */ 71 75 const uint8_t *d = 72 usb_dp_get_nested_descriptor(&parser, &parser_data, 73 dev->descriptors.configuration); 76 usb_dp_get_nested_descriptor(&parser, &parser_data, desc); 74 77 75 78 /* … … 77 80 */ 78 81 int i = 0; 79 while (d != NULL && i < dev->interface_no) {82 while (d != NULL && i < usb_device_get_iface_number(dev)) { 80 83 d = usb_dp_get_sibling_descriptor(&parser, &parser_data, 81 de v->descriptors.configuration, d);84 desc, d); 82 85 ++i; 83 86 } … … 85 88 if (d == NULL) { 86 89 usb_log_error("The %d. interface descriptor not found!\n", 87 dev->interface_no);90 usb_device_get_iface_number(dev)); 88 91 return ENOENT; 89 92 } … … 135 138 * Get the descriptor from the device. 136 139 */ 137 int rc = usb_request_get_descriptor( &dev->ctrl_pipe,140 int rc = usb_request_get_descriptor(usb_device_get_default_pipe(dev), 138 141 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_INTERFACE, 139 USB_DESCTYPE_HID_REPORT, 0, dev->interface_no,142 USB_DESCTYPE_HID_REPORT, 0, usb_device_get_iface_number(dev), 140 143 *report_desc, length, &actual_size); 141 144
Note:
See TracChangeset
for help on using the changeset viewer.