svn commit: r195326 - projects/mesh11s/sys/dev/ath

Rui Paulo rpaulo at FreeBSD.org
Fri Jul 3 21:43:50 UTC 2009


Author: rpaulo
Date: Fri Jul  3 21:43:49 2009
New Revision: 195326
URL: http://svn.freebsd.org/changeset/base/195326

Log:
  Treat mesh the same as hostap.
  
  Submited by:	sam

Modified:
  projects/mesh11s/sys/dev/ath/if_ath.c

Modified: projects/mesh11s/sys/dev/ath/if_ath.c
==============================================================================
--- projects/mesh11s/sys/dev/ath/if_ath.c	Fri Jul  3 21:12:37 2009	(r195325)
+++ projects/mesh11s/sys/dev/ath/if_ath.c	Fri Jul  3 21:43:49 2009	(r195326)
@@ -888,11 +888,9 @@ ath_vap_create(struct ieee80211com *ic,
 		}
 		break;
 	case IEEE80211_M_IBSS:
-	case IEEE80211_M_MBSS:
 		if (sc->sc_nvaps != 0) {	/* XXX only 1 for now */
 			device_printf(sc->sc_dev,
-			    "only 1 %s vap supported\n",
-			    (opmode == IEEE80211_M_IBSS) ? "ibss" : "mbss");
+			    "only 1 ibss vap supported\n");
 			goto bad;
 		}
 		needbeacon = 1;
@@ -922,6 +920,7 @@ ath_vap_create(struct ieee80211com *ic,
 		}
 		break;
 	case IEEE80211_M_HOSTAP:
+	case IEEE80211_M_MBSS:
 		needbeacon = 1;
 		break;
 	case IEEE80211_M_WDS:
@@ -953,7 +952,7 @@ ath_vap_create(struct ieee80211com *ic,
 	}
 
 	/* STA, AHDEMO? */
-	if (opmode == IEEE80211_M_HOSTAP) {
+	if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS) {
 		assign_address(sc, mac, flags & IEEE80211_CLONE_BSSID);
 		ath_hal_setbssidmask(sc->sc_ah, sc->sc_hwbssidmask);
 	}
@@ -1133,7 +1132,8 @@ ath_vap_delete(struct ieee80211vap *vap)
 		sc->sc_nstavaps--;
 		if (sc->sc_nstavaps == 0 && sc->sc_swbmiss)
 			sc->sc_swbmiss = 0;
-	} else if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
+	} else if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
+	    vap->iv_opmode == IEEE80211_M_MBSS) {
 		reclaim_address(sc, vap->iv_myaddr);
 		ath_hal_setbssidmask(ah, sc->sc_hwbssidmask);
 	}
@@ -2512,7 +2512,8 @@ ath_updateslot(struct ifnet *ifp)
 	 * immediately.  For other operation we defer the change
 	 * until beacon updates have propagated to the stations.
 	 */
-	if (ic->ic_opmode == IEEE80211_M_HOSTAP)
+	if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
+	    ic->ic_opmode == IEEE80211_M_MBSS)
 		sc->sc_updateslot = UPDATE;
 	else
 		ath_setslottime(sc);
@@ -2547,7 +2548,8 @@ ath_beaconq_config(struct ath_softc *sc)
 	HAL_TXQ_INFO qi;
 
 	ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi);
-	if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
+	if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
+	    ic->ic_opmode == IEEE80211_M_MBSS) {
 		/*
 		 * Always burst out beacon and CAB traffic.
 		 */
@@ -3099,9 +3101,10 @@ ath_beacon_config(struct ath_softc *sc, 
 	/* extract tstamp from last beacon and convert to TU */
 	nexttbtt = TSF_TO_TU(LE_READ_4(ni->ni_tstamp.data + 4),
 			     LE_READ_4(ni->ni_tstamp.data));
-	if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
+	if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
+	    ic->ic_opmode == IEEE80211_M_MBSS) {
 		/*
-		 * For multi-bss ap support beacons are either staggered
+		 * For multi-bss ap/mesh support beacons are either staggered
 		 * evenly over N slots or burst together.  For the former
 		 * arrange for the SWBA to be delivered for each slot.
 		 * Slots that are not occupied will generate nothing.
@@ -3245,9 +3248,8 @@ ath_beacon_config(struct ath_softc *sc, 
 		} else if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
 		    ic->ic_opmode == IEEE80211_M_MBSS) {
 			/*
-			 * In AP mode and mesh mode we enable the beacon
-			 * timers and * SWBA interrupts to prepare beacon
-			 * frames.
+			 * In AP/mesh mode we enable the beacon timers
+			 * and SWBA interrupts to prepare beacon frames.
 			 */
 			intval |= HAL_BEACON_ENA;
 			sc->sc_imask |= HAL_INT_SWBA;	/* beacon prepare */


More information about the svn-src-projects mailing list