Changeset b0fc92c in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2013-07-26T13:29:05Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 059d507
- Parents:
- f3922c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
rf3922c2 rb0fc92c 84 84 */ 85 85 typedef enum { 86 /** Get handle binded with given USB address.87 * Parameters88 * - USB address89 * Answer:90 * - EOK - address binded, first parameter is the devman handle91 * - ENOENT - address is not in use at the moment92 */93 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS,94 95 86 /** Register endpoint attributes at host controller. 96 87 * This is used to reserve portion of USB bandwidth. … … 131 122 } usbhc_iface_funcs_t; 132 123 133 134 135 int usbhc_get_handle(async_exch_t *exch, usb_address_t address,136 devman_handle_t *handle)137 {138 if (!exch)139 return EBADMEM;140 sysarg_t h;141 const int ret = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),142 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS, address, &h);143 if (ret == EOK && handle)144 *handle = (devman_handle_t)h;145 return ret;146 }147 148 124 int usbhc_register_endpoint(async_exch_t *exch, usb_address_t address, 149 125 usb_endpoint_t endpoint, usb_transfer_type_t type, … … 265 241 266 242 267 static void remote_usbhc_get_handle(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);268 243 static void remote_usbhc_register_endpoint(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 269 244 static void remote_usbhc_unregister_endpoint(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 274 249 /** Remote USB host controller interface operations. */ 275 250 static remote_iface_func_ptr_t remote_usbhc_iface_ops[] = { 276 [IPC_M_USBHC_GET_HANDLE_BY_ADDRESS] = remote_usbhc_get_handle,277 278 251 [IPC_M_USBHC_REGISTER_ENDPOINT] = remote_usbhc_register_endpoint, 279 252 [IPC_M_USBHC_UNREGISTER_ENDPOINT] = remote_usbhc_unregister_endpoint, … … 322 295 return trans; 323 296 } 324 325 326 void remote_usbhc_get_handle(ddf_fun_t *fun, void *iface,327 ipc_callid_t callid, ipc_call_t *call)328 {329 const usbhc_iface_t *usb_iface = iface;330 331 if (!usb_iface->get_handle) {332 async_answer_0(callid, ENOTSUP);333 return;334 }335 336 const usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);337 devman_handle_t handle;338 const int ret = usb_iface->get_handle(fun, address, &handle);339 340 if (ret == EOK) {341 async_answer_1(callid, ret, handle);342 } else {343 async_answer_0(callid, ret);344 }345 }346 347 297 348 298 static void callback_out(int outcome, void *arg)
Note:
See TracChangeset
for help on using the changeset viewer.