Ignore:
File:
1 edited

Legend:

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

    rb5111c46 r58563585  
    3333 * @brief UHCI host controller driver structure
    3434 */
     35
    3536#ifndef DRV_UHCI_HC_H
    3637#define DRV_UHCI_HC_H
    3738
    38 #include <ddf/driver.h>
    39 #include <ddf/interrupt.h>
    4039#include <device/hw_res_parsed.h>
    4140#include <fibril.h>
     41#include <macros.h>
     42#include <stdbool.h>
     43#include <sys/types.h>
    4244#include <usb/host/hcd.h>
     45#include <usb/host/usb_transfer_batch.h>
    4346
     47#include "uhci_rh.h"
    4448#include "transfer_list.h"
     49#include "hw_struct/link_pointer.h"
    4550
    4651/** UHCI I/O registers layout */
     
    8388        /** SOF modification to match external timers */
    8489        ioport8_t sofmod;
     90
     91        PADD8[3];
     92        ioport16_t ports[];
    8593} uhci_regs_t;
    8694
    8795#define UHCI_FRAME_LIST_COUNT 1024
    88 #define UHCI_INT_EMULATOR_TIMEOUT 10000
    8996#define UHCI_DEBUGER_TIMEOUT 5000000
    9097#define UHCI_ALLOWED_HW_FAIL 5
    91 #define UHCI_NEEDED_IRQ_COMMANDS 5
    9298
    9399/** Main UHCI driver structure */
    94100typedef struct hc {
    95         /** Generic HCD driver structure */
    96         hcd_t *generic;
    97 
     101        uhci_rh_t rh;
    98102        /** Addresses of I/O registers */
    99103        uhci_regs_t *registers;
     
    113117        /** Pointer table to the above lists, helps during scheduling */
    114118        transfer_list_t *transfers[2][4];
    115         /** Fibril periodically checking status register*/
    116         fid_t interrupt_emulator;
    117119        /** Indicator of hw interrupts availability */
    118120        bool hw_interrupts;
     
    122124} hc_t;
    123125
    124 int hc_register_irq_handler(ddf_dev_t *, addr_range_t *, int,
    125     interrupt_handler_t);
    126 int hc_get_irq_code(irq_pio_range_t [], size_t, irq_cmd_t [], size_t,
    127     addr_range_t *);
    128 void hc_interrupt(hc_t *instance, uint16_t status);
    129 int hc_init(hc_t *, ddf_fun_t *, addr_range_t *, bool);
     126extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool);
     127extern void hc_fini(hc_t *);
    130128
    131 /** Safely dispose host controller internal structures
    132  *
    133  * @param[in] instance Host controller structure to use.
    134  */
    135 static inline void hc_fini(hc_t *instance) {} /* TODO: implement*/
     129extern int uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *);
     130
     131extern void uhci_hc_interrupt(hcd_t *, uint32_t);
     132extern int uhci_hc_status(hcd_t *, uint32_t *);
     133extern int uhci_hc_schedule(hcd_t *, usb_transfer_batch_t *);
     134
    136135#endif
    137136
Note: See TracChangeset for help on using the changeset viewer.