Changeset 7c3fb9b in mainline for uspace/lib/usbhost/src/bandwidth.c
- Timestamp:
- 2018-05-17T08:29:01Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/bandwidth.c
rfac0ac7 r7c3fb9b 70 70 const size_t packet_count = ep->packets_per_uframe; 71 71 72 /* TODO: It may be that ISO and INT transfers use only one packet per 73 * transaction, but I did not find text in USB spec to confirm this */ 72 /* 73 * TODO: It may be that ISO and INT transfers use only one packet per 74 * transaction, but I did not find text in USB spec to confirm this 75 */ 74 76 /* NOTE: All data packets will be considered to be max_packet_size */ 75 77 switch (ep->device->speed) { 76 78 case USB_SPEED_LOW: 77 79 assert(type == USB_TRANSFER_INTERRUPT); 78 /* Protocol overhead 13B 80 /* 81 * Protocol overhead 13B 79 82 * (3 SYNC bytes, 3 PID bytes, 2 Endpoint + CRC bytes, 2 80 83 * CRC bytes, and a 3-byte interpacket delay) 81 * see USB spec page 45-46. */ 84 * see USB spec page 45-46. 85 */ 82 86 /* Speed penalty 8: low speed is 8-times slower*/ 83 87 return packet_count * (13 + max_packet_size) * 8; 84 88 case USB_SPEED_FULL: 85 /* Interrupt transfer overhead see above 86 * or page 45 of USB spec */ 89 /* 90 * Interrupt transfer overhead see above 91 * or page 45 of USB spec 92 */ 87 93 if (type == USB_TRANSFER_INTERRUPT) 88 94 return packet_count * (13 + max_packet_size); 89 95 90 96 assert(type == USB_TRANSFER_ISOCHRONOUS); 91 /* Protocol overhead 9B 97 /* 98 * Protocol overhead 9B 92 99 * (2 SYNC bytes, 2 PID bytes, 2 Endpoint + CRC bytes, 2 CRC 93 100 * bytes, and a 1-byte interpacket delay) 94 * see USB spec page 42 */ 101 * see USB spec page 42 102 */ 95 103 return packet_count * (9 + max_packet_size); 96 104 default:
Note:
See TracChangeset
for help on using the changeset viewer.