Changeset 687efaa in mainline


Ignore:
Timestamp:
2011-02-11T15:00:18Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
518372c
Parents:
6cd7b17
Message:

Reuse libusb usbdevice interface

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/root_hub.c

    r6cd7b17 r687efaa  
    3535#include <errno.h>
    3636#include <stdio.h>
    37 
    3837#include <usb_iface.h>
    39 
    4038#include <usb/debug.h>
    4139
    4240#include "root_hub.h"
     41
     42extern device_ops_t child_ops;
    4343/*----------------------------------------------------------------------------*/
    44 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
    45 {
    46   assert(dev);
    47   assert(dev->parent != NULL);
    48 
    49   device_t *parent = dev->parent;
    50 
    51   if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {
    52     usb_iface_t *usb_iface
    53         = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];
    54     assert(usb_iface != NULL);
    55     if (usb_iface->get_hc_handle) {
    56       int rc = usb_iface->get_hc_handle(parent, handle);
    57       return rc;
    58     }
    59   }
    60 
    61   return ENOTSUP;
    62 }
    63 /*----------------------------------------------------------------------------*/
    64 static usb_iface_t usb_iface = {
    65   .get_hc_handle = usb_iface_get_hc_handle
    66 };
    67 
    68 static device_ops_t rh_ops = {
    69         .interfaces[USB_DEV_IFACE] = &usb_iface
    70 };
    71 
    7244int setup_root_hub(device_t **device, device_t *hc)
    7345{
     
    10880        hub->name = name;
    10981        hub->parent = hc;
    110         hub->ops = &rh_ops;
     82        hub->ops = &child_ops;
    11183
    11284        *device = hub;
  • uspace/lib/usb/src/recognise.c

    r6cd7b17 r687efaa  
    7070};
    7171
    72 static device_ops_t child_ops = {
     72device_ops_t child_ops = {
    7373        .interfaces[USB_DEV_IFACE] = &usb_iface
    7474};
Note: See TracChangeset for help on using the changeset viewer.