Changeset 4603b35 in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2018-01-16T20:23:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 51a51be
- Parents:
- eeca8a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
reeca8a6 r4603b35 45 45 46 46 typedef enum { 47 IPC_M_USB_RESERVE_DEFAULT_ADDRESS, 48 IPC_M_USB_RELEASE_DEFAULT_ADDRESS, 47 IPC_M_USB_DEFAULT_ADDRESS_RESERVATION, 49 48 IPC_M_USB_DEVICE_ENUMERATE, 50 49 IPC_M_USB_DEVICE_REMOVE, … … 63 62 if (!exch) 64 63 return EBADMEM; 65 return async_req_ 1_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USB_RESERVE_DEFAULT_ADDRESS);64 return async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USB_DEFAULT_ADDRESS_RESERVATION, true); 66 65 } 67 66 … … 76 75 if (!exch) 77 76 return EBADMEM; 78 return async_req_ 1_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USB_RELEASE_DEFAULT_ADDRESS);77 return async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USB_DEFAULT_ADDRESS_RESERVATION, false); 79 78 } 80 79 … … 263 262 } 264 263 265 static void remote_usbhc_reserve_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 266 static void remote_usbhc_release_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 264 static void remote_usbhc_default_address_reservation(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 267 265 static void remote_usbhc_device_enumerate(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 268 266 static void remote_usbhc_device_remove(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 274 272 /** Remote USB interface operations. */ 275 273 static const remote_iface_func_ptr_t remote_usbhc_iface_ops [] = { 276 [IPC_M_USB_RESERVE_DEFAULT_ADDRESS] = remote_usbhc_reserve_default_address, 277 [IPC_M_USB_RELEASE_DEFAULT_ADDRESS] = remote_usbhc_release_default_address, 274 [IPC_M_USB_DEFAULT_ADDRESS_RESERVATION] = remote_usbhc_default_address_reservation, 278 275 [IPC_M_USB_DEVICE_ENUMERATE] = remote_usbhc_device_enumerate, 279 276 [IPC_M_USB_DEVICE_REMOVE] = remote_usbhc_device_remove, … … 297 294 } async_transaction_t; 298 295 299 void remote_usbhc_ reserve_default_address(ddf_fun_t *fun, void *iface,296 void remote_usbhc_default_address_reservation(ddf_fun_t *fun, void *iface, 300 297 ipc_callid_t callid, ipc_call_t *call) 301 298 { 302 299 const usbhc_iface_t *usbhc_iface = (usbhc_iface_t *) iface; 303 300 304 if (usbhc_iface->reserve_default_address == NULL) { 305 async_answer_0(callid, ENOTSUP); 306 return; 307 } 308 309 const int ret = usbhc_iface->reserve_default_address(fun); 301 if (usbhc_iface->default_address_reservation == NULL) { 302 async_answer_0(callid, ENOTSUP); 303 return; 304 } 305 306 const bool reserve = IPC_GET_ARG2(*call); 307 const int ret = usbhc_iface->default_address_reservation(fun, reserve); 310 308 async_answer_0(callid, ret); 311 309 } 312 310 313 void remote_usbhc_release_default_address(ddf_fun_t *fun, void *iface,314 ipc_callid_t callid, ipc_call_t *call)315 {316 const usbhc_iface_t *usbhc_iface = (usbhc_iface_t *) iface;317 318 if (usbhc_iface->release_default_address == NULL) {319 async_answer_0(callid, ENOTSUP);320 return;321 }322 323 const int ret = usbhc_iface->release_default_address(fun);324 async_answer_0(callid, ret);325 }326 311 327 312 static void remote_usbhc_device_enumerate(ddf_fun_t *fun, void *iface,
Note:
See TracChangeset
for help on using the changeset viewer.