Changes in uspace/lib/usb/src/pipesinit.c [4ede178:2c2cbcf] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/pipesinit.c
r4ede178 r2c2cbcf 365 365 pipe->direction = direction; 366 366 pipe->refcount = 0; 367 pipe->refcount_soft = 0; 368 pipe->auto_reset_halt = false; 367 369 368 370 return EOK; … … 385 387 0, USB_TRANSFER_CONTROL, CTRL_PIPE_MIN_PACKET_SIZE, 386 388 USB_DIRECTION_BOTH); 389 390 pipe->auto_reset_halt = true; 387 391 388 392 return rc; … … 416 420 int rc; 417 421 418 rc = usb_pipe_start_long_transfer(pipe); 419 if (rc != EOK) { 420 return rc; 421 } 422 422 usb_pipe_start_long_transfer(pipe); 423 423 424 424 uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE]; … … 459 459 usb_hc_connection_t *hc_connection) 460 460 { 461 return usb_pipe_register_with_speed(pipe, USB_SPEED_MAX + 1, 462 interval, hc_connection); 463 } 464 465 /** Register endpoint with a speed at the host controller. 466 * 467 * You will rarely need to use this function because it is needed only 468 * if the registered endpoint is of address 0 and there is no other way 469 * to tell speed of the device at address 0. 470 * 471 * @param pipe Pipe to be registered. 472 * @param speed Speed of the device 473 * (invalid speed means use previously specified one). 474 * @param interval Polling interval. 475 * @param hc_connection Connection to the host controller (must be opened). 476 * @return Error code. 477 */ 478 int usb_pipe_register_with_speed(usb_pipe_t *pipe, usb_speed_t speed, 479 unsigned int interval, 480 usb_hc_connection_t *hc_connection) 481 { 461 482 assert(pipe); 462 483 assert(hc_connection); … … 466 487 } 467 488 468 #define _PACK(high, low) ((high) * 256 + (low)) 469 470 return async_req_5_0(hc_connection->hc_phone, 489 #define _PACK2(high, low) (((high) << 16) + (low)) 490 #define _PACK3(high, middle, low) (((((high) << 8) + (middle)) << 8) + (low)) 491 492 return async_req_4_0(hc_connection->hc_phone, 471 493 DEV_IFACE_ID(USBHC_DEV_IFACE), IPC_M_USBHC_REGISTER_ENDPOINT, 472 _PACK(pipe->wire->address, pipe->endpoint_no), 473 _PACK(pipe->transfer_type, pipe->direction), 474 pipe->max_packet_size, interval); 475 476 #undef _PACK 494 _PACK2(pipe->wire->address, pipe->endpoint_no), 495 _PACK3(speed, pipe->transfer_type, pipe->direction), 496 _PACK2(pipe->max_packet_size, interval)); 497 498 #undef _PACK2 499 #undef _PACK3 477 500 } 478 501
Note:
See TracChangeset
for help on using the changeset viewer.