#include <sys/gcq.h>
#define SC_DEV(sc) ((sc)->sc_dev)
#define SC_NAME(sc) (device_xname(SC_DEV(sc)))
typedef unsigned int Frame;
struct slhci_pipe;
struct slhci_transfers {
struct usbd_xfer *rootintr;
struct slhci_pipe *spipe[2];
struct gcq_head q[3];
struct gcq_head timed;
struct gcq_head to;
struct gcq_head ap;
Frame frame;
unsigned int flags;
int pend;
int reserved_bustime;
int16_t len[2];
uint8_t current_tregs[2][4];
uint8_t copyin[2];
uint8_t max_current;
uint8_t sltype;
};
enum power_change {
POWER_OFF,
POWER_ON,
};
typedef void (*PowerFunc)(void *, enum power_change);
struct slhci_softc {
device_t sc_dev;
struct usbd_bus sc_bus;
kmutex_t sc_lock;
kmutex_t sc_intr_lock;
struct slhci_transfers sc_transfers;
struct gcq_head sc_waitq;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
struct callout sc_timer;
PowerFunc sc_enable_power;
device_t sc_child;
struct timeval sc_reserved_warn_rate;
struct timeval sc_overflow_warn_rate;
void *sc_cb_softintr;
unsigned int sc_ier_check;
int sc_mem_use;
uint8_t sc_ier;
uint32_t sc_stride;
};
int slhci_supported_rev(uint8_t);
void slhci_preinit(struct slhci_softc *, PowerFunc, bus_space_tag_t,
bus_space_handle_t, uint16_t, uint32_t);
int slhci_attach(struct slhci_softc *);
int slhci_detach(struct slhci_softc *, int);
int slhci_activate(device_t, enum devact);
int slhci_intr(void *);