Ignore:
File:
1 edited

Legend:

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

    r58563585 r507c6f3  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 
    2928/** @addtogroup drvusbohci
    3029 * @{
     
    3332 * @brief OHCI host controller driver structure
    3433 */
    35 
    3634#ifndef DRV_OHCI_HC_H
    3735#define DRV_OHCI_HC_H
    3836
     37#include <ddf/interrupt.h>
     38#include <fibril.h>
     39#include <fibril_synch.h>
    3940#include <adt/list.h>
    4041#include <ddi.h>
    41 #include <ddf/driver.h>
    42 #include <device/hw_res_parsed.h>
    43 #include <fibril.h>
    44 #include <fibril_synch.h>
    45 #include <stdbool.h>
    46 #include <sys/types.h>
    4742
     43#include <usb/usb.h>
    4844#include <usb/host/hcd.h>
    49 #include <usb/host/endpoint.h>
    50 #include <usb/host/usb_transfer_batch.h>
    5145
     46#include "ohci_batch.h"
    5247#include "ohci_regs.h"
    53 #include "ohci_rh.h"
     48#include "root_hub.h"
    5449#include "endpoint_list.h"
    5550#include "hw_struct/hcca.h"
     
    5752/** Main OHCI driver structure */
    5853typedef struct hc {
     54        /** Generic USB hc driver */
     55        hcd_t generic;
     56
    5957        /** Memory mapped I/O registers area */
    6058        ohci_regs_t *registers;
     
    7371        fibril_mutex_t guard;
    7472
    75         /** interrupts available */
    76         bool hw_interrupts;
    77 
    7873        /** USB hub emulation structure */
    79         ohci_rh_t rh;
     74        rh_t rh;
    8075} hc_t;
    8176
    82 extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool);
    83 extern void hc_fini(hc_t *);
     77int hc_get_irq_code(irq_pio_range_t [], size_t, irq_cmd_t [], size_t, uintptr_t,
     78    size_t);
     79int hc_register_irq_handler(ddf_dev_t *, uintptr_t, size_t, int, interrupt_handler_t);
     80int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun);
     81int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts);
    8482
    85 extern void hc_enqueue_endpoint(hc_t *, const endpoint_t *);
    86 extern void hc_dequeue_endpoint(hc_t *, const endpoint_t *);
     83/** Safely dispose host controller internal structures
     84 *
     85 * @param[in] instance Host controller structure to use.
     86 */
     87static inline void hc_fini(hc_t *instance) { /* TODO: implement*/ };
    8788
    88 int ohci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res);
     89void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep);
     90void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep);
    8991
    90 extern void ohci_hc_interrupt(hcd_t *, uint32_t);
    91 extern int ohci_hc_status(hcd_t *, uint32_t *);
    92 extern int ohci_hc_schedule(hcd_t *, usb_transfer_batch_t *);
    93 
     92void hc_interrupt(hc_t *instance, uint32_t status);
    9493#endif
    95 
    9694/**
    9795 * @}
Note: See TracChangeset for help on using the changeset viewer.