Changeset a4e26882 in mainline for uspace/drv/bus/usb/xhci/transfers.c


Ignore:
Timestamp:
2017-10-22T16:37:44Z (7 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4594baa
Parents:
2c091a6
Message:

Very rudimentary support for device disconnection.

File:
1 edited

Legend:

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

    r2c091a6 ra4e26882  
    248248}
    249249
     250int xhci_transfer_abort(xhci_transfer_t *transfer)
     251{
     252        usb_transfer_batch_t *batch = &transfer->batch;
     253        batch->error = EAGAIN;
     254        batch->transfered_size = 0;
     255        usb_transfer_batch_finish(batch);
     256        return EOK;
     257}
     258
    250259int xhci_handle_transfer_event(xhci_hc_t* hc, xhci_trb_t* trb)
    251260{
     
    304313        assert(xhci_ep);
    305314
     315        xhci_device_t *xhci_dev = xhci_ep_to_dev(xhci_ep);
     316
     317        /* Offline devices don't schedule transfers other than on EP0. */
     318        if (!xhci_dev->online && xhci_ep->base.target.endpoint) {
     319                return EAGAIN;
     320        }
     321
    306322        const usb_transfer_type_t type = batch->ep->transfer_type;
    307323        assert(type >= 0 && type < ARRAY_SIZE(transfer_handlers));
     
    321337                return err;
    322338
    323         const uint8_t slot_id = xhci_ep_to_dev(xhci_ep)->slot_id;
     339        const uint8_t slot_id = xhci_dev->slot_id;
    324340        const uint8_t target = xhci_endpoint_index(xhci_ep) + 1; /* EP Doorbells start at 1 */
    325341        return hc_ring_doorbell(hc, slot_id, target);
Note: See TracChangeset for help on using the changeset viewer.