Deleted Added
full compact
if_ath.c (194135) if_ath.c (195049)
1/*-
2 * Copyright (c) 2002-2009 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

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2009 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

--- 14 unchanged lines hidden (view full) ---

23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 194135 2009-06-13 23:36:54Z sam $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 195049 2009-06-26 11:45:06Z rwatson $");
32
33/*
34 * Driver for the Atheros Wireless LAN controller.
35 *
36 * This software is derived from work of Atsushi Onoe; his contribution
37 * is greatly appreciated.
38 */
39

--- 2363 unchanged lines hidden (view full) ---

2403
2404 /* calculate and install multicast filter */
2405 if ((ifp->if_flags & IFF_ALLMULTI) == 0) {
2406 struct ifmultiaddr *ifma;
2407 /*
2408 * Merge multicast addresses to form the hardware filter.
2409 */
2410 mfilt[0] = mfilt[1] = 0;
32
33/*
34 * Driver for the Atheros Wireless LAN controller.
35 *
36 * This software is derived from work of Atsushi Onoe; his contribution
37 * is greatly appreciated.
38 */
39

--- 2363 unchanged lines hidden (view full) ---

2403
2404 /* calculate and install multicast filter */
2405 if ((ifp->if_flags & IFF_ALLMULTI) == 0) {
2406 struct ifmultiaddr *ifma;
2407 /*
2408 * Merge multicast addresses to form the hardware filter.
2409 */
2410 mfilt[0] = mfilt[1] = 0;
2411 IF_ADDR_LOCK(ifp); /* XXX need some fiddling to remove? */
2411 if_maddr_rlock(ifp); /* XXX need some fiddling to remove? */
2412 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
2413 caddr_t dl;
2414 u_int32_t val;
2415 u_int8_t pos;
2416
2417 /* calculate XOR of eight 6bit values */
2418 dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr);
2419 val = LE_READ_4(dl + 0);
2420 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
2421 val = LE_READ_4(dl + 3);
2422 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
2423 pos &= 0x3f;
2424 mfilt[pos / 32] |= (1 << (pos % 32));
2425 }
2412 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
2413 caddr_t dl;
2414 u_int32_t val;
2415 u_int8_t pos;
2416
2417 /* calculate XOR of eight 6bit values */
2418 dl = LLADDR((struct sockaddr_dl *) ifma->ifma_addr);
2419 val = LE_READ_4(dl + 0);
2420 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
2421 val = LE_READ_4(dl + 3);
2422 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
2423 pos &= 0x3f;
2424 mfilt[pos / 32] |= (1 << (pos % 32));
2425 }
2426 IF_ADDR_UNLOCK(ifp);
2426 if_maddr_runlock(ifp);
2427 } else
2428 mfilt[0] = mfilt[1] = ~0;
2429 ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]);
2430 DPRINTF(sc, ATH_DEBUG_MODE, "%s: MC filter %08x:%08x\n",
2431 __func__, mfilt[0], mfilt[1]);
2432}
2433
2434static void

--- 4845 unchanged lines hidden ---
2427 } else
2428 mfilt[0] = mfilt[1] = ~0;
2429 ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]);
2430 DPRINTF(sc, ATH_DEBUG_MODE, "%s: MC filter %08x:%08x\n",
2431 __func__, mfilt[0], mfilt[1]);
2432}
2433
2434static void

--- 4845 unchanged lines hidden ---