Ignore:
File:
1 edited

Legend:

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

    rff582d47 re7bc999  
    4545#include "pci.h"
    4646#include "iface.h"
    47 #include "hc.h"
     47#include "ohci_hc.h"
    4848
    4949static int ohci_add_device(ddf_dev_t *device);
    50 static int get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
    51 {
    52         assert(handle);
    53   assert(fun != NULL);
    54 
    55   *handle = fun->handle;
    56   return EOK;
    57 }
    58 /*----------------------------------------------------------------------------*/
    59 static int get_address(
    60     ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address)
    61 {
    62         assert(fun);
    63         device_keeper_t *manager = &fun_to_hc(fun)->manager;
    64   usb_address_t addr = device_keeper_find(manager, handle);
    65   if (addr < 0) {
    66     return addr;
    67   }
    68 
    69   if (address != NULL) {
    70     *address = addr;
    71   }
    72 
    73   return EOK;
    74 }
    7550/*----------------------------------------------------------------------------*/
    7651/** IRQ handling callback, identifies device
     
    8358{
    8459        assert(dev);
    85         hc_t *hc = (hc_t*)dev->driver_data;
     60        ohci_hc_t *hc = (ohci_hc_t*)dev->driver_data;
    8661        assert(hc);
    87         hc_interrupt(hc, 0);
     62        ohci_hc_interrupt(hc, 0);
    8863}
    8964/*----------------------------------------------------------------------------*/
     
    9671        .driver_ops = &ohci_driver_ops
    9772};
    98 /*----------------------------------------------------------------------------*/
    99 static usb_iface_t hc_usb_iface = {
    100         .get_address = get_address,
    101         .get_hc_handle = get_hc_handle,
     73static ddf_dev_ops_t hc_ops = {
     74        .interfaces[USBHC_DEV_IFACE] = &ohci_hc_iface,
    10275};
    103 /*----------------------------------------------------------------------------*/
    104 static ddf_dev_ops_t hc_ops = {
    105         .interfaces[USB_DEV_IFACE] = &hc_usb_iface,
    106         .interfaces[USBHC_DEV_IFACE] = &hc_iface,
    107 };
     76
    10877/*----------------------------------------------------------------------------*/
    10978/** Initializes a new ddf driver instance of OHCI hcd.
     
    136105            "Failed(%d) disable legacy USB: %s.\n", ret, str_error(ret));
    137106
    138         hc_t *hcd = malloc(sizeof(hc_t));
     107        ohci_hc_t *hcd = malloc(sizeof(ohci_hc_t));
    139108        if (hcd == NULL) {
    140109                usb_log_error("Failed to allocate OHCI driver.\n");
     
    160129        }
    161130
    162         ret = hc_init(hcd, hc_fun, device, mem_reg_base, mem_reg_size, interrupts);
     131        ret = ohci_hc_init(hcd, hc_fun, mem_reg_base, mem_reg_size, interrupts);
    163132        if (ret != EOK) {
    164133                usb_log_error("Failed to initialize OHCI driver.\n");
     
    179148        hc_fun->driver_data = hcd;
    180149
    181         fid_t later = fibril_create((int(*)(void*))hc_register_hub, hcd);
    182         fibril_add_ready(later);
     150        /* TODO: register interrupt handler */
    183151
    184152        usb_log_info("Controlling new OHCI device `%s' (handle %llu).\n",
Note: See TracChangeset for help on using the changeset viewer.