Changeset 04028225 in mainline
- Timestamp:
- 2011-05-20T20:11:39Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a9ab7f47
- Parents:
- 0edf7c7
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkbd/main.c
r0edf7c7 r04028225 173 173 /* Try to get its address. */ 174 174 if (!addr_found) { 175 addr = usb_ device_get_assigned_address(dev_handle);175 addr = usb_hc_get_address_by_handle(dev_handle); 176 176 if (addr >= 0) { 177 177 addr_found = true; -
uspace/app/usbinfo/main.c
r0edf7c7 r04028225 128 128 /* Try to get its address. */ 129 129 if (!addr_found) { 130 addr = usb_ device_get_assigned_address(dev_handle);130 addr = usb_hc_get_address_by_handle(dev_handle); 131 131 if (addr >= 0) { 132 132 addr_found = true; -
uspace/lib/usb/include/usb/hc.h
r0edf7c7 r04028225 60 60 devman_handle_t *); 61 61 62 int usb_hc_get_address_by_handle(devman_handle_t); 63 62 64 int usb_ddf_get_hc_handle_by_class(size_t, devman_handle_t *); 63 65 -
uspace/lib/usb/src/hc.c
r0edf7c7 r04028225 171 171 } 172 172 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 */ 178 usb_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 173 201 174 202 /** Get host controller handle by its class index. -
uspace/lib/usbdev/include/usb/dev/pipes.h
r0edf7c7 r04028225 163 163 164 164 int usb_device_get_assigned_interface(ddf_dev_t *); 165 usb_address_t usb_device_get_assigned_address(devman_handle_t);166 165 167 166 int usb_pipe_initialize(usb_pipe_t *, usb_device_connection_t *, -
uspace/lib/usbdev/src/pipes.c
r0edf7c7 r04028225 97 97 98 98 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;127 99 } 128 100
Note:
See TracChangeset
for help on using the changeset viewer.