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


Ignore:
Timestamp:
2017-10-12T14:07:27Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5976973
Parents:
7e74911
Message:

WIP usbhost refactoring

This commit replaces callbacks with more systematic virtual-like inheritance-like solution. Currently breaks build of HelenOS, but both xhci and usbhost are buildable. More refactoring follows…

File:
1 edited

Legend:

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

    r7e74911 r41924f30  
    3636#include <usb/host/utils/malloc32.h>
    3737#include <usb/debug.h>
     38#include "endpoint.h"
    3839#include "hc.h"
    3940#include "hw_struct/trb.h"
     
    141142                return EINVAL;
    142143        }
    143         if (batch->ep->endpoint != 0 || batch->ep->transfer_type != USB_TRANSFER_CONTROL) {
     144        if (batch->ep->target.endpoint != 0 || batch->ep->transfer_type != USB_TRANSFER_CONTROL) {
    144145                /* This method only works for control transfers. */
    145146                usb_log_error("Attempted to schedule control transfer to non 0 endpoint.");
     
    147148        }
    148149
    149         uint8_t slot_id = batch->ep->hc_data.slot_id;
     150        xhci_endpoint_t *xhci_ep = xhci_endpoint_get(batch->ep);
     151
     152        uint8_t slot_id = xhci_ep->slot_id;
    150153        xhci_trb_ring_t* ring = hc->dcbaa_virt[slot_id].trs[0];
    151154
     
    230233        }
    231234
    232         uint8_t slot_id = batch->ep->hc_data.slot_id;
    233         xhci_trb_ring_t* ring = hc->dcbaa_virt[slot_id].trs[batch->ep->endpoint];
     235        xhci_endpoint_t *xhci_ep = xhci_endpoint_get(batch->ep);
     236        uint8_t slot_id = xhci_ep->slot_id;
     237        xhci_trb_ring_t* ring = hc->dcbaa_virt[slot_id].trs[batch->ep->target.endpoint];
    234238
    235239        xhci_transfer_t *transfer = xhci_transfer_alloc(batch);
Note: See TracChangeset for help on using the changeset viewer.