Changeset 423c749 in mainline for uspace/lib/usbhost/include/usb
- 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
- Location:
- uspace/lib/usbhost/include/usb/host
- Files:
-
- 1 deleted
- 2 edited
-
hcd.h (modified) (2 diffs)
-
usb_device_manager.h (deleted)
-
usb_endpoint_manager.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/hcd.h
r2838486 r423c749 41 41 #include <usbhc_iface.h> 42 42 43 #include <usb/host/usb_device_manager.h>44 43 #include <usb/host/usb_endpoint_manager.h> 45 44 #include <usb/host/usb_transfer_batch.h> … … 53 52 /** Generic host controller driver structure. */ 54 53 struct hcd { 55 /** Device manager storing handles and addresses. */56 usb_device_manager_t dev_manager;57 54 /** Endpoint manager. */ 58 55 usb_endpoint_manager_t ep_manager; -
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.
