Ignore:
File:
1 edited

Legend:

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

    r58563585 r20eaa82  
    4848#include "res.h"
    4949#include "hc.h"
    50 #include "ehci_endpoint.h"
    5150
    5251#define NAME "ehci"
    5352
    54 static int ehci_driver_init(hcd_t *, const hw_res_list_parsed_t *, bool);
     53static int ehci_driver_init(hcd_t *, const hw_res_list_parsed_t *);
     54static int ehci_driver_claim(hcd_t *, ddf_dev_t *);
     55static int ehci_driver_start(hcd_t *, bool);
    5556static void ehci_driver_fini(hcd_t *);
    5657
    5758static const ddf_hc_driver_t ehci_hc_driver = {
    58         .claim = disable_legacy,
    59         .hc_speed = USB_SPEED_HIGH,
     59        .name = "EHCI-PCI",
     60        .init = ehci_driver_init,
    6061        .irq_code_gen = ehci_hc_gen_irq_code,
    61         .init = ehci_driver_init,
     62        .claim = ehci_driver_claim,
     63        .start = ehci_driver_start,
     64        .setup_root_hub = hcd_setup_virtual_root_hub,
    6265        .fini = ehci_driver_fini,
    63         .name = "EHCI-PCI",
    6466        .ops = {
    6567                .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,
    75     bool irq)
     74static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res)
    7675{
    7776        assert(hcd);
     
    8281                return ENOMEM;
    8382
    84         const int ret = hc_init(instance, res, irq);
     83        const int ret = hc_init(instance, res);
    8584        if (ret == EOK) {
    86                 hcd_set_implementation(hcd, instance, &ehci_hc_driver.ops);
     85                hcd_set_implementation(hcd, instance, &ehci_hc_driver.ops, &instance->bus.base.base);
    8786        } else {
    8887                free(instance);
    8988        }
    9089        return ret;
     90}
     91
     92static 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
     100static 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);
    91105}
    92106
     
    99113
    100114        free(hc);
    101         hcd_set_implementation(hcd, NULL, NULL);
     115        hcd_set_implementation(hcd, NULL, NULL, NULL);
    102116}
    103117
Note: See TracChangeset for help on using the changeset viewer.