Ignore:
File:
1 edited

Legend:

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

    r2972e21 r71ed4849  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky, Jan Vesely
     2 * Copyright (c) 2010 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828#include <usb/hcdhubd.h>
     29#include <usb_iface.h>
     30#include <usb/debug.h>
    2931#include <errno.h>
    30 
    31 #include "debug.h"
    32 #include "iface.h"
    33 #include "name.h"
     32#include <driver.h>
    3433#include "uhci.h"
    3534
     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};
    3647
    3748static device_ops_t uhci_ops = {
    38         .interfaces[USBHC_DEV_IFACE] = &uhci_iface,
     49        .interfaces[USB_DEV_IFACE] = &hc_usb_iface,
     50        .interfaces[USBHC_DEV_IFACE] = &uhci_iface
    3951};
    4052
    4153static int uhci_add_device(device_t *device)
    4254{
    43 //      usb_dprintf(NAME, DEBUG, "uhci_add_device() called\n");
    44         uhci_print_info( "uhci_add_device() called\n" );
     55        usb_dprintf(NAME, 1, "uhci_add_device() called\n");
    4556        device->ops = &uhci_ops;
    4657
    47         uhci_init( device, (void*)0xc020 );
     58        /*
     59         * We need to announce the presence of our root hub.
     60         */
     61        usb_dprintf(NAME, 2, "adding root hub\n");
     62        usb_hcd_add_root_hub(device);
    4863
    4964        return EOK;
     
    6479         * Do some global initializations.
    6580         */
    66         sleep( 5 );
    67         usb_dprintf_enable(NAME, DEBUG_LEVEL_MAX);
     81        sleep(5);
     82        usb_dprintf_enable(NAME, 5);
    6883
    6984        return driver_main(&uhci_driver);
Note: See TracChangeset for help on using the changeset viewer.