Changeset fc0271a5 in mainline for uspace/lib/usbhost/src/bandwidth.c
- Timestamp:
- 2017-10-12T16:06:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f9d787c
- Parents:
- d0db4a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/bandwidth.c
rd0db4a0 rfc0271a5 35 35 36 36 #include <usb/host/bandwidth.h> 37 #include <usb/host/endpoint.h> 37 38 38 39 #include <assert.h> … … 46 47 * @param max_packet_size Maximum bytes in one packet. 47 48 */ 48 size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type, 49 size_t size, size_t max_packet_size) 49 size_t bandwidth_count_usb11(endpoint_t *ep, size_t size) 50 50 { 51 assert(ep); 52 53 const usb_transfer_type_t type = ep->transfer_type; 54 51 55 /* We care about bandwidth only for interrupt and isochronous. */ 52 56 if ((type != USB_TRANSFER_INTERRUPT) … … 55 59 } 56 60 61 const size_t max_packet_size = ep->max_packet_size; 62 57 63 const unsigned packet_count = 58 64 (size + max_packet_size - 1) / max_packet_size; … … 60 66 * transaction, but I did not find text in USB spec to confirm this */ 61 67 /* NOTE: All data packets will be considered to be max_packet_size */ 62 switch ( speed)68 switch (ep->speed) 63 69 { 64 70 case USB_SPEED_LOW: … … 94 100 * @param max_packet_size Maximum bytes in one packet. 95 101 */ 96 size_t bandwidth_count_usb20(usb_speed_t speed, usb_transfer_type_t type, 97 size_t size, size_t max_packet_size) 102 size_t bandwidth_count_usb20(endpoint_t *ep, size_t size) 98 103 { 104 assert(ep); 105 106 const usb_transfer_type_t type = ep->transfer_type; 107 99 108 /* We care about bandwidth only for interrupt and isochronous. */ 100 109 if ((type != USB_TRANSFER_INTERRUPT)
Note:
See TracChangeset
for help on using the changeset viewer.