Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb revert accidental last commit (except ukbd.c)



details:   https://anonhg.NetBSD.org/src/rev/b2f097e5d8d6
branches:  trunk
changeset: 364697:b2f097e5d8d6
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Wed Apr 06 22:01:45 2022 +0000

description:
revert accidental last commit (except ukbd.c)

diffstat:

 sys/dev/usb/ehci.c       |   13 +-
 sys/dev/usb/if_smscreg.h |    4 +-
 sys/dev/usb/if_urtwn.c   |    7 +-
 sys/dev/usb/ubt.c        |   28 +---
 sys/dev/usb/uhub.c       |   28 +----
 sys/dev/usb/usb_subr.c   |   17 +--
 sys/dev/usb/usbdi.c      |   10 +-
 sys/dev/usb/uvideo.c     |   34 ++--
 sys/dev/usb/xhci.c       |  281 ++++++++++++++++------------------------------
 sys/dev/usb/xhcireg.h    |   11 +-
 10 files changed, 144 insertions(+), 289 deletions(-)

diffs (truncated from 820 to 300 lines):

diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/ehci.c        Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.310 2022/04/06 21:51:29 mlelstv Exp $ */
+/*     $NetBSD: ehci.c,v 1.311 2022/04/06 22:01:45 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.310 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.311 2022/04/06 22:01:45 mlelstv Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -790,9 +790,6 @@
        if (eintrs & EHCI_STS_HSE) {
                printf("%s: unrecoverable error, controller halted\n",
                       device_xname(sc->sc_dev));
-#ifdef EHCI_DEBUG
-               ehci_dump();
-#endif
                /* XXX what else */
        }
        if (eintrs & EHCI_STS_PCD) {
@@ -2244,7 +2241,6 @@
        unsigned starttime = getticks();
        unsigned endtime = starttime + delta;
        unsigned now;
-       uint32_t v;
 
        KASSERT(mutex_owned(&sc->sc_lock));
 
@@ -2264,10 +2260,7 @@
        sc->sc_doorbelllwp = curlwp;
 
        /* ask for doorbell */
-       v = EOREAD4(sc, EHCI_USBCMD);
-       if ((v & EHCI_CMD_IAAD) == 0)
-               EOWRITE4(sc, EHCI_USBCMD, v | EHCI_CMD_IAAD);
-
+       EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);
        DPRINTF("cmd = 0x%08jx sts = 0x%08jx",
            EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS), 0, 0);
 
diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/if_smscreg.h
--- a/sys/dev/usb/if_smscreg.h  Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/if_smscreg.h  Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smscreg.h,v 1.7 2022/04/06 21:51:29 mlelstv Exp $   */
+/*     $NetBSD: if_smscreg.h,v 1.8 2022/04/06 22:01:45 mlelstv Exp $   */
 
 /*     $OpenBSD: if_smscreg.h,v 1.2 2012/09/27 12:38:11 jsg Exp $      */
 /*-
@@ -244,7 +244,7 @@
 #define SMSC_UR_GET_STATS      0xA2
 
 #define SMSC_RX_LIST_CNT       1
-#define SMSC_TX_LIST_CNT       2
+#define SMSC_TX_LIST_CNT       1
 
 #define        SMSC_CONFIG_INDEX       1       /* config number 1 */
 #define        SMSC_IFACE_IDX          0
diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/if_urtwn.c    Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_urtwn.c,v 1.102 2022/04/06 21:51:29 mlelstv Exp $   */
+/*     $NetBSD: if_urtwn.c,v 1.103 2022/04/06 22:01:45 mlelstv Exp $   */
 /*     $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $       */
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.102 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.103 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2623,8 +2623,7 @@
                                struct usbd_pipe *pipe = sc->tx_pipe[pidx];
                                usbd_clear_endpoint_stall_async(pipe);
                        }
-                       device_printf(sc->sc_dev, "device error %s\n",
-                                     usbd_errstr(status));
+                       device_printf(sc->sc_dev, "device timeout\n");
                        if_statinc(ifp, if_oerrors);
                }
                splx(s);
diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/ubt.c
--- a/sys/dev/usb/ubt.c Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/ubt.c Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ubt.c,v 1.65 2022/04/06 21:51:29 mlelstv Exp $ */
+/*     $NetBSD: ubt.c,v 1.66 2022/04/06 22:01:45 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.65 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.66 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1456,7 +1456,7 @@
                             isoc,
                             isoc->size,
                             num,
-                            USBD_FORCE_SHORT_XFER | USBD_SHORT_XFER_OK,
+                            USBD_FORCE_SHORT_XFER,
                             ubt_xmit_sco_complete);
 
        usbd_transfer(isoc->xfer);
@@ -1777,11 +1777,11 @@
                        if (m == NULL) {
                                MGETHDR(m, M_DONTWAIT, MT_DATA);
                                if (m == NULL) {
-                                       device_printf(sc->sc_dev,
+                                       aprint_error_dev(sc->sc_dev,
                                            "out of memory (xfer halted)\n");
 
                                        sc->sc_stats.err_rx++;
-                                       return; /* lost sync */
+                                       return;         /* lost sync */
                                }
 
                                ptr = mtod(m, uint8_t *);
@@ -1808,21 +1808,14 @@
                                if (want == sizeof(hci_scodata_hdr_t)) {
                                        uint32_t len =
                                            mtod(m, hci_scodata_hdr_t *)->length;
-                                       if (len == 0) {
-                                               ptr = mtod(m, uint8_t *);
-                                               ptr++;
-                                               got = 1;
-                                       } else if (want > MHLEN) {
-                                               device_printf(sc->sc_dev,
+                                       want += len;
+                                       if (len == 0 || want > MHLEN) {
+                                               aprint_error_dev(sc->sc_dev,
                                                    "packet too large %u "
                                                    "(lost sync)\n", len);
                                                sc->sc_stats.err_rx++;
-
-                                               /* lost sync */
-                                               m_freem(m);
                                                return;
-                                       } else
-                                               want += len;
+                                       }
                                }
 
                                if (got == want) {
@@ -1832,9 +1825,6 @@
                                                sc->sc_stats.err_rx++;
 
                                        m = NULL;
-                                       ptr = NULL;
-                                       got = 0;
-                                       want = 0;
                                }
                        }
 
diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c        Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/uhub.c        Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhub.c,v 1.160 2022/04/06 21:51:29 mlelstv Exp $       */
+/*     $NetBSD: uhub.c,v 1.161 2022/04/06 22:01:45 mlelstv Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $       */
 /*     $OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */
 
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.160 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.161 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -563,29 +563,9 @@
                for (port = 1; port <= hd->bNbrPorts; port++) {
                        SDT_PROBE3(usb, hub, explore, rescan,
                            dev, port, &dev->ud_hub->uh_ports[port - 1]);
-                       up = &dev->ud_hub->uh_ports[port - 1];
-                       subdev = up->up_dev;
+                       subdev = dev->ud_hub->uh_ports[port - 1].up_dev;
                        if (subdev == NULL)
                                continue;
-
-                       err = usbd_get_port_status(subdev, port, &up->up_status);
-                       if (err) {
-                               DPRINTF("uhub%jd get port stat failed, err %jd",
-                               device_unit(sc->sc_dev), err, 0, 0);
-                               continue;
-                       }
-
-                       change = UGETW(up->up_status.wPortChange);
-                       if ((change & UPS_C_PORT_ENABLED) == 0) {
-                               if (usbd_reset_port(subdev, port, &up->up_status)) {
-                                       device_printf(sc->sc_dev,
-                                       "port %d reset failed\n", port);
-                                       continue;
-                               }
-                               device_printf(sc->sc_dev,
-                                   "port %d reset succeeded\n", port);
-                       }
-
                        usbd_reattach_device(sc->sc_dev, subdev, port, NULL);
                }
        }
@@ -884,7 +864,7 @@
                         * some other serious problem.  Since we cannot leave
                         * at 0 we have to disable the port instead.
                         */
-                       device_printf(sc->sc_dev,
+                       aprint_error_dev(sc->sc_dev,
                            "device problem, disabling port %d\n", port);
                        usbd_clear_port_feature(dev, port, UHF_PORT_ENABLE);
                } else {
diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/usb_subr.c    Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.276 2022/04/06 21:51:29 mlelstv Exp $   */
+/*     $NetBSD: usb_subr.c,v 1.277 2022/04/06 22:01:45 mlelstv Exp $   */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.276 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.277 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -247,11 +247,8 @@
        /* Wait at least two clock ticks so we know the time has passed. */
        if (bus->ub_usepolling || cold)
                delay((ms+1) * 1000);
-       else {
-int timeo = (ms*hz+999)/1000 + 1;
-if (timeo > hz/2) printf("usb_delay_ms_locked(%p) %d ticks\n",lock,timeo);
+       else
                kpause("usbdly", false, (ms*hz+999)/1000 + 1, lock);
-       }
 }
 
 void
@@ -461,16 +458,8 @@
 {
 
        mutex_enter(iface->ui_dev->ud_bus->ub_lock);
-#if 1
-if (iface->ui_busy != 0) {
-       printf("%s: addr %d not idle, busy = %"PRId64"\n",
-               device_xname(iface->ui_dev->ud_bus->ub_usbctl),
-               iface->ui_dev->ud_addr, iface->ui_busy);
-}
-#else
        KASSERTMSG(iface->ui_busy == 0, "interface is not idle,"
            " busy=%"PRId64, iface->ui_busy);
-#endif
        iface->ui_busy = -1;
        mutex_exit(iface->ui_dev->ud_bus->ub_lock);
 }
diff -r 17ee0efc43d3 -r b2f097e5d8d6 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Wed Apr 06 21:51:29 2022 +0000
+++ b/sys/dev/usb/usbdi.c       Wed Apr 06 22:01:45 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.241 2022/04/06 21:51:29 mlelstv Exp $      */
+/*     $NetBSD: usbdi.c,v 1.242 2022/04/06 22:01:45 mlelstv Exp $      */
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.241 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.242 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1185,11 +1185,7 @@
 
        if (xfer->ux_callback) {
                if (!polling) {
-                       while (pipe->up_callingxfer != NULL) {



Home | Main Index | Thread Index | Old Index