Changeset 8a01a0b in mainline
- Timestamp:
- 2011-12-14T21:23:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6883abfa
- Parents:
- 0cfb05e
- Location:
- uspace/lib/usbdev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/driver.h
r0cfb05e r8a01a0b 176 176 const usb_endpoint_description_t **, const uint8_t *, size_t, int, int, 177 177 usb_endpoint_mapping_t **, size_t *); 178 int usb_device_destroy_pipes( const ddf_dev_t *,usb_endpoint_mapping_t *, size_t);178 int usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t); 179 179 180 180 void * usb_device_data_alloc(usb_device_t *, size_t); -
uspace/lib/usbdev/src/devdrv.c
r0cfb05e r8a01a0b 205 205 static int destroy_current_pipes(usb_device_t *dev) 206 206 { 207 int rc = usb_device_destroy_pipes(dev->ddf_dev, 208 dev->pipes, dev->pipes_count); 207 const int rc = usb_device_destroy_pipes(dev->pipes, dev->pipes_count); 209 208 if (rc != EOK) { 210 209 return rc; … … 423 422 * @param[in] pipes_count Number of endpoints. 424 423 */ 425 int usb_device_destroy_pipes(const ddf_dev_t *dev, 426 usb_endpoint_mapping_t *pipes, size_t pipes_count) 427 { 428 assert(dev != NULL); 429 424 int usb_device_destroy_pipes(usb_endpoint_mapping_t *pipes, size_t pipes_count) 425 { 430 426 if (pipes_count == 0) { 431 427 assert(pipes == NULL); … … 434 430 assert(pipes != NULL); 435 431 436 int rc;437 438 /* Prepare connection to HC to allow endpoint unregistering. */439 usb_hc_connection_t hc_conn;440 rc = usb_hc_connection_initialize_from_device(&hc_conn, dev);441 if (rc != EOK) {442 return rc;443 }444 /* Open connection to hc for pipe unregister. */445 rc = usb_hc_connection_open(&hc_conn);446 if (rc != EOK) {447 return rc;448 }449 450 432 /* Destroy the pipes. */ 451 size_t i; 452 for (i = 0; i < pipes_count; i++) { 453 usb_log_debug2("Unregistering pipe %zu (%spresent).\n", 433 for (size_t i = 0; i < pipes_count; ++i) { 434 usb_log_debug2("Unregistering pipe %zu: %spresent.\n", 454 435 i, pipes[i].present ? "" : "not "); 455 436 if (pipes[i].present) … … 457 438 } 458 439 459 usb_hc_connection_close(&hc_conn);460 440 free(pipes); 461 441
Note:
See TracChangeset
for help on using the changeset viewer.