Changeset 7aaed09 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c


Ignore:
Timestamp:
2011-12-18T14:02:30Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c868e2d
Parents:
3b71e84d (diff), 1761268 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    r3b71e84d r7aaed09  
    170170int usb_hub_device_remove(usb_device_t *usb_dev)
    171171{
    172         assert(usb_dev);
    173         usb_hub_dev_t *hub_dev = usb_dev->driver_data;
    174         assert(hub_dev);
    175         //TODO: Cascade the call here.
    176         //TODO: Enable after cascading is implemented.
    177172        return ENOTSUP;
    178         if (!hub_dev->power_switched) {
    179                 /* That is all we can do. */
    180                 return EOK;
    181         }
    182         int ret = EOK;
    183         usb_log_info("Hub is about to be removed, powering down all ports.\n");
    184         for (size_t port = 0; port < hub_dev->port_count; ++port) {
    185                 usb_log_debug("Powering down port %zu.\n", port);
    186                 int pret = usb_hub_port_clear_feature(
    187                     &hub_dev->ports[port], USB_HUB_FEATURE_PORT_POWER);
    188                 if (pret != EOK) {
    189                         usb_log_error("Cannot power down port %zu: %s.\n",
    190                             hub_dev->ports[port].port_number, str_error(pret));
    191                         ret = pret;
    192                 } else {
    193                         if (!hub_dev->per_port_power) {
    194                                 usb_log_debug("Ganged power switching mode, "
    195                                    "one port is enough.\n");
    196                                 break;
    197                         }
    198                 }
    199         }
    200         return ret;
    201173}
    202174/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.