Changes in uspace/lib/drv/generic/remote_usbhc.c [a76b01b4:272f46f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
ra76b01b4 r272f46f8 165 165 { 166 166 if (!exch || !address) 167 return E BADMEM;167 return EINVAL; 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 BADMEM;180 return EINVAL; 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 BADMEM;189 return EINVAL; 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 BADMEM;201 return EINVAL; 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 BADMEM;211 return EINVAL; 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 BADMEM;227 return EINVAL; 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 239 236 if (size == 0 && setup == 0) 240 237 return EOK; 241 238 239 if (!exch) 240 return EINVAL; 242 241 const usb_target_t target = 243 242 {{ .address = address, .endpoint = endpoint }}; … … 285 284 return EOK; 286 285 } 287 286 /*----------------------------------------------------------------------------*/ 288 287 int usbhc_write(async_exch_t *exch, usb_address_t address, 289 288 usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size) 290 289 { 291 if (!exch)292 return EBADMEM;293 294 290 if (size == 0 && setup == 0) 295 291 return EOK; 296 292 293 if (!exch) 294 return EINVAL; 297 295 const usb_target_t target = 298 296 {{ .address = address, .endpoint = endpoint }}; … … 321 319 return (int) opening_request_rc; 322 320 } 323 321 /*----------------------------------------------------------------------------*/ 324 322 325 323 static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 386 384 return trans; 387 385 } 388 386 /*----------------------------------------------------------------------------*/ 389 387 void remote_usbhc_request_address(ddf_fun_t *fun, void *iface, 390 388 ipc_callid_t callid, ipc_call_t *call) … … 408 406 } 409 407 } 410 408 /*----------------------------------------------------------------------------*/ 411 409 void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface, 412 410 ipc_callid_t callid, ipc_call_t *call) … … 425 423 async_answer_0(callid, ret); 426 424 } 427 425 /*----------------------------------------------------------------------------*/ 428 426 void remote_usbhc_get_handle(ddf_fun_t *fun, void *iface, 429 427 ipc_callid_t callid, ipc_call_t *call) … … 446 444 } 447 445 } 448 446 /*----------------------------------------------------------------------------*/ 449 447 void remote_usbhc_release_address(ddf_fun_t *fun, void *iface, 450 448 ipc_callid_t callid, ipc_call_t *call) … … 462 460 async_answer_0(callid, ret); 463 461 } 464 462 /*----------------------------------------------------------------------------*/ 465 463 static void callback_out(ddf_fun_t *fun, 466 464 int outcome, void *arg) … … 472 470 async_transaction_destroy(trans); 473 471 } 474 472 /*----------------------------------------------------------------------------*/ 475 473 static void callback_in(ddf_fun_t *fun, 476 474 int outcome, size_t actual_size, void *arg) … … 496 494 async_transaction_destroy(trans); 497 495 } 498 496 /*----------------------------------------------------------------------------*/ 499 497 void remote_usbhc_register_endpoint(ddf_fun_t *fun, void *iface, 500 498 ipc_callid_t callid, ipc_call_t *call) … … 596 594 } 597 595 } 598 596 /*----------------------------------------------------------------------------*/ 599 597 void remote_usbhc_write( 600 598 ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
Note:
See TracChangeset
for help on using the changeset viewer.