Deleted Added
full compact
if_ae.c (188127) if_ae.c (195049)
1/*-
2 * Copyright (c) 2008 Stanislav Sedov <stas@FreeBSD.org>.
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 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * Driver for Attansic Technology Corp. L2 FastEthernet adapter.
26 *
27 * This driver is heavily based on age(4) Attansic L1 driver by Pyun YongHyeon.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Stanislav Sedov <stas@FreeBSD.org>.
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 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * Driver for Attansic Technology Corp. L2 FastEthernet adapter.
26 *
27 * This driver is heavily based on age(4) Attansic L1 driver by Pyun YongHyeon.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/ae/if_ae.c 188127 2009-02-04 20:35:22Z imp $");
31__FBSDID("$FreeBSD: head/sys/dev/ae/if_ae.c 195049 2009-06-26 11:45:06Z rwatson $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/malloc.h>
39#include <sys/mbuf.h>

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

2068 AE_WRITE_4(sc, AE_MAC_REG, rxcfg);
2069 return;
2070 }
2071
2072 /*
2073 * Load multicast tables.
2074 */
2075 bzero(mchash, sizeof(mchash));
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/bus.h>
36#include <sys/endian.h>
37#include <sys/kernel.h>
38#include <sys/malloc.h>
39#include <sys/mbuf.h>

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

2068 AE_WRITE_4(sc, AE_MAC_REG, rxcfg);
2069 return;
2070 }
2071
2072 /*
2073 * Load multicast tables.
2074 */
2075 bzero(mchash, sizeof(mchash));
2076 IF_ADDR_LOCK(ifp);
2076 if_maddr_rlock(ifp);
2077 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
2078 if (ifma->ifma_addr->sa_family != AF_LINK)
2079 continue;
2080 crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
2081 ifma->ifma_addr), ETHER_ADDR_LEN);
2082 mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
2083 }
2077 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
2078 if (ifma->ifma_addr->sa_family != AF_LINK)
2079 continue;
2080 crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
2081 ifma->ifma_addr), ETHER_ADDR_LEN);
2082 mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f);
2083 }
2084 IF_ADDR_UNLOCK(ifp);
2084 if_maddr_runlock(ifp);
2085 AE_WRITE_4(sc, AE_REG_MHT0, mchash[0]);
2086 AE_WRITE_4(sc, AE_REG_MHT1, mchash[1]);
2087 AE_WRITE_4(sc, AE_MAC_REG, rxcfg);
2088}
2089
2090static int
2091ae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
2092{

--- 166 unchanged lines hidden ---
2085 AE_WRITE_4(sc, AE_REG_MHT0, mchash[0]);
2086 AE_WRITE_4(sc, AE_REG_MHT1, mchash[1]);
2087 AE_WRITE_4(sc, AE_MAC_REG, rxcfg);
2088}
2089
2090static int
2091ae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
2092{

--- 166 unchanged lines hidden ---