Ignore:
File:
1 edited

Legend:

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

    r20eaa82 r58563585  
    4848#include "res.h"
    4949#include "hc.h"
     50#include "ehci_endpoint.h"
    5051
    5152#define NAME "ehci"
    5253
    53 static int ehci_driver_init(hcd_t *, const hw_res_list_parsed_t *);
    54 static int ehci_driver_claim(hcd_t *, ddf_dev_t *);
    55 static int ehci_driver_start(hcd_t *, bool);
     54static int ehci_driver_init(hcd_t *, const hw_res_list_parsed_t *, bool);
    5655static void ehci_driver_fini(hcd_t *);
    5756
    5857static const ddf_hc_driver_t ehci_hc_driver = {
     58        .claim = disable_legacy,
     59        .hc_speed = USB_SPEED_HIGH,
     60        .irq_code_gen = ehci_hc_gen_irq_code,
     61        .init = ehci_driver_init,
     62        .fini = ehci_driver_fini,
    5963        .name = "EHCI-PCI",
    60         .init = ehci_driver_init,
    61         .irq_code_gen = ehci_hc_gen_irq_code,
    62         .claim = ehci_driver_claim,
    63         .start = ehci_driver_start,
    64         .setup_root_hub = hcd_setup_virtual_root_hub,
    65         .fini = ehci_driver_fini,
    6664        .ops = {
    6765                .schedule       = ehci_hc_schedule,
     66                .ep_add_hook    = ehci_endpoint_init,
     67                .ep_remove_hook = ehci_endpoint_fini,
    6868                .irq_hook       = ehci_hc_interrupt,
    6969                .status_hook    = ehci_hc_status,
     
    7272
    7373
    74 static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res)
     74static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res,
     75    bool irq)
    7576{
    7677        assert(hcd);
     
    8182                return ENOMEM;
    8283
    83         const int ret = hc_init(instance, res);
     84        const int ret = hc_init(instance, res, irq);
    8485        if (ret == EOK) {
    85                 hcd_set_implementation(hcd, instance, &ehci_hc_driver.ops, &instance->bus.base.base);
     86                hcd_set_implementation(hcd, instance, &ehci_hc_driver.ops);
    8687        } else {
    8788                free(instance);
    8889        }
    8990        return ret;
    90 }
    91 
    92 static int ehci_driver_claim(hcd_t *hcd, ddf_dev_t *dev)
    93 {
    94         hc_t *instance = hcd_get_driver_data(hcd);
    95         assert(instance);
    96 
    97         return disable_legacy(instance, dev);
    98 }
    99 
    100 static int ehci_driver_start(hcd_t *hcd, bool irq) {
    101         hc_t *instance = hcd_get_driver_data(hcd);
    102         assert(instance);
    103 
    104         return hc_start(instance, irq);
    10591}
    10692
     
    11399
    114100        free(hc);
    115         hcd_set_implementation(hcd, NULL, NULL, NULL);
     101        hcd_set_implementation(hcd, NULL, NULL);
    116102}
    117103
Note: See TracChangeset for help on using the changeset viewer.