Changeset 9d15d1b in mainline
- Timestamp:
- 2013-08-02T13:04:47Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e4219ab
- Parents:
- 7c10198
- Location:
- uspace/lib/drv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usb.c
r7c10198 r9d15d1b 70 70 IPC_M_USB_GET_MY_INTERFACE, 71 71 IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, 72 IPC_M_USB_GET_DEVICE_HANDLE, 72 73 IPC_M_USB_RESERVE_DEFAULT_ADDRESS, 73 74 IPC_M_USB_RELEASE_DEFAULT_ADDRESS, … … 131 132 } 132 133 134 /** Tell devman handle of the usb device function. 135 * @param[in] exch IPC communication exchange 136 * @param[out] handle devman handle of the HC used by the target device. 137 * @return Error code. 138 */ 139 int usb_get_device_handle(async_exch_t *exch, devman_handle_t *handle) 140 { 141 devman_handle_t h = 0; 142 const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 143 IPC_M_USB_GET_DEVICE_HANDLE, &h); 144 if (ret == EOK && handle) 145 *handle = (devman_handle_t)h; 146 return ret; 147 } 148 133 149 /** Reserve default USB address. 134 150 * @param[in] exch IPC communication exchange … … 213 229 static void remote_usb_get_my_interface(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 214 230 static void remote_usb_get_hc_handle(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 231 static void remote_usb_get_device_handle(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 215 232 216 233 static void remote_usb_reserve_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 226 243 [IPC_M_USB_GET_MY_INTERFACE] = remote_usb_get_my_interface, 227 244 [IPC_M_USB_GET_HOST_CONTROLLER_HANDLE] = remote_usb_get_hc_handle, 245 [IPC_M_USB_GET_DEVICE_HANDLE] = remote_usb_get_device_handle, 228 246 [IPC_M_USB_RESERVE_DEFAULT_ADDRESS] = remote_usb_reserve_default_address, 229 247 [IPC_M_USB_RELEASE_DEFAULT_ADDRESS] = remote_usb_release_default_address, … … 299 317 } 300 318 319 void remote_usb_get_device_handle(ddf_fun_t *fun, void *iface, 320 ipc_callid_t callid, ipc_call_t *call) 321 { 322 const usb_iface_t *usb_iface = (usb_iface_t *) iface; 323 324 if (usb_iface->get_device_handle == NULL) { 325 async_answer_0(callid, ENOTSUP); 326 return; 327 } 328 329 devman_handle_t handle; 330 const int ret = usb_iface->get_device_handle(fun, &handle); 331 if (ret != EOK) { 332 async_answer_0(callid, ret); 333 } 334 335 async_answer_1(callid, EOK, (sysarg_t) handle); 336 } 337 301 338 void remote_usb_reserve_default_address(ddf_fun_t *fun, void *iface, 302 339 ipc_callid_t callid, ipc_call_t *call) -
uspace/lib/drv/include/usb_iface.h
r7c10198 r9d15d1b 55 55 int usb_get_my_interface(async_exch_t *, int *); 56 56 int usb_get_hc_handle(async_exch_t *, devman_handle_t *); 57 int usb_get_device_handle(async_exch_t *, devman_handle_t *); 57 58 58 59 int usb_reserve_default_address(async_exch_t *, usb_speed_t); … … 72 73 int (*get_hc_handle)(ddf_fun_t *, devman_handle_t *); 73 74 75 int (*get_device_handle)(ddf_fun_t *, devman_handle_t *); 76 74 77 int (*reserve_default_address)(ddf_fun_t *, usb_speed_t); 75 78 int (*release_default_address)(ddf_fun_t *);
Note:
See TracChangeset
for help on using the changeset viewer.