Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/ddfiface.c

    re882e3a r27ed734c  
    3333 * Implementations of DDF interfaces functions (actual implementation).
    3434 */
     35#include <ipc/devman.h>
    3536#include <devman.h>
    3637#include <async.h>
    37 #include <usb_iface.h>
    3838#include <usb/ddfiface.h>
    3939#include <usb/hc.h>
     
    4242#include <errno.h>
    4343#include <assert.h>
    44 
    45 #include <usb/dev.h>
    4644
    4745/** DDF interface for USB device, implementation for typical hub. */
     
    6765{
    6866        assert(fun);
    69         return usb_get_hc_by_handle(fun->handle, handle);
     67        return usb_hc_find(fun->handle, handle);
    7068}
    7169
     
    9896{
    9997        assert(fun);
    100         return usb_get_address_by_handle(fun->handle, address);
     98
     99        async_sess_t *parent_sess =
     100            devman_parent_device_connect(EXCHANGE_SERIALIZE, fun->handle,
     101            IPC_FLAG_BLOCKING);
     102        if (!parent_sess)
     103                return ENOMEM;
     104
     105        async_exch_t *exch = async_exchange_begin(parent_sess);
     106
     107        sysarg_t addr;
     108        int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     109            IPC_M_USB_GET_MY_ADDRESS, &addr);
     110
     111        async_exchange_end(exch);
     112        async_hangup(parent_sess);
     113
     114        if (rc != EOK)
     115                return rc;
     116
     117        if (address != NULL)
     118                *address = (usb_address_t) addr;
     119
     120        return EOK;
    101121}
    102122
     
    117137        assert(fun);
    118138        assert(fun->driver_data);
    119         const usb_hub_attached_device_t *device = fun->driver_data;
     139        usb_hub_attached_device_t *device = fun->driver_data;
    120140        assert(device->fun == fun);
    121141        if (address)
Note: See TracChangeset for help on using the changeset viewer.