Changeset 3b5d1535 in mainline for uspace/drv/vhc/hcd.c
- Timestamp:
- 2011-02-23T10:28:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eb48f61
- Parents:
- e936e8e (diff), eb1a2f4 (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/hcd.c
re936e8e r3b5d1535 42 42 #include <errno.h> 43 43 #include <str_error.h> 44 #include <d river.h>44 #include <ddf/driver.h> 45 45 46 46 #include <usb/usb.h> … … 53 53 #include "conn.h" 54 54 55 static d evice_ops_t vhc_ops = {55 static ddf_dev_ops_t vhc_ops = { 56 56 .interfaces[USBHC_DEV_IFACE] = &vhc_iface, 57 57 .interfaces[USB_DEV_IFACE] = &vhc_usb_iface, … … 60 60 }; 61 61 62 static int vhc_count = 0; 63 static int vhc_add_device(device_t *dev) 62 static int vhc_add_device(ddf_dev_t *dev) 64 63 { 64 static int vhc_count = 0; 65 int rc; 66 65 67 /* 66 68 * Currently, we know how to simulate only single HC. … … 70 72 } 71 73 72 vhc_count++; 74 /* 75 * Create exposed function representing the host controller 76 * itself. 77 */ 78 ddf_fun_t *hc = ddf_fun_create(dev, fun_exposed, "hc"); 79 if (hc == NULL) { 80 usb_log_fatal("Failed to create device function.\n"); 81 return ENOMEM; 82 } 73 83 74 dev->ops = &vhc_ops;84 hc->ops = &vhc_ops; 75 85 76 devman_add_device_to_class(dev->handle, "usbhc"); 86 rc = ddf_fun_bind(hc); 87 if (rc != EOK) { 88 usb_log_fatal("Failed to bind HC function: %s.\n", 89 str_error(rc)); 90 return rc; 91 } 92 93 ddf_fun_add_to_class(hc, "usbhc"); 77 94 78 95 /* 79 96 * Initialize our hub and announce its presence. 80 97 */ 81 virtual_hub_device_init( dev);98 virtual_hub_device_init(hc); 82 99 83 usb_log_info("Virtual USB host controller ready ( id =%zu).\n",84 (size_t) dev->handle );100 usb_log_info("Virtual USB host controller ready (dev %zu, hc %zu).\n", 101 (size_t) dev->handle, (size_t) hc->handle); 85 102 86 103 return EOK; … … 103 120 * in devman output. 104 121 */ 105 sleep(5);122 //sleep(5); 106 123 107 usb_log_enable(USB_LOG_LEVEL_ INFO, NAME);124 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 108 125 109 126 printf(NAME ": virtual USB host controller driver.\n"); … … 122 139 * We are also a driver within devman framework. 123 140 */ 124 return d river_main(&vhc_driver);141 return ddf_driver_main(&vhc_driver); 125 142 } 126 143
Note:
See TracChangeset
for help on using the changeset viewer.