Changeset c86ca9a in mainline
- Timestamp:
- 2015-06-29T00:35:29Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68a61f19
- Parents:
- 92900e2
- Location:
- uspace/lib/usbhost/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/ddf_helpers.c
r92900e2 rc86ca9a 472 472 } 473 473 474 usb_log_debug("Found new %s speed USB device\n", usb_str_speed(speed)); 475 474 476 static const usb_target_t default_target = {{ 475 477 .address = USB_ADDRESS_DEFAULT, … … 481 483 return address; 482 484 485 usb_log_debug("Reserved new address: %d\n", address); 486 483 487 const usb_target_t target = {{ 484 488 .address = address, … … 489 493 490 494 /* Add default pipe on default address */ 495 usb_log_debug("Device(%d): Adding default target(0:0)\n", address); 491 496 ret = hcd_add_ep(hcd, 492 497 default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, 493 498 CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 1, 494 499 tt_address, port); 495 496 500 if (ret != EOK) { 497 501 hcd_release_address(hcd, address); … … 505 509 506 510 // TODO CALLBACKS 511 usb_log_debug("Device(%d): Requesting first 8B of device descriptor\n", 512 address); 507 513 ssize_t got = hcd_send_batch_sync(hcd, default_target, USB_DIRECTION_IN, 508 514 &desc, CTRL_PIPE_MIN_PACKET_SIZE, *(uint64_t *)&get_device_desc_8, … … 516 522 517 523 /* Register EP on the new address */ 524 usb_log_debug("Device(%d): Registering control EP\n", address); 518 525 ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL, 519 526 ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)), … … 532 539 SET_ADDRESS(target.address); 533 540 541 usb_log_debug("Device(%d): Setting USB address.\n", address); 534 542 got = hcd_send_batch_sync(hcd, default_target, USB_DIRECTION_OUT, 535 543 NULL, 0, *(uint64_t *)&set_address, "set address"); 536 544 545 usb_log_debug("Device(%d): Removing default (0:0) EP\n", address); 537 546 hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH); 538 547 … … 547 556 GET_DEVICE_DESC(sizeof(desc)); 548 557 558 usb_log_debug("Device(%d): Requesting full device descriptor\n", 559 address); 549 560 got = hcd_send_batch_sync(hcd, target, USB_DIRECTION_IN, 550 561 &desc, sizeof(desc), *(uint64_t *)&get_device_desc, … … 560 571 init_match_ids(&mids); 561 572 573 usb_log_debug("Device(%d): Creating match IDs\n", address); 562 574 ret = create_match_ids(&mids, &desc); 563 575 if (ret != EOK) { … … 568 580 569 581 /* Register device */ 582 usb_log_debug("Device(%d): Registering DDF device\n", address); 570 583 ret = hcd_ddf_add_device(device, hub, port, address, speed, NULL, &mids); 571 584 clean_match_ids(&mids); … … 848 861 hw_res_list_parsed_clean(&hw_res); 849 862 if (ret != EOK) { 850 usb_log_error("Failed to init uhci_hcd: %s.\n", str_error(ret));863 usb_log_error("Failed to init HCD: %s.\n", str_error(ret)); 851 864 goto irq_unregister; 852 865 } … … 871 884 ret = hcd_ddf_setup_root_hub(device); 872 885 if (ret != EOK) { 873 usb_log_error("Failed to setup UHCIroot hub: %s.\n",886 usb_log_error("Failed to setup HC root hub: %s.\n", 874 887 str_error(ret)); 875 888 driver_fini(dev_to_hcd(device)); -
uspace/lib/usbhost/src/usb_bus.c
r92900e2 rc86ca9a 34 34 35 35 #include <usb/host/usb_bus.h> 36 #include <usb/debug.h> 36 37 37 38 #include <assert.h> … … 244 245 245 246 instance->free_bw -= ep->bandwidth; 247 usb_log_debug("Registered EP(%d:%d:%s:%s)\n", ep->address, ep->endpoint, 248 usb_str_transfer_type_short(ep->transfer_type), 249 usb_str_direction(ep->direction)); 246 250 fibril_mutex_unlock(&instance->guard); 247 251 return EOK; … … 267 271 list_remove(&ep->link); 268 272 instance->free_bw += ep->bandwidth; 273 usb_log_debug("Unregistered EP(%d:%d:%s:%s)\n", ep->address, 274 ep->endpoint, usb_str_transfer_type_short(ep->transfer_type), 275 usb_str_direction(ep->direction)); 269 276 fibril_mutex_unlock(&instance->guard); 270 277 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.