Changeset e4d7363 in mainline for uspace/drv/bus/usb/xhci/hc.h


Ignore:
Timestamp:
2017-06-22T21:34:39Z (9 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
91ca111
Parents:
cb89430
Message:

usbhost: refactor the initialization

Before that, drivers had to setup MMIO range multiple times, or even parse hw
resources themselves again. The former init method was split in half - init and
start. Init shall allocate and initialize inner structures, start shall start
the HC.

In the XHCI it is demonstrated how to isolate inner HC implementation from the
fact this driver is using libusbhost. It adds some boilerplate code, but
I think it leads to cleaner design.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hc.h

    rcb89430 re4d7363  
    3434 */
    3535
    36 #include <usb/host/ddf_helpers.h>
     36#include <usb/host/usb_transfer_batch.h>
    3737#include "hw_struct/regs.h"
    3838#include "hw_struct/context.h"
     
    4444        xhci_rt_regs_t *rt_regs;
    4545        xhci_doorbell_t *db_arry;
     46
     47        addr_range_t mmio_range;
    4648
    4749        xhci_trb_ring_t command_ring;
     
    5557} xhci_hc_t;
    5658
    57 extern const ddf_hc_driver_t xhci_ddf_hc_driver;
    58 
     59int hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *);
     60int hc_init_memory(xhci_hc_t *);
     61int hc_claim(xhci_hc_t *, ddf_dev_t *);
     62int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *);
     63int hc_start(xhci_hc_t *, bool);
     64int hc_schedule(xhci_hc_t *hc, usb_transfer_batch_t *batch);
     65int hc_status(xhci_hc_t *, uint32_t *);
     66void hc_interrupt(xhci_hc_t *, uint32_t);
     67void hc_fini(xhci_hc_t *);
    5968
    6069/**
Note: See TracChangeset for help on using the changeset viewer.