Changeset 21be46a in mainline for uspace/lib/usbhost/src/hcd.c


Ignore:
Timestamp:
2012-12-20T11:46:26Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8f68913f
Parents:
9c7ed9c
Message:

libusbhost: Move hcd_init to .c file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/hcd.c

    r9c7ed9c r21be46a  
    116116};
    117117
     118/** Initialize hcd_t structure.
     119 * Initializes device and endpoint managers. Sets data and hook pointer to NULL.
     120 *
     121 * @param hcd hcd_t structure to initialize, non-null.
     122 * @param max_speed Maximum supported USB speed (full, high).
     123 * @param bandwidth Available bandwidth, passed to endpoint manager.
     124 * @param bw_count Bandwidth compute function, passed to endpoint manager.
     125 */
     126void hcd_init(hcd_t *hcd, usb_speed_t max_speed, size_t bandwidth,
     127    bw_count_func_t bw_count)
     128{
     129        assert(hcd);
     130        usb_device_manager_init(&hcd->dev_manager, max_speed);
     131        usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count);
     132        list_initialize(&hcd->devices);
     133
     134        hcd->private_data = NULL;
     135        hcd->schedule = NULL;
     136        hcd->ep_add_hook = NULL;
     137        hcd->ep_remove_hook = NULL;
     138}
     139
    118140int hcd_add_device(hcd_t *instance, ddf_dev_t *parent,
    119141    usb_address_t address, usb_speed_t speed, const char *name,
Note: See TracChangeset for help on using the changeset viewer.