Ignore:
File:
1 edited

Legend:

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

    r1558d85 r58563585  
    3333 * @brief
    3434 */
     35
    3536#include <usb/classes/classes.h>
     37#include <usb/classes/hub.h>
    3638#include <usbvirt/device.h>
    3739#include <assert.h>
    3840#include <errno.h>
    3941#include <str_error.h>
     42#include <stdio.h>
    4043#include <stdlib.h>
    4144#include <ddf/driver.h>
     
    7578        .type = USB_DESCTYPE_HUB,
    7679        .port_count = HUB_PORT_COUNT,
    77         .characteristics = 0,
     80        .characteristics = HUB_CHAR_NO_POWER_SWITCH_FLAG | HUB_CHAR_NO_OC_FLAG,
    7881        .power_on_warm_up = 50, /* Huh? */
    7982        .max_current = 100, /* Huh again. */
     
    9699        .length = sizeof(usb_standard_configuration_descriptor_t),
    97100        .descriptor_type = USB_DESCTYPE_CONFIGURATION,
    98         .total_length = 
     101        .total_length =
    99102                sizeof(usb_standard_configuration_descriptor_t)
    100103                + sizeof(std_interface_descriptor)
     
    144147 * @return Error code.
    145148 */
    146 int virthub_init(usbvirt_device_t *dev)
     149int virthub_init(usbvirt_device_t *dev, const char* name)
    147150{
    148151        if (dev == NULL) {
     
    151154        dev->ops = &hub_ops;
    152155        dev->descriptors = &descriptors;
     156        dev->address = 0;
     157        dev->name = str_dup(name);
     158        if (!dev->name)
     159                return ENOMEM;
    153160
    154161        hub_t *hub = malloc(sizeof(hub_t));
    155162        if (hub == NULL) {
     163                free(dev->name);
    156164                return ENOMEM;
    157165        }
Note: See TracChangeset for help on using the changeset viewer.