Changeset eeca8a6 in mainline for uspace/drv/bus/usb


Ignore:
Timestamp:
2018-01-16T19:22:58Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4603b35
Parents:
47e9494
Message:

usb: speed moved from default address reservation to enumeration callback

Location:
uspace/drv/bus/usb
Files:
2 edited

Legend:

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

    r47e9494 reeca8a6  
    246246         * TODO: Make the request synchronous.
    247247         */
    248         while ((err = usbhc_reserve_default_address(exch, port->speed)) == EAGAIN) {
     248        while ((err = usbhc_reserve_default_address(exch)) == EAGAIN) {
    249249                fibril_condvar_wait_timeout(&port->state_cv, &port->guard, 500000);
    250250                if (port->state != PORT_CONNECTED) {
     
    271271        port_log(debug, port, "Port reset, enumerating device.");
    272272
    273         if ((err = usbhc_device_enumerate(exch, port->port_number))) {
     273        if ((err = usbhc_device_enumerate(exch, port->port_number, port->speed))) {
    274274                port_log(error, port, "Failed to enumerate device: %s", str_error(err));
    275275                port_change_state(port, PORT_DISABLED);
  • uspace/drv/bus/usb/xhci/rh.c

    r47e9494 reeca8a6  
    169169        }
    170170
    171         device_t *dev = hcd_ddf_fun_create(&rh->hc->base);
     171        const xhci_port_speed_t *port_speed = xhci_rh_get_port_speed(rh, port_id);
     172
     173        device_t *dev = hcd_ddf_fun_create(&rh->hc->base, port_speed->usb_speed);
    172174        if (!dev) {
    173175                usb_log_error("Failed to create USB device function.");
     
    175177        }
    176178
    177         const xhci_port_speed_t *port_speed = xhci_rh_get_port_speed(rh, port_id);
     179        dev->hub = &rh->device.base;
     180        dev->port = port_id;
     181
    178182        xhci_device_t *xhci_dev = xhci_device_get(dev);
    179183        xhci_dev->usb3 = port_speed->major == 3;
    180184        xhci_dev->rh_port = port_id;
    181 
    182         dev->hub = &rh->device.base;
    183         dev->port = port_id;
    184         dev->speed = port_speed->usb_speed;
    185185
    186186        if ((err = bus_device_enumerate(dev))) {
Note: See TracChangeset for help on using the changeset viewer.