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/a15fabebe186
branches:  trunk
changeset: 986762:a15fabebe186
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 3bd2a056e8ee -r a15fabebe186 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);
 
@@ -4381,6 +4388,7 @@
                error = ETIMEDOUT;
                goto fail;
        }
+       DELAY(10000);
  fail:
        firmware_free(fw, fwlen);
        return error;
@@ -5553,6 +5561,7 @@
 
        urtwn_stop(ifp, 0);
 
+       DELAY(2000);
        mutex_enter(&sc->sc_write_mtx);
 
        mutex_enter(&sc->sc_task_mtx);
@@ -5808,6 +5817,7 @@
        urtwn_wait_async(sc);
        splx(s);
 
+       DELAY(2000);
        sc->tx_timer = 0;
        ifp->if_timer = 0;
        ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@@ -5868,6 +5878,8 @@
        urtwn_write_1(sc, R92C_SYS_FUNC_EN,
            R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA);
 
+       DELAY(10000);
+
        /*
         * Reset digital sequence
         */
@@ -5885,6 +5897,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