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


Ignore:
Timestamp:
2017-10-13T12:32:57Z (7 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
063dfe8
Parents:
366e9b6
Message:

Refactored XHCI bus to hold devices instead of endpoints. Added middle layer to keep track of endpoints within devices.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/endpoint.h

    r366e9b6 rc10daa8  
    4343#include <usb/host/hcd.h>
    4444
     45typedef struct xhci_device xhci_device_t;
    4546typedef struct xhci_endpoint xhci_endpoint_t;
    4647typedef struct xhci_bus xhci_bus_t;
     48
     49#define XHCI_DEVICE_MAX_ENDPOINTS 32
    4750
    4851enum {
     
    6164        endpoint_t base;        /**< Inheritance. Keep this first. */
    6265
     66        xhci_device_t *device;
     67} xhci_endpoint_t;
     68
     69typedef struct xhci_device {
     70        usb_address_t address;
     71
    6372        uint32_t slot_id;
    64 } xhci_endpoint_t;
     73
     74        xhci_endpoint_t *endpoints[XHCI_DEVICE_MAX_ENDPOINTS];
     75        uint8_t active_endpoint_count;
     76} xhci_device_t;
    6577
    6678int xhci_endpoint_init(xhci_endpoint_t *, xhci_bus_t *);
    6779void xhci_endpoint_fini(xhci_endpoint_t *);
     80
     81int xhci_device_init(xhci_device_t *, xhci_bus_t *);
     82void xhci_device_fini(xhci_device_t *);
     83
     84int xhci_device_add_endpoint(xhci_device_t *, xhci_endpoint_t *);
     85int xhci_device_remove_endpoint(xhci_device_t *, xhci_endpoint_t *);
     86xhci_endpoint_t * xhci_device_get_endpoint(xhci_device_t *, usb_endpoint_t);
    6887
    6988static inline xhci_endpoint_t * xhci_endpoint_get(endpoint_t *ep)
Note: See TracChangeset for help on using the changeset viewer.