Ignore:
Timestamp:
2018-01-25T02:05:57Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d369b3b
Parents:
5f0b366
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-25 01:23:20)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-25 02:05:57)
Message:

usbhost: make bandwidth accounting a usb2_bus-thing

File:
1 edited

Legend:

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

    r5f0b366 rb357377  
    4141#include <stddef.h>
    4242
    43 /** Bytes per second in FULL SPEED */
    44 #define BANDWIDTH_TOTAL_USB11 (12000000 / 8)
    45 /** 90% of total bandwidth is available for periodic transfers */
    46 #define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 * 9) / 10)
    47 
    48 /** Number of nanoseconds in one microframe */
    49 #define BANDWIDTH_TOTAL_USB20 (125000)
    50 /** 90% of total bandwidth is available for periodic transfers */
    51 #define BANDWIDTH_AVAILABLE_USB20  ((BANDWIDTH_TOTAL_USB20 * 9) / 10)
    52 
    5343typedef struct endpoint endpoint_t;
    5444
    55 extern ssize_t bandwidth_count_usb11(endpoint_t *, size_t);
     45typedef size_t (*endpoint_count_bw_t)(endpoint_t *);
    5646
    57 extern ssize_t bandwidth_count_usb20(endpoint_t *, size_t);
     47typedef struct {
     48        size_t available_bandwidth;
     49        endpoint_count_bw_t count_bw;
     50} bandwidth_accounting_t;
     51
     52extern const bandwidth_accounting_t bandwidth_accounting_usb11;
     53extern const bandwidth_accounting_t bandwidth_accounting_usb2;
    5854
    5955#endif
Note: See TracChangeset for help on using the changeset viewer.