Ignore:
Timestamp:
2011-10-28T20:53:41Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
48ae3ef
Parents:
83c3123
Message:

libusbhost: Drop hash_table and use multiple lists instead.

This has several advantages:
Knowing that all endpoints on one address are in one list makes toggle resets more efficient.
Endpoint search is done only once for inserts and deletes.
Lists are part of the structure and not allocated separately, removing one more failure point from init path.

File:
1 edited

Legend:

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

    r83c3123 r7265558  
    4040#define LIBUSBHOST_HOST_USB_ENDPOINT_MANAGER_H
    4141
    42 #include <stdlib.h>
    43 #include <adt/hash_table.h>
     42#include <adt/list.h>
    4443#include <fibril_synch.h>
    4544#include <usb/usb.h>
     45
    4646#include <usb/host/endpoint.h>
    4747
    4848#define BANDWIDTH_TOTAL_USB11 12000000
    4949#define BANDWIDTH_AVAILABLE_USB11 ((BANDWIDTH_TOTAL_USB11 / 10) * 9)
     50#define ENDPOINT_LIST_COUNT 8
    5051
    5152typedef struct usb_endpoint_manager {
    52         hash_table_t ep_table;
     53        list_t endpoint_lists[ENDPOINT_LIST_COUNT];
    5354        fibril_mutex_t guard;
    5455        size_t free_bw;
Note: See TracChangeset for help on using the changeset viewer.