Changeset d8cdf39e in mainline


Ignore:
Timestamp:
2012-12-22T23:34:36Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
db8b7ca
Parents:
3c4663e
Message:

libusbhost: Remove fun_to_hcd helper.

Use dev_to_hcd instead.

Location:
uspace/lib/usbhost
Files:
2 edited

Legend:

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

    r3c4663e rd8cdf39e  
    8787    usbhc_iface_transfer_out_callback_t out, void *arg, const char* name);
    8888
    89 /** Data retrieve wrapper.
    90  * @param fun ddf function, non-null.
    91  * @return pointer cast to hcd_t*.
    92  */
    93 static inline hcd_t *fun_to_hcd(ddf_fun_t *fun)
    94 {
    95         return ddf_fun_data_get(fun);
    96 }
    97 
    98 
    9989#endif
    100 
    10190/**
    10291 * @}
  • uspace/lib/usbhost/src/iface.c

    r3c4663e rd8cdf39e  
    4040#include <usb/host/endpoint.h>
    4141#include <usb/host/hcd.h>
     42#include "ddf_helpers.h"
    4243
    4344/** Calls ep_add_hook upon endpoint registration.
     
    9798{
    9899        assert(fun);
    99         hcd_t *hcd = fun_to_hcd(fun);
     100        hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
    100101        assert(hcd);
    101102        assert(address);
     
    118119{
    119120        assert(fun);
    120         hcd_t *hcd = fun_to_hcd(fun);
     121        hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
    121122        assert(hcd);
    122123
     
    137138{
    138139        assert(fun);
    139         hcd_t *hcd = fun_to_hcd(fun);
     140        hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
    140141        assert(hcd);
    141142        return usb_device_manager_get_info_by_address(
     
    152153{
    153154        assert(fun);
    154         hcd_t *hcd = fun_to_hcd(fun);
     155        hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
    155156        assert(hcd);
    156157        usb_log_debug("Address release %d.\n", address);
     
    177178{
    178179        assert(fun);
    179         hcd_t *hcd = fun_to_hcd(fun);
     180        hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
    180181        assert(hcd);
    181182        const size_t size = max_packet_size;
     
    209210{
    210211        assert(fun);
    211         hcd_t *hcd = fun_to_hcd(fun);
     212        hcd_t *hcd = dev_to_hcd(ddf_fun_get_dev(fun));
    212213        assert(hcd);
    213214        usb_log_debug("Unregister endpoint %d:%d %s.\n",
     
    231232    void *arg)
    232233{
    233         return hcd_send_batch(fun_to_hcd(fun), target, USB_DIRECTION_IN,
     234        return hcd_send_batch(dev_to_hcd(ddf_fun_get_dev(fun)), target, USB_DIRECTION_IN,
    234235            data, size, setup_data, callback, NULL, arg, "READ");
    235236}
     
    249250    usbhc_iface_transfer_out_callback_t callback, void *arg)
    250251{
    251         return hcd_send_batch(fun_to_hcd(fun), target, USB_DIRECTION_OUT,
    252             (uint8_t*)data, size, setup_data, NULL, callback, arg, "WRITE");
     252        return hcd_send_batch(dev_to_hcd(ddf_fun_get_dev(fun)),
     253            target, USB_DIRECTION_OUT, (uint8_t*)data, size, setup_data, NULL,
     254            callback, arg, "WRITE");
    253255}
    254256
Note: See TracChangeset for help on using the changeset viewer.