[PATCH] net80211: Fix bss channel on CSA reception

Adrian Chadd adrian at freebsd.org
Mon Jun 27 07:10:15 UTC 2011


This patch fixes a strange bug where although the CSA correctly
changes ic_curchan, it doesn't update the VAP BSS channel.
Hence querying the VAP doesn't report the correct channel.

Thanks,

Adrian

Index: ieee80211_proto.c
===================================================================
--- ieee80211_proto.c   (revision 223525)
+++ ieee80211_proto.c   (working copy)
@@ -1522,11 +1522,19 @@
 void
 ieee80211_csa_completeswitch(struct ieee80211com *ic)
 {
+       struct ieee80211vap *vap;
+
        IEEE80211_LOCK_ASSERT(ic);

        KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending"));

        ieee80211_setcurchan(ic, ic->ic_csa_newchan);
+       /*
+        * ic_curchan now matches ic_csa_newchan;
+        * inform all VAPs of the new channel
+        */
+       TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
+               vap->iv_bss->ni_chan = ic->ic_curchan;
        csa_completeswitch(ic);
 }


More information about the freebsd-wireless mailing list