Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2009 19:01:04 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195807 - head/sys/dev/ath
Message-ID:  <200907211901.n6LJ14nU019314@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Tue Jul 21 19:01:04 2009
New Revision: 195807
URL: http://svn.freebsd.org/changeset/base/195807

Log:
  track whether any mesh vaps are present to correctly setup the rx filter
  when, for example, an ap vap is created first
  
  Reviewed by:	rpaulo
  Approved by:	re (kib)

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Tue Jul 21 16:54:11 2009	(r195806)
+++ head/sys/dev/ath/if_ath.c	Tue Jul 21 19:01:04 2009	(r195807)
@@ -1023,6 +1023,8 @@ ath_vap_create(struct ieee80211com *ic,
 		sc->sc_nvaps++;
 		if (opmode == IEEE80211_M_STA)
 			sc->sc_nstavaps++;
+		if (opmode == IEEE80211_M_MBSS)
+			sc->sc_nmeshvaps++;
 	}
 	switch (ic_opmode) {
 	case IEEE80211_M_IBSS:
@@ -1137,6 +1139,8 @@ ath_vap_delete(struct ieee80211vap *vap)
 	    vap->iv_opmode == IEEE80211_M_MBSS) {
 		reclaim_address(sc, vap->iv_myaddr);
 		ath_hal_setbssidmask(ah, sc->sc_hwbssidmask);
+		if (vap->iv_opmode == IEEE80211_M_MBSS)
+			sc->sc_nmeshvaps--;
 	}
 	if (vap->iv_opmode != IEEE80211_M_WDS)
 		sc->sc_nvaps--;
@@ -2381,7 +2385,7 @@ ath_calcrxfilter(struct ath_softc *sc)
 	if (ic->ic_opmode == IEEE80211_M_HOSTAP &&
 	    IEEE80211_IS_CHAN_ANYG(ic->ic_curchan))
 		rfilt |= HAL_RX_FILTER_BEACON;
-	if (ic->ic_opmode == IEEE80211_M_MBSS) {
+	if (sc->sc_nmeshvaps) {
 		rfilt |= HAL_RX_FILTER_BEACON;
 		if (sc->sc_hasbmatch)
 			rfilt |= HAL_RX_FILTER_BSSID;

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Tue Jul 21 16:54:11 2009	(r195806)
+++ head/sys/dev/ath/if_athvar.h	Tue Jul 21 19:01:04 2009	(r195807)
@@ -203,6 +203,7 @@ struct ath_softc {
 	int			sc_debug;
 	int			sc_nvaps;	/* # vaps */
 	int			sc_nstavaps;	/* # station vaps */
+	int			sc_nmeshvaps;	/* # mbss vaps */
 	u_int8_t		sc_hwbssidmask[IEEE80211_ADDR_LEN];
 	u_int8_t		sc_nbssid0;	/* # vap's using base mac */
 	uint32_t		sc_bssidmask;	/* bssid mask */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907211901.n6LJ14nU019314>