Changes in uspace/drv/bus/usb/vhc/hub/virthub.c [1558d85:58563585] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/hub/virthub.c
r1558d85 r58563585 33 33 * @brief 34 34 */ 35 35 36 #include <usb/classes/classes.h> 37 #include <usb/classes/hub.h> 36 38 #include <usbvirt/device.h> 37 39 #include <assert.h> 38 40 #include <errno.h> 39 41 #include <str_error.h> 42 #include <stdio.h> 40 43 #include <stdlib.h> 41 44 #include <ddf/driver.h> … … 75 78 .type = USB_DESCTYPE_HUB, 76 79 .port_count = HUB_PORT_COUNT, 77 .characteristics = 0,80 .characteristics = HUB_CHAR_NO_POWER_SWITCH_FLAG | HUB_CHAR_NO_OC_FLAG, 78 81 .power_on_warm_up = 50, /* Huh? */ 79 82 .max_current = 100, /* Huh again. */ … … 96 99 .length = sizeof(usb_standard_configuration_descriptor_t), 97 100 .descriptor_type = USB_DESCTYPE_CONFIGURATION, 98 .total_length = 101 .total_length = 99 102 sizeof(usb_standard_configuration_descriptor_t) 100 103 + sizeof(std_interface_descriptor) … … 144 147 * @return Error code. 145 148 */ 146 int virthub_init(usbvirt_device_t *dev )149 int virthub_init(usbvirt_device_t *dev, const char* name) 147 150 { 148 151 if (dev == NULL) { … … 151 154 dev->ops = &hub_ops; 152 155 dev->descriptors = &descriptors; 156 dev->address = 0; 157 dev->name = str_dup(name); 158 if (!dev->name) 159 return ENOMEM; 153 160 154 161 hub_t *hub = malloc(sizeof(hub_t)); 155 162 if (hub == NULL) { 163 free(dev->name); 156 164 return ENOMEM; 157 165 }
Note:
See TracChangeset
for help on using the changeset viewer.