Ignore:
Timestamp:
2018-01-07T01:01:42Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63431db
Parents:
9efad54
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:41)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-07 01:01:42)
Message:

usbhost: manage endpoints by library + get/set_toggle → reset_toggle

That simplifies things A LOT. Now you can find endpoints for device in
an array inside device. This array is managed automatically in
register/unregister endpoint. HC drivers still needs to write to it when
setting up/tearing down the device.

Sorry for these two changes being in one commit, but splitting them
would be simply more work for no benefit.

File:
1 edited

Legend:

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

    r9efad54 r56257ba  
    7676        usb_speed_t speed;
    7777        usb_address_t address;
     78        endpoint_t *endpoints [USB_ENDPOINT_MAX];
    7879
    7980        /* Managing bus */
     
    101102        int (*reserve_default_address)(bus_t *, usb_speed_t);
    102103        int (*release_default_address)(bus_t *);
    103         int (*reset_toggle)(bus_t *, usb_target_t, toggle_reset_mode_t);
    104104
    105105        /* Operations on device */
     
    108108        int (*device_online)(device_t *);                       /**< Optional */
    109109        int (*device_offline)(device_t *);                      /**< Optional */
    110         endpoint_t *(*device_find_endpoint)(device_t*, usb_target_t, usb_direction_t);
    111110        endpoint_t *(*endpoint_create)(device_t *, const usb_endpoint_descriptors_t *);
    112111
     
    115114        int (*endpoint_unregister)(endpoint_t *);
    116115        void (*endpoint_destroy)(endpoint_t *);                 /**< Optional */
    117         bool (*endpoint_get_toggle)(endpoint_t *);              /**< Optional */
    118         void (*endpoint_set_toggle)(endpoint_t *, bool);        /**< Optional */
    119         ssize_t (*endpoint_count_bw) (endpoint_t *, size_t);
     116        void (*endpoint_toggle_reset)(endpoint_t *);            /**< Optional */
     117        ssize_t (*endpoint_count_bw) (endpoint_t *, size_t);    /**< Optional */
    120118        usb_transfer_batch_t *(*batch_create)(endpoint_t *);    /**< Optional */
    121119
     
    164162
    165163int bus_endpoint_add(device_t *, const usb_endpoint_descriptors_t *, endpoint_t **);
    166 endpoint_t *bus_find_endpoint(device_t *, usb_target_t, usb_direction_t);
     164endpoint_t *bus_find_endpoint(device_t *, usb_endpoint_t);
    167165int bus_endpoint_remove(endpoint_t *);
    168166
     
    170168int bus_release_default_address(bus_t *);
    171169
    172 int bus_reset_toggle(bus_t *, usb_target_t, bool);
    173 
    174170#endif
    175171/**
Note: See TracChangeset for help on using the changeset viewer.