Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 8b68bdf in mainline


Ignore:
Timestamp:
2013-01-27T00:42:35Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
fd9b3a67
Parents:
35bc430
Message:

usbhub, libusbhid: Forgotten conversions to usb_device wrappers.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/usbhub.c

    r35bc430 r8b68bdf  
    359359        /* Get number of possible configurations from device descriptor */
    360360        const size_t configuration_count =
    361             usb_device->descriptors.device.configuration_count;
     361            usb_device_get_device_descriptor(usb_device)->configuration_count;
    362362        usb_log_debug("Hub has %zu configurations.\n", configuration_count);
    363363
     
    367367        }
    368368
    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)) {
    371375            usb_log_error("Configuration descriptor is not big enough"
    372376                " to fit standard configuration descriptor.\n");
     
    374378        }
    375379
    376         // TODO: Make sure that the cast is correct
    377         const usb_standard_configuration_descriptor_t *config_descriptor
    378             = (usb_standard_configuration_descriptor_t *)
    379             usb_device->descriptors.configuration;
    380380
    381381        /* Set configuration. Use the configuration that was in
  • uspace/lib/usbhid/src/hidreport.c

    r35bc430 r8b68bdf  
    6060        };
    6161       
     62        size_t desc_size = 0;
     63        const void *desc =
     64            usb_device_get_configuration_descriptor(dev, &desc_size);
     65
    6266        usb_dp_parser_data_t parser_data = {
    63                 .data = dev->descriptors.configuration,
    64                 .size = dev->descriptors.configuration_size,
     67                .data = desc,
     68                .size = desc_size,
    6569                .arg = NULL
    6670        };
     
    7074         */
    7175        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);
    7477       
    7578        /*
     
    7780         */
    7881        int i = 0;
    79         while (d != NULL && i < dev->interface_no) {
     82        while (d != NULL && i < usb_device_get_iface_number(dev)) {
    8083                d = usb_dp_get_sibling_descriptor(&parser, &parser_data,
    81                     dev->descriptors.configuration, d);
     84                    desc, d);
    8285                ++i;
    8386        }
     
    8588        if (d == NULL) {
    8689                usb_log_error("The %d. interface descriptor not found!\n",
    87                     dev->interface_no);
     90                    usb_device_get_iface_number(dev));
    8891                return ENOENT;
    8992        }
     
    135138         * Get the descriptor from the device.
    136139         */
    137         int rc = usb_request_get_descriptor(&dev->ctrl_pipe,
     140        int rc = usb_request_get_descriptor(usb_device_get_default_pipe(dev),
    138141            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),
    140143            *report_desc, length, &actual_size);
    141144
Note: See TracChangeset for help on using the changeset viewer.