Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[pandora-kernel.git] / drivers / usb / host / xhci.h
index e12db7c..d8bbf5c 100644 (file)
@@ -560,6 +560,11 @@ struct xhci_slot_ctx {
 #define SLOT_STATE     (0x1f << 27)
 #define GET_SLOT_STATE(p)      (((p) & (0x1f << 27)) >> 27)
 
+#define SLOT_STATE_DISABLED    0
+#define SLOT_STATE_ENABLED     SLOT_STATE_DISABLED
+#define SLOT_STATE_DEFAULT     1
+#define SLOT_STATE_ADDRESSED   2
+#define SLOT_STATE_CONFIGURED  3
 
 /**
  * struct xhci_ep_ctx
@@ -869,6 +874,8 @@ struct xhci_transfer_event {
 #define COMP_PING_ERR  20
 /* Event Ring is full */
 #define COMP_ER_FULL   21
+/* Incompatible Device Error */
+#define COMP_DEV_ERR   22
 /* Missed Service Error - HC couldn't service an isoc ep within interval */
 #define COMP_MISSED_INT        23
 /* Successfully stopped command ring */
@@ -1123,6 +1130,7 @@ struct xhci_ring {
         */
        u32                     cycle_state;
        unsigned int            stream_id;
+       bool                    last_td_was_short;
 };
 
 struct xhci_erst_entry {
@@ -1290,6 +1298,21 @@ struct xhci_hcd {
 #define XHCI_RESET_EP_QUIRK    (1 << 1)
 #define XHCI_NEC_HOST          (1 << 2)
 #define XHCI_AMD_PLL_FIX       (1 << 3)
+#define XHCI_SPURIOUS_SUCCESS  (1 << 4)
+/*
+ * Certain Intel host controllers have a limit to the number of endpoint
+ * contexts they can handle.  Ideally, they would signal that they can't handle
+ * anymore endpoint contexts by returning a Resource Error for the Configure
+ * Endpoint command, but they don't.  Instead they expect software to keep track
+ * of the number of active endpoints for them, across configure endpoint
+ * commands, reset device commands, disable slot commands, and address device
+ * commands.
+ */
+#define XHCI_EP_LIMIT_QUIRK    (1 << 5)
+#define XHCI_BROKEN_MSI                (1 << 6)
+#define XHCI_RESET_ON_RESUME   (1 << 7)
+       unsigned int            num_active_eps;
+       unsigned int            limit_active_eps;
        /* There are two roothubs to keep track of bus suspend info for */
        struct xhci_bus_state   bus_state[2];
        /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */
@@ -1338,9 +1361,6 @@ static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,
 static inline void xhci_writel(struct xhci_hcd *xhci,
                const unsigned int val, __le32 __iomem *regs)
 {
-       xhci_dbg(xhci,
-                       "`MEM_WRITE_DWORD(3'b000, 32'h%p, 32'h%0x, 4'hf);\n",
-                       regs, val);
        writel(val, regs);
 }
 
@@ -1368,9 +1388,6 @@ static inline void xhci_write_64(struct xhci_hcd *xhci,
        u32 val_lo = lower_32_bits(val);
        u32 val_hi = upper_32_bits(val);
 
-       xhci_dbg(xhci,
-                       "`MEM_WRITE_DWORD(3'b000, 64'h%p, 64'h%0lx, 4'hf);\n",
-                       regs, (long unsigned int) val);
        writel(val_lo, ptr);
        writel(val_hi, ptr + 1);
 }
@@ -1439,6 +1456,8 @@ void xhci_setup_streams_ep_input_ctx(struct xhci_hcd *xhci,
 void xhci_setup_no_streams_ep_input_ctx(struct xhci_hcd *xhci,
                struct xhci_ep_ctx *ep_ctx,
                struct xhci_virt_ep *ep);
+void xhci_free_device_endpoint_resources(struct xhci_hcd *xhci,
+       struct xhci_virt_device *virt_dev, bool drop_control_ep);
 struct xhci_ring *xhci_dma_to_transfer_ring(
                struct xhci_virt_ep *ep,
                u64 address);