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/5e580893a730
branches:  trunk
changeset: 370855:5e580893a730
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 3eaa12b6b001 -r 5e580893a730 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
@@ -2353,6 +2353,8 @@
        callout_stop(&sc->sc_scan_to);
        callout_stop(&sc->sc_calib_to);
 
+       DELAY(1000);
+
        switch (ostate) {
        case IEEE80211_S_INIT:
                break;
@@ -2408,6 +2410,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);
@@ -2426,6 +2429,8 @@
                break;
        }
 
+       DELAY(1000);
+
        switch (nstate) {
        case IEEE80211_S_INIT:
                /* Turn link LED off. */
@@ -2570,6 +2575,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);
 
@@ -4384,6 +4391,7 @@
                error = ETIMEDOUT;
                goto fail;
        }
+       DELAY(10000);
  fail:
        firmware_free(fw, fwlen);
        return error;
@@ -5556,6 +5564,7 @@
 
        urtwn_stop(ifp, 0);
 
+       DELAY(2000);
        mutex_enter(&sc->sc_write_mtx);
 
        mutex_enter(&sc->sc_task_mtx);
@@ -5811,6 +5820,7 @@
        urtwn_wait_async(sc);
        splx(s);
 
+       DELAY(2000);
        sc->tx_timer = 0;
        ifp->if_timer = 0;
        ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@@ -5871,6 +5881,8 @@
        urtwn_write_1(sc, R92C_SYS_FUNC_EN,
            R92C_SYS_FUNC_EN_USBD | R92C_SYS_FUNC_EN_USBA);
 
+       DELAY(10000);
+
        /*
         * Reset digital sequence
         */
@@ -5888,6 +5900,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