Changeset 50ba203 in mainline for uspace/drv/usbhub/usbhub.c
- Timestamp:
- 2011-02-20T15:46:48Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6bb83c7
- Parents:
- d81ef61c (diff), 0c00dac (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
rd81ef61c r50ba203 36 36 #include <bool.h> 37 37 #include <errno.h> 38 #include <str_error.h> 38 39 39 40 #include <usb_iface.h> 40 41 #include <usb/usbdrv.h> 41 42 #include <usb/descriptor.h> 43 #include <usb/recognise.h> 42 44 #include <usb/devreq.h> 43 45 #include <usb/request.h> … … 76 78 result->device = device; 77 79 80 <<<<<<< TREE 78 81 result->usb_device = usb_new(usb_hcd_attached_device_info_t); 79 82 83 ======= 84 85 dprintf(USB_LOG_LEVEL_DEBUG, "phone to hc = %d", hc); 86 if (hc < 0) { 87 return result; 88 } 89 //get some hub info 90 usb_address_t addr = usb_drv_get_my_address(hc, device); 91 dprintf(USB_LOG_LEVEL_DEBUG, "address of newly created hub = %d", addr); 92 /*if(addr<0){ 93 //return result; 94 95 }*/ 96 97 result->address = addr; 98 99 >>>>>>> MERGE-SOURCE 80 100 // get hub descriptor 81 101 … … 148 168 int port; 149 169 int opResult; 170 <<<<<<< TREE 150 171 //usb_target_t target; 151 172 //target.address = hub_info->usb_device->address; 152 173 //target.endpoint = 0; 174 ======= 175 usb_target_t target; 176 target.address = hub_info->address; 177 target.endpoint = 0; 178 >>>>>>> MERGE-SOURCE 153 179 154 180 //get configuration descriptor … … 212 238 dprintf(USB_LOG_LEVEL_INFO, "hub dev added"); 213 239 dprintf(USB_LOG_LEVEL_DEBUG, "\taddress %d, has %d ports ", 214 hub_info-> usb_device->address,240 hub_info->address, 215 241 hub_info->port_count); 216 242 dprintf(USB_LOG_LEVEL_DEBUG, "\tused configuration %d",config_descriptor.configuration_number); … … 317 343 } 318 344 345 devman_handle_t hc_handle; 346 opResult = usb_drv_find_hc(hub->device, &hc_handle); 347 if (opResult != EOK) { 348 usb_log_error("Failed to get handle of host controller: %s.\n", 349 str_error(opResult)); 350 return; 351 } 352 319 353 devman_handle_t child_handle; 320 opResult = usb_drv_register_child_in_devman(hc, hub->device,321 new_device_address, &child_handle);354 opResult = usb_device_register_child_in_devman(new_device_address, 355 hc_handle, hub->device, &child_handle); 322 356 if (opResult != EOK) { 323 357 dprintf(USB_LOG_LEVEL_ERROR, "could not start driver for new device"); … … 472 506 /* 473 507 usb_target_t target; 474 target.address = hub_info-> usb_device->address;508 target.address = hub_info->address; 475 509 target.endpoint = 1;/// \TODO get from endpoint descriptor 476 510 dprintf(USB_LOG_LEVEL_INFO, "checking changes for hub at addr %d", … … 515 549 if (interrupt) { 516 550 usb_hub_process_interrupt( 551 <<<<<<< TREE 517 552 hub_info, port); 553 ======= 554 hub_info, hc, port, hub_info->address); 555 >>>>>>> MERGE-SOURCE 518 556 } 519 557 }
Note:
See TracChangeset
for help on using the changeset viewer.