Changeset 1998bcd in mainline for uspace/lib/drv
- Timestamp:
- 2011-04-08T22:25:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 98064795
- Parents:
- 297341b
- Location:
- uspace/lib/drv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r297341b r1998bcd 533 533 } 534 534 535 #define INIT_FROM_HIGH_DATA(type, var, arg_no) \ 536 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) / 256 537 #define INIT_FROM_LOW_DATA(type, var, arg_no) \ 538 type var = (type) DEV_IPC_GET_ARG##arg_no(*call) % 256 539 540 INIT_FROM_HIGH_DATA(usb_address_t, address, 1); 541 INIT_FROM_LOW_DATA(usb_endpoint_t, endpoint, 1); 542 INIT_FROM_HIGH_DATA(usb_transfer_type_t, transfer_type, 2); 543 INIT_FROM_LOW_DATA(usb_direction_t, direction, 2); 544 545 #undef INIT_FROM_HIGH_DATA 546 #undef INIT_FROM_LOW_DATA 547 548 size_t max_packet_size = (size_t) DEV_IPC_GET_ARG3(*call); 549 unsigned int interval = (unsigned int) DEV_IPC_GET_ARG4(*call); 550 551 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, 552 563 transfer_type, direction, max_packet_size, interval); 553 564 -
uspace/lib/drv/include/usbhc_iface.h
r297341b r1998bcd 168 168 /** Register endpoint attributes at host controller. 169 169 * This is used to reserve portion of USB bandwidth. 170 * When speed is invalid, speed of the device is used. 170 171 * Parameters: 171 * - USB address + endpoint number (ADDR * 256 + EP) 172 * - transfer type + direction (TYPE * 256 + DIR) 173 * - maximum packet size 174 * - interval (in milliseconds) 172 * - USB address + endpoint number 173 * - packed as ADDR << 16 + EP 174 * - speed + transfer type + direction 175 * - packed as ( SPEED << 8 + TYPE ) << 8 + DIR 176 * - maximum packet size + interval (in milliseconds) 177 * - packed as MPS << 16 + INT 175 178 * Answer: 176 179 * - EOK - reservation successful … … 221 224 int (*release_address)(ddf_fun_t *, usb_address_t); 222 225 223 int (*register_endpoint)(ddf_fun_t *, usb_address_t, usb_endpoint_t, 226 int (*register_endpoint)(ddf_fun_t *, 227 usb_address_t, usb_speed_t, usb_endpoint_t, 224 228 usb_transfer_type_t, usb_direction_t, size_t, unsigned int); 225 229 int (*unregister_endpoint)(ddf_fun_t *, usb_address_t, usb_endpoint_t,
Note:
See TracChangeset
for help on using the changeset viewer.