Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/vhc/hub/virthub.c

    r9d58539 r1da979d  
    3434 */
    3535#include <usb/classes/classes.h>
     36#include <usb/classes/hub.h>
    3637#include <usbvirt/device.h>
    3738#include <assert.h>
    3839#include <errno.h>
    3940#include <str_error.h>
     41#include <stdio.h>
    4042#include <assert.h>
    4143#include <stdlib.h>
     
    7678        .type = USB_DESCTYPE_HUB,
    7779        .port_count = HUB_PORT_COUNT,
    78         .characteristics = 0,
     80        .characteristics = HUB_CHAR_NO_POWER_SWITCH_FLAG | HUB_CHAR_NO_OC_FLAG,
    7981        .power_on_warm_up = 50, /* Huh? */
    8082        .max_current = 100, /* Huh again. */
     
    9799        .length = sizeof(usb_standard_configuration_descriptor_t),
    98100        .descriptor_type = USB_DESCTYPE_CONFIGURATION,
    99         .total_length = 
     101        .total_length =
    100102                sizeof(usb_standard_configuration_descriptor_t)
    101103                + sizeof(std_interface_descriptor)
     
    145147 * @return Error code.
    146148 */
    147 int virthub_init(usbvirt_device_t *dev)
     149int virthub_init(usbvirt_device_t *dev, const char* name)
    148150{
    149151        if (dev == NULL) {
     
    152154        dev->ops = &hub_ops;
    153155        dev->descriptors = &descriptors;
     156        dev->address = 0;
     157        dev->name = str_dup(name);
     158        if (!dev->name)
     159                return ENOMEM;
    154160
    155161        hub_t *hub = malloc(sizeof(hub_t));
    156162        if (hub == NULL) {
     163                free(dev->name);
    157164                return ENOMEM;
    158165        }
Note: See TracChangeset for help on using the changeset viewer.