Changeset cd4ae1e in mainline for uspace/drv/vhc/hub/virthub.c


Ignore:
Timestamp:
2011-04-28T13:14:14Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
54d71e1, a146aa33
Parents:
74f00b6 (diff), c82135a8 (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:

Better virtual USB HID; USB-virt rewritten

The new virtual USB HID is easily extensible with new interfaces that
might provide different report descriptors.

The virtual host controller was completely rewritten together
with the libusbvirt.

The documentation is missing and the code would deserver some refactoring.
That will appear later.

File:
1 edited

Legend:

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

    r74f00b6 rcd4ae1e  
    3434 */
    3535#include <usb/classes/classes.h>
    36 #include <usbvirt/hub.h>
    3736#include <usbvirt/device.h>
    3837#include <assert.h>
     
    153152        dev->ops = &hub_ops;
    154153        dev->descriptors = &descriptors;
    155         dev->lib_debug_level = 0;
    156         dev->lib_debug_enabled_tags = USBVIRT_DEBUGTAG_ALL;
    157154
    158155        hub_t *hub = malloc(sizeof(hub_t));
     
    164161        dev->device_data = hub;
    165162
    166         int rc;
    167 #ifdef STANDALONE_HUB
    168         dev->name = "hub";
    169         rc = usbvirt_connect(dev);
    170 #else
    171         rc = usbvirt_connect_local(dev);
    172 #endif
    173 
    174         return rc;
     163        return EOK;
    175164}
    176165
     
    181170 * @return Port device was connected to.
    182171 */
    183 int virthub_connect_device(usbvirt_device_t *dev, virtdev_connection_t *conn)
     172int virthub_connect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn)
    184173{
    185174        assert(dev != NULL);
     
    201190 * @return Error code.
    202191 */
    203 int virthub_disconnect_device(usbvirt_device_t *dev, virtdev_connection_t *conn)
     192int virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn)
    204193{
    205194        assert(dev != NULL);
     
    212201        hub_release(hub);
    213202
    214         return ENOTSUP;
     203        return EOK;
    215204}
    216205
     
    221210 * @return Whether port is signalling to the device.
    222211 */
    223 bool virthub_is_device_enabled(usbvirt_device_t *dev, virtdev_connection_t *conn)
     212bool virthub_is_device_enabled(usbvirt_device_t *dev, vhc_virtdev_t *conn)
    224213{
    225214        assert(dev != NULL);
Note: See TracChangeset for help on using the changeset viewer.