Merge tag 'usb-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
[linux-block.git] / drivers / usb / host / xhci.h
index 3ecee10fdcdc7dfd697b24310de0ad3885421f10..3289bb51620172c8490135aa3f9f7849a55246fb 100644 (file)
@@ -1642,7 +1642,7 @@ struct xhci_scratchpad {
 struct urb_priv {
        int     num_tds;
        int     num_tds_done;
-       struct  xhci_td td[0];
+       struct  xhci_td td[];
 };
 
 /*
@@ -1694,6 +1694,7 @@ struct xhci_bus_state {
        /* Which ports are waiting on RExit to U0 transition. */
        unsigned long           rexit_ports;
        struct completion       rexit_done[USB_MAXCHILDREN];
+       struct completion       u3exit_done[USB_MAXCHILDREN];
 };
 
 
@@ -1901,7 +1902,7 @@ struct xhci_hcd {
 
        void                    *dbc;
        /* platform-specific data -- must come last */
-       unsigned long           priv[0] __aligned(sizeof(s64));
+       unsigned long           priv[] __aligned(sizeof(s64));
 };
 
 /* Platform specific overrides to generic XHCI hc_driver ops */
@@ -2589,6 +2590,35 @@ static inline const char *xhci_decode_portsc(u32 portsc)
        return str;
 }
 
+static inline const char *xhci_decode_usbsts(u32 usbsts)
+{
+       static char str[256];
+       int ret = 0;
+
+       if (usbsts == ~(u32)0)
+               return " 0xffffffff";
+       if (usbsts & STS_HALT)
+               ret += sprintf(str + ret, " HCHalted");
+       if (usbsts & STS_FATAL)
+               ret += sprintf(str + ret, " HSE");
+       if (usbsts & STS_EINT)
+               ret += sprintf(str + ret, " EINT");
+       if (usbsts & STS_PORT)
+               ret += sprintf(str + ret, " PCD");
+       if (usbsts & STS_SAVE)
+               ret += sprintf(str + ret, " SSS");
+       if (usbsts & STS_RESTORE)
+               ret += sprintf(str + ret, " RSS");
+       if (usbsts & STS_SRE)
+               ret += sprintf(str + ret, " SRE");
+       if (usbsts & STS_CNR)
+               ret += sprintf(str + ret, " CNR");
+       if (usbsts & STS_HCE)
+               ret += sprintf(str + ret, " HCE");
+
+       return str;
+}
+
 static inline const char *xhci_decode_doorbell(u32 slot, u32 doorbell)
 {
        static char str[256];