Changeset f5f0cfb in mainline for uspace/drv/bus/usb/vhc/main.c


Ignore:
Timestamp:
2012-12-22T16:24:28Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1e2af6a9
Parents:
f6577d9
Message:

vhc: Remove single instance limitation.

Embed hub vitrul device instead of using global instance.

File:
1 edited

Legend:

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

    rf6577d9 rf5f0cfb  
    4444#include <usb/debug.h>
    4545#include "vhcd.h"
    46 #include "hub/hub.h"
    47 #include "hub/virthub.h"
    4846
    49 static usbvirt_device_t virtual_hub_device = {
    50         .name = "root hub",
    51         .ops = &hub_ops,
    52         .address = 0
    53 };
    5447
    5548static ddf_dev_ops_t vhc_ops = {
     
    5750        .default_handler = default_connection_handler
    5851};
     52
    5953
    6054static int vhc_control_node(ddf_dev_t *dev, ddf_fun_t **fun)
     
    7872                return ret;
    7973        }
    80         vhc_data_init(vhc);
    81         // TODO: This limits us to single vhc instance.
    82         virthub_init(&virtual_hub_device);
    83         vhc->hub = &virtual_hub_device;
     74        vhc_init(vhc);
    8475        return EOK;
    8576}
    86 
    8777
    8878static int vhc_dev_add(ddf_dev_t *dev)
     
    111101        /* Add virtual hub device */
    112102        usb_address_t address = 1;
    113         ret = vhc_virtdev_plug_hub(data, data->hub, NULL, address);
     103        ret = vhc_virtdev_plug_hub(data, &data->hub, NULL, address);
    114104        if (ret != EOK) {
    115105                usb_log_error("Failed to plug root hub: %s.\n", str_error(ret));
Note: See TracChangeset for help on using the changeset viewer.