Changes in uspace/lib/drv/generic/remote_usbhc.c [ec59693:5842493] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
rec59693 r5842493 40 40 41 41 #define USB_MAX_PAYLOAD_SIZE 1020 42 #define HACK_MAX_PACKET_SIZE 843 #define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 444 42 45 43 static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *); … … 242 240 243 241 static void callback_out(device_t *device, 244 int outcome, void *arg)242 usb_transaction_outcome_t outcome, void *arg) 245 243 { 246 244 async_transaction_t *trans = (async_transaction_t *)arg; … … 252 250 253 251 static void callback_in(device_t *device, 254 int outcome, size_t actual_size, void *arg)252 usb_transaction_outcome_t outcome, size_t actual_size, void *arg) 255 253 { 256 254 async_transaction_t *trans = (async_transaction_t *)arg; 257 255 258 if (outcome != EOK) {256 if (outcome != USB_OUTCOME_OK) { 259 257 async_answer_0(trans->caller, outcome); 260 258 if (trans->data_caller) { … … 272 270 } 273 271 274 async_answer_0(trans->caller, EOK);272 async_answer_0(trans->caller, USB_OUTCOME_OK); 275 273 276 274 async_transaction_destroy(trans); … … 324 322 trans->size = len; 325 323 326 int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE, 327 buffer, len, 324 int rc = transfer_func(device, target, buffer, len, 328 325 callback_out, trans); 329 326 … … 371 368 trans->size = len; 372 369 373 int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE_INTERRUPT_IN, 374 trans->buffer, len, 370 int rc = transfer_func(device, target, trans->buffer, len, 375 371 callback_in, trans); 376 372 … … 544 540 .endpoint = DEV_IPC_GET_ARG2(*call) 545 541 }; 546 size_t data_buffer_len = DEV_IPC_GET_ARG3(*call);547 542 548 543 int rc; … … 551 546 void *data_buffer = NULL; 552 547 size_t setup_packet_len = 0; 548 size_t data_buffer_len = 0; 553 549 554 550 rc = async_data_write_accept(&setup_packet, false, … … 558 554 return; 559 555 } 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 } 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; 569 562 } 570 563 … … 580 573 trans->size = data_buffer_len; 581 574 582 rc = usb_iface->control_write(device, target, HACK_MAX_PACKET_SIZE,575 rc = usb_iface->control_write(device, target, 583 576 setup_packet, setup_packet_len, 584 577 data_buffer, data_buffer_len, … … 603 596 } 604 597 598 size_t data_len = DEV_IPC_GET_ARG3(*call); 605 599 usb_target_t target = { 606 600 .address = DEV_IPC_GET_ARG1(*call), … … 612 606 void *setup_packet = NULL; 613 607 size_t setup_packet_len = 0; 614 size_t data_len = 0;615 608 616 609 rc = async_data_write_accept(&setup_packet, false, … … 644 637 } 645 638 646 rc = usb_iface->control_read(device, target, HACK_MAX_PACKET_SIZE,639 rc = usb_iface->control_read(device, target, 647 640 setup_packet, setup_packet_len, 648 641 trans->buffer, trans->size,
Note:
See TracChangeset
for help on using the changeset viewer.