Ignore:
File:
1 edited

Legend:

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

    rcbd568b r6b6fc232  
    3939#include <usb/host/hcd.h>
    4040
    41 /** Prepare generic usb_transfer_batch and schedule it.
    42  * @param fun DDF fun
    43  * @param target address and endpoint number.
    44  * @param setup_data Data to use in setup stage (Control communication type)
    45  * @param in Callback for device to host communication.
    46  * @param out Callback for host to device communication.
    47  * @param arg Callback parameter.
    48  * @param name Communication identifier (for nicer output).
    49  * @return Error code.
    50  */
    5141static inline int send_batch(
    5242    ddf_fun_t *fun, usb_target_t target, usb_direction_t direction,
     
    9989}
    10090/*----------------------------------------------------------------------------*/
    101 /** Calls ep_add_hook upon endpoint registration.
    102  * @param ep Endpoint to be registered.
    103  * @param arg hcd_t in disguise.
    104  * @return Error code.
    105  */
    10691static int register_helper(endpoint_t *ep, void *arg)
    10792{
     
    11499}
    115100/*----------------------------------------------------------------------------*/
    116 /** Calls ep_remove_hook upon endpoint removal.
    117  * @param ep Endpoint to be unregistered.
    118  * @param arg hcd_t in disguise.
    119  */
    120101static void unregister_helper(endpoint_t *ep, void *arg)
    121102{
     
    127108}
    128109/*----------------------------------------------------------------------------*/
    129 /** Calls ep_remove_hook upon endpoint removal. Prints warning.
    130  * @param ep Endpoint to be unregistered.
    131  * @param arg hcd_t in disguise.
    132  */
    133110static void unregister_helper_warn(endpoint_t *ep, void *arg)
    134111{
     
    142119}
    143120/*----------------------------------------------------------------------------*/
    144 /** Request address interface function.
    145  *
    146  * @param[in] fun DDF function that was called.
    147  * @param[in] address Pointer to preferred USB address.
     121/** Request address interface function
     122 *
     123 * @param[in] fun DDF function that was called.
     124 * @param[in] speed Speed to associate with the new default address.
    148125 * @param[out] address Place to write a new address.
    149  * @param[in] strict Fail if the preferred address is not available.
    150  * @param[in] speed Speed to associate with the new default address.
    151126 * @return Error code.
    152127 */
     
    165140}
    166141/*----------------------------------------------------------------------------*/
    167 /** Bind address interface function.
     142/** Bind address interface function
    168143 *
    169144 * @param[in] fun DDF function that was called.
     
    173148 */
    174149static int bind_address(
    175     ddf_fun_t *fun, usb_address_t address, devman_handle_t handle)
     150  ddf_fun_t *fun, usb_address_t address, devman_handle_t handle)
    176151{
    177152        assert(fun);
     
    201176}
    202177/*----------------------------------------------------------------------------*/
    203 /** Release address interface function.
     178/** Release address interface function
    204179 *
    205180 * @param[in] fun DDF function that was called.
     
    219194}
    220195/*----------------------------------------------------------------------------*/
    221 /** Register endpoint interface function.
    222  * @param fun DDF function.
    223  * @param address USB address of the device.
    224  * @param endpoint USB endpoint number to be registered.
    225  * @param transfer_type Endpoint's transfer type.
    226  * @param direction USB communication direction the endpoint is capable of.
    227  * @param max_packet_size Maximu size of packets the endpoint accepts.
    228  * @param interval Preferred timeout between communication.
    229  * @return Error code.
    230  */
    231196static int register_endpoint(
    232197    ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint,
    233198    usb_transfer_type_t transfer_type, usb_direction_t direction,
    234     size_t max_packet_size, unsigned interval)
     199    size_t max_packet_size, unsigned int interval)
    235200{
    236201        assert(fun);
     
    255220}
    256221/*----------------------------------------------------------------------------*/
    257 /** Unregister endpoint interface function.
    258  * @param fun DDF function.
    259  * @param address USB address of the endpoint.
    260  * @param endpoint USB endpoint number.
    261  * @param direction Communication direction of the enpdoint to unregister.
    262  * @return Error code.
    263  */
    264222static int unregister_endpoint(
    265223    ddf_fun_t *fun, usb_address_t address,
     
    275233}
    276234/*----------------------------------------------------------------------------*/
    277 /** Inbound communication interface function.
    278  * @param fun DDF function.
    279  * @param target Communication target.
    280  * @param setup_data Data to use in setup stage (control transfers).
    281  * @param data Pointer to data buffer.
    282  * @param size Size of the data buffer.
    283  * @param callback Function to call on communication end.
    284  * @param arg Argument passed to the callback function.
    285  * @return Error code.
    286  */
    287235static int usb_read(ddf_fun_t *fun, usb_target_t target, uint64_t setup_data,
    288236    uint8_t *data, size_t size, usbhc_iface_transfer_in_callback_t callback,
     
    293241}
    294242/*----------------------------------------------------------------------------*/
    295 /** Outbound communication interface function.
    296  * @param fun DDF function.
    297  * @param target Communication target.
    298  * @param setup_data Data to use in setup stage (control transfers).
    299  * @param data Pointer to data buffer.
    300  * @param size Size of the data buffer.
    301  * @param callback Function to call on communication end.
    302  * @param arg Argument passed to the callback function.
    303  * @return Error code.
    304  */
    305243static int usb_write(ddf_fun_t *fun, usb_target_t target, uint64_t setup_data,
    306244    const uint8_t *data, size_t size,
     
    311249}
    312250/*----------------------------------------------------------------------------*/
    313 /** usbhc Interface implementation using hcd_t from libusbhost library. */
    314251usbhc_iface_t hcd_iface = {
    315252        .request_address = request_address,
    316253        .bind_address = bind_address,
    317         .get_handle = find_by_address,
     254        .find_by_address = find_by_address,
    318255        .release_address = release_address,
    319256
Note: See TracChangeset for help on using the changeset viewer.