if_txp.c (147256) | if_txp.c (148654) |
---|---|
1/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ 2 3/*- 4 * Copyright (c) 2001 5 * Jason L. Wright <jason@thought.net>, Theo de Raadt, and 6 * Aaron Campbell <aaron@monkey.org>. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 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 IN 32 * 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 DAMAGE. 35 */ 36 37#include <sys/cdefs.h> | 1/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ 2 3/*- 4 * Copyright (c) 2001 5 * Jason L. Wright <jason@thought.net>, Theo de Raadt, and 6 * Aaron Campbell <aaron@monkey.org>. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 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 IN 32 * 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 DAMAGE. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/txp/if_txp.c 147256 2005-06-10 16:49:24Z brooks $"); | 38__FBSDID("$FreeBSD: head/sys/dev/txp/if_txp.c 148654 2005-08-03 00:18:35Z rwatson $"); |
39 40/* 41 * Driver for 3c990 (Typhoon) Ethernet ASIC 42 */ 43 44#include <sys/cdefs.h> | 39 40/* 41 * Driver for 3c990 (Typhoon) Ethernet ASIC 42 */ 43 44#include <sys/cdefs.h> |
45__FBSDID("$FreeBSD: head/sys/dev/txp/if_txp.c 147256 2005-06-10 16:49:24Z brooks $"); | 45__FBSDID("$FreeBSD: head/sys/dev/txp/if_txp.c 148654 2005-08-03 00:18:35Z rwatson $"); |
46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/sockio.h> 50#include <sys/mbuf.h> 51#include <sys/malloc.h> 52#include <sys/kernel.h> 53#include <sys/module.h> --- 33 unchanged lines hidden (view full) --- 87#define TXP_USEIOSPACE 88#define __STRICT_ALIGNMENT 89 90#include <dev/txp/if_txpreg.h> 91#include <dev/txp/3c990img.h> 92 93#ifndef lint 94static const char rcsid[] = | 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/sockio.h> 50#include <sys/mbuf.h> 51#include <sys/malloc.h> 52#include <sys/kernel.h> 53#include <sys/module.h> --- 33 unchanged lines hidden (view full) --- 87#define TXP_USEIOSPACE 88#define __STRICT_ALIGNMENT 89 90#include <dev/txp/if_txpreg.h> 91#include <dev/txp/3c990img.h> 92 93#ifndef lint 94static const char rcsid[] = |
95 "$FreeBSD: head/sys/dev/txp/if_txp.c 147256 2005-06-10 16:49:24Z brooks $"; | 95 "$FreeBSD: head/sys/dev/txp/if_txp.c 148654 2005-08-03 00:18:35Z rwatson $"; |
96#endif 97 98/* 99 * Various supported device vendors/types and their names. 100 */ 101static struct txp_type txp_devs[] = { 102 { TXP_VENDORID_3COM, TXP_DEVICEID_3CR990_TX_95, 103 "3Com 3cR990-TX-95 Etherlink with 3XP Processor" }, --- 1665 unchanged lines hidden (view full) --- 1769 if (ifp->if_flags & IFF_BROADCAST) 1770 filter |= TXP_RXFILT_BROADCAST; 1771 1772 if (ifp->if_flags & IFF_ALLMULTI) 1773 filter |= TXP_RXFILT_ALLMULTI; 1774 else { 1775 hash[0] = hash[1] = 0; 1776 | 96#endif 97 98/* 99 * Various supported device vendors/types and their names. 100 */ 101static struct txp_type txp_devs[] = { 102 { TXP_VENDORID_3COM, TXP_DEVICEID_3CR990_TX_95, 103 "3Com 3cR990-TX-95 Etherlink with 3XP Processor" }, --- 1665 unchanged lines hidden (view full) --- 1769 if (ifp->if_flags & IFF_BROADCAST) 1770 filter |= TXP_RXFILT_BROADCAST; 1771 1772 if (ifp->if_flags & IFF_ALLMULTI) 1773 filter |= TXP_RXFILT_ALLMULTI; 1774 else { 1775 hash[0] = hash[1] = 0; 1776 |
1777 IF_ADDR_LOCK(ifp); |
|
1777 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 1778 if (ifma->ifma_addr->sa_family != AF_LINK) 1779 continue; 1780 1781 enm = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); 1782 mcnt++; 1783 crc = 0xffffffff; 1784 --- 7 unchanged lines hidden (view full) --- 1792 if (carry) 1793 crc = (crc ^ TXP_POLYNOMIAL) | 1794 carry; 1795 } 1796 } 1797 hashbit = (u_int16_t)(crc & (64 - 1)); 1798 hash[hashbit / 32] |= (1 << hashbit % 32); 1799 } | 1778 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 1779 if (ifma->ifma_addr->sa_family != AF_LINK) 1780 continue; 1781 1782 enm = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); 1783 mcnt++; 1784 crc = 0xffffffff; 1785 --- 7 unchanged lines hidden (view full) --- 1793 if (carry) 1794 crc = (crc ^ TXP_POLYNOMIAL) | 1795 carry; 1796 } 1797 } 1798 hashbit = (u_int16_t)(crc & (64 - 1)); 1799 hash[hashbit / 32] |= (1 << hashbit % 32); 1800 } |
1801 IF_ADDR_UNLOCK(ifp); |
|
1800 1801 if (mcnt > 0) { 1802 filter |= TXP_RXFILT_HASHMULTI; 1803 txp_command(sc, TXP_CMD_MCAST_HASH_MASK_WRITE, 1804 2, hash[0], hash[1], NULL, NULL, NULL, 0); 1805 } 1806 } 1807 --- 76 unchanged lines hidden --- | 1802 1803 if (mcnt > 0) { 1804 filter |= TXP_RXFILT_HASHMULTI; 1805 txp_command(sc, TXP_CMD_MCAST_HASH_MASK_WRITE, 1806 2, hash[0], hash[1], NULL, NULL, NULL, 0); 1807 } 1808 } 1809 --- 76 unchanged lines hidden --- |