Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev Pull up the following revisions, requested by msa...



details:   https://anonhg.NetBSD.org/src/rev/f5801ed4ccd5
branches:  netbsd-9
changeset: 373171:f5801ed4ccd5
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Jan 23 12:05:36 2023 +0000

description:
Pull up the following revisions, requested by msaitoh in ticket #1570:

        sys/dev/pci/xhci_pci.c                          1.31 via patch
        sys/dev/usb/xhci.c                              1.173-1.175
        sys/dev/usb/xhcivar.h                           1.22

Support xHCI device which has USB 2 port only.

diffstat:

 sys/dev/pci/xhci_pci.c |  10 ++++++----
 sys/dev/usb/xhci.c     |  16 +++++++++++-----
 sys/dev/usb/xhcivar.h  |   4 +++-
 3 files changed, 20 insertions(+), 10 deletions(-)

diffs (97 lines):

diff -r cb6f9098acaf -r f5801ed4ccd5 sys/dev/pci/xhci_pci.c
--- a/sys/dev/pci/xhci_pci.c    Thu Jan 19 10:59:51 2023 +0000
+++ b/sys/dev/pci/xhci_pci.c    Mon Jan 23 12:05:36 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci_pci.c,v 1.21.4.1 2021/05/17 15:50:35 martin Exp $ */
+/*     $NetBSD: xhci_pci.c,v 1.21.4.2 2023/01/23 12:05:36 martin Exp $ */
 /*     OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.21.4.1 2021/05/17 15:50:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.21.4.2 2023/01/23 12:05:36 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -267,9 +267,11 @@
                aprint_error_dev(self, "couldn't establish power handler\n");
 
        /* Attach usb buses. */
-       sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
+       if (sc->sc_usb3nports != 0)
+               sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
 
-       sc->sc_child2 = config_found(self, &sc->sc_bus2, usbctlprint);
+       if (sc->sc_usb2nports != 0)
+               sc->sc_child2 = config_found(self, &sc->sc_bus2, usbctlprint);
 
        return;
 
diff -r cb6f9098acaf -r f5801ed4ccd5 sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Thu Jan 19 10:59:51 2023 +0000
+++ b/sys/dev/usb/xhci.c        Mon Jan 23 12:05:36 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.107.2.10 2022/09/16 18:32:49 martin Exp $   */
+/*     $NetBSD: xhci.c,v 1.107.2.11 2023/01/23 12:05:36 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.10 2022/09/16 18:32:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.11 2023/01/23 12:05:36 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1177,7 +1177,11 @@
        case 0x0310:
        case 0x0320:
                aprint_debug_dev(sc->sc_dev, " %s ports %d - %d\n",
-                   major == 3 ? "ss" : "hs", cpo, cpo + cpc -1);
+                   major == 3 ? "ss" : "hs", cpo, cpo + cpc - 1);
+               if (major == 3)
+                       sc->sc_usb3nports += cpo + cpc - 1;
+               else
+                       sc->sc_usb2nports += cpo + cpc - 1;
                break;
        default:
                aprint_error_dev(sc->sc_dev, " unknown major/minor (%d/%d)\n",
@@ -1399,11 +1403,13 @@
        /* default all ports to bus 0, i.e. usb 3 */
        sc->sc_ctlrportbus = kmem_zalloc(
            howmany(sc->sc_maxports * sizeof(uint8_t), NBBY), KM_SLEEP);
-       sc->sc_ctlrportmap = kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
+       sc->sc_ctlrportmap =
+           kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
 
        /* controller port to bus roothub port map */
        for (size_t j = 0; j < __arraycount(sc->sc_rhportmap); j++) {
-               sc->sc_rhportmap[j] = kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
+               sc->sc_rhportmap[j] =
+                   kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
        }
 
        /*
diff -r cb6f9098acaf -r f5801ed4ccd5 sys/dev/usb/xhcivar.h
--- a/sys/dev/usb/xhcivar.h     Thu Jan 19 10:59:51 2023 +0000
+++ b/sys/dev/usb/xhcivar.h     Mon Jan 23 12:05:36 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhcivar.h,v 1.11.4.2 2021/06/22 05:10:50 martin Exp $  */
+/*     $NetBSD: xhcivar.h,v 1.11.4.3 2023/01/23 12:05:36 martin Exp $  */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -103,6 +103,8 @@
         * Port routing and root hub - xHCI 4.19.7
         */
        int sc_maxports;                /* number of controller ports */
+       int sc_usb3nports;
+       int sc_usb2nports;
 
        uint8_t *sc_ctlrportbus;        /* a bus bit per port */
 



Home | Main Index | Thread Index | Old Index