From owner-p4-projects@FreeBSD.ORG Sat Mar 15 22:49:14 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 648961065673; Sat, 15 Mar 2008 22:49:14 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24523106564A for ; Sat, 15 Mar 2008 22:49:14 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 272808FC17 for ; Sat, 15 Mar 2008 22:49:14 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2FMnD7Z086007 for ; Sat, 15 Mar 2008 22:49:13 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2FMnDAe086005 for perforce@freebsd.org; Sat, 15 Mar 2008 22:49:13 GMT (envelope-from sam@freebsd.org) Date: Sat, 15 Mar 2008 22:49:13 GMT Message-Id: <200803152249.m2FMnDAe086005@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 137808 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2008 22:49:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=137808 Change 137808 by sam@sam_ebb on 2008/03/15 22:48:36 remove hack to walk the vap list to calculate the mcast filter as net80211 now does the merge for us Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#44 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#44 (text+ko) ==== @@ -142,6 +142,7 @@ const u_int8_t mac[IEEE80211_ADDR_LEN]); static void ath_key_update_begin(struct ieee80211vap *); static void ath_key_update_end(struct ieee80211vap *); +static void ath_update_mcast(struct ifnet *); static void ath_mode_init(struct ath_softc *); static void ath_setslottime(struct ath_softc *); static void ath_updateslot(struct ifnet *); @@ -625,6 +626,7 @@ ic->ic_vap_create = ath_vap_create; ic->ic_vap_delete = ath_vap_delete; ic->ic_raw_xmit = ath_raw_xmit; + ic->ic_update_mcast = ath_update_mcast; ic->ic_node_alloc = ath_node_alloc; sc->sc_node_free = ic->ic_node_free; ic->ic_node_free = ath_node_free; @@ -2496,25 +2498,20 @@ return rfilt; } -/* - * Merge multicast address from all vap's to form the hardware - * filter. Ideally we should only inspect our own list and the - * 802.11 layer would merge for us but that's bit difficult so - * for now we put the onus on the driver. - */ static void -ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2]) +ath_update_mcast(struct ifnet *ifp) { - struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211vap *vap; + struct ath_softc *sc = ifp->if_softc; + u_int32_t mfilt[2]; - mfilt[0] = mfilt[1] = 0; - /* XXX locking */ - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - struct ifnet *ifp = vap->iv_ifp; + /* calculate and install multicast filter */ + if ((ifp->if_flags & IFF_ALLMULTI) == 0) { struct ifmultiaddr *ifma; - - IF_ADDR_LOCK(ifp); + /* + * Merge multicast addresses to form the hardware filter. + */ + mfilt[0] = mfilt[1] = 0; + IF_ADDR_LOCK(ifp); /* XXX need some fiddling to remove? */ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { caddr_t dl; u_int32_t val; @@ -2530,7 +2527,11 @@ mfilt[pos / 32] |= (1 << (pos % 32)); } IF_ADDR_UNLOCK(ifp); - } + } else + mfilt[0] = mfilt[1] = ~0; + ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]); + DPRINTF(sc, ATH_DEBUG_MODE, "%s: , MC filter %08x:%08x\n", + __func__, mfilt[0], mfilt[1]); } static void @@ -2539,11 +2540,12 @@ struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; struct ifnet *ifp = sc->sc_ifp; - u_int32_t rfilt, mfilt[2]; + u_int32_t rfilt; /* configure rx filter */ rfilt = ath_calcrxfilter(sc); ath_hal_setrxfilter(ah, rfilt); + DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x\n", __func__, rfilt); /* configure operational mode */ ath_hal_setopmode(ah); @@ -2560,13 +2562,7 @@ ath_hal_setmac(ah, ic->ic_myaddr); /* calculate and install multicast filter */ - if ((ifp->if_flags & IFF_ALLMULTI) == 0) - ath_merge_mcast(sc, mfilt); - else - mfilt[0] = mfilt[1] = ~0; - ath_hal_setmcastfilter(ah, mfilt[0], mfilt[1]); - DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, MC filter %08x:%08x\n", - __func__, rfilt, mfilt[0], mfilt[1]); + ath_update_mcast(ifp); } /*