Author: glebius
Date: Mon Oct 21 18:12:31 2019
New Revision: 353858
URL: https://svnweb.freebsd.org/changeset/base/353858

Log:
  Convert to if_foreach_llmaddr() KPI.

Modified:
  head/sys/dev/rtwn/if_rtwn_rx.c

Modified: head/sys/dev/rtwn/if_rtwn_rx.c
==============================================================================
--- head/sys/dev/rtwn/if_rtwn_rx.c      Mon Oct 21 18:12:26 2019        
(r353857)
+++ head/sys/dev/rtwn/if_rtwn_rx.c      Mon Oct 21 18:12:31 2019        
(r353858)
@@ -366,6 +366,18 @@ rtwn_get_multi_pos(const uint8_t maddr[])
        return (pos);
 }
 
+static u_int
+rtwm_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
+{
+       uint32_t *mfilt = arg;
+       uint8_t pos;
+
+       pos = rtwn_get_multi_pos(LLADDR(sdl));
+       mfilt[pos / 32] |= (1 << (pos % 32));
+
+       return (1);
+}
+
 void
 rtwn_set_multi(struct rtwn_softc *sc)
 {
@@ -377,28 +389,13 @@ rtwn_set_multi(struct rtwn_softc *sc)
        /* general structure was copied from ath(4). */
        if (ic->ic_allmulti == 0) {
                struct ieee80211vap *vap;
-               struct ifnet *ifp;
-               struct ifmultiaddr *ifma;
 
                /*
                 * Merge multicast addresses to form the hardware filter.
                 */
                mfilt[0] = mfilt[1] = 0;
-               TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
-                       ifp = vap->iv_ifp;
-                       if_maddr_rlock(ifp);
-                       CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) 
{
-                               caddr_t dl;
-                               uint8_t pos;
-
-                               dl = LLADDR((struct sockaddr_dl *)
-                                   ifma->ifma_addr);
-                               pos = rtwn_get_multi_pos(dl);
-
-                               mfilt[pos / 32] |= (1 << (pos % 32));
-                       }
-                       if_maddr_runlock(ifp);
-               }
+               TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
+                       if_foreach_llmaddr(vap->iv_ifp, rtwm_hash_maddr, mfilt);
        } else
                mfilt[0] = mfilt[1] = ~0;
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to