Changes in uspace/lib/usb/src/pipes.c [27a0012:563fb40] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/pipes.c
r27a0012 r563fb40 36 36 #include <usb/pipes.h> 37 37 #include <usbhc_iface.h> 38 #include <usb_iface.h>39 38 #include <errno.h> 40 39 #include <assert.h> … … 42 41 /** Tell USB address assigned to given device. 43 42 * 44 * @param phone Phone to parent device.43 * @param phone Phone to my HC. 45 44 * @param dev Device in question. 46 45 * @return USB address or error code. … … 49 48 { 50 49 sysarg_t address; 51 int rc = async_req_2_1(phone, DEV_IFACE_ID(USB _DEV_IFACE),52 IPC_M_USB _GET_ADDRESS,50 int rc = async_req_2_1(phone, DEV_IFACE_ID(USBHC_DEV_IFACE), 51 IPC_M_USBHC_GET_ADDRESS, 53 52 dev->handle, &address); 54 53 … … 58 57 59 58 return (usb_address_t) address; 60 }61 62 /** Tell USB interface assigned to given device.63 *64 * @param device Device in question.65 * @return Interface number (negative code means any).66 */67 int usb_device_get_assigned_interface(device_t *device)68 {69 int parent_phone = devman_parent_device_connect(device->handle,70 IPC_FLAG_BLOCKING);71 if (parent_phone < 0) {72 return -1;73 }74 75 sysarg_t iface_no;76 int rc = async_req_2_1(parent_phone, DEV_IFACE_ID(USB_DEV_IFACE),77 IPC_M_USB_GET_INTERFACE,78 device->handle, &iface_no);79 80 async_hangup(parent_phone);81 82 if (rc != EOK) {83 return -1;84 }85 86 return (int) iface_no;87 59 } 88 60 … … 108 80 } 109 81 110 int parent_phone = devman_parent_device_connect(device->handle, 111 IPC_FLAG_BLOCKING); 112 if (parent_phone < 0) { 113 return parent_phone; 114 } 115 116 my_address = get_my_address(parent_phone, device); 82 int hc_phone = devman_device_connect(hc_handle, 0); 83 if (hc_phone < 0) { 84 return hc_phone; 85 } 86 87 my_address = get_my_address(hc_phone, device); 117 88 if (my_address < 0) { 118 89 rc = my_address; … … 124 95 125 96 leave: 126 async_hangup( parent_phone);97 async_hangup(hc_phone); 127 98 return rc; 128 99 }
Note:
See TracChangeset
for help on using the changeset viewer.