Changeset 90994fa in mainline for uspace/drv/bus/usb/usbhub/port.c


Ignore:
Timestamp:
2011-10-12T20:03:36Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
162726b
Parents:
205f0766
Message:

usb: Hubs should store child functions not just handles.

File:
1 edited

Legend:

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

    r205f0766 r90994fa  
    257257                usb_log_debug("Removing device on port %zu.\n",
    258258                    port->port_number);
    259                 const int ret =
    260                     devman_remove_function(port->attached_device.handle);
     259                const int ret = ddf_fun_unbind(port->attached_device.fun);
    261260                if (ret == EOK) {
     261                        ddf_fun_destroy(port->attached_device.fun);
    262262                        const int ret =
    263263                            usb_hc_unregister_device(&hub->connection,
     
    269269                        }
    270270                } else {
    271                         usb_log_error("Failed to remove child function on port"
     271                        usb_log_error("Failed to unbind child function on port"
    272272                           " %zu: %s.\n", port->port_number, str_error(ret));
    273273                }
    274274                port->attached_device.address = -1;
    275                 port->attached_device.handle = 0;
     275                port->attached_device.fun = NULL;
    276276                fibril_mutex_unlock(&port->mutex);
    277277                usb_log_info("Removed device on port %zu.\n",
     
    418418
    419419        usb_address_t new_address;
    420         devman_handle_t child_handle;
     420        ddf_fun_t *child_fun;
    421421
    422422        const int rc = usb_hc_new_device_wrapper(data->hub->usb_device->ddf_dev,
    423423            &data->hub->connection, data->speed,
    424424            enable_port_callback, (int) data->port->port_number,
    425             data->port, &new_address, &child_handle,
    426             NULL, NULL, NULL);
     425            data->port, &new_address, NULL,
     426            NULL, NULL, &child_fun);
    427427
    428428        if (rc != EOK) {
     
    433433
    434434        fibril_mutex_lock(&data->port->mutex);
    435         data->port->attached_device.handle = child_handle;
     435        data->port->attached_device.fun = child_fun;
    436436        data->port->attached_device.address = new_address;
    437437        fibril_mutex_unlock(&data->port->mutex);
     
    440440            "address %d (handle %" PRIun ").\n",
    441441            data->hub->usb_device->ddf_dev->name, data->port->port_number,
    442             new_address, child_handle);
     442            new_address, child_fun->handle);
    443443
    444444leave:
Note: See TracChangeset for help on using the changeset viewer.