diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-26 11:45:06 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-26 11:45:06 +0000 |
commit | be5740a255fbcb1d4053e709cb7f22bb96320eb0 (patch) | |
tree | 30aee113c454323f30d4c201e18a0f29e2938074 /sys | |
parent | ffea8e20279ff0d82924add1cef0d8e16d9538a5 (diff) | |
download | FreeBSD-src-be5740a255fbcb1d4053e709cb7f22bb96320eb0.zip FreeBSD-src-be5740a255fbcb1d4053e709cb7f22bb96320eb0.tar.gz |
Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs. This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.
For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.
Approved by: re (kib)
MFC after: 6 weeks
Diffstat (limited to 'sys')
74 files changed, 165 insertions, 169 deletions
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index 00d3e3b..ec4771c 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -413,7 +413,7 @@ ate_setmcast(struct ate_softc *sc) */ mcaf[0] = 0; mcaf[1] = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -421,14 +421,14 @@ ate_setmcast(struct ate_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; af[index >> 3] |= 1 << (index & 7); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* * Write the hash to the hash register. This card can also * accept unicast packets as well as multicast packets using this * register for easier bridging operations, but we don't take * advantage of that. Locks here are to avoid LOR with the - * IF_ADDR_LOCK, but might not be strictly necessary. + * if_maddr_rlock, but might not be strictly necessary. */ WR4(sc, ETH_HSL, mcaf[0]); WR4(sc, ETH_HSH, mcaf[1]); diff --git a/sys/arm/xscale/ixp425/if_npe.c b/sys/arm/xscale/ixp425/if_npe.c index c02058b..5b605ae 100644 --- a/sys/arm/xscale/ixp425/if_npe.c +++ b/sys/arm/xscale/ixp425/if_npe.c @@ -435,7 +435,7 @@ npe_setmcast(struct npe_softc *sc) memset(clr, 0, ETHER_ADDR_LEN); memset(set, 0xff, ETHER_ADDR_LEN); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -445,7 +445,7 @@ npe_setmcast(struct npe_softc *sc) set[i] &= mac[i]; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < ETHER_ADDR_LEN; i++) { mask[i] = set[i] | ~clr[i]; diff --git a/sys/dev/ae/if_ae.c b/sys/dev/ae/if_ae.c index f6d8e42..da26ee7 100644 --- a/sys/dev/ae/if_ae.c +++ b/sys/dev/ae/if_ae.c @@ -2073,7 +2073,7 @@ ae_rxfilter(ae_softc_t *sc) * Load multicast tables. */ bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2081,7 +2081,7 @@ ae_rxfilter(ae_softc_t *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); AE_WRITE_4(sc, AE_REG_MHT0, mchash[0]); AE_WRITE_4(sc, AE_REG_MHT1, mchash[1]); AE_WRITE_4(sc, AE_MAC_REG, rxcfg); diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c index d60c285..f2a3725 100644 --- a/sys/dev/age/if_age.c +++ b/sys/dev/age/if_age.c @@ -3131,7 +3131,7 @@ age_rxfilter(struct age_softc *sc) /* Program new filter. */ bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3139,7 +3139,7 @@ age_rxfilter(struct age_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, AGE_MAR0, mchash[0]); CSR_WRITE_4(sc, AGE_MAR1, mchash[1]); diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index dc1c1fd..b28a411 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -3446,7 +3446,7 @@ alc_rxfilter(struct alc_softc *sc) goto chipit; } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3454,7 +3454,7 @@ alc_rxfilter(struct alc_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); chipit: CSR_WRITE_4(sc, ALC_MAR0, mchash[0]); diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c index 19ec2e9..f5ecb6a 100644 --- a/sys/dev/ale/if_ale.c +++ b/sys/dev/ale/if_ale.c @@ -3048,7 +3048,7 @@ ale_rxfilter(struct ale_softc *sc) /* Program new filter. */ bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3056,7 +3056,7 @@ ale_rxfilter(struct ale_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, ALE_MAR0, mchash[0]); CSR_WRITE_4(sc, ALE_MAR1, mchash[1]); diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 4a0401f..7d0eb5e 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -2408,7 +2408,7 @@ ath_update_mcast(struct ifnet *ifp) * Merge multicast addresses to form the hardware filter. */ mfilt[0] = mfilt[1] = 0; - IF_ADDR_LOCK(ifp); /* XXX need some fiddling to remove? */ + if_maddr_rlock(ifp); /* XXX need some fiddling to remove? */ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { caddr_t dl; u_int32_t val; @@ -2423,7 +2423,7 @@ ath_update_mcast(struct ifnet *ifp) pos &= 0x3f; mfilt[pos / 32] |= (1 << (pos % 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]); diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index c65451d..431ed9f 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -7260,7 +7260,7 @@ bce_set_rx_mode(struct bce_softc *sc) /* Accept one or more multicast(s). */ DBPRINT(sc, BCE_INFO_MISC, "Enabling selective multicast mode.\n"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -7268,7 +7268,7 @@ bce_set_rx_mode(struct bce_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN) & 0xFF; hashes[(h & 0xE0) >> 5] |= 1 << (h & 0x1F); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), hashes[i]); diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index fb95eba..00a2e97 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -1111,14 +1111,14 @@ bfe_set_rx_mode(struct bfe_softc *sc) val |= BFE_RXCONF_ALLMULTI; else { val &= ~BFE_RXCONF_ALLMULTI; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bfe_cam_write(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), i++); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } CSR_WRITE_4(sc, BFE_RXCONF, val); diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 87c05a3..4528762 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -1186,7 +1186,7 @@ bge_setmulti(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0); /* Now program new ones. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1194,7 +1194,7 @@ bge_setmulti(struct bge_softc *sc) ifma->ifma_addr), ETHER_ADDR_LEN) & 0x7F; hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 4; i++) CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), hashes[i]); diff --git a/sys/dev/bm/if_bm.c b/sys/dev/bm/if_bm.c index 1bb07b2..c2a4358 100644 --- a/sys/dev/bm/if_bm.c +++ b/sys/dev/bm/if_bm.c @@ -1072,7 +1072,7 @@ bm_setladrf(struct bm_softc *sc) /* Clear the hash table. */ memset(hash, 0, sizeof(hash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -1085,7 +1085,7 @@ bm_setladrf(struct bm_softc *sc) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (crc & 0xf); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } /* Write out new hash table */ diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c index 4c196a5..edcfec4 100644 --- a/sys/dev/cas/if_cas.c +++ b/sys/dev/cas/if_cas.c @@ -2531,7 +2531,7 @@ cas_setladrf(struct cas_softc *sc) /* Clear the hash table. */ memset(hash, 0, sizeof(hash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -2544,7 +2544,7 @@ cas_setladrf(struct cas_softc *sc) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (15 - (crc & 15)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); v |= CAS_MAC_RX_CONF_HFILTER; diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index f3fed0a..826f4ad 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -1022,7 +1022,7 @@ cs_setmode(struct cs_softc *sc) * Set up the filter to only accept multicast * frames we're interested in. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { struct sockaddr_dl *dl = (struct sockaddr_dl *)ifma->ifma_addr; @@ -1032,7 +1032,7 @@ cs_setmode(struct cs_softc *sc) mask = (u_int16_t) (1 << (index & 0xf)); af[port] |= mask; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } cs_writereg(sc, PP_LAF + 0, af[0]); diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index d1f51ac..64e7aef 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1110,7 +1110,7 @@ dc_setfilt_21143(struct dc_softc *sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1118,7 +1118,7 @@ dc_setfilt_21143(struct dc_softc *sc) LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); sp[h >> 4] |= htole32(1 << (h & 0xF)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (ifp->if_flags & IFF_BROADCAST) { h = dc_mchash_le(sc, ifp->if_broadcastaddr); @@ -1185,7 +1185,7 @@ dc_setfilt_admtek(struct dc_softc *sc) return; /* Now program new ones. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1200,7 +1200,7 @@ dc_setfilt_admtek(struct dc_softc *sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, DC_AL_MAR0, hashes[0]); CSR_WRITE_4(sc, DC_AL_MAR1, hashes[1]); @@ -1258,7 +1258,7 @@ dc_setfilt_asix(struct dc_softc *sc) return; /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1268,7 +1268,7 @@ dc_setfilt_asix(struct dc_softc *sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_MAR0); CSR_WRITE_4(sc, DC_AX_FILTDATA, hashes[0]); @@ -1313,7 +1313,7 @@ dc_setfilt_xircom(struct dc_softc *sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1321,7 +1321,7 @@ dc_setfilt_xircom(struct dc_softc *sc) LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); sp[h >> 4] |= htole32(1 << (h & 0xF)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (ifp->if_flags & IFF_BROADCAST) { h = dc_mchash_le(sc, ifp->if_broadcastaddr); diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index cda4d3b..2acf1a8 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -3041,7 +3041,7 @@ tulip_addr_filter(tulip_softc_t * const sc) multicnt = 0; ifp = sc->tulip_ifp; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); /* Copy MAC address on stack to align. */ if (ifp->if_input != NULL) @@ -3134,7 +3134,7 @@ tulip_addr_filter(tulip_softc_t * const sc) *sp++ = TULIP_SP_MAC(eaddr[2]); } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } static void diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 43990b6..14d82f0 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -2538,7 +2538,7 @@ em_set_multi(struct adapter *adapter) if (mta == NULL) panic("em_set_multi memory failure\n"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2550,7 +2550,7 @@ em_set_multi(struct adapter *adapter) &mta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index e5297da..0924eda 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -1886,7 +1886,7 @@ igb_set_multi(struct adapter *adapter) IOCTL_DEBUGOUT("igb_set_multi: begin"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1898,7 +1898,7 @@ igb_set_multi(struct adapter *adapter) &mta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index f94ec8b..12483a8 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1614,7 +1614,7 @@ ed_ds_getmcaf(struct ed_softc *sc, uint32_t *mcaf) mcaf[0] = 0; mcaf[1] = 0; - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1622,7 +1622,7 @@ ed_ds_getmcaf(struct ed_softc *sc, uint32_t *mcaf) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; af[index >> 3] |= 1 << (index & 7); } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); } int diff --git a/sys/dev/et/if_et.c b/sys/dev/et/if_et.c index b59cf78..1e28f0b 100644 --- a/sys/dev/et/if_et.c +++ b/sys/dev/et/if_et.c @@ -1361,7 +1361,7 @@ et_setmulti(struct et_softc *sc) } count = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { uint32_t *hp, h; @@ -1387,7 +1387,7 @@ et_setmulti(struct et_softc *sc) ++count; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 4; ++i) CSR_WRITE_4(sc, ET_MULTI_HASH + (i * 4), hash[i]); diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 3e6c90c..7a3d74f 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -870,13 +870,13 @@ ex_setmulti(struct ex_softc *sc) ifp = sc->ifp; count = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; count++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || count > 63) { @@ -904,7 +904,7 @@ ex_setmulti(struct ex_softc *sc) CSR_WRITE_2(sc, IO_PORT_REG, 0); CSR_WRITE_2(sc, IO_PORT_REG, (count + 1) * 6); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; @@ -915,7 +915,7 @@ ex_setmulti(struct ex_softc *sc) CSR_WRITE_2(sc, IO_PORT_REG, *addr++); CSR_WRITE_2(sc, IO_PORT_REG, *addr++); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* Program our MAC address as well */ /* XXX: Is this necessary? The Linux driver does this diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index ed50841..eff92b7 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -2080,7 +2080,7 @@ fe_mcaf ( struct fe_softc *sc ) struct ifmultiaddr *ifma; filter = fe_filter_nothing; - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2093,7 +2093,7 @@ fe_mcaf ( struct fe_softc *sc ) filter.data[index >> 3] |= 1 << (index & 7); } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); return ( filter ); } diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 4d93c00..4fb890f 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -2851,7 +2851,7 @@ fxp_mc_addrs(struct fxp_softc *sc) nmcasts = 0; if ((ifp->if_flags & IFF_ALLMULTI) == 0) { - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2864,7 +2864,7 @@ fxp_mc_addrs(struct fxp_softc *sc) &sc->mcsp->mc_addr[nmcasts][0], ETHER_ADDR_LEN); nmcasts++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } mcsp->mc_cnt = htole16(nmcasts * ETHER_ADDR_LEN); return (nmcasts); diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index 86c9334..9456383 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -2201,7 +2201,7 @@ gem_setladrf(struct gem_softc *sc) /* Clear the hash table. */ memset(hash, 0, sizeof(hash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -2214,7 +2214,7 @@ gem_setladrf(struct gem_softc *sc) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (15 - (crc & 15)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); v |= GEM_MAC_RX_HASH_FILTER; diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c index 393bf2f..d78e8f1 100644 --- a/sys/dev/hme/if_hme.c +++ b/sys/dev/hme/if_hme.c @@ -1710,7 +1710,7 @@ hme_setladrf(struct hme_softc *sc, int reenable) * the word. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; @@ -1723,7 +1723,7 @@ hme_setladrf(struct hme_softc *sc, int reenable) /* Set the corresponding bit in the filter. */ hash[crc >> 4] |= 1 << (crc & 0xf); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); chipit: /* Now load the hash table into the chip */ diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index e3ba1d2..34c658e 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -1675,7 +1675,7 @@ ie_mc_reset(struct ie_softc *sc) * Step through the list of addresses. */ sc->mcast_count = 0; - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1691,7 +1691,7 @@ ie_mc_reset(struct ie_softc *sc) &(sc->mcast_addrs[sc->mcast_count]), 6); sc->mcast_count++; } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); setflag: sc->want_mcsetup = 1; diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index f9a2186..426418b 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -320,7 +320,7 @@ ndis_setmulti(sc) sc->ndis_filter |= NDIS_PACKET_TYPE_MULTICAST; len = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -328,13 +328,13 @@ ndis_setmulti(sc) mclist + (ETHER_ADDR_LEN * len), ETHER_ADDR_LEN); len++; if (len > mclistsz) { - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); sc->ndis_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; sc->ndis_filter &= ~NDIS_PACKET_TYPE_MULTICAST; goto out; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); len = len * ETHER_ADDR_LEN; error = ndis_set_info(sc, OID_802_3_MULTICAST_LIST, mclist, &len); diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index f555e79..90b3c91 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -1090,7 +1090,7 @@ ixgb_set_multi(struct adapter * adapter) IOCTL_DEBUGOUT("ixgb_set_multi: begin"); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); #if __FreeBSD_version < 500000 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { #else @@ -1103,7 +1103,7 @@ ixgb_set_multi(struct adapter * adapter) &mta[mcnt * IXGB_ETH_LENGTH_OF_ADDRESS], IXGB_ETH_LENGTH_OF_ADDRESS); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt > MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = IXGB_READ_REG(&adapter->hw, RCTL); diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index 040863c..2d2e859 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -1883,7 +1883,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1892,7 +1892,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_ETH_LENGTH_OF_ADDRESS); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); update_ptr = mta; ixgbe_update_mc_addr_list(&adapter->hw, diff --git a/sys/dev/jme/if_jme.c b/sys/dev/jme/if_jme.c index 8353b04..86d9c57 100644 --- a/sys/dev/jme/if_jme.c +++ b/sys/dev/jme/if_jme.c @@ -3122,7 +3122,7 @@ jme_set_filter(struct jme_softc *sc) rxcfg |= RXMAC_MULTICAST; bzero(mchash, sizeof(mchash)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &sc->jme_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3135,7 +3135,7 @@ jme_set_filter(struct jme_softc *sc) /* Set the corresponding bit in the hash table. */ mchash[crc >> 5] |= 1 << (crc & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, JME_MAR0, mchash[0]); CSR_WRITE_4(sc, JME_MAR1, mchash[1]); diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index 68673a9..db20099 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -605,7 +605,7 @@ lance_setladrf(struct lance_softc *sc, uint16_t *af) } af[0] = af[1] = af[2] = af[3] = 0x0000; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -619,7 +619,7 @@ lance_setladrf(struct lance_softc *sc, uint16_t *af) /* Set the corresponding bit in the filter. */ af[crc >> 4] |= LE_HTOLE16(1 << (crc & 0xf)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } /* diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index ecae572..79a9156 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -393,7 +393,7 @@ lge_setmulti(sc) CSR_WRITE_4(sc, LGE_MAR1, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -404,7 +404,7 @@ lge_setmulti(sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, LGE_MAR0, hashes[0]); CSR_WRITE_4(sc, LGE_MAR1, hashes[1]); diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index e9c6716..d77718b 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -1577,14 +1577,14 @@ malo_setmcastfilter(struct malo_softc *sc) (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC))) goto all; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (nmc == MALO_HAL_MCAST_MAX) { ifp->if_flags |= IFF_ALLMULTI; - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); goto all; } IEEE80211_ADDR_COPY(mp, @@ -1592,7 +1592,7 @@ malo_setmcastfilter(struct malo_softc *sc) mp += IEEE80211_ADDR_LEN, nmc++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); malo_hal_setmcast(sc->malo_mh, nmc, macs); diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c index 66d670f..ff505e9 100644 --- a/sys/dev/mge/if_mge.c +++ b/sys/dev/mge/if_mge.c @@ -1731,7 +1731,7 @@ mge_setup_multicast(struct mge_softc *sc) memset(smt, 0, sizeof(smt)); memset(omt, 0, sizeof(omt)); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1745,7 +1745,7 @@ mge_setup_multicast(struct mge_softc *sc) omt[i >> 2] |= v << ((i & 0x03) << 3); } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } for (i = 0; i < MGE_MCAST_REG_NUMBER; i++) { diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 73d5232..f5f94ba 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -601,7 +601,7 @@ msk_rxfilter(struct msk_if_softc *sc_if) mchash[1] = 0xffff; } else { mode |= GM_RXCR_UCF_ENA; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -612,7 +612,7 @@ msk_rxfilter(struct msk_if_softc *sc_if) /* Set the corresponding bit in the hash table. */ mchash[crc >> 5] |= 1 << (crc & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mchash[0] != 0 || mchash[1] != 0) mode |= GM_RXCR_MCF_ENA; } diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c index 16453e9..367cec0 100644 --- a/sys/dev/mxge/if_mxge.c +++ b/sys/dev/mxge/if_mxge.c @@ -1130,7 +1130,7 @@ mxge_set_multicast_list(mxge_softc_t *sc) /* Walk the multicast list, and add each address */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1146,11 +1146,11 @@ mxge_set_multicast_list(mxge_softc_t *sc) "MXGEFW_JOIN_MULTICAST_GROUP, error status:" "%d\t", err); /* abort, leaving multicast filtering off */ - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); return; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* Enable multicast filtering */ err = mxge_send_cmd(sc, MXGEFW_DISABLE_ALLMULTI, &cmd); if (err != 0) { diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index b25ae22..8bfeb34 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -337,7 +337,7 @@ my_setmulti(struct my_softc * sc) CSR_WRITE_4(sc, MY_MAR1, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -349,7 +349,7 @@ my_setmulti(struct my_softc * sc) hashes[1] |= (1 << (h - 32)); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxfilt |= MY_AM; diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c index 99f75aa..67d4871 100644 --- a/sys/dev/nfe/if_nfe.c +++ b/sys/dev/nfe/if_nfe.c @@ -2491,7 +2491,7 @@ nfe_setmulti(struct nfe_softc *sc) bcopy(etherbroadcastaddr, addr, ETHER_ADDR_LEN); bcopy(etherbroadcastaddr, mask, ETHER_ADDR_LEN); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { u_char *addrp; @@ -2505,7 +2505,7 @@ nfe_setmulti(struct nfe_softc *sc) mask[i] &= ~mcaddr; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < ETHER_ADDR_LEN; i++) { mask[i] |= addr[i]; diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 7917331..1b346dd 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -863,7 +863,7 @@ nge_rxfilter(struct nge_softc *sc) * that needs to be updated, and the lower 4 bits represent * which bit within that byte needs to be set. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -875,7 +875,7 @@ nge_rxfilter(struct nge_softc *sc) NGE_FILTADDR_MCAST_LO + (index * 2)); NGE_SETBIT(sc, NGE_RXFILT_DATA, (1 << bit)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); done: CSR_WRITE_4(sc, NGE_RXFILT_CTL, rxfilt); diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c index c4f8710..a987c6c 100644 --- a/sys/dev/nve/if_nve.c +++ b/sys/dev/nve/if_nve.c @@ -1133,7 +1133,7 @@ nve_setmulti(struct nve_softc *sc) return; } /* Setup multicast filter */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { u_char *addrp; @@ -1147,7 +1147,7 @@ nve_setmulti(struct nve_softc *sc) oraddr[i] |= mcaddr; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 6; i++) { hwfilter.acMulticastAddress[i] = andaddr[i] & oraddr[i]; hwfilter.acMulticastMask[i] = andaddr[i] | (~oraddr[i]); diff --git a/sys/dev/nxge/if_nxge.c b/sys/dev/nxge/if_nxge.c index 95f97a8..129ccb5 100644 --- a/sys/dev/nxge/if_nxge.c +++ b/sys/dev/nxge/if_nxge.c @@ -2238,7 +2238,7 @@ xge_setmulti(xge_lldev_t *lldev) } /* Updating address list */ - IF_ADDR_LOCK(ifnetp); + if_maddr_rlock(ifnetp); index = 0; TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { if(ifma->ifma_addr->sa_family != AF_LINK) { @@ -2247,7 +2247,7 @@ xge_setmulti(xge_lldev_t *lldev) lladdr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); index += 1; } - IF_ADDR_UNLOCK(ifnetp); + if_maddr_runlock(ifnetp); if((!lldev->all_multicast) && (index)) { lldev->macaddr_count = (index + 1); @@ -2263,7 +2263,7 @@ xge_setmulti(xge_lldev_t *lldev) } /* Add new addresses */ - IF_ADDR_LOCK(ifnetp); + if_maddr_rlock(ifnetp); index = 0; TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { if(ifma->ifma_addr->sa_family != AF_LINK) { @@ -2273,7 +2273,7 @@ xge_setmulti(xge_lldev_t *lldev) xge_hal_device_macaddr_set(hldev, (offset + index), lladdr); index += 1; } - IF_ADDR_UNLOCK(ifnetp); + if_maddr_runlock(ifnetp); _exit: return; diff --git a/sys/dev/pcn/if_pcn.c b/sys/dev/pcn/if_pcn.c index f863cfc..c52c22b 100644 --- a/sys/dev/pcn/if_pcn.c +++ b/sys/dev/pcn/if_pcn.c @@ -371,7 +371,7 @@ pcn_setmulti(sc) pcn_csr_write(sc, PCN_CSR_MAR0 + i, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -379,7 +379,7 @@ pcn_setmulti(sc) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; hashes[h >> 4] |= 1 << (h & 0xF); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 4; i++) pcn_csr_write(sc, PCN_CSR_MAR0 + i, hashes[i]); diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index ce1a208..ce67b0e 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -273,7 +273,7 @@ pdq_os_addr_fill( PDQ_IFNET(sc)->if_flags &= ~IFF_ALLMULTI; #endif - IF_ADDR_LOCK(PDQ_IFNET(sc)); + if_maddr_rlock(PDQ_IFNET(sc)); for (ifma = TAILQ_FIRST(&PDQ_IFNET(sc)->if_multiaddrs); ifma && num_addrs > 0; ifma = TAILQ_NEXT(ifma, ifma_link)) { char *mcaddr; @@ -286,7 +286,7 @@ pdq_os_addr_fill( addr++; num_addrs--; } - IF_ADDR_UNLOCK(PDQ_IFNET(sc)); + if_maddr_runlock(PDQ_IFNET(sc)); /* * If not all the address fit into the CAM, turn on all-multicast mode. */ diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 10725f1..c2ac478 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -640,7 +640,7 @@ re_set_rxmode(struct rl_softc *sc) goto done; } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -651,7 +651,7 @@ re_set_rxmode(struct rl_softc *sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (hashes[0] != 0 || hashes[1] != 0) { /* diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index 5105c70..5238a27 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -494,7 +494,7 @@ sf_rxfilter(struct sf_softc *sc) /* Now program new ones. */ i = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -514,7 +514,7 @@ sf_rxfilter(struct sf_softc *sc) sf_sethash(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), 0); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); done: csr_write_4(sc, SF_RXFILT, rxfilt); diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c index 38a3e73..aac46f7 100644 --- a/sys/dev/sis/if_sis.c +++ b/sys/dev/sis/if_sis.c @@ -773,7 +773,7 @@ sis_setmulti_ns(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -786,7 +786,7 @@ sis_setmulti_ns(struct sis_softc *sc) bit -= 0x10; SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); @@ -825,7 +825,7 @@ sis_setmulti_sis(struct sis_softc *sc) for (i = 0; i < n; i++) hashes[i] = 0; i = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -834,7 +834,7 @@ sis_setmulti_sis(struct sis_softc *sc) hashes[h >> 4] |= 1 << (h & 0xf); i++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (i > n) { ctl |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 7e2e563..b9ca1cf 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -759,7 +759,7 @@ sk_rxfilter_genesis(sc_if) hashes[1] = 0xFFFFFFFF; } else { i = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -783,7 +783,7 @@ sk_rxfilter_genesis(sc_if) hashes[1] |= (1 << (h - 32)); mode |= XM_MODE_RX_USE_HASH; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } SK_XM_WRITE_4(sc_if, XM_MODE, mode); @@ -811,7 +811,7 @@ sk_rxfilter_yukon(sc_if) hashes[1] = 0xFFFFFFFF; } else { mode |= YU_RCR_UFLEN; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -822,7 +822,7 @@ sk_rxfilter_yukon(sc_if) /* Set the corresponding bit in the hash table. */ hashes[crc >> 5] |= 1 << (crc & 0x1f); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (hashes[0] != 0 || hashes[1] != 0) mode |= YU_RCR_MUFLEN; } diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 42da0dd..923c028 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1404,10 +1404,10 @@ sn_getmcf(struct ifnet *ifp, uint8_t *mcf) bzero(mcf, MCFSZ); - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) { - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); return 0; } index = ether_crc32_le(LLADDR((struct sockaddr_dl *) @@ -1420,6 +1420,6 @@ sn_getmcf(struct ifnet *ifp, uint8_t *mcf) } af[index2 >> 3] |= 1 << (index2 & 7); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); return 1; /* use multicast filter */ } diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index 8108a33..c659c82 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -691,7 +691,7 @@ camprogram(sc) ifp->if_flags &= ~IFF_ALLMULTI; /* Loop through multicast addresses */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -705,7 +705,7 @@ camprogram(sc) LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); mcount++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); NIC_PUT(sc, SNCR_CDP, LOWER(sc->v_cda)); NIC_PUT(sc, SNCR_CDC, MAXCAM); diff --git a/sys/dev/ste/if_ste.c b/sys/dev/ste/if_ste.c index 5411d08..f68a97d 100644 --- a/sys/dev/ste/if_ste.c +++ b/sys/dev/ste/if_ste.c @@ -594,7 +594,7 @@ ste_setmulti(sc) CSR_WRITE_2(sc, STE_MAR3, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -605,7 +605,7 @@ ste_setmulti(sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_2(sc, STE_MAR0, hashes[0] & 0xFFFF); CSR_WRITE_2(sc, STE_MAR1, (hashes[0] >> 16) & 0xFFFF); diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c index 0e12728..dac4da6 100644 --- a/sys/dev/stge/if_stge.c +++ b/sys/dev/stge/if_stge.c @@ -2683,7 +2683,7 @@ stge_set_multi(struct stge_softc *sc) bzero(mchash, sizeof(mchash)); count = 0; - IF_ADDR_LOCK(sc->sc_ifp); + if_maddr_rlock(sc->sc_ifp); TAILQ_FOREACH(ifma, &sc->sc_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2697,7 +2697,7 @@ stge_set_multi(struct stge_softc *sc) mchash[crc >> 5] |= 1 << (crc & 0x1f); count++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); mode &= ~(RM_ReceiveMulticast | RM_ReceiveAllFrames); if (count > 0) diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index a1b9c9d..488d038 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1851,7 +1851,7 @@ ti_setmulti(sc) } /* Now program new ones. */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1866,7 +1866,7 @@ ti_setmulti(sc) SLIST_INSERT_HEAD(&sc->ti_mc_listhead, mc, mc_entries); ti_add_mcast(sc, &mc->mc_addr); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* Re-enable interrupts. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, intrs); diff --git a/sys/dev/tl/if_tl.c b/sys/dev/tl/if_tl.c index 28fea78..f1a3db8 100644 --- a/sys/dev/tl/if_tl.c +++ b/sys/dev/tl/if_tl.c @@ -952,7 +952,7 @@ tl_setmulti(sc) hashes[1] = 0xFFFFFFFF; } else { i = 1; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -975,7 +975,7 @@ tl_setmulti(sc) else hashes[1] |= (1 << (h - 32)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } tl_dio_write32(sc, TL_HASH1, hashes[0]); diff --git a/sys/dev/tsec/if_tsec.c b/sys/dev/tsec/if_tsec.c index 23ed34e..2fb2710 100644 --- a/sys/dev/tsec/if_tsec.c +++ b/sys/dev/tsec/if_tsec.c @@ -1899,7 +1899,7 @@ tsec_setup_multicast(struct tsec_softc *sc) return; } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -1910,7 +1910,7 @@ tsec_setup_multicast(struct tsec_softc *sc) hashtable[(h >> 5)] |= 1 << (0x1F - (h & 0x1F)); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); for (i = 0; i < 8; i++) TSEC_WRITE(sc, TSEC_REG_GADDR(i), hashtable[i]); diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index 2e38dd2..3750e7b 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -1400,7 +1400,7 @@ epic_set_mc_table(epic_softc_t *sc) filter[2] = 0; filter[3] = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1408,7 +1408,7 @@ epic_set_mc_table(epic_softc_t *sc) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; filter[h >> 4] |= 1 << (h & 0xF); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); CSR_WRITE_4(sc, MC0, filter[0]); CSR_WRITE_4(sc, MC1, filter[1]); diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index b0e989d..619b3f7 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -2725,7 +2725,7 @@ txp_set_filter(struct txp_softc *sc) mchash[0] = mchash[1] = 0; mcnt = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2735,7 +2735,7 @@ txp_set_filter(struct txp_softc *sc) mchash[crc >> 5] |= 1 << (crc & 0x1f); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt > 0) { filter |= TXP_RXFILT_HASHMULTI; diff --git a/sys/dev/usb/net/if_aue.c b/sys/dev/usb/net/if_aue.c index 550186d..142780f 100644 --- a/sys/dev/usb/net/if_aue.c +++ b/sys/dev/usb/net/if_aue.c @@ -551,7 +551,7 @@ aue_setmulti(struct usb_ether *ue) AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -559,7 +559,7 @@ aue_setmulti(struct usb_ether *ue) ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1); hashtbl[(h >> 3)] |= 1 << (h & 0x7); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* write the hashtable */ for (i = 0; i != 8; i++) diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c index 3c72b38..ae9d512 100644 --- a/sys/dev/usb/net/if_axe.c +++ b/sys/dev/usb/net/if_axe.c @@ -475,7 +475,7 @@ axe_setmulti(struct usb_ether *ue) } rxmode &= ~AXE_RXCMD_ALLMULTI; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -484,7 +484,7 @@ axe_setmulti(struct usb_ether *ue) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; hashtbl[h / 8] |= 1 << (h % 8); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); axe_cmd(sc, AXE_CMD_WRITE_MCAST, 0, 0, (void *)&hashtbl); axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, rxmode, NULL); diff --git a/sys/dev/usb/net/if_cue.c b/sys/dev/usb/net/if_cue.c index 4bb0da2..dcbef61 100644 --- a/sys/dev/usb/net/if_cue.c +++ b/sys/dev/usb/net/if_cue.c @@ -318,7 +318,7 @@ cue_setmulti(struct usb_ether *ue) } /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -326,7 +326,7 @@ cue_setmulti(struct usb_ether *ue) h = cue_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); hashtbl[h >> 3] |= 1 << (h & 0x7); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* * Also include the broadcast address in the filter diff --git a/sys/dev/usb/net/if_kue.c b/sys/dev/usb/net/if_kue.c index 85a43a2..281d54f 100644 --- a/sys/dev/usb/net/if_kue.c +++ b/sys/dev/usb/net/if_kue.c @@ -368,7 +368,7 @@ kue_setmulti(struct usb_ether *ue) sc->sc_rxfilt &= ~KUE_RXFILT_ALLMULTI; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -383,7 +383,7 @@ kue_setmulti(struct usb_ether *ue) KUE_MCFILT(sc, i), ETHER_ADDR_LEN); i++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (i == KUE_MCFILTCNT(sc)) sc->sc_rxfilt |= KUE_RXFILT_ALLMULTI; diff --git a/sys/dev/usb/net/if_rue.c b/sys/dev/usb/net/if_rue.c index b942e50..7b92bc5 100644 --- a/sys/dev/usb/net/if_rue.c +++ b/sys/dev/usb/net/if_rue.c @@ -494,7 +494,7 @@ rue_setmulti(struct usb_ether *ue) rue_csr_write_4(sc, RUE_MAR4, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -507,7 +507,7 @@ rue_setmulti(struct usb_ether *ue) hashes[1] |= (1 << (h - 32)); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxcfg |= RUE_RCR_AM; diff --git a/sys/dev/usb/net/if_udav.c b/sys/dev/usb/net/if_udav.c index 926b0a3..20853e0 100644 --- a/sys/dev/usb/net/if_udav.c +++ b/sys/dev/usb/net/if_udav.c @@ -494,7 +494,7 @@ udav_setmulti(struct usb_ether *ue) udav_csr_write(sc, UDAV_MAR, hashtbl, sizeof(hashtbl)); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -503,7 +503,7 @@ udav_setmulti(struct usb_ether *ue) ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; hashtbl[h / 8] |= 1 << (h % 8); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); /* disable all multicast */ UDAV_CLRBIT(sc, UDAV_RCR, UDAV_RCR_ALL); diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c index 9ab02a7..ff3220b 100644 --- a/sys/dev/usb/wlan/if_upgt.c +++ b/sys/dev/usb/wlan/if_upgt.c @@ -809,9 +809,7 @@ upgt_set_multi(void *arg) * XXX don't know how to set a device. Lack of docs. Just try to set * IFF_ALLMULTI flag here. */ - IF_ADDR_LOCK(ifp); ifp->if_flags |= IFF_ALLMULTI; - IF_ADDR_UNLOCK(ifp); } static void diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index 0f8fe44..5c10a6f 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -1945,9 +1945,7 @@ urtw_set_multi(void *arg) * XXX don't know how to set a device. Lack of docs. Just try to set * IFF_ALLMULTI flag here. */ - IF_ADDR_LOCK(ifp); ifp->if_flags |= IFF_ALLMULTI; - IF_ADDR_UNLOCK(ifp); } static usb_error_t diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 8216a75..9bdb6ea 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -2016,7 +2016,7 @@ zyd_set_multi(struct zyd_softc *sc) low = 0xffffffff; high = 0xffffffff; } else { - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2027,7 +2027,7 @@ zyd_set_multi(struct zyd_softc *sc) else high |= 1 << (v - 32); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } /* reprogram multicast global hash table */ diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index b9eaeaa..f08f8a2 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -569,7 +569,7 @@ vge_setmulti(sc) } /* Now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -597,7 +597,7 @@ vge_setmulti(sc) CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); return; } diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 0ec70bc..954024d 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -482,7 +482,7 @@ vr_set_filter(struct vr_softc *sc) /* Now program new ones. */ error = 0; mcnt = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); if ((sc->vr_quirks & VR_Q_CAM) != 0) { /* * For hardwares that have CAM capability, use @@ -523,7 +523,7 @@ vr_set_filter(struct vr_softc *sc) mcnt++; } } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt > 0) rxfilt |= VR_RXCFG_RX_MULTI; diff --git a/sys/dev/wb/if_wb.c b/sys/dev/wb/if_wb.c index 1538114..d901595 100644 --- a/sys/dev/wb/if_wb.c +++ b/sys/dev/wb/if_wb.c @@ -605,7 +605,7 @@ wb_setmulti(sc) CSR_WRITE_4(sc, WB_MAR1, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -617,7 +617,7 @@ wb_setmulti(sc) hashes[1] |= (1 << (h - 32)); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxfilt |= WB_NETCFG_RX_MULTI; diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index d9d1286a..616c5d7 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1582,7 +1582,7 @@ allmulti: } n = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -1592,7 +1592,7 @@ allmulti: (LLADDR((struct sockaddr_dl *)ifma->ifma_addr))); n++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); return wi_write_rid(sc, WI_RID_MCAST_LIST, &mlist, IEEE80211_ADDR_LEN * n); } diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index 17ad81a..e773fd3 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -2116,7 +2116,7 @@ wlconfig(struct wl_softc *sc) outw(PIOP1(base), 0); /* ac_status */ outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */ outw(PIOR1(base), OFFSET_CU + 8); - IF_ADDR_LOCK(sc->ifp); + if_maddr_rlock(sc->ifp); TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -2127,7 +2127,7 @@ wlconfig(struct wl_softc *sc) outw(PIOP1(base), addrp[4] + (addrp[5] << 8)); ++cnt; } - IF_ADDR_UNLOCK(sc->ifp); + if_maddr_runlock(sc->ifp); outw(PIOR1(base), OFFSET_CU + 6); /* mc-cnt */ outw(PIOP1(base), cnt * WAVELAN_ADDR_SIZE); if (wlcmd(sc, "config()-mcaddress") == 0) diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index e73d56a..f18fd98 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -1390,7 +1390,7 @@ xe_set_multicast(struct xe_softc *scp) /* Iterate over multicast address list */ count = 0; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; @@ -1413,7 +1413,7 @@ xe_set_multicast(struct xe_softc *scp) /* Nowhere else to put them on CE2 */ break; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); DEVPRINTF(2, (scp->dev, "set_multicast: count = %u\n", count)); diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index a0f7042..81ed592 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -724,10 +724,10 @@ xl_setmulti(struct xl_softc *sc) return; } - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) mcnt++; - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxfilt |= XL_RXFILTER_ALLMULTI; @@ -766,7 +766,7 @@ xl_setmulti_hash(struct xl_softc *sc) CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_HASH|i); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -788,7 +788,7 @@ xl_setmulti_hash(struct xl_softc *sc) h | XL_CMD_RX_SET_HASH | XL_HASH_SET); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxfilt |= XL_RXFILTER_MULTIHASH; diff --git a/sys/mips/adm5120/if_admsw.c b/sys/mips/adm5120/if_admsw.c index 71971cd..fff8930 100644 --- a/sys/mips/adm5120/if_admsw.c +++ b/sys/mips/adm5120/if_admsw.c @@ -1168,7 +1168,7 @@ admsw_set_filter(struct admsw_softc *sc) ifp->if_flags &= ~IFF_ALLMULTI; - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -1176,7 +1176,7 @@ admsw_set_filter(struct admsw_softc *sc) anymc |= vlan_matrix[i]; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); } conf = REG_READ(CPUP_CONF_REG); diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 5f22f17..2be3b883 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -551,10 +551,10 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook) * lose a race while we check if the membership * already exists. */ - IF_ADDR_LOCK(priv->ifp); + if_maddr_rlock(priv->ifp); ifma = if_findmulti(priv->ifp, (struct sockaddr *)&sa_dl); - IF_ADDR_UNLOCK(priv->ifp); + if_maddr_runlock(priv->ifp); if (ifma != NULL) { error = EADDRINUSE; } else { diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 16e3ccc..8b22516 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -697,7 +697,7 @@ rl_setmulti(struct rl_softc *sc) CSR_WRITE_4(sc, RL_MAR4, 0); /* now program new ones */ - IF_ADDR_LOCK(ifp); + if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -709,7 +709,7 @@ rl_setmulti(struct rl_softc *sc) hashes[1] |= (1 << (h - 32)); mcnt++; } - IF_ADDR_UNLOCK(ifp); + if_maddr_runlock(ifp); if (mcnt) rxfilt |= RL_RXCFG_RX_MULTI; |