Changeset 4ab89e5 in mainline for uspace/lib/usb/include


Ignore:
Timestamp:
2011-04-02T14:32:48Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1313b8c
Parents:
857edac
Message:

Compute used bandwidth during reservation

File:
1 edited

Legend:

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

    r857edac r4ab89e5  
    4444#include <usb/usb.h>
    4545
     46#define BANDWIDTH_TOTAL_USB11 12000000
     47#define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 / 10) * 9)
     48
    4649typedef struct bandwidth {
    4750        hash_table_t reserved;
    4851        fibril_mutex_t guard;
    4952        size_t free;
     53        size_t (*usage_fnc)(usb_speed_t, usb_transfer_type_t, size_t, size_t);
    5054} bandwidth_t;
    5155
    52 int bandwidth_init(bandwidth_t *instance);
     56size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type,
     57    size_t size, size_t max_packet_size);
     58
     59int bandwidth_init(bandwidth_t *instance, size_t bandwidth,
     60    size_t (*usage_fnc)(usb_speed_t, usb_transfer_type_t, size_t, size_t));
    5361
    5462void bandwidth_destroy(bandwidth_t *instance);
Note: See TracChangeset for help on using the changeset viewer.