Changeset 21be46a in mainline


Ignore:
Timestamp:
2012-12-20T11:46:26Z (11 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.

Location:
uspace/lib/usbhost
Files:
2 edited

Legend:

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

    r9c7ed9c r21be46a  
    7070};
    7171
    72 
    73 /** Initialize hcd_t structure.
    74  * Initializes device and endpoint managers. Sets data and hook pointer to NULL.
    75  * @param hcd hcd_t structure to initialize, non-null.
    76  * @param bandwidth Available bandwidth, passed to endpoint manager.
    77  * @param bw_count Bandwidth compute function, passed to endpoint manager.
    78  */
    79 static inline void hcd_init(hcd_t *hcd, usb_speed_t max_speed, size_t bandwidth,
    80     bw_count_func_t bw_count)
    81 {
    82         assert(hcd);
    83         usb_device_manager_init(&hcd->dev_manager, max_speed);
    84         usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count);
    85         list_initialize(&hcd->devices);
    86 
    87         hcd->private_data = NULL;
    88         hcd->schedule = NULL;
    89         hcd->ep_add_hook = NULL;
    90         hcd->ep_remove_hook = NULL;
    91 }
     72void hcd_init(hcd_t *hcd, usb_speed_t max_speed, size_t bandwidth,
     73    bw_count_func_t bw_count);
    9274
    9375static inline void hcd_set_implementation(hcd_t *hcd, void *data,
  • 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.