Changeset 3562cd18 in mainline


Ignore:
Timestamp:
2011-10-31T10:07:51Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ae754e5f
Parents:
eea3e39
Message:

libusb: Remove usb_iface_get_hc_handle_hub_child_impl.

Rename usb_iface_get_hc_handle_hub_impl ⇒ usb_iface_get_hc_handle_device_impl.
This was just a hidden duplicity, the only difference was using EXCHANGE_SERIALIZE instead of EXCHANGE_ATOMIC.
All USB devices, but root hubs, ask their parents for hc handle.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmid/usbmid.c

    reea3e39 r3562cd18  
    6262/** DDF interface of the child - interface function. */
    6363static usb_iface_t child_usb_iface = {
    64         .get_hc_handle = usb_iface_get_hc_handle_hub_child_impl,
     64        .get_hc_handle = usb_iface_get_hc_handle_device_impl,
    6565        .get_address = usb_iface_get_address_forward_impl,
    6666        .get_interface = usb_iface_get_interface_impl
  • uspace/lib/usb/include/usb/ddfiface.h

    reea3e39 r3562cd18  
    3939#include <usb_iface.h>
    4040
    41 int usb_iface_get_hc_handle_hub_impl(ddf_fun_t *, devman_handle_t *);
     41int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *);
    4242int usb_iface_get_address_forward_impl(ddf_fun_t *, devman_handle_t,
    4343    usb_address_t *);
    4444extern usb_iface_t usb_iface_hub_impl;
    4545
    46 int usb_iface_get_hc_handle_hub_child_impl(ddf_fun_t *, devman_handle_t *);
    4746int usb_iface_get_address_set_my_handle_impl(ddf_fun_t *, devman_handle_t,
    4847    usb_address_t *);
  • uspace/lib/usb/src/ddfiface.c

    reea3e39 r3562cd18  
    4444/** DDF interface for USB device, implementation for typical hub. */
    4545usb_iface_t  usb_iface_hub_impl = {
    46         .get_hc_handle = usb_iface_get_hc_handle_hub_impl,
     46        .get_hc_handle = usb_iface_get_hc_handle_device_impl,
    4747        .get_address = usb_iface_get_address_forward_impl,
    4848};
     
    5050/** DDF interface for USB device, implementation for child of a typical hub. */
    5151usb_iface_t  usb_iface_hub_child_impl = {
    52         .get_hc_handle = usb_iface_get_hc_handle_hub_child_impl,
     52        .get_hc_handle = usb_iface_get_hc_handle_device_impl,
    5353        .get_address = usb_iface_get_address_set_my_handle_impl
    5454};
     
    6161 * @return Error code.
    6262 */
    63 int usb_iface_get_hc_handle_hub_impl(ddf_fun_t *fun, devman_handle_t *handle)
     63int usb_iface_get_hc_handle_device_impl(ddf_fun_t *fun, devman_handle_t *handle)
    6464{
    6565        assert(fun);
    6666        return usb_hc_find(fun->handle, handle);
    67 }
    68 
    69 /** Get host controller handle, interface implementation for child of
    70  * a hub driver.
    71  *
    72  * @param[in] fun Device function the operation is running on.
    73  * @param[out] handle Storage for the host controller handle.
    74  * @return Error code.
    75  */
    76 int usb_iface_get_hc_handle_hub_child_impl(ddf_fun_t *fun,
    77     devman_handle_t *handle)
    78 {
    79         assert(fun != NULL);
    80        
    81         async_sess_t *parent_sess =
    82             devman_parent_device_connect(EXCHANGE_SERIALIZE, fun->handle,
    83             IPC_FLAG_BLOCKING);
    84         if (!parent_sess)
    85                 return ENOMEM;
    86        
    87         async_exch_t *exch = async_exchange_begin(parent_sess);
    88        
    89         sysarg_t hc_handle;
    90         int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    91             IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &hc_handle);
    92        
    93         async_exchange_end(exch);
    94         async_hangup(parent_sess);
    95        
    96         if (rc != EOK)
    97                 return rc;
    98        
    99         *handle = hc_handle;
    100         return EOK;
    10167}
    10268
Note: See TracChangeset for help on using the changeset viewer.