Changeset eeca8a6 in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2018-01-16T19:22:58Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4603b35
- Parents:
- 47e9494
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r47e9494 reeca8a6 57 57 /** Reserve default USB address. 58 58 * @param[in] exch IPC communication exchange 59 * @return Error code. 60 */ 61 int usbhc_reserve_default_address(async_exch_t *exch) 62 { 63 if (!exch) 64 return EBADMEM; 65 return async_req_1_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USB_RESERVE_DEFAULT_ADDRESS); 66 } 67 68 /** Release default USB address. 69 * 70 * @param[in] exch IPC communication exchange 71 * 72 * @return Error code. 73 */ 74 int usbhc_release_default_address(async_exch_t *exch) 75 { 76 if (!exch) 77 return EBADMEM; 78 return async_req_1_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USB_RELEASE_DEFAULT_ADDRESS); 79 } 80 81 /** 82 * Trigger USB device enumeration 83 * 84 * @param[in] exch IPC communication exchange 85 * @param[in] port Port number at which the device is attached 59 86 * @param[in] speed Communication speed of the newly attached device 87 * 60 88 * @return Error code. 61 89 */ 62 int usbhc_reserve_default_address(async_exch_t *exch, usb_speed_t speed) 63 { 64 if (!exch) 65 return EBADMEM; 66 return async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 67 IPC_M_USB_RESERVE_DEFAULT_ADDRESS, speed); 68 } 69 70 /** Release default USB address. 71 * 72 * @param[in] exch IPC communication exchange 73 * 74 * @return Error code. 75 * 76 */ 77 int usbhc_release_default_address(async_exch_t *exch) 78 { 79 if (!exch) 80 return EBADMEM; 81 return async_req_1_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 82 IPC_M_USB_RELEASE_DEFAULT_ADDRESS); 83 } 84 85 /** Trigger USB device enumeration 86 * 87 * @param[in] exch IPC communication exchange 88 * @param[out] handle Identifier of the newly added device (if successful) 89 * 90 * @return Error code. 91 * 92 */ 93 int usbhc_device_enumerate(async_exch_t *exch, unsigned port) 94 { 95 if (!exch) 96 return EBADMEM; 97 const int ret = async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 98 IPC_M_USB_DEVICE_ENUMERATE, port); 90 int usbhc_device_enumerate(async_exch_t *exch, unsigned port, usb_speed_t speed) 91 { 92 if (!exch) 93 return EBADMEM; 94 const int ret = async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 95 IPC_M_USB_DEVICE_ENUMERATE, port, speed); 99 96 return ret; 100 97 } … … 310 307 } 311 308 312 usb_speed_t speed = DEV_IPC_GET_ARG1(*call); 313 const int ret = usbhc_iface->reserve_default_address(fun, speed); 309 const int ret = usbhc_iface->reserve_default_address(fun); 314 310 async_answer_0(callid, ret); 315 311 } … … 340 336 341 337 const unsigned port = DEV_IPC_GET_ARG1(*call); 342 const int ret = usbhc_iface->device_enumerate(fun, port); 338 usb_speed_t speed = DEV_IPC_GET_ARG2(*call); 339 const int ret = usbhc_iface->device_enumerate(fun, port, speed); 343 340 async_answer_0(callid, ret); 344 341 }
Note:
See TracChangeset
for help on using the changeset viewer.