Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/main.c

    rdcffe95 r1dc4a5e  
    4242#include <usb/ddfiface.h>
    4343#include <usb/debug.h>
    44 #include <usb/host/hcd.h>
    4544
    46 #include "res.h"
     45#include "pci.h"
     46#include "ehci.h"
    4747
    48 #define NAME "ehci"
    49 
    50 static int ehci_dev_add(ddf_dev_t *device);
     48static int ehci_add_device(ddf_dev_t *device);
    5149/*----------------------------------------------------------------------------*/
    5250static driver_ops_t ehci_driver_ops = {
    53         .dev_add = ehci_dev_add,
     51        .add_device = ehci_add_device,
    5452};
    5553/*----------------------------------------------------------------------------*/
     
    5957};
    6058static ddf_dev_ops_t hc_ops = {
    61         .interfaces[USBHC_DEV_IFACE] = &hcd_iface,
     59        .interfaces[USBHC_DEV_IFACE] = &ehci_hc_iface,
    6260};
    6361
     
    6866 * @return Error code.
    6967 */
    70 static int ehci_dev_add(ddf_dev_t *device)
     68static int ehci_add_device(ddf_dev_t *device)
    7169{
    7270        assert(device);
     
    8179        int irq = 0;
    8280
    83         int ret = get_my_registers(device, &reg_base, &reg_size, &irq);
     81        int ret = pci_get_my_registers(device, &reg_base, &reg_size, &irq);
    8482        CHECK_RET_RETURN(ret,
    8583            "Failed to get memory addresses for %" PRIun ": %s.\n",
     
    8886            reg_base, reg_size, irq);
    8987
    90         ret = disable_legacy(device, reg_base, reg_size);
     88        ret = pci_disable_legacy(device, reg_base, reg_size, irq);
    9189        CHECK_RET_RETURN(ret,
    9290            "Failed to disable legacy USB: %s.\n", str_error(ret));
     
    9795                return ENOMEM;
    9896        }
    99         hcd_t *ehci_hc = ddf_fun_data_alloc(hc_fun, sizeof(hcd_t));
    100         if (ehci_hc == NULL) {
    101                 usb_log_error("Failed to alloc generic HC driver.\n");
    102                 return ENOMEM;
    103         }
    104         /* High Speed, no bandwidth */
    105         hcd_init(ehci_hc, USB_SPEED_HIGH, 0, NULL);
    10697        hc_fun->ops = &hc_ops;
    10798
Note: See TracChangeset for help on using the changeset viewer.