Ignore:
Timestamp:
2017-10-21T20:52:56Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
766043c
Parents:
74b852b
Message:

usbhost refactoring: let transfer_batch be initialized by bus

Currently makes older HCs fail, work in progress.

File:
1 edited

Legend:

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

    r74b852b r5fd9c30  
    3333 *
    3434 * The purpose of this structure is to keep information about connected devices
    35  * and enpoints, manage available bandwidth and the toggle bit flipping.
     35 * and endpoints, manage available bandwidth and the toggle bit flipping.
    3636 *
    3737 * The generic implementation is provided for USB 1 and 2 in usb2_bus.c. Some
     
    5353typedef struct bus bus_t;
    5454typedef struct ddf_fun ddf_fun_t;
     55typedef struct usb_transfer_batch usb_transfer_batch_t;
    5556
    5657typedef struct device {
     
    8586        int (*release_endpoint)(bus_t *, endpoint_t *);
    8687        endpoint_t *(*find_endpoint)(bus_t *, usb_target_t, usb_direction_t);
     88        void (*destroy_endpoint)(endpoint_t *);                 /**< Optional */
     89        bool (*endpoint_get_toggle)(endpoint_t *);              /**< Optional */
     90        void (*endpoint_set_toggle)(endpoint_t *, bool);        /**< Optional */
    8791
    8892        int (*request_address)(bus_t *, usb_address_t*, bool, usb_speed_t);
     
    9397        size_t (*count_bw) (endpoint_t *, size_t);
    9498
    95         /* Endpoint ops, optional (have generic fallback) */
    96         void (*destroy_endpoint)(endpoint_t *);
    97         bool (*endpoint_get_toggle)(endpoint_t *);
    98         void (*endpoint_set_toggle)(endpoint_t *, bool);
     99        usb_transfer_batch_t *(*create_batch)(bus_t *, endpoint_t *); /**< Optional */
     100        void (*destroy_batch)(usb_transfer_batch_t *);  /**< Optional */
    99101} bus_ops_t;
    100102
     
    135137int bus_release_address(bus_t *, usb_address_t);
    136138
     139
    137140static inline int bus_reserve_default_address(bus_t *bus, usb_speed_t speed) {
    138141        usb_address_t addr = USB_ADDRESS_DEFAULT;
Note: See TracChangeset for help on using the changeset viewer.