Changeset 41924f30 in mainline for uspace/drv/bus/usb/xhci/endpoint.h


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/endpoint.h

    r7e74911 r41924f30  
    4343#include <usb/host/hcd.h>
    4444
     45typedef struct xhci_endpoint xhci_endpoint_t;
     46typedef struct xhci_bus xhci_bus_t;
     47
    4548enum {
    4649        EP_TYPE_INVALID = 0,
     
    5659/** Connector structure linking endpoint context to the endpoint. */
    5760typedef struct xhci_endpoint {
     61        endpoint_t base;        /**< Inheritance. Keep this first. */
     62
    5863        uint32_t slot_id;
    5964} xhci_endpoint_t;
    6065
    61 int endpoint_init(hcd_t *hcd, endpoint_t *ep);
    62 void endpoint_fini(hcd_t *hcd, endpoint_t *ep);
     66int xhci_endpoint_init(xhci_endpoint_t *, xhci_bus_t *);
     67void xhci_endpoint_fini(xhci_endpoint_t *);
    6368
    64 static inline xhci_endpoint_t * endpoint_get(const endpoint_t *ep)
     69static inline xhci_endpoint_t * xhci_endpoint_get(endpoint_t *ep)
    6570{
    6671        assert(ep);
    67         return ep->hc_data.data;
     72        return (xhci_endpoint_t *) ep;
    6873}
    6974
Note: See TracChangeset for help on using the changeset viewer.