Changeset dcaf819 in mainline for uspace/lib/usb/include
- Timestamp:
- 2011-04-06T22:33:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a7e5b4
- Parents:
- 6bf9bc4 (diff), 87305bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib/usb/include/usb/host
- Files:
-
- 1 added
- 2 edited
- 1 moved
-
batch.h (modified) (3 diffs)
-
device_keeper.h (modified) (3 diffs)
-
endpoint.h (added)
-
usb_endpoint_manager.h (moved) (moved from uspace/lib/usb/include/usb/host/bandwidth.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/host/batch.h
r6bf9bc4 rdcaf819 39 39 #include <usbhc_iface.h> 40 40 #include <usb/usb.h> 41 #include <usb/host/endpoint.h> 41 42 42 43 typedef struct usb_transfer_batch usb_transfer_batch_t; … … 60 61 ddf_fun_t *fun; 61 62 void *arg; 63 endpoint_t *ep; 62 64 void *private_data; 63 65 }; … … 78 80 void *arg, 79 81 ddf_fun_t *fun, 82 endpoint_t *ep, 80 83 void *private_data 81 84 ); -
uspace/lib/usb/include/usb/host/device_keeper.h
r6bf9bc4 rdcaf819 40 40 #ifndef LIBUSB_HOST_DEVICE_KEEPER_H 41 41 #define LIBUSB_HOST_DEVICE_KEEPER_H 42 43 #include <adt/list.h> 42 44 #include <devman.h> 43 45 #include <fibril_synch.h> 44 46 #include <usb/usb.h> 47 #include <usb/host/endpoint.h> 45 48 46 49 /** Number of USB address for array dimensions. */ … … 51 54 usb_speed_t speed; 52 55 bool occupied; 56 link_t endpoints; 53 57 uint16_t control_used; 54 uint16_t toggle_status[2];55 58 devman_handle_t handle; 56 59 }; … … 68 71 void usb_device_keeper_init(usb_device_keeper_t *instance); 69 72 70 void usb_device_keeper_reserve_default_address(usb_device_keeper_t *instance, 71 usb_speed_t speed); 73 void usb_device_keeper_add_ep( 74 usb_device_keeper_t *instance, usb_address_t address, endpoint_t *ep); 75 76 void usb_device_keeper_reserve_default_address( 77 usb_device_keeper_t *instance, usb_speed_t speed); 72 78 73 79 void usb_device_keeper_release_default_address(usb_device_keeper_t *instance); 74 80 75 81 void usb_device_keeper_reset_if_need(usb_device_keeper_t *instance, 76 usb_target_t target, 77 const uint8_t *setup_data); 78 79 int usb_device_keeper_get_toggle(usb_device_keeper_t *instance, 80 usb_target_t target, usb_direction_t direction); 81 82 int usb_device_keeper_set_toggle(usb_device_keeper_t *instance, 83 usb_target_t target, usb_direction_t direction, bool toggle); 82 usb_target_t target, const uint8_t *setup_data); 84 83 85 84 usb_address_t device_keeper_get_free_address(usb_device_keeper_t *instance, -
uspace/lib/usb/include/usb/host/usb_endpoint_manager.h
r6bf9bc4 rdcaf819 37 37 * This structure shall simplify the management. 38 38 */ 39 #ifndef LIBUSB_HOST_ BANDWIDTH_H40 #define LIBUSB_HOST_ BANDWIDTH_H39 #ifndef LIBUSB_HOST_USB_ENDPOINT_MANAGER_H 40 #define LIBUSB_HOST_YSB_ENDPOINT_MANAGER_H 41 41 42 42 #include <adt/hash_table.h> 43 43 #include <fibril_synch.h> 44 44 #include <usb/usb.h> 45 #include <usb/host/endpoint.h> 45 46 46 47 #define BANDWIDTH_TOTAL_USB11 12000000 47 48 #define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 / 10) * 9) 48 49 49 typedef struct bandwidth{50 hash_table_t reserved;50 typedef struct usb_endpoint_manager { 51 hash_table_t ep_table; 51 52 fibril_mutex_t guard; 52 size_t free;53 size_t (*usage_fnc)(usb_speed_t, usb_transfer_type_t, size_t, size_t);54 } bandwidth_t;53 fibril_condvar_t change; 54 size_t free_bw; 55 } usb_endpoint_manager_t; 55 56 56 57 size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type, 57 58 size_t size, size_t max_packet_size); 58 59 59 int bandwidth_init(bandwidth_t *instance, size_t bandwidth,60 size_t (*usage_fnc)(usb_speed_t, usb_transfer_type_t, size_t, size_t));60 int usb_endpoint_manager_init(usb_endpoint_manager_t *instance, 61 size_t available_bandwidth); 61 62 62 void bandwidth_destroy(bandwidth_t *instance);63 void usb_endpoint_manager_destroy(usb_endpoint_manager_t *instance); 63 64 64 int bandwidth_reserve(bandwidth_t *instance, usb_address_t address, 65 usb_endpoint_t endpoint, usb_direction_t direction, usb_speed_t speed, 66 usb_transfer_type_t transfer_type, size_t max_packet_size, size_t size, 67 unsigned interval); 65 int usb_endpoint_manager_register_ep(usb_endpoint_manager_t *instance, 66 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 67 endpoint_t *ep, size_t data_size); 68 68 69 int bandwidth_release(bandwidth_t *instance, usb_address_t address, 70 usb_endpoint_t endpoint, usb_direction_t direction); 69 int usb_endpoint_manager_register_ep_wait(usb_endpoint_manager_t *instance, 70 usb_address_t address, usb_endpoint_t ep, usb_direction_t direction, 71 void *data, void (*data_remove_callback)(void* data, void* arg), void *arg, 72 size_t bw); 71 73 72 int bandwidth_use(bandwidth_t *instance, usb_address_t address,73 usb_ endpoint_t endpoint, usb_direction_t direction, size_t bw);74 int usb_endpoint_manager_unregister_ep(usb_endpoint_manager_t *instance, 75 usb_address_t address, usb_endpoint_t ep, usb_direction_t direction); 74 76 75 int bandwidth_free(bandwidth_t *instance, usb_address_t address, 76 usb_endpoint_t endpoint, usb_direction_t direction); 77 endpoint_t * usb_endpoint_manager_get_ep(usb_endpoint_manager_t *instance, 78 usb_address_t address, usb_endpoint_t ep, usb_direction_t direction, 79 size_t *bw); 77 80 78 81 #endif … … 80 83 * @} 81 84 */ 85
Note:
See TracChangeset
for help on using the changeset viewer.
