Changeset 3bacee1 in mainline for uspace/drv/bus/usb/xhci/streams.c


Ignore:
Timestamp:
2018-04-12T16:27:17Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3cf22f9
Parents:
76d0981d
git-author:
Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
git-committer:
Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
Message:

Make ccheck-fix again and commit more good files.

File:
1 edited

Legend:

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

    r76d0981d r3bacee1  
    8888{
    8989        usb_log_debug("Allocating primary stream context array of size %u "
    90                 "for endpoint " XHCI_EP_FMT, count, XHCI_EP_ARGS(*xhci_ep));
     90            "for endpoint " XHCI_EP_FMT, count, XHCI_EP_ARGS(*xhci_ep));
    9191
    9292        if ((dma_buffer_alloc(&xhci_ep->primary_stream_ctx_dma,
    93                 count * sizeof(xhci_stream_ctx_t)))) {
     93            count * sizeof(xhci_stream_ctx_t)))) {
    9494                return ENOMEM;
    9595        }
     
    110110{
    111111        usb_log_debug("Deallocating primary stream structures for "
    112                 "endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
     112            "endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
    113113
    114114        dma_buffer_free(&xhci_ep->primary_stream_ctx_dma);
     
    138138{
    139139        usb_log_debug("Freeing stream rings and context arrays of endpoint "
    140                 XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
     140            XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
    141141
    142142        for (size_t index = 0; index < xhci_ep->primary_stream_data_size; ++index) {
     
    153153 */
    154154static errno_t initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
    155         unsigned index)
     155    unsigned index)
    156156{
    157157        xhci_stream_ctx_t *ctx = &xhci_ep->primary_stream_ctx_array[index];
     
    206206 */
    207207static errno_t initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
    208         unsigned idx, unsigned count)
     208    unsigned idx, unsigned count)
    209209{
    210210        if (count == 0) {
     
    218218        if ((count & (count - 1)) != 0 || count < 8 || count > 256) {
    219219                usb_log_error("The secondary stream array size must be a power of 2 "
    220                         "between 8 and 256.");
     220                    "between 8 and 256.");
    221221                return EINVAL;
    222222        }
     
    233233
    234234        if ((dma_buffer_alloc(&data->secondary_stream_ctx_dma,
    235                 count * sizeof(xhci_stream_ctx_t)))) {
     235            count * sizeof(xhci_stream_ctx_t)))) {
    236236                free(data->secondary_data);
    237237                return ENOMEM;
     
    275275 */
    276276static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx,
    277         unsigned pstreams, unsigned lsa)
     277    unsigned pstreams, unsigned lsa)
    278278{
    279279        XHCI_EP_TYPE_SET(*ctx, xhci_endpoint_type(xhci_ep));
     
    295295 */
    296296static errno_t verify_stream_conditions(xhci_hc_t *hc, xhci_device_t *dev,
    297         xhci_endpoint_t *xhci_ep, unsigned count)
    298 {
    299         if (xhci_ep->base.transfer_type != USB_TRANSFER_BULK
    300                 || dev->base.speed != USB_SPEED_SUPER) {
     297    xhci_endpoint_t *xhci_ep, unsigned count)
     298{
     299        if (xhci_ep->base.transfer_type != USB_TRANSFER_BULK ||
     300            dev->base.speed != USB_SPEED_SUPER) {
    301301                usb_log_error("Streams are only supported by superspeed bulk endpoints.");
    302302                return EINVAL;
     
    321321        if (count > max_psa_size) {
    322322                usb_log_error("Host controller only supports "
    323                         "%u primary streams.", max_psa_size);
     323                    "%u primary streams.", max_psa_size);
    324324                return EINVAL;
    325325        }
     
    327327        if (count > xhci_ep->max_streams) {
    328328                usb_log_error("Endpoint " XHCI_EP_FMT " supports only %" PRIu32 " streams.",
    329                         XHCI_EP_ARGS(*xhci_ep), xhci_ep->max_streams);
     329                    XHCI_EP_ARGS(*xhci_ep), xhci_ep->max_streams);
    330330                return EINVAL;
    331331        }
     
    346346 */
    347347errno_t xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,
    348         xhci_endpoint_t *xhci_ep)
     348    xhci_endpoint_t *xhci_ep)
    349349{
    350350        if (!xhci_ep->primary_stream_data_size) {
     
    374374 */
    375375errno_t xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    376         xhci_endpoint_t *xhci_ep, unsigned count)
     376    xhci_endpoint_t *xhci_ep, unsigned count)
    377377{
    378378        errno_t err = verify_stream_conditions(hc, dev, xhci_ep, count);
     
    422422 */
    423423errno_t xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    424         xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count)
     424    xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count)
    425425{
    426426        /* Check if HC supports secondary indexing */
     
    454454        if (max * count > xhci_ep->max_streams) {
    455455                usb_log_error("Endpoint " XHCI_EP_FMT " supports only %" PRIu32 " streams.",
    456                         XHCI_EP_ARGS(*xhci_ep), xhci_ep->max_streams);
     456                    XHCI_EP_ARGS(*xhci_ep), xhci_ep->max_streams);
    457457                return EINVAL;
    458458        }
Note: See TracChangeset for help on using the changeset viewer.