Changeset 75eb6735 in mainline


Ignore:
Timestamp:
2011-09-23T09:28:16Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d3cd30
Parents:
ea6de35
Message:

usbhub: Reduce the use of usb_info_t.control_pipe

File:
1 edited

Legend:

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

    rea6de35 r75eb6735  
    248248        /* Get hub descriptor. */
    249249        usb_log_debug("Retrieving descriptor\n");
     250        usb_pipe_t *control_pipe = &hub_info->usb_device->ctrl_pipe;
    250251        uint8_t serialized_descriptor[USB_HUB_MAX_DESCRIPTOR_SIZE];
    251252        int opResult;
    252253
    253254        size_t received_size;
    254         opResult = usb_request_get_descriptor(hub_info->control_pipe,
     255        opResult = usb_request_get_descriptor(control_pipe,
    255256            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE,
    256257            USB_DESCTYPE_HUB, 0, 0, serialized_descriptor,
     
    296297                        usb_log_debug("Powering port %zu.\n", port);
    297298                        opResult = usb_hub_set_port_feature(
    298                             hub_info->control_pipe,
    299                             port, USB_HUB_FEATURE_PORT_POWER);
     299                            control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
    300300                        if (opResult != EOK) {
    301301                                usb_log_error("Cannot power on port %zu: %s.\n",
     
    368368    usb_hub_status_t status)
    369369{
     370        usb_pipe_t *control_pipe = &hub_info->usb_device->ctrl_pipe;
    370371        if (status & USB_HUB_STATUS_OVER_CURRENT) {
    371372                /* Over-current detected on one or all ports,
     
    375376                for (port = 1; port <= hub_info->port_count; ++port) {
    376377                        const int opResult = usb_hub_clear_port_feature(
    377                             hub_info->control_pipe, port,
    378                             USB_HUB_FEATURE_PORT_POWER);
     378                            control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
    379379                        if (opResult != EOK) {
    380380                                usb_log_warning(
     
    390390                for (port = 1; port <= hub_info->port_count; ++port) {
    391391                        const int opResult = usb_hub_set_port_feature(
    392                             hub_info->control_pipe, port,
    393                             USB_HUB_FEATURE_PORT_POWER);
     392                            control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
    394393                        if (opResult != EOK) {
    395394                                usb_log_warning(
     
    413412        assert(hub_info->usb_device);
    414413        usb_log_debug("Global interrupt on a hub\n");
    415         usb_pipe_t *ctrlpipe = &hub_info->usb_device->ctrl_pipe;
     414        usb_pipe_t *control_pipe = &hub_info->usb_device->ctrl_pipe;
    416415
    417416        usb_hub_status_t status;
     
    419418        /* NOTE: We can't use standard USB GET_STATUS request, because
    420419         * hubs reply is 4byte instead of 2 */
    421         const int opResult = usb_pipe_control_read(
    422             ctrlpipe, &get_hub_status_request, sizeof(get_hub_status_request),
     420        const int opResult = usb_pipe_control_read(control_pipe,
     421            &get_hub_status_request, sizeof(get_hub_status_request),
    423422            &status, sizeof(usb_hub_status_t), &rcvd_size);
    424423        if (opResult != EOK) {
     
    450449                 * Just ACK the change.
    451450                 */
    452                 const int opResult = usb_hub_clear_feature(ctrlpipe,
    453                     USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
     451                const int opResult = usb_hub_clear_feature(
     452                    control_pipe, USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
    454453                if (opResult != EOK) {
    455454                        usb_log_error("Cannot clear hub power change flag: "
Note: See TracChangeset for help on using the changeset viewer.