Ignore:
Timestamp:
2016-07-22T08:24:47Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge from lp:~jan.vesely/helenos/usb

File:
1 edited

Legend:

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

    r5b18137 rb4b534ac  
    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 <stdlib.h>
    4143#include <ddf/driver.h>
     
    7577        .type = USB_DESCTYPE_HUB,
    7678        .port_count = HUB_PORT_COUNT,
    77         .characteristics = 0,
     79        .characteristics = HUB_CHAR_NO_POWER_SWITCH_FLAG | HUB_CHAR_NO_OC_FLAG,
    7880        .power_on_warm_up = 50, /* Huh? */
    7981        .max_current = 100, /* Huh again. */
     
    9698        .length = sizeof(usb_standard_configuration_descriptor_t),
    9799        .descriptor_type = USB_DESCTYPE_CONFIGURATION,
    98         .total_length = 
     100        .total_length =
    99101                sizeof(usb_standard_configuration_descriptor_t)
    100102                + sizeof(std_interface_descriptor)
     
    144146 * @return Error code.
    145147 */
    146 int virthub_init(usbvirt_device_t *dev)
     148int virthub_init(usbvirt_device_t *dev, const char* name)
    147149{
    148150        if (dev == NULL) {
     
    151153        dev->ops = &hub_ops;
    152154        dev->descriptors = &descriptors;
     155        dev->address = 0;
     156        dev->name = str_dup(name);
     157        if (!dev->name)
     158                return ENOMEM;
    153159
    154160        hub_t *hub = malloc(sizeof(hub_t));
    155161        if (hub == NULL) {
     162                free(dev->name);
    156163                return ENOMEM;
    157164        }
Note: See TracChangeset for help on using the changeset viewer.