Changeset 94c19b8 in mainline
- Timestamp:
- 2010-12-12T13:30:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b666608
- Parents:
- 1eb272d
- Location:
- uspace/drv/usbhub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.h
r1eb272d r94c19b8 46 46 /** Number of ports. */ 47 47 int port_count; 48 /** General device info. */ 49 usb_hcd_attached_device_info_t * device; 48 /** General usb device info. */ 49 usb_hcd_attached_device_info_t * usb_device; 50 /** General device info*/ 51 device_t * device; 52 50 53 } usb_hub_info_t; 51 54 -
uspace/drv/usbhub/utils.c
r1eb272d r94c19b8 34 34 */ 35 35 #include <driver.h> 36 #include <usb/devreq.h> 36 #include <bool.h> 37 #include <errno.h> 38 37 39 #include <usbhc_iface.h> 38 40 #include <usb/usbdrv.h> 39 41 #include <usb/descriptor.h> 40 #include <driver.h> 41 #include <bool.h> 42 #include <errno.h> 42 #include <usb/devreq.h> 43 43 #include <usb/classes/hub.h> 44 44 45 #include "usbhub.h" 45 46 #include "usbhub_private.h" 46 47 #include "port_status.h" 47 #include <usb/devreq.h> 48 48 49 49 50 static void check_hub_changes(void); … … 302 303 //result->device = device; 303 304 result->port_count = -1; 305 /// \TODO is this correct? is the device stored? 306 result->device = device; 304 307 305 308 … … 316 319 }*/ 317 320 318 result-> device = usb_new(usb_hcd_attached_device_info_t);319 result-> device->address = addr;321 result->usb_device = usb_new(usb_hcd_attached_device_info_t); 322 result->usb_device->address = addr; 320 323 321 324 // get hub descriptor … … 387 390 usb_device_request_setup_packet_t request; 388 391 usb_target_t target; 389 target.address = hub_info-> device->address;392 target.address = hub_info->usb_device->address; 390 393 target.endpoint = 0; 391 394 for (port = 0; port < hub_info->port_count; ++port) { … … 429 432 * @param target 430 433 */ 431 432 434 static void usb_hub_init_add_device(int hc, uint16_t port, usb_target_t target) { 433 435 usb_device_request_setup_packet_t request; … … 479 481 return; 480 482 } 483 484 481 485 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 */ 482 495 483 496 484 497 /// \TODO driver work 485 498 //add_child_device..... 499 //opResult = usb_drv_bind_address(hc, new_device_address, 500 //devman_handle_t handle);... 486 501 } 487 502 … … 594 609 lst_item = lst_item->next) { 595 610 printf("[usb_hub] checking hub changes\n"); 611 usb_hub_info_t * hub_info = ((usb_hub_info_t*)lst_item->data); 596 612 /* 597 613 * Check status change pipe of this hub. 598 614 */ 599 615 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; 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; 608 621 609 622 /* 610 623 * Connect to respective HC. 611 624 */ 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); 625 int hc = usb_drv_hc_connect(hub_info->device, 0); 616 626 if (hc < 0) { 617 627 continue;
Note:
See TracChangeset
for help on using the changeset viewer.