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


Ignore:
Timestamp:
2013-01-07T17:30:03Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5a470c
Parents:
e6becb9
Message:

usbhub: Fix after porting to new usb ops.

Check attached handle instead of attached device function.
Release default address after successful enumeration.
Decrease pending ops count after device enumeration.

Remove attached_device member.
usb_hub_port_fini is safe to call on ports withou attached devices.

File:
1 edited

Legend:

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

    re6becb9 rc9467b0  
    6666{
    6767        assert(port);
    68         if (port->attached_device.fun)
     68        if (port->attached_handle != USB_DEVICE_HANDLE_INVALID)
    6969                return usb_hub_port_device_gone(port, hub);
    7070        return EOK;
     
    471471        }
    472472
    473         usb_log_fatal("reserving default address\n");
    474 
    475473        /* Reserve default address */
    476474        int ret;
    477475        while ((ret = usb_reserve_default_address(exch, speed)) == ENOENT) {
    478                 usb_log_fatal("reserving default address %d\n", ret);
    479476                async_usleep(1000000);
    480477        }
     
    507504                                    "Failed to release default address\n");
    508505                }
     506        } else {
     507                if (usb_release_default_address(exch) != EOK)
     508                        usb_log_warning("Failed to release default address\n");
    509509        }
    510510        async_exchange_end(exch);
     511
     512        fibril_mutex_lock(&hub->pending_ops_mutex);
     513        assert(hub->pending_ops_count > 0);
     514        --hub->pending_ops_count;
     515        fibril_condvar_signal(&hub->pending_ops_cv);
     516        fibril_mutex_unlock(&hub->pending_ops_mutex);
     517
    511518        return ret;
    512519#if 0
Note: See TracChangeset for help on using the changeset viewer.