Changes in uspace/drv/usbhub/utils.c [94c19b8:ee0d8a8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/utils.c
r94c19b8 ree0d8a8 34 34 */ 35 35 #include <driver.h> 36 #include <bool.h> 37 #include <errno.h> 38 36 #include <usb/devreq.h> 39 37 #include <usbhc_iface.h> 40 38 #include <usb/usbdrv.h> 41 39 #include <usb/descriptor.h> 42 #include <usb/devreq.h> 40 #include <driver.h> 41 #include <bool.h> 42 #include <errno.h> 43 43 #include <usb/classes/hub.h> 44 45 44 #include "usbhub.h" 46 45 #include "usbhub_private.h" 47 46 #include "port_status.h" 48 47 #include <usb/devreq.h> 49 48 50 49 static void check_hub_changes(void); … … 303 302 //result->device = device; 304 303 result->port_count = -1; 305 /// \TODO is this correct? is the device stored?306 result->device = device;307 304 308 305 … … 319 316 }*/ 320 317 321 result-> usb_device = usb_new(usb_hcd_attached_device_info_t);322 result-> usb_device->address = addr;318 result->device = usb_new(usb_hcd_attached_device_info_t); 319 result->device->address = addr; 323 320 324 321 // get hub descriptor … … 390 387 usb_device_request_setup_packet_t request; 391 388 usb_target_t target; 392 target.address = hub_info-> usb_device->address;389 target.address = hub_info->device->address; 393 390 target.endpoint = 0; 394 391 for (port = 0; port < hub_info->port_count; ++port) { … … 432 429 * @param target 433 430 */ 431 434 432 static void usb_hub_init_add_device(int hc, uint16_t port, usb_target_t target) { 435 433 usb_device_request_setup_packet_t request; … … 481 479 return; 482 480 } 483 484 485 481 usb_drv_release_default_address(hc); 486 /*487 devman_handle_t dev_handle;488 rc = child_device_register_wrapper(hub_dev, "dev",489 * match_id, match_score, &dev_handle);490 if (rc != EOK) {491 free(id);492 }493 *494 */495 482 496 483 497 484 /// \TODO driver work 498 485 //add_child_device..... 499 //opResult = usb_drv_bind_address(hc, new_device_address,500 //devman_handle_t handle);...501 486 } 502 487 … … 609 594 lst_item = lst_item->next) { 610 595 printf("[usb_hub] checking hub changes\n"); 611 usb_hub_info_t * hub_info = ((usb_hub_info_t*)lst_item->data);612 596 /* 613 597 * Check status change pipe of this hub. 614 598 */ 615 599 616 usb_target_t target; 617 target.address = hub_info->usb_device->address; 618 target.endpoint = 1; 619 620 size_t port_count = hub_info->port_count; 600 usb_target_t target = { 601 .address = 5, 602 .endpoint = 1 603 }; 604 /// \TODO uncomment once it works correctly 605 //target.address = usb_create_hub_info(lst_item)->device->address; 606 607 size_t port_count = 7; 621 608 622 609 /* 623 610 * Connect to respective HC. 624 611 */ 625 int hc = usb_drv_hc_connect(hub_info->device, 0); 612 /// \FIXME this is incorrect code: here 613 /// must be used particular device instead of NULL 614 //which one? 615 int hc = usb_drv_hc_connect(NULL, 0); 626 616 if (hc < 0) { 627 617 continue;
Note:
See TracChangeset
for help on using the changeset viewer.