Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Sprinkle delay in some places. Improves s...



details:   https://anonhg.NetBSD.org/src-all/rev/bd259146e8eb
branches:  trunk
changeset: 952463:bd259146e8eb
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Fri Jun 05 04:30:14 2020 +1000

description:
Sprinkle delay in some places.  Improves stability.

diffstat:

 sys/dev/usb/if_urtwn.c |  14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diffs (80 lines):

diff -r 50b49ae39606 -r bd259146e8eb sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Tue Jun 02 02:04:47 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Fri Jun 05 04:30:14 2020 +1000
@@ -2351,6 +2351,8 @@
        callout_stop(&sc->sc_scan_to);
        callout_stop(&sc->sc_calib_to);
 
+       DELAY(1000);
+
        switch (ostate) {
        case IEEE80211_S_INIT:
                break;
@@ -2406,6 +2408,7 @@
                            urtwn_read_1(sc, R92C_BCN_CTRL) &
                            ~(R92C_BCN_CTRL_EN_BCN | R92C_BCN_CTRL_TXBCN_RPT));
                }
+               DELAY(1000);
 
                /* Reset EDCA parameters. */
                urtwn_write_4(sc, R92C_EDCA_VO_PARAM, 0x002f3217);
@@ -2424,6 +2427,8 @@
                break;
        }
 
+       DELAY(1000);
+
        switch (nstate) {
        case IEEE80211_S_INIT:
                /* Turn link LED off. */
@@ -2568,6 +2573,8 @@
                } else /* IEEE_MODE_11NG */
                        urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 12); /* MCS 0 */
 
+               DELAY(1000);
+
                /* Enable Rx of data frames. */
                urtwn_write_2(sc, R92C_RXFLTMAP2, 0xffff);
 
@@ -4376,6 +4383,7 @@
                error = ETIMEDOUT;
                goto fail;
        }
+       DELAY(10000);
  fail:
        firmware_free(fw, fwlen);
        return error;
@@ -5548,6 +5556,7 @@
 
        urtwn_stop(ifp, 0);
 
+       DELAY(2000);
        mutex_enter(&sc->sc_write_mtx);
 
        mutex_enter(&sc->sc_task_mtx);
@@ -5803,6 +5812,7 @@
        urtwn_wait_async(sc);
        splx(s);
 
+       DELAY(2000);
        sc->tx_timer = 0;
        ifp->if_timer = 0;
        ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@@ -5863,6 +5873,8 @@
        urtwn_write_1(sc, R92C_SYS_FUNC_EN,
            R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA);
 
+       DELAY(10000);
+
        /*
         * Reset digital sequence
         */
@@ -5880,6 +5892,8 @@
                }
        }
 
+       DELAY(10000);
+
        /* Reset MAC and Enable 8051 */
        urtwn_write_1(sc, R92C_SYS_FUNC_EN + 1, 0x54);
 



Home | Main Index | Thread Index | Old Index