Changeset bdd8ad2f in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2011-09-14T20:15:03Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bbce2c2
- Parents:
- 365e29e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r365e29e2 rbdd8ad2f 230 230 ipc_callid_t callid, ipc_call_t *call) 231 231 { 232 assert(false); 232 233 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 233 234 assert(usb_iface != NULL); … … 291 292 ipc_callid_t callid, ipc_call_t *call) 292 293 { 294 assert(false); 293 295 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 294 296 assert(usb_iface != NULL); … … 388 390 #undef _INIT_FROM_LOW_DATA3 389 391 390 int rc = usb_iface->register_endpoint(fun, target.address, 391 speed, target.endpoint, 392 transfer_type, direction, max_packet_size, interval); 392 int rc = usb_iface->register_endpoint(fun, target.address, speed, 393 target.endpoint, transfer_type, direction, max_packet_size, interval); 393 394 394 395 async_answer_0(callid, rc); … … 431 432 432 433 const usb_target_t target = { .packed = DEV_IPC_GET_ARG1(*call) }; 434 const uint64_t setup = 435 ((uint64_t)DEV_IPC_GET_ARG2(*call)) | 436 (((uint64_t)DEV_IPC_GET_ARG3(*call)) << 32); 433 437 434 438 async_transaction_t *trans = async_transaction_create(callid); … … 451 455 452 456 const int rc = hc_iface->read( 453 fun, target, 0, trans->buffer, trans->size, callback_in, trans);457 fun, target, setup, trans->buffer, trans->size, callback_in, trans); 454 458 455 459 if (rc != EOK) { … … 475 479 476 480 const usb_target_t target = { .packed = DEV_IPC_GET_ARG1(*call) }; 481 const size_t data_buffer_len = DEV_IPC_GET_ARG2(*call); 482 const uint64_t setup = 483 ((uint64_t)DEV_IPC_GET_ARG3(*call)) | 484 (((uint64_t)DEV_IPC_GET_ARG4(*call)) << 32); 477 485 478 486 async_transaction_t *trans = async_transaction_create(callid); … … 482 490 } 483 491 484 int rc = async_data_write_accept(&trans->buffer, false, 485 1, USB_MAX_PAYLOAD_SIZE, 486 0, &trans->size); 487 488 if (rc != EOK) { 489 async_answer_0(callid, rc); 490 async_transaction_destroy(trans); 491 return; 492 } 493 494 rc = hc_iface->write( 495 fun, target, 0, trans->buffer, trans->size, callback_out, trans); 492 if (data_buffer_len > 0) { 493 int rc = async_data_write_accept(&trans->buffer, false, 494 1, USB_MAX_PAYLOAD_SIZE, 495 0, &trans->size); 496 497 if (rc != EOK) { 498 async_answer_0(callid, rc); 499 async_transaction_destroy(trans); 500 return; 501 } 502 } 503 504 int rc = hc_iface->write( 505 fun, target, setup, trans->buffer, trans->size, callback_out, trans); 496 506 497 507 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.