Changeset 0ee999d in mainline
- Timestamp:
- 2013-08-20T12:24:16Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5856b627
- Parents:
- 5dad73d
- Location:
- uspace/lib/usbhost
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/endpoint.h
r5dad73d r0ee999d 67 67 /** Signals change of active status. */ 68 68 fibril_condvar_t avail; 69 /** High speed TT data */ 70 struct { 71 usb_address_t address; 72 unsigned port; 73 } tt; 69 74 /** Optional device specific data. */ 70 75 struct { … … 80 85 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint, 81 86 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 82 size_t max_packet_size, size_t bw); 87 size_t max_packet_size, size_t bw, usb_address_t tt_address, 88 unsigned tt_port); 83 89 void endpoint_destroy(endpoint_t *instance); 84 90 -
uspace/lib/usbhost/include/usb/host/hcd.h
r5dad73d r0ee999d 76 76 hcd->ep_add_hook = add_hook; 77 77 hcd->ep_remove_hook = rem_hook; 78 79 78 } 80 79 … … 91 90 92 91 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir, 93 usb_transfer_type_t type, size_t max_packet_size, size_t size); 92 usb_transfer_type_t type, size_t max_packet_size, size_t size, 93 usb_address_t tt_address, unsigned tt_port); 94 94 95 95 int hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir); -
uspace/lib/usbhost/include/usb/host/usb_endpoint_manager.h
r5dad73d r0ee999d 93 93 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 94 94 usb_transfer_type_t type, size_t max_packet_size, size_t data_size, 95 ep_add_callback_t callback, void *arg); 95 ep_add_callback_t callback, void *arg, usb_address_t tt_address, 96 unsigned tt_port); 96 97 97 98 int usb_endpoint_manager_remove_ep(usb_endpoint_manager_t *instance, … … 108 109 usb_address_t *address, bool strict, usb_speed_t speed); 109 110 110 int usb_endpoint_manager_get_ info_by_address(usb_endpoint_manager_t *instance,111 int usb_endpoint_manager_get_speed(usb_endpoint_manager_t *instance, 111 112 usb_address_t address, usb_speed_t *speed); 112 113 #endif -
uspace/lib/usbhost/src/ddf_helpers.c
r5dad73d r0ee999d 114 114 115 115 return hcd_add_ep(hcd, target, direction, transfer_type, 116 max_packet_size, size );116 max_packet_size, size, dev->tt_address, dev->port); 117 117 } 118 118 … … 391 391 (d->device_version & 0xff)); 392 392 393 /* Next, without release number. */ 393 /* Next, without release number. */ 394 394 ADD_MATCHID_OR_RETURN(l, 90, "usb&vendor=%#04x&product=%#04x", 395 395 d->vendor_id, d->product_id); … … 453 453 454 454 /* This checks whether the default address is reserved and gets speed */ 455 int ret = usb_endpoint_manager_get_ info_by_address(&hcd->ep_manager,455 int ret = usb_endpoint_manager_get_speed(&hcd->ep_manager, 456 456 USB_ADDRESS_DEFAULT, &speed); 457 457 if (ret != EOK) { … … 473 473 }}; 474 474 475 const usb_address_t tt_address = hub ? hub->tt_address : -1; 476 475 477 /* Add default pipe on default address */ 476 478 ret = hcd_add_ep(hcd, 477 479 default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, 478 CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE); 480 CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 481 tt_address, port); 479 482 480 483 if (ret != EOK) { … … 501 504 /* Register EP on the new address */ 502 505 ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, 503 desc.max_packet_size, desc.max_packet_size );506 desc.max_packet_size, desc.max_packet_size, tt_address, port); 504 507 if (ret != EOK) { 505 508 hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH); -
uspace/lib/usbhost/src/endpoint.c
r5dad73d r0ee999d 50 50 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint, 51 51 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 52 size_t max_packet_size, size_t bw )52 size_t max_packet_size, size_t bw, usb_address_t tt_address, unsigned tt_p) 53 53 { 54 54 endpoint_t *instance = malloc(sizeof(endpoint_t)); … … 63 63 instance->toggle = 0; 64 64 instance->active = false; 65 instance->tt.address = tt_address; 66 instance->tt.port = tt_p; 65 67 instance->hc_data.data = NULL; 66 68 instance->hc_data.toggle_get = NULL; -
uspace/lib/usbhost/src/hcd.c
r5dad73d r0ee999d 130 130 131 131 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir, 132 usb_transfer_type_t type, size_t max_packet_size, size_t size) 132 usb_transfer_type_t type, size_t max_packet_size, size_t size, 133 usb_address_t tt_address, unsigned tt_port) 133 134 { 134 135 assert(hcd); 135 136 return usb_endpoint_manager_add_ep(&hcd->ep_manager, target.address, 136 137 target.endpoint, dir, type, max_packet_size, size, register_helper, 137 hcd );138 hcd, tt_address, tt_port); 138 139 } 139 140 -
uspace/lib/usbhost/src/usb_endpoint_manager.c
r5dad73d r0ee999d 287 287 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 288 288 usb_transfer_type_t type, size_t max_packet_size, size_t data_size, 289 ep_add_callback_t callback, void *arg) 289 ep_add_callback_t callback, void *arg, usb_address_t tt_address, 290 unsigned tt_port) 290 291 { 291 292 assert(instance); … … 320 321 } 321 322 322 ep = endpoint_create( 323 address, endpoint, direction, type, speed, max_packet_size, bw);323 ep = endpoint_create(address, endpoint, direction, type, speed, 324 max_packet_size, bw, tt_address, tt_port); 324 325 if (!ep) { 325 326 fibril_mutex_unlock(&instance->guard); … … 484 485 * @return Error code. 485 486 */ 486 int usb_endpoint_manager_get_ info_by_address(usb_endpoint_manager_t *instance,487 int usb_endpoint_manager_get_speed(usb_endpoint_manager_t *instance, 487 488 usb_address_t address, usb_speed_t *speed) 488 489 {
Note:
See TracChangeset
for help on using the changeset viewer.