Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 75d8821 in mainline


Ignore:
Timestamp:
2013-12-31T06:58:19Z (8 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
1760556
Parents:
643e7ba
Message:

libusbhost: Add dummy USB 2.0 calculations.

Location:
uspace/lib/usbhost
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/usb_bus.h

    r643e7ba r75d8821  
    5353#define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 / 10) * 9)
    5454
     55//TODO: Implement
     56#define BANDWIDTH_AVAILABLE_USB20  1
     57
    5558typedef size_t (*bw_count_func_t)(usb_speed_t, usb_transfer_type_t, size_t, size_t);
    5659typedef void (*ep_remove_callback_t)(endpoint_t *, void *);
     
    7881
    7982size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type,
     83    size_t size, size_t max_packet_size);
     84size_t bandwidth_count_usb20(usb_speed_t speed, usb_transfer_type_t type,
    8085    size_t size, size_t max_packet_size);
    8186
  • uspace/lib/usbhost/src/usb_bus.c

    r643e7ba r75d8821  
    169169}
    170170
     171/** Calculate bandwidth that needs to be reserved for communication with EP.
     172 * Calculation follows USB 2.0 specification.
     173 * @param speed Device's speed.
     174 * @param type Type of the transfer.
     175 * @param size Number of byte to transfer.
     176 * @param max_packet_size Maximum bytes in one packet.
     177 */
     178size_t bandwidth_count_usb20(usb_speed_t speed, usb_transfer_type_t type,
     179    size_t size, size_t max_packet_size)
     180{
     181        /* We care about bandwidth only for interrupt and isochronous. */
     182        if ((type != USB_TRANSFER_INTERRUPT)
     183            && (type != USB_TRANSFER_ISOCHRONOUS)) {
     184                return 0;
     185        }
     186        //TODO Implement
     187        return 0;
     188}
     189
    171190/** Initialize to default state.
    172191 * You need to provide valid bw_count function if you plan to use
Note: See TracChangeset for help on using the changeset viewer.