Changes in uspace/lib/drv/generic/remote_usbhc.c [46e078a:eb2f7dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r46e078a reb2f7dd 52 52 static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 53 53 static void remote_usbhc_bind_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 54 static void remote_usbhc_find_by_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 54 55 static void remote_usbhc_release_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 55 56 static void remote_usbhc_register_endpoint(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 61 62 remote_usbhc_request_address, 62 63 remote_usbhc_bind_address, 64 remote_usbhc_find_by_address, 63 65 remote_usbhc_release_address, 64 66 … … 163 165 } 164 166 167 void remote_usbhc_find_by_address(ddf_fun_t *fun, void *iface, 168 ipc_callid_t callid, ipc_call_t *call) 169 { 170 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 171 172 if (!usb_iface->find_by_address) { 173 async_answer_0(callid, ENOTSUP); 174 return; 175 } 176 177 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call); 178 devman_handle_t handle; 179 int rc = usb_iface->find_by_address(fun, address, &handle); 180 181 if (rc == EOK) { 182 async_answer_1(callid, EOK, handle); 183 } else { 184 async_answer_0(callid, rc); 185 } 186 } 187 165 188 void remote_usbhc_release_address(ddf_fun_t *fun, void *iface, 166 189 ipc_callid_t callid, ipc_call_t *call) … … 302 325 async_transaction_t *trans = async_transaction_create(callid); 303 326 if (trans == NULL) { 327 async_answer_0(data_callid, ENOMEM); 304 328 async_answer_0(callid, ENOMEM); 305 329 return; … … 314 338 315 339 if (rc != EOK) { 340 async_answer_0(data_callid, rc); 316 341 async_answer_0(callid, rc); 317 342 async_transaction_destroy(trans); … … 460 485 async_transaction_t *trans = async_transaction_create(callid); 461 486 if (trans == NULL) { 487 async_answer_0(data_callid, ENOMEM); 462 488 async_answer_0(callid, ENOMEM); 463 489 free(setup_packet); … … 469 495 trans->buffer = malloc(data_len); 470 496 if (trans->buffer == NULL) { 497 async_answer_0(data_callid, ENOMEM); 471 498 async_answer_0(callid, ENOMEM); 472 499 async_transaction_destroy(trans); … … 480 507 481 508 if (rc != EOK) { 509 async_answer_0(data_callid, rc); 482 510 async_answer_0(callid, rc); 483 511 async_transaction_destroy(trans);
Note:
See TracChangeset
for help on using the changeset viewer.