Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/pipes.c

    re8f826b r160b75e  
    3636#include <usb/dev/pipes.h>
    3737#include <usb/debug.h>
    38 #include <usb/hc.h>
     38#include <usb/driver.h>
    3939#include <usbhc_iface.h>
    4040#include <usb_iface.h>
     
    9797
    9898        return (int) iface_no;
     99}
     100
     101/** Tell USB address assigned to given device.
     102 *
     103 * @param dev_handle Devman handle of the USB device in question.
     104 * @return USB address or negative error code.
     105 */
     106usb_address_t usb_device_get_assigned_address(devman_handle_t dev_handle)
     107{
     108        int parent_phone = devman_parent_device_connect(dev_handle,
     109            IPC_FLAG_BLOCKING);
     110        if (parent_phone < 0) {
     111                return parent_phone;
     112        }
     113
     114        sysarg_t address;
     115
     116        int rc = async_req_2_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),
     117            IPC_M_USB_GET_ADDRESS,
     118            dev_handle, &address);
     119
     120        if (rc != EOK) {
     121                return rc;
     122        }
     123
     124        async_hangup(parent_phone);
     125
     126        return (usb_address_t) address;
    99127}
    100128
Note: See TracChangeset for help on using the changeset viewer.