Changeset 423c749 in mainline for uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
- Timestamp:
- 2013-07-27T07:49:45Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3aac088
- Parents:
- 2838486
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
r2838486 r423c749 50 50 /** 90% of total bandwidth is available for periodic transfers */ 51 51 #define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 / 10) * 9) 52 /** 16 addresses per list */53 #define ENDPOINT_LIST_COUNT 854 52 55 53 typedef size_t (*bw_count_func_t)(usb_speed_t, usb_transfer_type_t, size_t, size_t); … … 59 57 /** Endpoint management structure */ 60 58 typedef 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]; 63 64 /** Prevents races accessing lists */ 64 65 fibril_mutex_t guard; … … 67 68 /** Use this function to count bw required by EP */ 68 69 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; 69 74 } usb_endpoint_manager_t; 70 75 … … 74 79 75 80 int 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); 77 82 78 83 int usb_endpoint_manager_register_ep( … … 98 103 void usb_endpoint_manager_remove_address(usb_endpoint_manager_t *instance, 99 104 usb_address_t address, ep_remove_callback_t callback, void *arg); 105 106 int usb_endpoint_manager_request_address(usb_endpoint_manager_t *instance, 107 usb_address_t *address, bool strict, usb_speed_t speed); 108 109 int usb_endpoint_manager_release_address(usb_endpoint_manager_t *instance, 110 usb_address_t address); 111 112 int usb_endpoint_manager_get_info_by_address(usb_endpoint_manager_t *instance, 113 usb_address_t address, usb_speed_t *speed); 100 114 #endif 101 115 /**
Note:
See TracChangeset
for help on using the changeset viewer.