Changeset 159100a in mainline for uspace/lib
- Timestamp:
- 2011-07-13T22:19:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef9460b
- Parents:
- 3e5c48c9 (diff), 5d36062 (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
- Files:
-
- 5 edited
-
usb/include/usb/classes/hub.h (modified) (1 diff)
-
usbhost/include/usb/host/endpoint.h (modified) (1 diff)
-
usbhost/include/usb/host/usb_endpoint_manager.h (modified) (1 diff)
-
usbhost/src/batch.c (modified) (1 diff)
-
usbhost/src/endpoint.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hub.h
r3e5c48c9 r159100a 119 119 */ 120 120 uint16_t hub_characteristics; 121 #define HUB_CHAR_POWER_PER_PORT_FLAG (1 << 0) 122 #define HUB_CHAR_NO_POWER_SWITCH_FLAG (1 << 1) 121 123 122 124 /** -
uspace/lib/usbhost/include/usb/host/endpoint.h
r3e5c48c9 r159100a 61 61 } endpoint_t; 62 62 63 int endpoint_init(endpoint_t *instance, usb_address_t address,64 usb_ endpoint_t endpoint, usb_direction_t direction,65 usb_transfer_type_t type, usb_speed_t speed,size_t max_packet_size);63 endpoint_t * endpoint_get(usb_address_t address, usb_endpoint_t endpoint, 64 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 65 size_t max_packet_size); 66 66 67 67 void endpoint_destroy(endpoint_t *instance); -
uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
r3e5c48c9 r159100a 82 82 size_t data_size) 83 83 { 84 endpoint_t *ep = malloc(sizeof(endpoint_t)); 85 if (ep == NULL) 84 endpoint_t *ep = endpoint_get( 85 address, endpoint, direction, type, speed, max_packet_size); 86 if (!ep) 86 87 return ENOMEM; 87 88 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); 89 const int ret = 90 usb_endpoint_manager_register_ep(instance, ep, data_size); 96 91 if (ret != EOK) { 97 92 endpoint_destroy(ep); 98 return ret;99 93 } 100 return EOK;94 return ret; 101 95 } 102 96 #endif -
uspace/lib/usbhost/src/batch.c
r3e5c48c9 r159100a 109 109 assert(instance); 110 110 assert(instance->ep); 111 assert(instance->next_step); 111 112 endpoint_release(instance->ep); 112 113 instance->next_step(instance); -
uspace/lib/usbhost/src/endpoint.c
r3e5c48c9 r159100a 39 39 #include <usb/host/endpoint.h> 40 40 41 int endpoint_init(endpoint_t *instance, usb_address_t address,42 usb_ endpoint_t endpoint, usb_direction_t direction,43 usb_transfer_type_t type, usb_speed_t speed,size_t max_packet_size)41 endpoint_t * endpoint_get(usb_address_t address, usb_endpoint_t endpoint, 42 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 43 size_t max_packet_size) 44 44 { 45 assert(instance); 46 instance->address = address; 47 instance->endpoint = endpoint; 48 instance->direction = direction; 49 instance->transfer_type = type; 50 instance->speed = speed; 51 instance->max_packet_size = max_packet_size; 52 instance->toggle = 0; 53 instance->active = false; 54 fibril_mutex_initialize(&instance->guard); 55 fibril_condvar_initialize(&instance->avail); 56 endpoint_clear_hc_data(instance); 57 return EOK; 45 endpoint_t *instance = malloc(sizeof(endpoint_t)); 46 if (instance) { 47 instance->address = address; 48 instance->endpoint = endpoint; 49 instance->direction = direction; 50 instance->transfer_type = type; 51 instance->speed = speed; 52 instance->max_packet_size = max_packet_size; 53 instance->toggle = 0; 54 instance->active = false; 55 fibril_mutex_initialize(&instance->guard); 56 fibril_condvar_initialize(&instance->avail); 57 endpoint_clear_hc_data(instance); 58 } 59 return instance; 58 60 } 59 61 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.
