Changes in uspace/drv/bus/usb/vhc/hub/virthub.c [9d58539:1da979d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/hub/virthub.c
r9d58539 r1da979d 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 <assert.h> 41 43 #include <stdlib.h> … … 76 78 .type = USB_DESCTYPE_HUB, 77 79 .port_count = HUB_PORT_COUNT, 78 .characteristics = 0,80 .characteristics = HUB_CHAR_NO_POWER_SWITCH_FLAG | HUB_CHAR_NO_OC_FLAG, 79 81 .power_on_warm_up = 50, /* Huh? */ 80 82 .max_current = 100, /* Huh again. */ … … 97 99 .length = sizeof(usb_standard_configuration_descriptor_t), 98 100 .descriptor_type = USB_DESCTYPE_CONFIGURATION, 99 .total_length = 101 .total_length = 100 102 sizeof(usb_standard_configuration_descriptor_t) 101 103 + sizeof(std_interface_descriptor) … … 145 147 * @return Error code. 146 148 */ 147 int virthub_init(usbvirt_device_t *dev )149 int virthub_init(usbvirt_device_t *dev, const char* name) 148 150 { 149 151 if (dev == NULL) { … … 152 154 dev->ops = &hub_ops; 153 155 dev->descriptors = &descriptors; 156 dev->address = 0; 157 dev->name = str_dup(name); 158 if (!dev->name) 159 return ENOMEM; 154 160 155 161 hub_t *hub = malloc(sizeof(hub_t)); 156 162 if (hub == NULL) { 163 free(dev->name); 157 164 return ENOMEM; 158 165 }
Note:
See TracChangeset
for help on using the changeset viewer.