]> Pileus Git - ~andy/linux/blobdiff - drivers/usb/host/ehci.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit
[~andy/linux] / drivers / usb / host / ehci.h
index cc7d337ec35535bb24e2097775dc653381560b6b..0a5fda73b3f2f48a6918f7e752e8d39516a6ae12 100644 (file)
@@ -62,6 +62,12 @@ struct ehci_stats {
 
 #define        EHCI_MAX_ROOT_PORTS     15              /* see HCS_N_PORTS */
 
+enum ehci_rh_state {
+       EHCI_RH_HALTED,
+       EHCI_RH_SUSPENDED,
+       EHCI_RH_RUNNING
+};
+
 struct ehci_hcd {                      /* one per controller */
        /* glue to PCI and HCD framework */
        struct ehci_caps __iomem *caps;
@@ -70,6 +76,7 @@ struct ehci_hcd {                     /* one per controller */
 
        __u32                   hcs_params;     /* cached register copy */
        spinlock_t              lock;
+       enum ehci_rh_state      rh_state;
 
        /* async schedule support */
        struct ehci_qh          *async;
@@ -139,6 +146,7 @@ struct ehci_hcd {                   /* one per controller */
        unsigned                fs_i_thresh:1;  /* Intel iso scheduling */
        unsigned                use_dummy_qh:1; /* AMD Frame List table quirk*/
        unsigned                has_synopsys_hc_bug:1; /* Synopsys HC */
+       unsigned                frame_index_bug:1; /* MosChip (AKA NetMos) */
 
        /* required for usb32 quirk */
        #define OHCI_CTRL_HCFS          (3 << 6)
@@ -740,6 +748,22 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x)
 
 /*-------------------------------------------------------------------------*/
 
+#ifdef CONFIG_PCI
+
+/* For working around the MosChip frame-index-register bug */
+static unsigned ehci_read_frame_index(struct ehci_hcd *ehci);
+
+#else
+
+static inline unsigned ehci_read_frame_index(struct ehci_hcd *ehci)
+{
+       return ehci_readl(ehci, &ehci->regs->frame_index);
+}
+
+#endif
+
+/*-------------------------------------------------------------------------*/
+
 #ifndef DEBUG
 #define STUB_DEBUG_FILES
 #endif /* DEBUG */