Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/ddf_helpers.h

    rcccd60c3 r0f6b50f  
    3838
    3939#include <usb/host/hcd.h>
    40 #include <usb/host/usb_bus.h>
     40#include <usb/host/bus.h>
    4141#include <usb/usb.h>
    4242
     
    4545#include <device/hw_res_parsed.h>
    4646
    47 typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, bool);
     47typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *);
     48typedef int (*irq_code_gen_t)(irq_code_t *, hcd_t *, const hw_res_list_parsed_t *);
     49typedef int (*claim_t)(hcd_t *, ddf_dev_t *);
     50typedef int (*driver_start_t)(hcd_t *, bool irq);
     51typedef int (*setup_root_hub_t)(hcd_t *, ddf_dev_t *);
     52
     53typedef void (*driver_stop_t)(hcd_t *);
    4854typedef void (*driver_fini_t)(hcd_t *);
    49 typedef int (*claim_t)(ddf_dev_t *);
    50 typedef int (*irq_code_gen_t)(irq_code_t *, const hw_res_list_parsed_t *);
    5155
     56/**
     57 * All callbacks are optional.
     58 */
    5259typedef struct {
    5360        hcd_ops_t ops;
    54         claim_t claim;
    55         usb_speed_t hc_speed;
    56         driver_init_t init;
    57         driver_fini_t fini;
    58         interrupt_handler_t *irq_handler;
    59         irq_code_gen_t irq_code_gen;
    6061        const char *name;
     62
     63        interrupt_handler_t *irq_handler;  /**< Handler of IRQ. Do have generic implementation. */
     64
     65        /* Initialization sequence: */
     66        driver_init_t init;                /**< Initialize internal structures, memory */
     67        claim_t claim;                     /**< Claim device from BIOS */
     68        irq_code_gen_t irq_code_gen;       /**< Generate IRQ handling code */
     69        driver_start_t start;              /**< Start the HC */
     70        setup_root_hub_t setup_root_hub;   /**< Setup the root hub */
     71
     72        /* Destruction sequence: */
     73        driver_stop_t stop;                /**< Stop the HC (counterpart of start) */
     74        driver_fini_t fini;                /**< Destroy internal structures (counterpart of init) */
    6175} ddf_hc_driver_t;
    6276
    6377int hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver);
    6478
    65 int hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed,
    66     size_t bw, bw_count_func_t bw_count);
     79int hcd_ddf_setup_hc(ddf_dev_t *device);
    6780void hcd_ddf_clean_hc(ddf_dev_t *device);
    68 int hcd_ddf_setup_root_hub(ddf_dev_t *device);
     81
     82int hcd_setup_virtual_root_hub(hcd_t *, ddf_dev_t *);
     83
     84device_t *hcd_ddf_device_create(ddf_dev_t *, size_t);
     85void hcd_ddf_device_destroy(device_t *);
     86int hcd_ddf_device_explore(hcd_t *, device_t *);
    6987
    7088hcd_t *dev_to_hcd(ddf_dev_t *dev);
     
    7593    const hw_res_list_parsed_t *hw_res,
    7694    interrupt_handler_t handler,
    77     int (*gen_irq_code)(irq_code_t *, const hw_res_list_parsed_t *));
     95    irq_code_gen_t gen_irq_code);
    7896void ddf_hcd_gen_irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev);
    7997
Note: See TracChangeset for help on using the changeset viewer.