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/lib/usbhost/include/usb/host/hcd.h

    r7e74911 r41924f30  
    3838
    3939#include <usb/host/endpoint.h>
    40 #include <usb/host/usb_bus.h>
     40#include <usb/host/bus.h>
    4141#include <usb/host/usb_transfer_batch.h>
    4242#include <usb/usb.h>
     
    7171struct hcd {
    7272        /** Endpoint manager. */
    73         usb_bus_t bus;
     73        bus_t *bus;
    7474
    7575        /** Interrupt replacement fibril */
     
    7878        /** Driver implementation */
    7979        hcd_ops_t ops;
     80
    8081        /** Device specific driver data. */
    8182        void * driver_data;
    8283};
    8384
    84 extern void hcd_init(hcd_t *, usb_speed_t, size_t, bw_count_func_t);
     85extern void hcd_init(hcd_t *);
    8586
    8687static inline void hcd_set_implementation(hcd_t *hcd, void *data,
    87     const hcd_ops_t *ops)
     88    const hcd_ops_t *ops, bus_t *bus)
    8889{
    8990        assert(hcd);
     
    9192                hcd->driver_data = data;
    9293                hcd->ops = *ops;
     94                hcd->bus = bus;
    9395        } else {
    9496                memset(&hcd->ops, 0, sizeof(hcd->ops));
Note: See TracChangeset for help on using the changeset viewer.