Changeset a43f1d18 in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2011-04-09T18:26:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2ad98fd
- Parents:
- f35b294 (diff), 97e7e8a (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
rf35b294 ra43f1d18 270 270 } 271 271 272 size_t max_packet_size = DEV_IPC_GET_ARG3(*call);273 272 usb_target_t target = { 274 273 .address = DEV_IPC_GET_ARG1(*call), … … 300 299 trans->size = len; 301 300 302 rc = transfer_func(fun, target, max_packet_size,301 rc = transfer_func(fun, target, 303 302 buffer, len, 304 303 callback_out, trans); … … 326 325 } 327 326 328 size_t max_packet_size = DEV_IPC_GET_ARG3(*call);329 327 usb_target_t target = { 330 328 .address = DEV_IPC_GET_ARG1(*call), … … 348 346 trans->size = len; 349 347 350 int rc = transfer_func(fun, target, max_packet_size,348 int rc = transfer_func(fun, target, 351 349 trans->buffer, len, 352 350 callback_in, trans); … … 414 412 }; 415 413 size_t data_buffer_len = DEV_IPC_GET_ARG3(*call); 416 size_t max_packet_size = DEV_IPC_GET_ARG4(*call);417 414 418 415 int rc; … … 450 447 trans->size = data_buffer_len; 451 448 452 rc = usb_iface->control_write(fun, target, max_packet_size,449 rc = usb_iface->control_write(fun, target, 453 450 setup_packet, setup_packet_len, 454 451 data_buffer, data_buffer_len, … … 477 474 .endpoint = DEV_IPC_GET_ARG2(*call) 478 475 }; 479 size_t max_packet_size = DEV_IPC_GET_ARG3(*call);480 476 481 477 int rc; … … 515 511 } 516 512 517 rc = usb_iface->control_read(fun, target, max_packet_size,513 rc = usb_iface->control_read(fun, target, 518 514 setup_packet, setup_packet_len, 519 515 trans->buffer, trans->size, … … 537 533 } 538 534 539 #define INIT_FROM_HIGH_DATA(type, var, arg_no) \ 540 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) / 256 541 #define INIT_FROM_LOW_DATA(type, var, arg_no) \ 542 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) % 256 543 544 INIT_FROM_HIGH_DATA(usb_address_t, address, 1); 545 INIT_FROM_LOW_DATA(usb_endpoint_t, endpoint, 1); 546 INIT_FROM_HIGH_DATA(usb_transfer_type_t, transfer_type, 2); 547 INIT_FROM_LOW_DATA(usb_direction_t, direction, 2); 548 549 #undef INIT_FROM_HIGH_DATA 550 #undef INIT_FROM_LOW_DATA 551 552 size_t max_packet_size = (size_t) DEV_IPC_GET_ARG3(*call); 553 unsigned int interval = (unsigned int) DEV_IPC_GET_ARG4(*call); 554 555 int rc = usb_iface->register_endpoint(fun, address, endpoint, 535 #define _INIT_FROM_HIGH_DATA2(type, var, arg_no) \ 536 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) / (1 << 16) 537 #define _INIT_FROM_LOW_DATA2(type, var, arg_no) \ 538 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) % (1 << 16) 539 #define _INIT_FROM_HIGH_DATA3(type, var, arg_no) \ 540 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) / (1 << 16) 541 #define _INIT_FROM_MIDDLE_DATA3(type, var, arg_no) \ 542 type var = (type) (DEV_IPC_GET_ARG##arg_no(*call) / (1 << 8)) % (1 << 8) 543 #define _INIT_FROM_LOW_DATA3(type, var, arg_no) \ 544 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) % (1 << 8) 545 546 _INIT_FROM_HIGH_DATA2(usb_address_t, address, 1); 547 _INIT_FROM_LOW_DATA2(usb_endpoint_t, endpoint, 1); 548 549 _INIT_FROM_HIGH_DATA3(usb_speed_t, speed, 2); 550 _INIT_FROM_MIDDLE_DATA3(usb_transfer_type_t, transfer_type, 2); 551 _INIT_FROM_LOW_DATA3(usb_direction_t, direction, 2); 552 553 _INIT_FROM_HIGH_DATA2(size_t, max_packet_size, 3); 554 _INIT_FROM_LOW_DATA2(unsigned int, interval, 3); 555 556 #undef _INIT_FROM_HIGH_DATA2 557 #undef _INIT_FROM_LOW_DATA2 558 #undef _INIT_FROM_HIGH_DATA3 559 #undef _INIT_FROM_MIDDLE_DATA3 560 #undef _INIT_FROM_LOW_DATA3 561 562 int rc = usb_iface->register_endpoint(fun, address, speed, endpoint, 556 563 transfer_type, direction, max_packet_size, interval); 557 564
Note:
See TracChangeset
for help on using the changeset viewer.