Changeset 26e7d6d in mainline for uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
r3842a955 r26e7d6d 38 38 */ 39 39 #ifndef LIBUSBHOST_HOST_USB_ENDPOINT_MANAGER_H 40 #define LIBUSBHOST_HOST_ YSB_ENDPOINT_MANAGER_H40 #define LIBUSBHOST_HOST_USB_ENDPOINT_MANAGER_H 41 41 42 42 #include <stdlib.h> … … 52 52 hash_table_t ep_table; 53 53 fibril_mutex_t guard; 54 fibril_condvar_t change;55 54 size_t free_bw; 55 size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t); 56 56 } usb_endpoint_manager_t; 57 57 … … 60 60 61 61 int usb_endpoint_manager_init(usb_endpoint_manager_t *instance, 62 size_t available_bandwidth); 62 size_t available_bandwidth, 63 size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t)); 63 64 64 65 void usb_endpoint_manager_destroy(usb_endpoint_manager_t *instance); … … 77 78 usb_endpoint_manager_t *instance, usb_target_t target, const uint8_t *data); 78 79 80 /** Wrapper combining allocation and insertion */ 79 81 static inline int usb_endpoint_manager_add_ep(usb_endpoint_manager_t *instance, 80 82 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, … … 82 84 size_t data_size) 83 85 { 84 endpoint_t *ep = malloc(sizeof(endpoint_t)); 85 if (ep == NULL) 86 endpoint_t *ep = endpoint_get( 87 address, endpoint, direction, type, speed, max_packet_size); 88 if (!ep) 86 89 return ENOMEM; 87 90 88 int ret = endpoint_init(ep, address, endpoint, direction, type, speed, 89 max_packet_size); 90 if (ret != EOK) { 91 free(ep); 92 return ret; 93 } 94 95 ret = usb_endpoint_manager_register_ep(instance, ep, data_size); 91 const int ret = 92 usb_endpoint_manager_register_ep(instance, ep, data_size); 96 93 if (ret != EOK) { 97 94 endpoint_destroy(ep); 98 return ret;99 95 } 100 return EOK;96 return ret; 101 97 } 102 98 #endif
Note:
See TracChangeset
for help on using the changeset viewer.