Changeset 41b70d30 in mainline for uspace/drv/vhc/hub.c
- Timestamp:
- 2011-02-20T23:26:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b317b0b, dbe25f1
- Parents:
- d37b235 (diff), 0f21c0c (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/vhc/hub.c
rd37b235 r41b70d30 40 40 #include <stdlib.h> 41 41 #include <driver.h> 42 #include <usb/ usbdrv.h>42 #include <usb/hub.h> 43 43 #include <usb/recognise.h> 44 44 … … 71 71 } 72 72 73 static int pretend_port_rest(int unused, void *unused2) 74 { 75 return EOK; 76 } 77 73 78 /** Register root hub in devman. 74 79 * … … 80 85 device_t *hc_dev = (device_t *) arg; 81 86 82 int hc; 87 /* 88 * Wait until parent device is properly initialized. 89 */ 90 int phone; 83 91 do { 84 hc = usb_drv_hc_connect(hc_dev, hc_dev->handle,85 IPC_FLAG_BLOCKING);86 } while (hc < 0);92 phone = devman_device_connect(hc_dev->handle, 0); 93 } while (phone < 0); 94 async_hangup(phone); 87 95 88 usb_drv_reserve_default_address(hc); 96 usb_hc_connection_t hc_conn; 97 usb_hc_connection_initialize(&hc_conn, hc_dev->handle); 89 98 90 usb_address_t hub_address = usb_drv_request_address(hc); 91 usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT, hub_address); 99 usb_hc_connection_open(&hc_conn); 92 100 93 usb_drv_release_default_address(hc); 101 int rc = usb_hc_new_device_wrapper(hc_dev, &hc_conn, USB_SPEED_FULL, 102 pretend_port_rest, 0, NULL, 103 NULL, NULL); 104 if (rc != EOK) { 105 usb_log_fatal("Failed to create root hub: %s.\n", 106 str_error(rc)); 107 } 94 108 95 devman_handle_t hub_handle; 96 usb_device_register_child_in_devman(hub_address, hc_dev->handle, 97 hc_dev, &hub_handle); 98 //usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle); 99 usb_drv_bind_address(hc, hub_address, hub_handle); 109 usb_hc_connection_close(&hc_conn); 100 110 101 return EOK;111 return 0; 102 112 } 103 113
Note:
See TracChangeset
for help on using the changeset viewer.