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 Avoid redundant (and expensive) channel setup



details:   https://anonhg.NetBSD.org/src-all/rev/cec2c432d9b7
branches:  trunk
changeset: 990391:cec2c432d9b7
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sun Jun 06 14:28:55 2021 +0200

description:
Avoid redundant (and expensive) channel setup

diffstat:

 sys/dev/pci/if_rtwn.c    |  8 ++++++++
 sys/dev/pci/if_rtwnreg.h |  1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diffs (36 lines):

diff -r bbf2a2e16225 -r cec2c432d9b7 sys/dev/pci/if_rtwn.c
--- a/sys/dev/pci/if_rtwn.c     Sun Jun 06 14:27:00 2021 +0200
+++ b/sys/dev/pci/if_rtwn.c     Sun Jun 06 14:28:55 2021 +0200
@@ -3147,6 +3147,11 @@
 
        DPRINTFN(3, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
 
+       if (sc->sc_curchan != NULL && sc->sc_curchan == ic->ic_curchan)
+               return;
+
+//     RTWN_LOCK();    // XXX
+
        chan = ieee80211_chan2ieee(ic, ic->ic_curchan);
 
        /* Set Tx power for this new channel. */
@@ -3214,6 +3219,9 @@
                rtwn_rf_write(sc, 0, R92C_RF_CHNLBW,
                    (sc->rf_chnlbw[0] & ~0xfff) | R92C_RF_CHNLBW_BW20 | chan);
        }
+
+       sc->sc_curchan = ic->ic_curchan;
+//     RTWN_UNLOCK();  // XXX
 }
 
 static void
diff -r bbf2a2e16225 -r cec2c432d9b7 sys/dev/pci/if_rtwnreg.h
--- a/sys/dev/pci/if_rtwnreg.h  Sun Jun 06 14:27:00 2021 +0200
+++ b/sys/dev/pci/if_rtwnreg.h  Sun Jun 06 14:28:55 2021 +0200
@@ -147,6 +147,7 @@
        device_t                        sc_dev;
        struct ieee80211com             sc_ic;
        struct ifqueue                  sc_sendq;
+       struct ieee80211_channel        *sc_curchan;
 
        /* PCI specific goo. */
        bus_dma_tag_t                   sc_dmat;



Home | Main Index | Thread Index | Old Index