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 Tweak scanning for iwn.



details:   https://anonhg.NetBSD.org/src-all/rev/50d5d70eb05d
branches:  trunk
changeset: 376785:50d5d70eb05d
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Mon May 18 22:46:41 2020 +1000

description:
Tweak scanning for iwn.

diffstat:

 sys/dev/pci/if_iwn.c |  17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diffs (48 lines):

diff -r 2aad7d6c4947 -r 50d5d70eb05d sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Mon May 18 20:31:02 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Mon May 18 22:46:41 2020 +1000
@@ -841,6 +841,9 @@ static void
 iwn_scan_start(struct ieee80211com *ic)
 {
        struct iwn_softc *sc = ic->ic_softc;
+       IEEE80211_LOCK(ic);
+       ic->ic_flags |= IEEE80211_F_SCAN;
+       IEEE80211_UNLOCK(ic);
 
        /* make the link LED blink while we're scanning */
        iwn_set_led(sc, IWN_LED_LINK, 20, 2);
@@ -855,6 +858,10 @@ iwn_scan_end(struct ieee80211com *ic)
        struct iwn_softc *sc = ic->ic_softc;
        struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
 
+       IEEE80211_LOCK(ic);
+       ic->ic_flags &= ~IEEE80211_F_SCAN;
+       IEEE80211_UNLOCK(ic);
+
        if (vap->iv_state == IEEE80211_S_RUN) {
                /* Set link LED to ON status if we are associated */
                iwn_set_led(sc, IWN_LED_LINK, 0, 1);
@@ -2942,11 +2949,6 @@ iwn_notif_intr(struct ieee80211vap *vap)
                        DPRINTFN(2, ("scanning channel %d status %x\n",
                            scan->chan, le32toh(scan->status)));
 
-#if 0
-                       IEEE80211_LOCK(ic);
-                       ic->ic_flags |= IEEE80211_F_SCAN;
-                       IEEE80211_UNLOCK(ic);
-#endif
                        /* Fix current channel. */
                        vap->iv_bss->ni_chan = &ic->ic_channels[scan->chan];
                        break;
@@ -2962,11 +2964,6 @@ iwn_notif_intr(struct ieee80211vap *vap)
                            scan->nchan, scan->status, scan->chan));
 
                        sc->sc_flags &= ~IWN_FLAG_SCANNING;
-#if 0
-                       IEEE80211_LOCK(ic);
-                       ic->ic_flags &= ~IEEE80211_F_SCAN;
-                       IEEE80211_UNLOCK(ic);
-#endif
                        ieee80211_scan_next(vap);
                        break;
                }



Home | Main Index | Thread Index | Old Index