From owner-svn-src-projects@FreeBSD.ORG Fri Jul 3 21:43:49 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5083106564A; Fri, 3 Jul 2009 21:43:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3F5D8FC08; Fri, 3 Jul 2009 21:43:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n63LhnqJ089203; Fri, 3 Jul 2009 21:43:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n63LhniG089201; Fri, 3 Jul 2009 21:43:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907032143.n63LhniG089201@svn.freebsd.org> From: Rui Paulo Date: Fri, 3 Jul 2009 21:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195326 - projects/mesh11s/sys/dev/ath X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2009 21:43:50 -0000 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 */