if_ath.c (148362) | if_ath.c (148654) |
---|---|
1/*- 2 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGES. 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGES. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 148362 2005-07-24 05:11:39Z sam $"); | 38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 148654 2005-08-03 00:18:35Z rwatson $"); |
39 40/* 41 * Driver for the Atheros Wireless LAN controller. 42 * 43 * This software is derived from work of Atsushi Onoe; his contribution 44 * is greatly appreciated. 45 */ 46 --- 1610 unchanged lines hidden (view full) --- 1657 * XXX should get from lladdr instead of arpcom but that's more work 1658 */ 1659 IEEE80211_ADDR_COPY(ic->ic_myaddr, IFP2ENADDR(ifp)); 1660 ath_hal_setmac(ah, ic->ic_myaddr); 1661 1662 /* calculate and install multicast filter */ 1663 if ((ifp->if_flags & IFF_ALLMULTI) == 0) { 1664 mfilt[0] = mfilt[1] = 0; | 39 40/* 41 * Driver for the Atheros Wireless LAN controller. 42 * 43 * This software is derived from work of Atsushi Onoe; his contribution 44 * is greatly appreciated. 45 */ 46 --- 1610 unchanged lines hidden (view full) --- 1657 * XXX should get from lladdr instead of arpcom but that's more work 1658 */ 1659 IEEE80211_ADDR_COPY(ic->ic_myaddr, IFP2ENADDR(ifp)); 1660 ath_hal_setmac(ah, ic->ic_myaddr); 1661 1662 /* calculate and install multicast filter */ 1663 if ((ifp->if_flags & IFF_ALLMULTI) == 0) { 1664 mfilt[0] = mfilt[1] = 0; |
1665 IF_ADDR_LOCK(ifp); |
|
1665 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 1666 caddr_t dl; 1667 1668 /* calculate XOR of eight 6bit values */ 1669 dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); 1670 val = LE_READ_4(dl + 0); 1671 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; 1672 val = LE_READ_4(dl + 3); 1673 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; 1674 pos &= 0x3f; 1675 mfilt[pos / 32] |= (1 << (pos % 32)); 1676 } | 1666 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 1667 caddr_t dl; 1668 1669 /* calculate XOR of eight 6bit values */ 1670 dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); 1671 val = LE_READ_4(dl + 0); 1672 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; 1673 val = LE_READ_4(dl + 3); 1674 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; 1675 pos &= 0x3f; 1676 mfilt[pos / 32] |= (1 << (pos % 32)); 1677 } |
1678 IF_ADDR_UNLOCK(ifp); |
|
1677 } else { 1678 mfilt[0] = mfilt[1] = ~0; 1679 } 1680 ath_hal_setmcastfilter(ah, mfilt[0], mfilt[1]); 1681 DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, MC filter %08x:%08x\n", 1682 __func__, rfilt, mfilt[0], mfilt[1]); 1683} 1684 --- 3336 unchanged lines hidden --- | 1679 } else { 1680 mfilt[0] = mfilt[1] = ~0; 1681 } 1682 ath_hal_setmcastfilter(ah, mfilt[0], mfilt[1]); 1683 DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, MC filter %08x:%08x\n", 1684 __func__, rfilt, mfilt[0], mfilt[1]); 1685} 1686 --- 3336 unchanged lines hidden --- |