Changeset 93fb170c in mainline for uspace/lib/usb/src/hcdhubd.c


Ignore:
Timestamp:
2011-01-08T18:51:31Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
15be932
Parents:
8f748215 (diff), a523af4 (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 main branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hcdhubd.c

    r8f748215 r93fb170c  
    3636#include <usb/devreq.h>
    3737#include <usbhc_iface.h>
     38#include <usb_iface.h>
    3839#include <usb/descriptor.h>
    3940#include <driver.h>
     
    4546#include "hcdhubd_private.h"
    4647
     48
     49static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     50{
     51        assert(dev);
     52        assert(dev->parent != NULL);
     53
     54        device_t *parent = dev->parent;
     55
     56        if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {
     57                usb_iface_t *usb_iface
     58                    = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];
     59                assert(usb_iface != NULL);
     60                if (usb_iface->get_hc_handle) {
     61                        int rc = usb_iface->get_hc_handle(parent, handle);
     62                        return rc;
     63                }
     64        }
     65
     66        return ENOTSUP;
     67}
     68
     69static usb_iface_t usb_iface = {
     70        .get_hc_handle = usb_iface_get_hc_handle
     71};
     72
     73static device_ops_t child_ops = {
     74        .interfaces[USB_DEV_IFACE] = &usb_iface
     75};
     76
    4777/** Callback when new device is detected and must be handled by this driver.
    4878 *
     
    129159        }
    130160        child->name = child_info->name;
     161        child->parent = child_info->parent;
     162        child->ops = &child_ops;
    131163
    132164        match_id = create_match_id();
Note: See TracChangeset for help on using the changeset viewer.