Changeset 04028225 in mainline for uspace/lib/usb/src/hc.c


Ignore:
Timestamp:
2011-05-20T20:11:39Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9ab7f47
Parents:
0edf7c7
Message:

Getting address by handle also moved into libusb

File:
1 edited

Legend:

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

    r0edf7c7 r04028225  
    171171}
    172172
     173/** Tell USB address assigned to device with given handle.
     174 *
     175 * @param dev_handle Devman handle of the USB device in question.
     176 * @return USB address or negative error code.
     177 */
     178usb_address_t usb_hc_get_address_by_handle(devman_handle_t dev_handle)
     179{
     180        int parent_phone = devman_parent_device_connect(dev_handle,
     181            IPC_FLAG_BLOCKING);
     182        if (parent_phone < 0) {
     183                return parent_phone;
     184        }
     185
     186        sysarg_t address;
     187
     188        int rc = async_req_2_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),
     189            IPC_M_USB_GET_ADDRESS,
     190            dev_handle, &address);
     191
     192        if (rc != EOK) {
     193                return rc;
     194        }
     195
     196        async_hangup(parent_phone);
     197
     198        return (usb_address_t) address;
     199}
     200
    173201
    174202/** Get host controller handle by its class index.
Note: See TracChangeset for help on using the changeset viewer.