Changeset 04028225 in mainline for uspace/lib/usbdev/src/pipes.c


Ignore:
Timestamp:
2011-05-20T20:11:39Z (13 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/usbdev/src/pipes.c

    r0edf7c7 r04028225  
    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  */
    106 usb_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;
    12799}
    128100
Note: See TracChangeset for help on using the changeset viewer.