Changeset 71ed4849 in mainline for uspace/drv/uhci/main.c


Ignore:
Timestamp:
2010-12-28T14:00:36Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8f8a0cd6
Parents:
de2c901
Message:

Connecting to "parent" host controller

USB drivers can now connect to host controller drivers they physically
belong to (so far, everything connected to VHC).

Each USB device must implement the USB interface of libdrv to allow
this (it is absolutely neccesary for hubs).

USB drivers can use usb_drv_hc_connect() to connect to "their" host
controller.

Child devices created with usb_drv_register_child_in_devman()are set
to handle this connection automatically.

UHCI and VHC drivers were updated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/main.c

    rde2c901 r71ed4849  
    2727 */
    2828#include <usb/hcdhubd.h>
     29#include <usb_iface.h>
    2930#include <usb/debug.h>
    3031#include <errno.h>
     
    3233#include "uhci.h"
    3334
     35static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     36{
     37        /* This shall be called only for the UHCI itself. */
     38        assert(dev->parent == NULL);
     39
     40        *handle = dev->handle;
     41        return EOK;
     42}
     43
     44static usb_iface_t hc_usb_iface = {
     45        .get_hc_handle = usb_iface_get_hc_handle
     46};
     47
    3448static device_ops_t uhci_ops = {
    35         .interfaces[USBHC_DEV_IFACE] = &uhci_iface,
     49        .interfaces[USB_DEV_IFACE] = &hc_usb_iface,
     50        .interfaces[USBHC_DEV_IFACE] = &uhci_iface
    3651};
    3752
Note: See TracChangeset for help on using the changeset viewer.