Changeset 8033f89 in mainline for uspace/drv/bus/usb/xhci/transfers.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/transfers.c

    re546142 r8033f89  
    151151        TRB_CTRL_SET_IDT(*trb_setup, 1);
    152152        TRB_CTRL_SET_TRB_TYPE(*trb_setup, XHCI_TRB_TYPE_SETUP_STAGE);
    153         TRB_CTRL_SET_TRT(*trb_setup, get_transfer_type(trb_setup, setup->request_type, setup->length));
     153        TRB_CTRL_SET_TRT(*trb_setup,
     154            get_transfer_type(trb_setup, setup->request_type, setup->length));
    154155
    155156        /* Data stage */
     
    178179        xhci_trb_clean(trb_status);
    179180
    180         // FIXME: Evaluate next TRB? 4.12.3
    181         // TRB_CTRL_SET_ENT(*trb_status, 1);
    182 
    183181        TRB_CTRL_SET_IOC(*trb_status, 1);
    184182        TRB_CTRL_SET_TRB_TYPE(*trb_status, XHCI_TRB_TYPE_STATUS_STAGE);
    185         TRB_CTRL_SET_DIR(*trb_status, get_status_direction_flag(trb_setup, setup->request_type, setup->length));
     183        TRB_CTRL_SET_DIR(*trb_status, get_status_direction_flag(trb_setup,
     184            setup->request_type, setup->length));
    186185
    187186        // Issue a Configure Endpoint command, if needed.
     
    192191        }
    193192
    194         return xhci_trb_ring_enqueue_multiple(get_ring(transfer), trbs, trbs_used, &transfer->interrupt_trb_phys);
     193        return xhci_trb_ring_enqueue_multiple(get_ring(transfer), trbs,
     194            trbs_used, &transfer->interrupt_trb_phys);
    195195}
    196196
     
    303303                /* We are received transfer pointer instead - work with that */
    304304                transfer = (xhci_transfer_t *) addr;
    305                 xhci_trb_ring_update_dequeue(get_ring(transfer), transfer->interrupt_trb_phys);
     305                xhci_trb_ring_update_dequeue(get_ring(transfer),
     306                    transfer->interrupt_trb_phys);
    306307                batch = &transfer->batch;
    307308
     
    453454         * the Reset Endpoint command.
    454455         */
    455         if (batch->ep->transfer_type == USB_TRANSFER_CONTROL && batch->dir == USB_DIRECTION_OUT) {
     456        if (batch->ep->transfer_type == USB_TRANSFER_CONTROL
     457            && batch->dir == USB_DIRECTION_OUT) {
    456458                const usb_device_request_setup_packet_t *request = &batch->setup.packet;
    457459                if (request->request == USB_DEVREQ_CLEAR_FEATURE
     
    460462                        const uint16_t index = uint16_usb2host(request->index);
    461463                        const usb_endpoint_t ep_num = index & 0xf;
    462                         const usb_direction_t dir = (index >> 7) ? USB_DIRECTION_IN : USB_DIRECTION_OUT;
     464                        const usb_direction_t dir = (index >> 7)
     465                            ? USB_DIRECTION_IN
     466                            : USB_DIRECTION_OUT;
    463467                        endpoint_t *halted_ep = bus_find_endpoint(&xhci_dev->base, ep_num, dir);
    464468                        if (halted_ep) {
    465469                                /*
    466                                  * TODO: Find out how to come up with stream_id. It
    467                                  * might be possible that we have to clear all of them.
     470                                 * TODO: Find out how to come up with stream_id. It might be
     471                                 * possible that we have to clear all of them.
    468472                                 */
    469473                                xhci_endpoint_clear_halt(xhci_endpoint_get(halted_ep), 0);
    470474                                endpoint_del_ref(halted_ep);
    471475                        } else {
    472                                 usb_log_warning("Device(%u): Resetting unregistered endpoint %u %s.", xhci_dev->base.address, ep_num, usb_str_direction(dir));
     476                                usb_log_warning("Device(%u): Resetting unregistered endpoint"
     477                                        " %u %s.", xhci_dev->base.address, ep_num,
     478                                        usb_str_direction(dir));
    473479                        }
    474480                }
     
    487493
    488494        hc_ring_ep_doorbell(xhci_ep, batch->target.stream);
    489 
    490         /* After the critical section, the transfer can already be finished or aborted. */
    491         transfer = NULL; batch = NULL;
    492495        fibril_mutex_unlock(&ep->guard);
    493496        return EOK;
Note: See TracChangeset for help on using the changeset viewer.