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


Ignore:
Timestamp:
2018-01-23T12:41:22Z (6 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/endpoint.c

    re546142 r8033f89  
    5858 * @return Error code.
    5959 */
    60 static int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, const usb_endpoint_descriptors_t *desc)
     60static int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev,
     61    const usb_endpoint_descriptors_t *desc)
    6162{
    6263        int rc;
     
    7980                xhci_ep->mult = 1;
    8081
    81         /* In USB 3, the semantics of wMaxPacketSize changed. Now the number of
     82        /*
     83         * In USB 3, the semantics of wMaxPacketSize changed. Now the number of
    8284         * packets per service interval is determined from max_burst and mult.
    8385         */
     
    9395         * others have 2-based log of it.
    9496         */
    95         if (dev->speed >= USB_SPEED_HIGH || ep->transfer_type != USB_TRANSFER_INTERRUPT) {
     97        if (dev->speed >= USB_SPEED_HIGH
     98            || ep->transfer_type != USB_TRANSFER_INTERRUPT) {
    9699                xhci_ep->interval = 1 << (xhci_ep->interval - 1);
    97100        }
     
    119122 * Bus callback.
    120123 */
    121 endpoint_t *xhci_endpoint_create(device_t *dev, const usb_endpoint_descriptors_t *desc)
     124endpoint_t *xhci_endpoint_create(device_t *dev,
     125    const usb_endpoint_descriptors_t *desc)
    122126{
    123127        const usb_transfer_type_t type = USB_ED_GET_TRANSFER_TYPE(desc->endpoint);
     
    193197                        const int err = hc_stop_endpoint(xhci_ep);
    194198                        if (err) {
    195                                 usb_log_warning("Failed to stop endpoint %u of device " XHCI_DEV_FMT ": %s",
    196                                     ep->endpoint, XHCI_DEV_ARGS(*dev), str_error(err));
     199                                usb_log_warning("Failed to stop endpoint %u of device "
     200                                    XHCI_DEV_FMT ": %s", ep->endpoint, XHCI_DEV_ARGS(*dev),
     201                                    str_error(err));
    197202                        }
    198203
     
    233238
    234239                if ((err = hc_drop_endpoint(ep))) {
    235                         usb_log_error("Failed to drop endpoint " XHCI_EP_FMT ": %s", XHCI_EP_ARGS(*ep), str_error(err));
     240                        usb_log_error("Failed to drop endpoint " XHCI_EP_FMT ": %s",
     241                            XHCI_EP_ARGS(*ep), str_error(err));
    236242                }
    237243        } else {
     
    271277}
    272278
    273 /** Allocate transfer data structures for XHCI endpoint not using streams.
     279/**
     280 * Allocate transfer data structures for XHCI endpoint not using streams.
    274281 * @param[in] xhci_ep XHCI endpoint to allocate data structures for.
    275282 *
     
    279286{
    280287        /* Can't use XHCI_EP_FMT because the endpoint may not have device. */
    281         usb_log_debug("Allocating main transfer ring for endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
     288        usb_log_debug("Allocating main transfer ring for endpoint " XHCI_EP_FMT,
     289            XHCI_EP_ARGS(*xhci_ep));
    282290
    283291        xhci_ep->primary_stream_data_array = NULL;
     
    299307}
    300308
    301 /** Free transfer data structures for XHCI endpoint.
     309/**
     310 * Free transfer data structures for XHCI endpoint.
    302311 * @param[in] xhci_ep XHCI endpoint to free data structures for.
    303312 */
     
    307316                xhci_stream_free_ds(xhci_ep);
    308317        } else {
    309                 usb_log_debug("Freeing main transfer ring of endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
     318                usb_log_debug("Freeing main transfer ring of endpoint " XHCI_EP_FMT,
     319                    XHCI_EP_ARGS(*xhci_ep));
    310320                xhci_trb_ring_fini(&xhci_ep->ring);
    311321        }
     
    329339}
    330340
    331 /** Configure endpoint context of a control endpoint.
     341/**
     342 * Configure endpoint context of a control endpoint.
    332343 * @param[in] ep XHCI control endpoint.
    333344 * @param[in] ctx Endpoint context to configure.
     
    344355}
    345356
    346 /** Configure endpoint context of a bulk endpoint.
     357/**
     358 * Configure endpoint context of a bulk endpoint.
    347359 * @param[in] ep XHCI bulk endpoint.
    348360 * @param[in] ctx Endpoint context to configure.
     
    360372}
    361373
    362 /** Configure endpoint context of a isochronous endpoint.
     374/**
     375 * Configure endpoint context of a isochronous endpoint.
    363376 * @param[in] ep XHCI isochronous endpoint.
    364377 * @param[in] ctx Endpoint context to configure.
     
    379392}
    380393
    381 /** Configure endpoint context of a interrupt endpoint.
     394/**
     395 * Configure endpoint context of a interrupt endpoint.
    382396 * @param[in] ep XHCI interrupt endpoint.
    383397 * @param[in] ctx Endpoint context to configure.
     
    399413typedef void (*setup_ep_ctx_helper)(xhci_endpoint_t *, xhci_ep_ctx_t *);
    400414
    401 /** Static array, which maps USB endpoint types to their respective endpoint context configuration functions. */
     415/**
     416 * Static array, which maps USB endpoint types to their respective endpoint
     417 * context configuration functions.
     418 */
    402419static const setup_ep_ctx_helper setup_ep_ctx_helpers[] = {
    403420        [USB_TRANSFER_CONTROL] = setup_control_ep_ctx,
Note: See TracChangeset for help on using the changeset viewer.