Changeset b4b534ac in mainline for uspace/drv/bus/usb/vhc/hub/virthub.c
- Timestamp:
- 2016-07-22T08:24:47Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f76d2c2
- Parents:
- 5b18137 (diff), 8351f9a4 (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/bus/usb/vhc/hub/virthub.c
r5b18137 rb4b534ac 34 34 */ 35 35 #include <usb/classes/classes.h> 36 #include <usb/classes/hub.h> 36 37 #include <usbvirt/device.h> 37 38 #include <assert.h> 38 39 #include <errno.h> 39 40 #include <str_error.h> 41 #include <stdio.h> 40 42 #include <stdlib.h> 41 43 #include <ddf/driver.h> … … 75 77 .type = USB_DESCTYPE_HUB, 76 78 .port_count = HUB_PORT_COUNT, 77 .characteristics = 0,79 .characteristics = HUB_CHAR_NO_POWER_SWITCH_FLAG | HUB_CHAR_NO_OC_FLAG, 78 80 .power_on_warm_up = 50, /* Huh? */ 79 81 .max_current = 100, /* Huh again. */ … … 96 98 .length = sizeof(usb_standard_configuration_descriptor_t), 97 99 .descriptor_type = USB_DESCTYPE_CONFIGURATION, 98 .total_length = 100 .total_length = 99 101 sizeof(usb_standard_configuration_descriptor_t) 100 102 + sizeof(std_interface_descriptor) … … 144 146 * @return Error code. 145 147 */ 146 int virthub_init(usbvirt_device_t *dev )148 int virthub_init(usbvirt_device_t *dev, const char* name) 147 149 { 148 150 if (dev == NULL) { … … 151 153 dev->ops = &hub_ops; 152 154 dev->descriptors = &descriptors; 155 dev->address = 0; 156 dev->name = str_dup(name); 157 if (!dev->name) 158 return ENOMEM; 153 159 154 160 hub_t *hub = malloc(sizeof(hub_t)); 155 161 if (hub == NULL) { 162 free(dev->name); 156 163 return ENOMEM; 157 164 }
Note:
See TracChangeset
for help on using the changeset viewer.