Ignore:
File:
1 edited

Legend:

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

    r68e5406 rd369b3b  
    4343#include <ddi.h>
    4444#include <usb/host/hcd.h>
     45#include <usb/host/usb2_bus.h>
    4546#include <usb/host/usb_transfer_batch.h>
    4647
     
    99100/** Main UHCI driver structure */
    100101typedef struct hc {
     102        /* Common hc_device header */
     103        hc_device_t base;
     104
    101105        uhci_rh_t rh;
     106        bus_t bus;
     107        usb2_bus_helper_t bus_helper;
     108
    102109        /** Addresses of I/O registers */
    103110        uhci_regs_t *registers;
     
    117124        /** Pointer table to the above lists, helps during scheduling */
    118125        transfer_list_t *transfers[2][4];
    119         /** Indicator of hw interrupts availability */
    120         bool hw_interrupts;
     126
     127        /**
     128         * Guard for the pending list. Can be locked under EP guard, but not
     129         * vice versa.
     130         */
     131        fibril_mutex_t guard;
     132        /** List of endpoints with a transfer scheduled */
     133        list_t pending_endpoints;
    121134
    122135        /** Number of hw failures detected. */
     
    124137} hc_t;
    125138
    126 extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool);
    127 extern void hc_fini(hc_t *);
     139typedef struct uhci_endpoint {
     140        endpoint_t base;
    128141
    129 extern int uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *, int *);
     142        bool toggle;
     143} uhci_endpoint_t;
    130144
    131 extern void uhci_hc_interrupt(hcd_t *, uint32_t);
    132 extern int uhci_hc_status(hcd_t *, uint32_t *);
    133 extern int uhci_hc_schedule(hcd_t *, usb_transfer_batch_t *);
     145static inline hc_t *hcd_to_hc(hc_device_t *hcd)
     146{
     147        assert(hcd);
     148        return (hc_t *) hcd;
     149}
     150
     151static inline hc_t *bus_to_hc(bus_t *bus)
     152{
     153        assert(bus);
     154        return member_to_inst(bus, hc_t, bus);
     155}
     156
     157int hc_unschedule_batch(usb_transfer_batch_t *);
     158
     159extern int hc_add(hc_device_t *, const hw_res_list_parsed_t *);
     160extern int hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *);
     161extern int hc_start(hc_device_t *);
     162extern int hc_setup_roothub(hc_device_t *);
     163extern int hc_gone(hc_device_t *);
    134164
    135165#endif
Note: See TracChangeset for help on using the changeset viewer.