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/5d1c260104a9
branches:  trunk
changeset: 1026024:5d1c260104a9
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 637fcb3a1bf5 -r 5d1c260104a9 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
@@ -2352,6 +2352,8 @@
        callout_stop(&sc->sc_scan_to);
        callout_stop(&sc->sc_calib_to);
 
+       DELAY(1000);
+
        switch (ostate) {
        case IEEE80211_S_INIT:
                break;
@@ -2407,6 +2409,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);
@@ -2425,6 +2428,8 @@
                break;
        }
 
+       DELAY(1000);
+
        switch (nstate) {
        case IEEE80211_S_INIT:
                /* Turn link LED off. */
@@ -2569,6 +2574,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);
 
@@ -4382,6 +4389,7 @@
                error = ETIMEDOUT;
                goto fail;
        }
+       DELAY(10000);
  fail:
        firmware_free(fw, fwlen);
        return error;
@@ -5554,6 +5562,7 @@
 
        urtwn_stop(ifp, 0);
 
+       DELAY(2000);
        mutex_enter(&sc->sc_write_mtx);
 
        mutex_enter(&sc->sc_task_mtx);
@@ -5809,6 +5818,7 @@
        urtwn_wait_async(sc);
        splx(s);
 
+       DELAY(2000);
        sc->tx_timer = 0;
        ifp->if_timer = 0;
        ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@@ -5869,6 +5879,8 @@
        urtwn_write_1(sc, R92C_SYS_FUNC_EN,
            R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA);
 
+       DELAY(10000);
+
        /*
         * Reset digital sequence
         */
@@ -5886,6 +5898,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