Changeset f29931c in mainline
- Timestamp:
- 2012-12-16T14:53:34Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4daee7a
- Parents:
- 2f87aa6
- Location:
- uspace/lib/usbhost
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/hcd.h
r2f87aa6 rf29931c 46 46 typedef struct hcd hcd_t; 47 47 48 typedef int (*schedule_hook_t)(hcd_t *, usb_transfer_batch_t *); 49 typedef int (*ep_add_hook_t)(hcd_t *, endpoint_t *); 50 typedef void (*ep_remove_hook_t)(hcd_t *, endpoint_t *); 51 48 52 /** Generic host controller driver structure. */ 49 53 struct hcd { … … 56 60 void *private_data; 57 61 /** Transfer scheduling, implement in device driver. */ 58 int (*schedule)(hcd_t *, usb_transfer_batch_t *);62 schedule_hook_t schedule; 59 63 /** Hook called upon registering new endpoint. */ 60 int (*ep_add_hook)(hcd_t *, endpoint_t *);64 ep_add_hook_t ep_add_hook; 61 65 /** Hook called upon removing of an endpoint. */ 62 void (*ep_remove_hook)(hcd_t *, endpoint_t *);66 ep_remove_hook_t ep_remove_hook; 63 67 }; 64 68 -
uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
r2f87aa6 rf29931c 53 53 #define ENDPOINT_LIST_COUNT 8 54 54 55 typedef size_t (*bw_count_func_t)(usb_speed_t, usb_transfer_type_t, size_t, size_t); 56 typedef void (*ep_remove_callback_t)(endpoint_t *, void *); 57 typedef int (*ep_add_callback_t)(endpoint_t *, void *); 58 55 59 /** Endpoint management structure */ 56 60 typedef struct usb_endpoint_manager { … … 62 66 size_t free_bw; 63 67 /** Use this function to count bw required by EP */ 64 size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t);68 bw_count_func_t bw_count; 65 69 } usb_endpoint_manager_t; 70 66 71 67 72 size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type, … … 69 74 70 75 int usb_endpoint_manager_init(usb_endpoint_manager_t *instance, 71 size_t available_bandwidth, 72 size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t)); 76 size_t available_bandwidth, bw_count_func_t bw_count); 73 77 74 78 void usb_endpoint_manager_reset_eps_if_need(usb_endpoint_manager_t *instance, … … 85 89 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 86 90 usb_transfer_type_t type, usb_speed_t speed, size_t max_packet_size, 87 size_t data_size, int (*callback)(endpoint_t *, void *), void *arg);91 size_t data_size, ep_add_callback_t callback, void *arg); 88 92 89 93 int usb_endpoint_manager_remove_ep(usb_endpoint_manager_t *instance, 90 94 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 91 void (*callback)(endpoint_t *, void *), void *arg);95 ep_remove_callback_t callback, void *arg); 92 96 93 97 void usb_endpoint_manager_remove_address(usb_endpoint_manager_t *instance, 94 usb_address_t address, void (*callback)(endpoint_t *, void *), void *arg);98 usb_address_t address, ep_remove_callback_t callback, void *arg); 95 99 #endif 96 100 /** -
uspace/lib/usbhost/src/usb_endpoint_manager.c
r2f87aa6 rf29931c 318 318 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 319 319 usb_transfer_type_t type, usb_speed_t speed, size_t max_packet_size, 320 size_t data_size, int (*callback)(endpoint_t *, void *), void *arg)320 size_t data_size, ep_add_callback_t callback, void *arg) 321 321 { 322 322 assert(instance);
Note:
See TracChangeset
for help on using the changeset viewer.