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


Ignore:
Timestamp:
2018-01-20T15:32:12Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
abb5d08
Parents:
129b821f
Message:

xhci: move all real functionality from bus to device/endpoint/transfers

File:
1 edited

Legend:

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

    r129b821f r682c9354  
    416416};
    417417
    418 int xhci_transfer_schedule(xhci_hc_t *hc, usb_transfer_batch_t *batch)
    419 {
    420         assert(hc);
     418/**
     419 * Schedule a batch for xHC.
     420 *
     421 * Bus callback.
     422 */
     423int xhci_transfer_schedule(usb_transfer_batch_t *batch)
     424{
    421425        endpoint_t *ep = batch->ep;
    422426
     427        xhci_hc_t *hc = bus_to_hc(endpoint_get_bus(batch->ep));
    423428        xhci_transfer_t *transfer = xhci_transfer_from_batch(batch);
    424429        xhci_endpoint_t *xhci_ep = xhci_endpoint_get(ep);
    425430        xhci_device_t *xhci_dev = xhci_ep_to_dev(xhci_ep);
     431
     432        if (!batch->target.address) {
     433                usb_log_error("Attempted to schedule transfer to address 0.");
     434                return EINVAL;
     435        }
    426436
    427437        // FIXME: find a better way to check if the ring is not initialized
Note: See TracChangeset for help on using the changeset viewer.