Changes in uspace/lib/usbdev/src/pipesinit.c [3ddbd38:277ff98] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipesinit.c
r3ddbd38 r277ff98 349 349 fibril_mutex_initialize(&pipe->guard); 350 350 pipe->wire = connection; 351 pipe->hc_sess = NULL;352 fibril_mutex_initialize(&pipe->hc_sess_mutex);353 351 pipe->endpoint_no = endpoint_no; 354 352 pipe->transfer_type = transfer_type; 355 353 pipe->max_packet_size = max_packet_size; 356 354 pipe->direction = direction; 357 pipe->refcount = 0;358 pipe->refcount_soft = 0;359 355 pipe->auto_reset_halt = false; 360 356 … … 375 371 assert(connection); 376 372 377 int rc = usb_pipe_initialize(pipe, connection, 378 0, USB_TRANSFER_CONTROL, CTRL_PIPE_MIN_PACKET_SIZE, 379 USB_DIRECTION_BOTH); 373 int rc = usb_pipe_initialize(pipe, connection, 0, USB_TRANSFER_CONTROL, 374 CTRL_PIPE_MIN_PACKET_SIZE, USB_DIRECTION_BOTH); 380 375 381 376 pipe->auto_reset_halt = true; … … 442 437 * @return Error code. 443 438 */ 444 int usb_pipe_register(usb_pipe_t *pipe, unsigned interval, 445 usb_hc_connection_t *hc_connection) 439 int usb_pipe_register(usb_pipe_t *pipe, unsigned interval) 446 440 { 447 441 assert(pipe); 448 442 assert(pipe->wire); 449 assert(hc_connection); 450 451 if (!usb_hc_connection_is_opened(hc_connection)) 452 return EBADF; 453 async_exch_t *exch = async_exchange_begin(hc_connection->hc_sess); 454 if (!exch) 455 return ENOMEM; 456 const int ret = usbhc_register_endpoint(exch, 457 pipe->wire->address, pipe->endpoint_no, pipe->transfer_type, 458 pipe->direction, pipe->max_packet_size, interval); 459 460 async_exchange_end(exch); 461 return ret; 443 assert(pipe->wire->hc_connection); 444 445 return usb_hc_register_endpoint(pipe->wire->hc_connection, 446 pipe->wire->address, pipe->endpoint_no, pipe->transfer_type, 447 pipe->direction, pipe->max_packet_size, interval); 462 448 } 463 449 … … 468 454 * @return Error code. 469 455 */ 470 int usb_pipe_unregister(usb_pipe_t *pipe, 471 usb_hc_connection_t *hc_connection) 456 int usb_pipe_unregister(usb_pipe_t *pipe) 472 457 { 473 458 assert(pipe); 474 459 assert(pipe->wire); 475 assert(hc_connection); 476 477 if (!usb_hc_connection_is_opened(hc_connection)) 478 return EBADF; 479 480 async_exch_t *exch = async_exchange_begin(hc_connection->hc_sess); 481 if (!exch) 482 return ENOMEM; 483 const int ret = usbhc_unregister_endpoint(exch, 460 assert(pipe->wire->hc_connection); 461 462 return usb_hc_unregister_endpoint(pipe->wire->hc_connection, 484 463 pipe->wire->address, pipe->endpoint_no, pipe->direction); 485 async_exchange_end(exch);486 487 return ret;488 464 } 489 465
Note:
See TracChangeset
for help on using the changeset viewer.