Changes in uspace/lib/drv/generic/remote_usbhc.c [272f46f8:a76b01b4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r272f46f8 ra76b01b4 165 165 { 166 166 if (!exch || !address) 167 return E INVAL;167 return EBADMEM; 168 168 sysarg_t new_address; 169 169 const int ret = async_req_4_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), … … 173 173 return ret; 174 174 } 175 /*----------------------------------------------------------------------------*/ 175 176 176 int usbhc_bind_address(async_exch_t *exch, usb_address_t address, 177 177 devman_handle_t handle) 178 178 { 179 179 if (!exch) 180 return E INVAL;180 return EBADMEM; 181 181 return async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 182 182 IPC_M_USBHC_BIND_ADDRESS, address, handle); 183 183 } 184 /*----------------------------------------------------------------------------*/ 184 185 185 int usbhc_get_handle(async_exch_t *exch, usb_address_t address, 186 186 devman_handle_t *handle) 187 187 { 188 188 if (!exch) 189 return E INVAL;189 return EBADMEM; 190 190 sysarg_t h; 191 191 const int ret = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), … … 195 195 return ret; 196 196 } 197 /*----------------------------------------------------------------------------*/ 197 198 198 int usbhc_release_address(async_exch_t *exch, usb_address_t address) 199 199 { 200 200 if (!exch) 201 return E INVAL;201 return EBADMEM; 202 202 return async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 203 203 IPC_M_USBHC_RELEASE_ADDRESS, address); 204 204 } 205 /*----------------------------------------------------------------------------*/ 205 206 206 int usbhc_register_endpoint(async_exch_t *exch, usb_address_t address, 207 207 usb_endpoint_t endpoint, usb_transfer_type_t type, … … 209 209 { 210 210 if (!exch) 211 return E INVAL;211 return EBADMEM; 212 212 const usb_target_t target = 213 213 {{ .address = address, .endpoint = endpoint }}; … … 220 220 #undef _PACK2 221 221 } 222 /*----------------------------------------------------------------------------*/ 222 223 223 int usbhc_unregister_endpoint(async_exch_t *exch, usb_address_t address, 224 224 usb_endpoint_t endpoint, usb_direction_t direction) 225 225 { 226 226 if (!exch) 227 return E INVAL;227 return EBADMEM; 228 228 return async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE), 229 229 IPC_M_USBHC_UNREGISTER_ENDPOINT, address, endpoint, direction); 230 230 } 231 /*----------------------------------------------------------------------------*/ 231 232 232 int usbhc_read(async_exch_t *exch, usb_address_t address, 233 233 usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size, 234 234 size_t *rec_size) 235 235 { 236 if (!exch) 237 return EBADMEM; 238 236 239 if (size == 0 && setup == 0) 237 240 return EOK; 238 241 239 if (!exch)240 return EINVAL;241 242 const usb_target_t target = 242 243 {{ .address = address, .endpoint = endpoint }}; … … 284 285 return EOK; 285 286 } 286 /*----------------------------------------------------------------------------*/ 287 287 288 int usbhc_write(async_exch_t *exch, usb_address_t address, 288 289 usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size) 289 290 { 291 if (!exch) 292 return EBADMEM; 293 290 294 if (size == 0 && setup == 0) 291 295 return EOK; 292 296 293 if (!exch)294 return EINVAL;295 297 const usb_target_t target = 296 298 {{ .address = address, .endpoint = endpoint }}; … … 319 321 return (int) opening_request_rc; 320 322 } 321 /*----------------------------------------------------------------------------*/ 323 322 324 323 325 static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 384 386 return trans; 385 387 } 386 /*----------------------------------------------------------------------------*/ 388 387 389 void remote_usbhc_request_address(ddf_fun_t *fun, void *iface, 388 390 ipc_callid_t callid, ipc_call_t *call) … … 406 408 } 407 409 } 408 /*----------------------------------------------------------------------------*/ 410 409 411 void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface, 410 412 ipc_callid_t callid, ipc_call_t *call) … … 423 425 async_answer_0(callid, ret); 424 426 } 425 /*----------------------------------------------------------------------------*/ 427 426 428 void remote_usbhc_get_handle(ddf_fun_t *fun, void *iface, 427 429 ipc_callid_t callid, ipc_call_t *call) … … 444 446 } 445 447 } 446 /*----------------------------------------------------------------------------*/ 448 447 449 void remote_usbhc_release_address(ddf_fun_t *fun, void *iface, 448 450 ipc_callid_t callid, ipc_call_t *call) … … 460 462 async_answer_0(callid, ret); 461 463 } 462 /*----------------------------------------------------------------------------*/ 464 463 465 static void callback_out(ddf_fun_t *fun, 464 466 int outcome, void *arg) … … 470 472 async_transaction_destroy(trans); 471 473 } 472 /*----------------------------------------------------------------------------*/ 474 473 475 static void callback_in(ddf_fun_t *fun, 474 476 int outcome, size_t actual_size, void *arg) … … 494 496 async_transaction_destroy(trans); 495 497 } 496 /*----------------------------------------------------------------------------*/ 498 497 499 void remote_usbhc_register_endpoint(ddf_fun_t *fun, void *iface, 498 500 ipc_callid_t callid, ipc_call_t *call) … … 594 596 } 595 597 } 596 /*----------------------------------------------------------------------------*/ 598 597 599 void remote_usbhc_write( 598 600 ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
Note:
See TracChangeset
for help on using the changeset viewer.