Changeset 9262571 in mainline


Ignore:
Timestamp:
2011-04-06T16:06:34Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9783496
Parents:
f0891ce
Message:

Make op structures static to avoid conflict
remove one bandwidth_count_usb11 implementation

Location:
uspace/lib/usb/src/host
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/host/bandwidth.c

    rf0891ce r9262571  
    7878}
    7979/*----------------------------------------------------------------------------*/
    80 hash_table_operations_t op = {
     80static hash_table_operations_t op = {
    8181        .hash = transfer_hash,
    8282        .compare = transfer_compare,
    8383        .remove_callback = transfer_remove,
    8484};
    85 /*----------------------------------------------------------------------------*/
    86 size_t bandwidth_count_usb11(usb_speed_t speed, usb_transfer_type_t type,
    87     size_t size, size_t max_packet_size)
    88 {
    89         const unsigned packet_count =
    90             (size + max_packet_size - 1) / max_packet_size;
    91         /* TODO: It may be that ISO and INT transfers use only one data packet
    92          * per transaction, but I did not find text in UB spec that confirms
    93          * this */
    94         /* NOTE: All data packets will be considered to be max_packet_size */
    95         switch (speed)
    96         {
    97         case USB_SPEED_LOW:
    98                 assert(type == USB_TRANSFER_INTERRUPT);
    99                 /* Protocol overhead 13B
    100                  * (3 SYNC bytes, 3 PID bytes, 2 Endpoint + CRC bytes, 2
    101                  * CRC bytes, and a 3-byte interpacket delay)
    102                  * see USB spec page 45-46. */
    103                 /* Speed penalty 8: low speed is 8-times slower*/
    104                 return packet_count * (13 + max_packet_size) * 8;
    105         case USB_SPEED_FULL:
    106                 /* Interrupt transfer overhead see above
    107                  * or page 45 of USB spec */
    108                 if (type == USB_TRANSFER_INTERRUPT)
    109                         return packet_count * (13 + max_packet_size);
    110 
    111                 assert(type == USB_TRANSFER_ISOCHRONOUS);
    112                 /* Protocol overhead 9B
    113                  * (2 SYNC bytes, 2 PID bytes, 2 Endpoint + CRC bytes, 2 CRC
    114                  * bytes, and a 1-byte interpacket delay)
    115                  * see USB spec page 42 */
    116                 return packet_count * (9 + max_packet_size);
    117         default:
    118                 return 0;
    119         }
    120 }
    12185/*----------------------------------------------------------------------------*/
    12286int bandwidth_init(bandwidth_t *instance, size_t bandwidth,
  • uspace/lib/usb/src/host/usb_endpoint_manager.c

    rf0891ce r9262571  
    8686}
    8787/*----------------------------------------------------------------------------*/
    88 hash_table_operations_t op = {
     88static hash_table_operations_t op = {
    8989        .hash = ep_hash,
    9090        .compare = ep_compare,
Note: See TracChangeset for help on using the changeset viewer.