summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-06-26 11:45:06 +0000
committerrwatson <rwatson@FreeBSD.org>2009-06-26 11:45:06 +0000
commitbe5740a255fbcb1d4053e709cb7f22bb96320eb0 (patch)
tree30aee113c454323f30d4c201e18a0f29e2938074 /sys/arm
parentffea8e20279ff0d82924add1cef0d8e16d9538a5 (diff)
downloadFreeBSD-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/arm')
-rw-r--r--sys/arm/at91/if_ate.c6
-rw-r--r--sys/arm/xscale/ixp425/if_npe.c4
2 files changed, 5 insertions, 5 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];
OpenPOWER on IntegriCloud