Changeset bd575647 in mainline for uspace/lib/usbdev/src/devdrv.c
- Timestamp:
- 2011-12-11T16:30:42Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7d5ef94
- Parents:
- 2c202c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
r2c202c5 rbd575647 373 373 } 374 374 375 /* Register the endpoints with HC. */376 usb_hc_connection_t hc_conn;377 rc = usb_hc_connection_initialize_from_device(&hc_conn, dev);378 if (rc != EOK) {379 goto rollback_free_only;380 }381 382 rc = usb_hc_connection_open(&hc_conn);383 if (rc != EOK) {384 goto rollback_free_only;385 }386 387 375 for (i = 0; i < pipe_count; i++) { 388 376 if (pipes[i].present) { 389 377 rc = usb_pipe_register(&pipes[i].pipe, 390 pipes[i].descriptor->poll_interval , &hc_conn);378 pipes[i].descriptor->poll_interval); 391 379 if (rc != EOK) { 392 380 goto rollback_unregister_endpoints; … … 394 382 } 395 383 } 396 397 if (usb_hc_connection_close(&hc_conn) != EOK)398 usb_log_warning("%s: Failed to close connection.\n",399 __FUNCTION__);400 384 401 385 *pipes_ptr = pipes; … … 415 399 for (i = 0; i < pipe_count; i++) { 416 400 if (pipes[i].present) { 417 usb_pipe_unregister(&pipes[i].pipe , &hc_conn);401 usb_pipe_unregister(&pipes[i].pipe); 418 402 } 419 403 } 420 421 if (usb_hc_connection_close(&hc_conn) != EOK)422 usb_log_warning("usb_device_create_pipes(): "423 "Failed to close connection.\n");424 404 425 405 /* … … 470 450 i, pipes[i].present ? "" : "not "); 471 451 if (pipes[i].present) 472 usb_pipe_unregister(&pipes[i].pipe, &hc_conn); 473 } 474 475 if (usb_hc_connection_close(&hc_conn) != EOK) 476 usb_log_warning("usb_device_destroy_pipes(): " 477 "Failed to close connection.\n"); 452 usb_pipe_unregister(&pipes[i].pipe); 453 } 478 454 479 455 free(pipes); … … 505 481 usb_dev->pipes = NULL; 506 482 483 usb_hc_connection_initialize_from_device(&usb_dev->hc_conn, ddf_dev); 484 const usb_address_t address = 485 usb_get_address_by_handle(ddf_dev->handle); 507 486 /* Initialize backing wire and control pipe. */ 508 int rc = usb_device_connection_initialize _from_device(509 &usb_dev->wire, ddf_dev);487 int rc = usb_device_connection_initialize( 488 &usb_dev->wire, &usb_dev->hc_conn, address); 510 489 if (rc != EOK) { 511 490 *errstr_ptr = "device connection initialization";
Note:
See TracChangeset
for help on using the changeset viewer.