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


Ignore:
Timestamp:
2011-10-12T20:03:36Z (13 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/uhcirh/port.c

    r205f0766 r90994fa  
    100100        port->number = number;
    101101        port->wait_period_usec = usec;
    102         port->attached_device.handle = 0;
     102        port->attached_device.fun = NULL;
    103103        port->attached_device.address = -1;
    104104        port->rh = rh;
     
    169169
    170170                /* Remove any old device */
    171                 if (instance->attached_device.handle) {
     171                if (instance->attached_device.fun) {
    172172                        usb_log_debug2("%s: Removing device.\n",
    173173                            instance->id_string);
     
    261261                ret = usb_hc_new_device_wrapper(port->rh, &port->hc_connection,
    262262                    speed, uhci_port_reset_enable, port->number, port,
    263                     &port->attached_device.address,
    264                     &port->attached_device.handle, NULL, NULL, NULL);
     263                    &port->attached_device.address, NULL, NULL, NULL,
     264                    &port->attached_device.fun);
    265265        } while (ret != EOK && ++count < 4);
    266266
     
    274274        usb_log_info("New device at port %u, address %d (handle %" PRIun ").\n",
    275275            port->number, port->attached_device.address,
    276             port->attached_device.handle);
     276            port->attached_device.fun->handle);
    277277        return EOK;
    278278}
     
    287287        assert(port);
    288288        /* There is nothing to remove. */
    289         if (port->attached_device.handle == 0) {
     289        if (port->attached_device.fun == NULL) {
    290290                usb_log_warning("%s: Removed a ghost device.\n",
    291291                    port->id_string);
     
    297297
    298298        /* Stop driver first */
    299         int ret = devman_remove_function(port->attached_device.handle);
     299        int ret = ddf_fun_unbind(port->attached_device.fun);
    300300        if (ret != EOK) {
    301301                usb_log_error("%s: Failed to remove child function: %s.\n",
     
    303303                return ret;
    304304        }
    305         port->attached_device.handle = 0;
     305        ddf_fun_destroy(port->attached_device.fun);
     306        port->attached_device.fun = NULL;
    306307
    307308        /* Driver stopped, free used address */
Note: See TracChangeset for help on using the changeset viewer.