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


Ignore:
Timestamp:
2011-09-23T13:44:12Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
442fa6b
Parents:
a590a23
Message:

usbhub: Add pipe and port number to port structure.

Use these fields in feature set/clear.

File:
1 edited

Legend:

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

    ra590a23 rc0587d90  
    277277        size_t port;
    278278        for (port = 0; port < hub_info->port_count + 1; ++port) {
    279                 usb_hub_port_init(&hub_info->ports[port]);
     279                usb_hub_port_init(&hub_info->ports[port], port, control_pipe);
    280280        }
    281281
     
    290290                        usb_log_debug("Powering port %zu.\n", port);
    291291                        opResult = usb_hub_set_port_feature(
    292                             control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
     292                            &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER);
    293293                        if (opResult != EOK) {
    294294                                usb_log_error("Cannot power on port %zu: %s.\n",
     
    361361    usb_hub_status_t status)
    362362{
    363         usb_pipe_t *control_pipe = &hub_info->usb_device->ctrl_pipe;
    364363        if (status & USB_HUB_STATUS_OVER_CURRENT) {
    365364                /* Over-current detected on one or all ports,
     
    369368                for (port = 1; port <= hub_info->port_count; ++port) {
    370369                        const int opResult = usb_hub_clear_port_feature(
    371                             control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
     370                            &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER);
    372371                        if (opResult != EOK) {
    373372                                usb_log_warning(
     
    383382                for (port = 1; port <= hub_info->port_count; ++port) {
    384383                        const int opResult = usb_hub_set_port_feature(
    385                             control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
     384                            &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER);
    386385                        if (opResult != EOK) {
    387386                                usb_log_warning(
Note: See TracChangeset for help on using the changeset viewer.