Changeset 2e85b3c in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2011-02-16T18:22:43Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4c87aa9
- Parents:
- 600733e (diff), ec59693 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r600733e r2e85b3c 40 40 41 41 #define USB_MAX_PAYLOAD_SIZE 1020 42 #define HACK_MAX_PACKET_SIZE 8 43 #define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 4 42 44 43 45 static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *); … … 240 242 241 243 static void callback_out(device_t *device, 242 usb_transaction_outcome_t outcome, void *arg)244 int outcome, void *arg) 243 245 { 244 246 async_transaction_t *trans = (async_transaction_t *)arg; … … 250 252 251 253 static void callback_in(device_t *device, 252 usb_transaction_outcome_t outcome, size_t actual_size, void *arg)254 int outcome, size_t actual_size, void *arg) 253 255 { 254 256 async_transaction_t *trans = (async_transaction_t *)arg; 255 257 256 if (outcome != USB_OUTCOME_OK) {258 if (outcome != EOK) { 257 259 async_answer_0(trans->caller, outcome); 258 260 if (trans->data_caller) { … … 270 272 } 271 273 272 async_answer_0(trans->caller, USB_OUTCOME_OK);274 async_answer_0(trans->caller, EOK); 273 275 274 276 async_transaction_destroy(trans); … … 322 324 trans->size = len; 323 325 324 int rc = transfer_func(device, target, buffer, len, 326 int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE, 327 buffer, len, 325 328 callback_out, trans); 326 329 … … 368 371 trans->size = len; 369 372 370 int rc = transfer_func(device, target, trans->buffer, len, 373 int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE_INTERRUPT_IN, 374 trans->buffer, len, 371 375 callback_in, trans); 372 376 … … 540 544 .endpoint = DEV_IPC_GET_ARG2(*call) 541 545 }; 546 size_t data_buffer_len = DEV_IPC_GET_ARG3(*call); 542 547 543 548 int rc; … … 546 551 void *data_buffer = NULL; 547 552 size_t setup_packet_len = 0; 548 size_t data_buffer_len = 0;549 553 550 554 rc = async_data_write_accept(&setup_packet, false, … … 554 558 return; 555 559 } 556 rc = async_data_write_accept(&data_buffer, false, 557 1, USB_MAX_PAYLOAD_SIZE, 0, &data_buffer_len); 558 if (rc != EOK) { 559 async_answer_0(callid, rc); 560 free(setup_packet); 561 return; 560 561 if (data_buffer_len > 0) { 562 rc = async_data_write_accept(&data_buffer, false, 563 1, USB_MAX_PAYLOAD_SIZE, 0, &data_buffer_len); 564 if (rc != EOK) { 565 async_answer_0(callid, rc); 566 free(setup_packet); 567 return; 568 } 562 569 } 563 570 … … 573 580 trans->size = data_buffer_len; 574 581 575 rc = usb_iface->control_write(device, target, 582 rc = usb_iface->control_write(device, target, HACK_MAX_PACKET_SIZE, 576 583 setup_packet, setup_packet_len, 577 584 data_buffer, data_buffer_len, … … 596 603 } 597 604 598 size_t data_len = DEV_IPC_GET_ARG3(*call);599 605 usb_target_t target = { 600 606 .address = DEV_IPC_GET_ARG1(*call), … … 606 612 void *setup_packet = NULL; 607 613 size_t setup_packet_len = 0; 614 size_t data_len = 0; 608 615 609 616 rc = async_data_write_accept(&setup_packet, false, … … 637 644 } 638 645 639 rc = usb_iface->control_read(device, target, 646 rc = usb_iface->control_read(device, target, HACK_MAX_PACKET_SIZE, 640 647 setup_packet, setup_packet_len, 641 648 trans->buffer, trans->size,
Note:
See TracChangeset
for help on using the changeset viewer.