Changeset 32fb6bce in mainline for uspace/drv/bus/usb/vhc/main.c
- Timestamp:
- 2017-12-18T22:50:21Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7f70d1c
- Parents:
- 1ea0bbf
- git-author:
- Ondřej Hlavatý <aearsis@…> (2017-12-18 22:04:50)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2017-12-18 22:50:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/main.c
r1ea0bbf r32fb6bce 69 69 return ret; 70 70 } 71 vhc_init(vhc, dev_to_hcd(dev));72 71 return EOK; 73 72 } 74 73 75 hcd_ops_t vhc_hc_ops = {76 .schedule = vhc_schedule,77 };78 79 74 static int vhc_dev_add(ddf_dev_t *dev) 80 75 { 76 /* Initialize generic structures */ 77 int ret = hcd_ddf_setup_hc(dev, sizeof(vhc_data_t)); 78 if (ret != EOK) { 79 usb_log_error("Failed to init HCD structures: %s.\n", 80 str_error(ret)); 81 return ret; 82 } 83 vhc_data_t *vhc = ddf_dev_data_get(dev); 84 vhc_init(vhc); 85 86 hc_device_setup(&vhc->base, (bus_t *) &vhc->bus); 87 81 88 /* Initialize virtual structure */ 82 89 ddf_fun_t *ctl_fun = NULL; 83 intret = vhc_control_node(dev, &ctl_fun);90 ret = vhc_control_node(dev, &ctl_fun); 84 91 if (ret != EOK) { 85 92 usb_log_error("Failed to setup control node.\n"); 86 93 return ret; 87 94 } 88 vhc_data_t *data = ddf_fun_data_get(ctl_fun);89 90 /* Initialize generic structures */91 ret = hcd_ddf_setup_hc(dev);92 if (ret != EOK) {93 usb_log_error("Failed to init HCD structures: %s.\n",94 str_error(ret));95 ddf_fun_destroy(ctl_fun);96 return ret;97 }98 99 hcd_set_implementation(dev_to_hcd(dev), data, &vhc_hc_ops, &data->bus.base);100 95 101 96 /* Add virtual hub device */ 102 ret = vhc_virtdev_plug_hub( data, &data->hub, NULL, 0);97 ret = vhc_virtdev_plug_hub(vhc, &vhc->hub, NULL, 0); 103 98 if (ret != EOK) { 104 99 usb_log_error("Failed to plug root hub: %s.\n", str_error(ret)); … … 111 106 * needs to be ready at this time. 112 107 */ 113 ret = hcd_setup_virtual_root_hub( dev_to_hcd(dev), dev);108 ret = hcd_setup_virtual_root_hub(&vhc->base); 114 109 if (ret != EOK) { 115 110 usb_log_error("Failed to init VHC root hub: %s\n",
Note:
See TracChangeset
for help on using the changeset viewer.