Changeset 56fb3732 in mainline for uspace/lib/usb/src/usbdrv.c
- Timestamp:
- 2010-12-28T10:28:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de2c901
- Parents:
- 6edd494
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/usbdrv.c
r6edd494 r56fb3732 35 35 #include <usb/usbdrv.h> 36 36 #include <usbhc_iface.h> 37 #include <usb_iface.h> 37 38 #include <errno.h> 38 39 #include <str_error.h> … … 54 55 } transfer_info_t; 55 56 57 /** Find handle of host controller the device is physically attached to. 58 * 59 * @param[in] dev Device looking for its host controller. 60 * @param[out] handle Host controller devman handle. 61 * @return Error code. 62 */ 63 int usb_drv_find_hc(device_t *dev, devman_handle_t *handle) 64 { 65 if (dev == NULL) { 66 return EBADMEM; 67 } 68 if (handle == NULL) { 69 return EBADMEM; 70 } 71 72 int parent_phone = devman_parent_device_connect(dev->handle, 0); 73 if (parent_phone < 0) { 74 return parent_phone; 75 } 76 77 devman_handle_t h; 78 int rc = async_req_1_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE), 79 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h); 80 if (rc != EOK) { 81 return rc; 82 } 83 84 *handle = h; 85 86 return EOK; 87 } 88 56 89 /** Connect to host controller the device is physically attached to. 57 90 *
Note:
See TracChangeset
for help on using the changeset viewer.