Author: hselasky
Date: Sat Dec 31 13:23:04 2011
New Revision: 229084
URL: http://svn.freebsd.org/changeset/base/229084

Log:
  MFC r227396, r227401, r227541, r227654 and r228493:
  Relax XHCI timeouts which should fix enumeration issues.
  Fix definition of XHCI port power bit.
  Correct size of some USB 3.0 descriptor fields.
  
  Reported by:    Kohji Okuno, Jan Henrik Sylvester

Modified:
  stable/9/sys/dev/usb/controller/xhci.c
  stable/9/sys/dev/usb/controller/xhcireg.h
  stable/9/sys/dev/usb/usb.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/usb/controller/xhci.c
==============================================================================
--- stable/9/sys/dev/usb/controller/xhci.c      Sat Dec 31 13:13:42 2011        
(r229083)
+++ stable/9/sys/dev/usb/controller/xhci.c      Sat Dec 31 13:23:04 2011        
(r229084)
@@ -292,7 +292,7 @@ xhci_start_controller(struct xhci_softc 
        XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST);
 
        for (i = 0; i != 100; i++) {
-               usb_pause_mtx(NULL, hz / 1000);
+               usb_pause_mtx(NULL, hz / 100);
                temp = XREAD4(sc, oper, XHCI_USBCMD) &
                    (XHCI_CMD_HCRST | XHCI_STS_CNR);
                if (!temp)
@@ -453,7 +453,7 @@ xhci_start_controller(struct xhci_softc 
            XHCI_CMD_INTE | XHCI_CMD_HSEE);
 
        for (i = 0; i != 100; i++) {
-               usb_pause_mtx(NULL, hz / 1000);
+               usb_pause_mtx(NULL, hz / 100);
                temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH;
                if (!temp)
                        break;
@@ -487,7 +487,7 @@ xhci_halt_controller(struct xhci_softc *
        XWRITE4(sc, oper, XHCI_USBCMD, 0);
 
        for (i = 0; i != 100; i++) {
-               usb_pause_mtx(NULL, hz / 1000);
+               usb_pause_mtx(NULL, hz / 100);
                temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH;
                if (temp)
                        break;
@@ -1110,7 +1110,7 @@ xhci_cmd_nop(struct xhci_softc *sc)
 
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 #endif
 
@@ -1127,7 +1127,7 @@ xhci_cmd_enable_slot(struct xhci_softc *
        trb.dwTrb2 = 0;
        trb.dwTrb3 = htole32(XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_ENABLE_SLOT));
 
-       err = xhci_do_command(sc, &trb, 50 /* ms */);
+       err = xhci_do_command(sc, &trb, 100 /* ms */);
        if (err)
                goto done;
 
@@ -1154,7 +1154,7 @@ xhci_cmd_disable_slot(struct xhci_softc 
 
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 static usb_error_t
@@ -1310,7 +1310,7 @@ xhci_cmd_configure_ep(struct xhci_softc 
 
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 static usb_error_t
@@ -1328,7 +1328,7 @@ xhci_cmd_evaluate_ctx(struct xhci_softc 
            XHCI_TRB_3_SLOT_SET(slot_id);
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 static usb_error_t
@@ -1351,7 +1351,7 @@ xhci_cmd_reset_ep(struct xhci_softc *sc,
 
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 static usb_error_t
@@ -1373,7 +1373,7 @@ xhci_cmd_set_tr_dequeue_ptr(struct xhci_
            XHCI_TRB_3_EP_SET(ep_id);
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 static usb_error_t
@@ -1396,7 +1396,7 @@ xhci_cmd_stop_ep(struct xhci_softc *sc, 
 
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 static usb_error_t
@@ -1414,7 +1414,7 @@ xhci_cmd_reset_dev(struct xhci_softc *sc
 
        trb.dwTrb3 = htole32(temp);
 
-       return (xhci_do_command(sc, &trb, 50 /* ms */));
+       return (xhci_do_command(sc, &trb, 100 /* ms */));
 }
 
 /*------------------------------------------------------------------------*
@@ -2831,7 +2831,7 @@ struct xhci_bos_desc xhci_bosd = {
                .bLength = sizeof(xhci_bosd.usb2extd),
                .bDescriptorType = 1,
                .bDevCapabilityType = 2,
-               .bmAttributes = 2,
+               .bmAttributes[0] = 2,
        },
        .usbdcd = {
                .bLength = sizeof(xhci_bosd.usbdcd),
@@ -2841,7 +2841,8 @@ struct xhci_bos_desc xhci_bosd = {
                HSETW(.wSpeedsSupported, 0x000C),
                .bFunctionalitySupport = 8,
                .bU1DevExitLat = 255,   /* dummy - not used */
-               .bU2DevExitLat = 255,   /* dummy - not used */
+               .wU2DevExitLat[0] = 0x00,
+               .wU2DevExitLat[1] = 0x08,
        },
        .cidd = {
                .bLength = sizeof(xhci_bosd.cidd),

Modified: stable/9/sys/dev/usb/controller/xhcireg.h
==============================================================================
--- stable/9/sys/dev/usb/controller/xhcireg.h   Sat Dec 31 13:13:42 2011        
(r229083)
+++ stable/9/sys/dev/usb/controller/xhcireg.h   Sat Dec 31 13:23:04 2011        
(r229084)
@@ -115,7 +115,7 @@
 #define        XHCI_PS_PR              0x00000010      /* RW - port reset */
 #define        XHCI_PS_PLS_GET(x)      (((x) >> 5) & 0xF)      /* RW - port 
link state */
 #define        XHCI_PS_PLS_SET(x)      (((x) & 0xF) << 5)      /* RW - port 
link state */
-#define        XHCI_PS_PP              0x00000100      /* RW - port power */
+#define        XHCI_PS_PP              0x00000200      /* RW - port power */
 #define        XHCI_PS_SPEED_GET(x)    (((x) >> 10) & 0xF)     /* RO - port 
speed */
 #define        XHCI_PS_PIC_GET(x)      (((x) >> 14) & 0x3)     /* RW - port 
indicator */
 #define        XHCI_PS_PIC_SET(x)      (((x) & 0x3) << 14)     /* RW - port 
indicator */

Modified: stable/9/sys/dev/usb/usb.h
==============================================================================
--- stable/9/sys/dev/usb/usb.h  Sat Dec 31 13:13:42 2011        (r229083)
+++ stable/9/sys/dev/usb/usb.h  Sat Dec 31 13:23:04 2011        (r229084)
@@ -323,7 +323,7 @@ struct usb_devcap_usb2ext_descriptor {
        uByte   bLength;
        uByte   bDescriptorType;
        uByte   bDevCapabilityType;
-       uByte   bmAttributes;
+       uDWord  bmAttributes;
 #define        USB_V2EXT_LPM 0x02
 } __packed;
 typedef struct usb_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t;
@@ -336,7 +336,7 @@ struct usb_devcap_ss_descriptor {
        uWord   wSpeedsSupported;
        uByte   bFunctionalitySupport;
        uByte   bU1DevExitLat;
-       uByte   bU2DevExitLat;
+       uWord   wU2DevExitLat;
 } __packed;
 typedef struct usb_devcap_ss_descriptor usb_devcap_ss_descriptor_t;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to