Ignore:
Timestamp:
2018-01-25T02:05:57Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
296d22fc
Parents:
b357377
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-25 01:52:13)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-25 02:05:57)
Message:

usb2_bus: no longer be a bus

As the number of implemented functions got to 3, it's not so beneficial
to inherit usb2 bus to get the functionality. Overall, four trampolines
needed to be added, which is an acceptable number.

Now, the usb2_bus has become a usb2_bus_helper, to be used as
a companion to the common bus.

This is mostly a preparation to remove the runtime binding of the bus
methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/usb2_bus.h

    rb357377 rd369b3b  
    4747typedef struct endpoint endpoint_t;
    4848
    49 /** Endpoint management structure */
    50 typedef struct usb2_bus {
    51         bus_t base;                     /**< Inheritance - keep this first */
    52 
     49/** Endpoint and bandwidth management structure */
     50typedef struct usb2_bus_helper {
    5351        /** Map of occupied addresses */
    5452        bool address_occupied [USB_ADDRESS_COUNT];
     
    6159        /* Configured bandwidth accounting */
    6260        const bandwidth_accounting_t *bw_accounting;
    63 } usb2_bus_t;
     61} usb2_bus_helper_t;
    6462
    65 extern const bus_ops_t usb2_bus_ops;
     63extern void usb2_bus_helper_init(usb2_bus_helper_t *, const bandwidth_accounting_t *);
    6664
    67 extern void usb2_bus_init(usb2_bus_t *, const bandwidth_accounting_t *);
     65extern int usb2_bus_device_enumerate(usb2_bus_helper_t *, device_t *);
     66extern int usb2_bus_endpoint_register(usb2_bus_helper_t *, endpoint_t *);
     67extern void usb2_bus_endpoint_unregister(usb2_bus_helper_t *, endpoint_t *);
    6868
    6969#endif
Note: See TracChangeset for help on using the changeset viewer.