Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/usb Fix pullup #1302 by adapting the changes to t...



details:   https://anonhg.NetBSD.org/src/rev/25e5dc6859bd
branches:  netbsd-9
changeset: 1002314:25e5dc6859bd
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jun 22 05:10:50 2021 +0000

description:
Fix pullup #1302 by adapting the changes to this branch
(there was a misunderstanding in the ticket handling)

diffstat:

 sys/dev/usb/xhci.c    |  14 +++++++-------
 sys/dev/usb/xhcireg.h |  25 ++++++++++++++++++++++++-
 sys/dev/usb/xhcivar.h |   2 +-
 3 files changed, 32 insertions(+), 9 deletions(-)

diffs (106 lines):

diff -r b13a0eea0abc -r 25e5dc6859bd sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Mon Jun 21 17:42:15 2021 +0000
+++ b/sys/dev/usb/xhci.c        Tue Jun 22 05:10:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $    */
+/*     $NetBSD: xhci.c,v 1.107.2.9 2021/06/22 05:10:50 martin Exp $    */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.9 2021/06/22 05:10:50 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -724,7 +724,7 @@
                if (xs->xs_idx == 0)
                        continue;
 
-               for (dci = XHCI_DCI_SLOT; dci <= XHCI_MAX_DCI; dci++) {
+               for (dci = 0; dci < 32; dci++) {
                        /* Skip if the endpoint is not Running.  */
                        /* XXX What about Busy?  */
                        if (xhci_get_epstate(sc, xs, dci) !=
@@ -951,7 +951,7 @@
         *
         * XXX Hope just zeroing it is good enough!
         */
-       xhci_host_dequeue(sc->sc_cr);
+       xhci_host_dequeue(&sc->sc_cr);
 
        /*
         * `7. Write the CRCR with the address and RCS value of the
@@ -959,8 +959,8 @@
         *     cause the Command Ring to restart at the address
         *     specified by the CRCR.'
         */
-       xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(sc->sc_cr, 0) |
-           sc->sc_cr->xr_cs);
+       xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(&sc->sc_cr, 0) |
+           sc->sc_cr.xr_cs);
 
        /*
         * `8. Enable the controller by setting Run/Stop (R/S) =
@@ -1049,7 +1049,7 @@
                if (xs->xs_idx == 0)
                        continue;
 
-               for (dci = XHCI_DCI_SLOT; dci <= XHCI_MAX_DCI; dci++) {
+               for (dci = 0; dci < 32; dci++) {
                        /* Skip if the endpoint is not Running.  */
                        if (xhci_get_epstate(sc, xs, dci) !=
                            XHCI_EPSTATE_RUNNING)
diff -r b13a0eea0abc -r 25e5dc6859bd sys/dev/usb/xhcireg.h
--- a/sys/dev/usb/xhcireg.h     Mon Jun 21 17:42:15 2021 +0000
+++ b/sys/dev/usb/xhcireg.h     Tue Jun 22 05:10:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xhcireg.h,v 1.13.2.1 2021/06/21 17:11:46 martin Exp $ */
+/* $NetBSD: xhcireg.h,v 1.13.2.2 2021/06/22 05:10:50 martin Exp $ */
 
 /*-
  * Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
@@ -162,8 +162,31 @@
 #define         XHCI_PS_PED            0x00000002      /* RW - port enabled / disabled */
 #define         XHCI_PS_OCA            0x00000008      /* RO - over current active */
 #define         XHCI_PS_PR             0x00000010      /* RW - port reset */
+#define         XHCI_PS_PLS_MASK       __BITS(8, 5)
 #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_PLS_SETU0     0
+#define  XHCI_PS_PLS_SETU2     2
+#define  XHCI_PS_PLS_SETU3     3
+#define  XHCI_PS_PLS_SETDISC   5
+#define  XHCI_PS_PLS_SETCOMP   10
+#define  XHCI_PS_PLS_SETRESUME 15
+
+#define  XHCI_PS_PLS_U0                0
+#define  XHCI_PS_PLS_U1                1
+#define  XHCI_PS_PLS_U2                2
+#define  XHCI_PS_PLS_U3                3
+#define  XHCI_PS_PLS_DISABLED  4
+#define  XHCI_PS_PLS_RXDETECT  5
+#define  XHCI_PS_PLS_INACTIVE  6
+#define  XHCI_PS_PLS_POLLING   7
+#define  XHCI_PS_PLS_RECOVERY  8
+#define  XHCI_PS_PLS_HOTRESET  9
+#define  XHCI_PS_PLS_COMPLIANCE        10
+#define  XHCI_PS_PLS_TEST      11
+#define  XHCI_PS_PLS_RESUME    15
+
 #define         XHCI_PS_PP             0x00000200      /* RW - port power */
 #define         XHCI_PS_SPEED_GET(x)   (((x) >> 10) & 0xF)     /* RO - port speed */
 #define         XHCI_PS_SPEED_FS       1
diff -r b13a0eea0abc -r 25e5dc6859bd sys/dev/usb/xhcivar.h
--- a/sys/dev/usb/xhcivar.h     Mon Jun 21 17:42:15 2021 +0000
+++ b/sys/dev/usb/xhcivar.h     Tue Jun 22 05:10:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhcivar.h,v 1.11.4.1 2021/06/21 17:11:46 martin Exp $  */
+/*     $NetBSD: xhcivar.h,v 1.11.4.2 2021/06/22 05:10:50 martin Exp $  */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch



Home | Main Index | Thread Index | Old Index