Changeset 4e732f1a in mainline for uspace/lib/usbhost
- Timestamp:
- 2014-01-24T02:10:16Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 42de21a
- Parents:
- 3de7a62
- Location:
- uspace/lib/usbhost
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/endpoint.h
r3de7a62 r4e732f1a 57 57 /** Maximum size of data packets. */ 58 58 size_t max_packet_size; 59 /** Additional opportunities per uframe */ 60 unsigned packets; 59 61 /** Necessary bandwidth. */ 60 62 size_t bandwidth; … … 85 87 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint, 86 88 usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed, 87 size_t max_packet_size, size_t bw, usb_address_t tt_address,88 u nsigned tt_port);89 size_t max_packet_size, unsigned packets, size_t bw, 90 usb_address_t tt_address, unsigned tt_port); 89 91 void endpoint_destroy(endpoint_t *instance); 90 92 -
uspace/lib/usbhost/include/usb/host/hcd.h
r3de7a62 r4e732f1a 109 109 110 110 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir, 111 usb_transfer_type_t type, size_t max_packet_size, size_t size,112 usb_address_t tt_address, unsigned tt_port);111 usb_transfer_type_t type, size_t max_packet_size, unsigned packets, 112 size_t size, usb_address_t tt_address, unsigned tt_port); 113 113 114 114 int hcd_remove_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir); -
uspace/lib/usbhost/include/usb/host/usb_bus.h
r3de7a62 r4e732f1a 97 97 int usb_bus_add_ep(usb_bus_t *instance, 98 98 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 99 usb_transfer_type_t type, size_t max_packet_size, size_t data_size,100 ep_add_callback_t callback, void *arg, usb_address_t tt_address,101 u nsigned tt_port);99 usb_transfer_type_t type, size_t max_packet_size, unsigned packets, 100 size_t data_size, ep_add_callback_t callback, void *arg, 101 usb_address_t tt_address, unsigned tt_port); 102 102 103 103 int usb_bus_remove_ep(usb_bus_t *instance, -
uspace/lib/usbhost/src/ddf_helpers.c
r3de7a62 r4e732f1a 110 110 ddf_fun_t *fun, usb_endpoint_t endpoint, 111 111 usb_transfer_type_t transfer_type, usb_direction_t direction, 112 size_t max_packet_size, unsigned interval)112 size_t max_packet_size, unsigned packets, unsigned interval) 113 113 { 114 114 assert(fun); … … 126 126 127 127 return hcd_add_ep(hcd, target, direction, transfer_type, 128 max_packet_size, size, dev->tt_address, dev->port);128 max_packet_size, packets, size, dev->tt_address, dev->port); 129 129 } 130 130 … … 491 491 ret = hcd_add_ep(hcd, 492 492 default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, 493 CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 493 CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 1, 494 494 tt_address, port); 495 495 … … 517 517 /* Register EP on the new address */ 518 518 ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, 519 desc.max_packet_size, desc.max_packet_size, tt_address, port); 519 ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)), 520 ED_MPS_TRANS_OPPORTUNITIES_GET(uint16_usb2host(desc.max_packet_size)), 521 ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)), 522 tt_address, port); 520 523 if (ret != EOK) { 521 524 hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH); -
uspace/lib/usbhost/src/endpoint.c
r3de7a62 r4e732f1a 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, usb_address_t tt_address, unsigned tt_p) 52 size_t max_packet_size, unsigned packets, size_t bw, 53 usb_address_t tt_address, unsigned tt_p) 53 54 { 54 55 endpoint_t *instance = malloc(sizeof(endpoint_t)); … … 60 61 instance->speed = speed; 61 62 instance->max_packet_size = max_packet_size; 63 instance->packets = packets; 62 64 instance->bandwidth = bw; 63 65 instance->toggle = 0; -
uspace/lib/usbhost/src/hcd.c
r3de7a62 r4e732f1a 132 132 133 133 int hcd_add_ep(hcd_t *hcd, usb_target_t target, usb_direction_t dir, 134 usb_transfer_type_t type, size_t max_packet_size, size_t size,135 usb_address_t tt_address, unsigned tt_port)134 usb_transfer_type_t type, size_t max_packet_size, unsigned packets, 135 size_t size, usb_address_t tt_address, unsigned tt_port) 136 136 { 137 137 assert(hcd); 138 138 return usb_bus_add_ep(&hcd->bus, target.address, 139 target.endpoint, dir, type, max_packet_size, size, register_helper,140 hcd, tt_address, tt_port);139 target.endpoint, dir, type, max_packet_size, packets, size, 140 register_helper, hcd, tt_address, tt_port); 141 141 } 142 142 -
uspace/lib/usbhost/src/usb_bus.c
r3de7a62 r4e732f1a 301 301 int usb_bus_add_ep(usb_bus_t *instance, 302 302 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction, 303 usb_transfer_type_t type, size_t max_packet_size, size_t data_size,304 ep_add_callback_t callback, void *arg, usb_address_t tt_address,305 u nsigned tt_port)303 usb_transfer_type_t type, size_t max_packet_size, unsigned packets, 304 size_t data_size, ep_add_callback_t callback, void *arg, 305 usb_address_t tt_address, unsigned tt_port) 306 306 { 307 307 assert(instance); … … 337 337 338 338 ep = endpoint_create(address, endpoint, direction, type, speed, 339 max_packet_size, bw, tt_address, tt_port);339 max_packet_size, packets, bw, tt_address, tt_port); 340 340 if (!ep) { 341 341 fibril_mutex_unlock(&instance->guard);
Note:
See TracChangeset
for help on using the changeset viewer.