Changeset 0918382f in mainline for uspace/lib/drv/generic/remote_usb.c
- Timestamp:
- 2013-08-07T15:00:36Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 14dd4c9
- Parents:
- 2757247
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usb.c
r2757247 r0918382f 139 139 * @return Error code. 140 140 */ 141 int usb_device_enumerate(async_exch_t *exch, usb_device_handle_t *handle) 142 { 143 if (!exch || !handle) 144 return EBADMEM; 145 sysarg_t h; 146 const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 147 IPC_M_USB_DEVICE_ENUMERATE, &h); 148 if (ret == EOK) 149 *handle = (usb_device_handle_t)h; 141 int usb_device_enumerate(async_exch_t *exch, unsigned port) 142 { 143 if (!exch) 144 return EBADMEM; 145 const int ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE), 146 IPC_M_USB_DEVICE_ENUMERATE, port); 150 147 return ret; 151 148 } … … 156 153 * @return Error code. 157 154 */ 158 int usb_device_remove(async_exch_t *exch, u sb_device_handle_t handle)155 int usb_device_remove(async_exch_t *exch, unsigned port) 159 156 { 160 157 if (!exch) 161 158 return EBADMEM; 162 159 return async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE), 163 IPC_M_USB_DEVICE_REMOVE, handle);160 IPC_M_USB_DEVICE_REMOVE, port); 164 161 } 165 162 … … 381 378 } 382 379 383 usb_device_handle_t handle = 0; 384 const int ret = usb_iface->device_enumerate(fun, &handle); 385 if (ret != EOK) { 386 async_answer_0(callid, ret); 387 } 388 389 async_answer_1(callid, EOK, (sysarg_t) handle); 380 const unsigned port = DEV_IPC_GET_ARG1(*call); 381 const int ret = usb_iface->device_enumerate(fun, port); 382 async_answer_0(callid, ret); 390 383 } 391 384 … … 400 393 } 401 394 402 usb_device_handle_t handle= DEV_IPC_GET_ARG1(*call);403 const int ret = usb_iface->device_remove(fun, handle);395 const unsigned port = DEV_IPC_GET_ARG1(*call); 396 const int ret = usb_iface->device_remove(fun, port); 404 397 async_answer_0(callid, ret); 405 398 }
Note:
See TracChangeset
for help on using the changeset viewer.