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/hcd.h

    r83c3123 r7265558  
    3737
    3838#include <assert.h>
     39#include <usbhc_iface.h>
    3940#include <usb/host/usb_device_manager.h>
    4041#include <usb/host/usb_endpoint_manager.h>
    4142#include <usb/host/usb_transfer_batch.h>
    42 #include <usbhc_iface.h>
    4343
    4444typedef struct hcd hcd_t;
     
    5353};
    5454/*----------------------------------------------------------------------------*/
    55 static inline int hcd_init(hcd_t *hcd, size_t bandwidth,
     55static inline void hcd_init(hcd_t *hcd, size_t bandwidth,
    5656    size_t (*bw_count)(usb_speed_t, usb_transfer_type_t, size_t, size_t))
    5757{
    5858        assert(hcd);
    5959        usb_device_manager_init(&hcd->dev_manager);
    60         return usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count);
    61 }
    62 /*----------------------------------------------------------------------------*/
    63 static inline void hcd_destroy(hcd_t *hcd)
    64 {
    65         usb_endpoint_manager_destroy(&hcd->ep_manager);
     60        usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count);
    6661}
    6762/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.