Ignore:
Timestamp:
2013-07-27T07:49:45Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3aac088
Parents:
2838486
Message:

libusbhost: Remove usb_device_manager.

Functions merged to usb_endpoint_manager.

File:
1 edited

Legend:

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

    r2838486 r423c749  
    5050/** 90% of total bandwidth is available for periodic transfers */
    5151#define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 / 10) * 9)
    52 /** 16 addresses per list */
    53 #define ENDPOINT_LIST_COUNT 8
    5452
    5553typedef size_t (*bw_count_func_t)(usb_speed_t, usb_transfer_type_t, size_t, size_t);
     
    5957/** Endpoint management structure */
    6058typedef struct usb_endpoint_manager {
    61         /** Store endpoint_t instances */
    62         list_t endpoint_lists[ENDPOINT_LIST_COUNT];
     59        struct {
     60                usb_speed_t speed;      /**< Device speed */
     61                bool occupied;          /**< The address is in use. */
     62                list_t endpoint_list;   /**< Store endpoint_t instances */
     63        } devices[USB_ADDRESS_COUNT];
    6364        /** Prevents races accessing lists */
    6465        fibril_mutex_t guard;
     
    6768        /** Use this function to count bw required by EP */
    6869        bw_count_func_t bw_count;
     70        /** Maximum speed allowed. */
     71        usb_speed_t max_speed;
     72        /** The last reserved address */
     73        usb_address_t last_address;
    6974} usb_endpoint_manager_t;
    7075
     
    7479
    7580int usb_endpoint_manager_init(usb_endpoint_manager_t *instance,
    76     size_t available_bandwidth, bw_count_func_t bw_count);
     81    size_t available_bandwidth, bw_count_func_t bw_count, usb_speed_t max_speed);
    7782
    7883int usb_endpoint_manager_register_ep(
     
    98103void usb_endpoint_manager_remove_address(usb_endpoint_manager_t *instance,
    99104    usb_address_t address, ep_remove_callback_t callback, void *arg);
     105
     106int usb_endpoint_manager_request_address(usb_endpoint_manager_t *instance,
     107    usb_address_t *address, bool strict, usb_speed_t speed);
     108
     109int usb_endpoint_manager_release_address(usb_endpoint_manager_t *instance,
     110    usb_address_t address);
     111
     112int usb_endpoint_manager_get_info_by_address(usb_endpoint_manager_t *instance,
     113    usb_address_t address, usb_speed_t *speed);
    100114#endif
    101115/**
Note: See TracChangeset for help on using the changeset viewer.