Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/pci Attempt at improving iwn tx/rx rates by re...



details:   https://anonhg.NetBSD.org/src-all/rev/3d6b87606f00
branches:  trunk
changeset: 1025725:3d6b87606f00
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Fri Aug 14 02:26:26 2020 +1000

description:
Attempt at improving iwn tx/rx rates by renabling rates to be configured for
the wifi node.

diffstat:

 sys/dev/pci/if_iwn.c |  29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diffs (65 lines):

diff -r 930c7d4a21a8 -r 3d6b87606f00 sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Fri Aug 14 02:25:10 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Fri Aug 14 02:26:26 2020 +1000
@@ -2196,26 +2196,31 @@
 static int
 iwn_media_change(struct ifnet *ifp)
 {
-       //struct iwn_softc *sc = ifp->if_softc;
-//     struct ieee80211com *ic = &sc->sc_ic;
-//     uint8_t rate, ridx;
+       struct ieee80211vap *vap = ifp->if_softc;
+       struct ieee80211com *ic = vap->iv_ic;
+       struct iwn_softc *sc = ic->ic_softc;
+       uint8_t rate, ridx, i;
        int error;
 
        error = ieee80211_media_change(ifp);
        if (error != ENETRESET)
                return error;
 
-#if 0
-       if (ic->ic_fixed_rate != -1) {
+//     if (ic->ic_fixed_rate != -1) {
+               /* Find the highest rate */
+               i = 0;
+               for (rate = 1; rate != 0; i++) {
+                       rate = ic->ic_sup_rates[ic->ic_curmode].
+                           rs_rates[i] & IEEE80211_RATE_VAL;
+               }
                rate = ic->ic_sup_rates[ic->ic_curmode].
-                   rs_rates[ic->ic_fixed_rate] & IEEE80211_RATE_VAL;
+                   rs_rates[i - 1] & IEEE80211_RATE_VAL;
                /* Map 802.11 rate to HW rate index. */
                for (ridx = 0; ridx <= IWN_RIDX_MAX; ridx++)
                        if (iwn_rates[ridx].rate == rate)
                                break;
                sc->fixed_ridx = ridx;
-       }
-#endif
+//     }
 
        if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
            (IFF_UP | IFF_RUNNING)) {
@@ -3442,16 +3447,18 @@
        data = &ring->data[ring->cur];
 
        /* Choose a TX rate index. */
+#if 0
        if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
            type != IEEE80211_FC0_TYPE_DATA) {
                ridx = (ic->ic_curmode == IEEE80211_MODE_11A) ?
                    IWN_RIDX_OFDM6 : IWN_RIDX_CCK1;
+       } else if (ic->ic_fixed_rate != -1) {
+#endif
+               ridx = sc->fixed_ridx;
 #if 0
-       } else if (ic->ic_fixed_rate != -1) {
-               ridx = sc->fixed_ridx;
-#endif
        } else
                ridx = wn->ridx[ni->ni_txrate];
+#endif
        rinfo = &iwn_rates[ridx];
 
        if (sc->sc_drvbpf != NULL) {



Home | Main Index | Thread Index | Old Index