Changeset 43c3937 in mainline for uspace/lib/usb/src/hcdhubd.c


Ignore:
Timestamp:
2011-01-07T10:43:15Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5097bed4
Parents:
5f7d96e (diff), 0f191a2 (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 with usb/development

File:
1 edited

Legend:

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

    r5f7d96e r43c3937  
    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.