Changeset 8033f89 in mainline for uspace/drv/bus/usb/xhci/device.c


Ignore:
Timestamp:
2018-01-23T12:41:22Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7e1fd3
Parents:
e546142
Message:

xhci: cstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/device.c

    re546142 r8033f89  
    5656#include "device.h"
    5757
    58 /** Initial descriptor used for control endpoint 0 before more configuration is retrieved. */
     58/**
     59 * Initial descriptor used for control endpoint 0,
     60 * before more configuration is retrieved.
     61 */
    5962static const usb_endpoint_descriptors_t ep0_initial_desc = {
    6063        .endpoint.max_packet_size = CTRL_PIPE_MIN_PACKET_SIZE,
     
    8790        dev->base.endpoints[0] = ep0_base;
    8891
    89         usb_log_debug("Looking up new device initial MPS: %s", usb_str_speed(dev->base.speed));
     92        usb_log_debug("Looking up new device initial MPS: %s",
     93            usb_str_speed(dev->base.speed));
    9094        ep0_base->max_packet_size = hc_get_ep0_initial_mps(dev->base.speed);
    9195
     
    117121
    118122        uint16_t max_packet_size;
    119         if ((err = hc_get_ep0_max_packet_size(&max_packet_size, (bus_t *) &hc->bus, &dev->base)))
     123        if ((err = hc_get_ep0_max_packet_size(&max_packet_size,
     124            (bus_t *) &hc->bus, &dev->base)))
    120125                return err;
    121126
     
    160165        }
    161166
    162         usb_log_debug("Device(%u): recognised USB hub with %u ports", dev->base.address, dev->num_ports);
     167        usb_log_debug("Device(%u): recognised USB hub with %u ports",
     168            dev->base.address, dev->num_ports);
    163169        return EOK;
    164170}
     
    197203
    198204        if (err) {
    199                 usb_log_error("Failed to setup address of the new device: %s", str_error(err));
     205                usb_log_error("Failed to setup address of the new device: %s",
     206                    str_error(err));
    200207                return err;
    201208        }
     
    208215
    209216        if ((err = setup_ep0_packet_size(bus->hc, xhci_dev))) {
    210                 usb_log_error("Failed to setup control endpoint of the new device: %s", str_error(err));
     217                usb_log_error("Failed to setup control endpoint "
     218                    "of the new device: %s", str_error(err));
    211219                goto err_address;
    212220        }
     
    215223
    216224        if ((err = hc_get_device_desc(dev, &desc))) {
    217                 usb_log_error("Device(%d): failed to get devices descriptor: %s", dev->address, str_error(err));
     225                usb_log_error("Device(%d): failed to get device "
     226                   "descriptor: %s", dev->address, str_error(err));
    218227                goto err_address;
    219228        }
    220229
    221230        if ((err = setup_hub(xhci_dev, &desc)))
    222                 usb_log_warning("Device(%d): failed to setup hub characteristics: %s. "
    223                     " Continuing anyway.", dev->address, str_error(err));
     231                usb_log_warning("Device(%d): failed to setup hub "
     232                    "characteristics: %s.  Continuing anyway.",
     233                    dev->address, str_error(err));
    224234
    225235        if ((err = hcd_ddf_setup_match_ids(dev, &desc))) {
    226                 usb_log_error("Device(%d): failed to setup match IDs: %s", dev->address, str_error(err));
     236                usb_log_error("Device(%d): failed to setup match IDs: %s",
     237                    dev->address, str_error(err));
    227238                goto err_address;
    228239        }
     
    253264        const uint32_t slot_id = xhci_dev->slot_id;
    254265        if ((err = hc_disable_slot(xhci_dev))) {
    255                 usb_log_warning("Failed to disable slot of device " XHCI_DEV_FMT ": %s",
    256                     XHCI_DEV_ARGS(*xhci_dev), str_error(err));
     266                usb_log_warning("Failed to disable slot of device " XHCI_DEV_FMT
     267                    ": %s", XHCI_DEV_ARGS(*xhci_dev), str_error(err));
    257268        }
    258269
     
    277288        /* Transition the device from the Addressed to the Configured state. */
    278289        if ((err = hc_configure_device(dev))) {
    279                 usb_log_warning("Failed to configure device " XHCI_DEV_FMT ".", XHCI_DEV_ARGS(*dev));
     290                usb_log_warning("Failed to configure device " XHCI_DEV_FMT ".",
     291                    XHCI_DEV_ARGS(*dev));
    280292                return err;
    281293        }
     
    302314        /* Issue one HC command to simultaneously drop all endpoints except zero. */
    303315        if ((err = hc_deconfigure_device(dev))) {
    304                 usb_log_warning("Failed to deconfigure device " XHCI_DEV_FMT ".",
    305                     XHCI_DEV_ARGS(*dev));
     316                usb_log_warning("Failed to deconfigure device "
     317                    XHCI_DEV_FMT ".", XHCI_DEV_ARGS(*dev));
    306318        }
    307319}
     
    339351        }
    340352
    341         // As we always allocate space for whole input context, we can set this to maximum
     353        /*
     354         * As we always allocate space for whole input context, we can set this
     355         * to maximum. The only exception being Address Device command, which
     356         * explicitly requires this to be se to 1.
     357         */
    342358        XHCI_SLOT_CTX_ENTRIES_SET(*ctx, 31);
    343359}
Note: See TracChangeset for help on using the changeset viewer.