if_wb.c (147256) | if_wb.c (148654) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/pci/if_wb.c 147256 2005-06-10 16:49:24Z brooks $"); | 34__FBSDID("$FreeBSD: head/sys/pci/if_wb.c 148654 2005-08-03 00:18:35Z rwatson $"); |
35 36/* 37 * Winbond fast ethernet PCI NIC driver 38 * 39 * Supports various cheap network adapters based on the Winbond W89C840F 40 * fast ethernet controller chip. This includes adapters manufactured by 41 * Winbond itself and some made by Linksys. 42 * --- 566 unchanged lines hidden (view full) --- 609 return; 610 } 611 612 /* first, zot all the existing hash bits */ 613 CSR_WRITE_4(sc, WB_MAR0, 0); 614 CSR_WRITE_4(sc, WB_MAR1, 0); 615 616 /* now program new ones */ | 35 36/* 37 * Winbond fast ethernet PCI NIC driver 38 * 39 * Supports various cheap network adapters based on the Winbond W89C840F 40 * fast ethernet controller chip. This includes adapters manufactured by 41 * Winbond itself and some made by Linksys. 42 * --- 566 unchanged lines hidden (view full) --- 609 return; 610 } 611 612 /* first, zot all the existing hash bits */ 613 CSR_WRITE_4(sc, WB_MAR0, 0); 614 CSR_WRITE_4(sc, WB_MAR1, 0); 615 616 /* now program new ones */ |
617 IF_ADDR_LOCK(ifp); |
|
617 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 618 if (ifma->ifma_addr->sa_family != AF_LINK) 619 continue; 620 h = ~ether_crc32_be(LLADDR((struct sockaddr_dl *) 621 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 622 if (h < 32) 623 hashes[0] |= (1 << h); 624 else 625 hashes[1] |= (1 << (h - 32)); 626 mcnt++; 627 } | 618 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 619 if (ifma->ifma_addr->sa_family != AF_LINK) 620 continue; 621 h = ~ether_crc32_be(LLADDR((struct sockaddr_dl *) 622 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 623 if (h < 32) 624 hashes[0] |= (1 << h); 625 else 626 hashes[1] |= (1 << (h - 32)); 627 mcnt++; 628 } |
629 IF_ADDR_UNLOCK(ifp); |
|
628 629 if (mcnt) 630 rxfilt |= WB_NETCFG_RX_MULTI; 631 else 632 rxfilt &= ~WB_NETCFG_RX_MULTI; 633 634 CSR_WRITE_4(sc, WB_MAR0, hashes[0]); 635 CSR_WRITE_4(sc, WB_MAR1, hashes[1]); --- 1200 unchanged lines hidden --- | 630 631 if (mcnt) 632 rxfilt |= WB_NETCFG_RX_MULTI; 633 else 634 rxfilt &= ~WB_NETCFG_RX_MULTI; 635 636 CSR_WRITE_4(sc, WB_MAR0, hashes[0]); 637 CSR_WRITE_4(sc, WB_MAR1, hashes[1]); --- 1200 unchanged lines hidden --- |