if_rl.c (147291) | if_rl.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_rl.c 147291 2005-06-11 01:37:46Z brooks $"); | 34__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 148654 2005-08-03 00:18:35Z rwatson $"); |
35 36/* 37 * RealTek 8129/8139 PCI NIC driver 38 * 39 * Supports several extremely cheap PCI 10/100 adapters based on 40 * the RealTek chipset. Datasheets can be obtained from 41 * www.realtek.com.tw. 42 * --- 637 unchanged lines hidden (view full) --- 680 return; 681 } 682 683 /* first, zot all the existing hash bits */ 684 CSR_WRITE_4(sc, RL_MAR0, 0); 685 CSR_WRITE_4(sc, RL_MAR4, 0); 686 687 /* now program new ones */ | 35 36/* 37 * RealTek 8129/8139 PCI NIC driver 38 * 39 * Supports several extremely cheap PCI 10/100 adapters based on 40 * the RealTek chipset. Datasheets can be obtained from 41 * www.realtek.com.tw. 42 * --- 637 unchanged lines hidden (view full) --- 680 return; 681 } 682 683 /* first, zot all the existing hash bits */ 684 CSR_WRITE_4(sc, RL_MAR0, 0); 685 CSR_WRITE_4(sc, RL_MAR4, 0); 686 687 /* now program new ones */ |
688 IF_ADDR_LOCK(ifp); |
|
688 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 689 if (ifma->ifma_addr->sa_family != AF_LINK) 690 continue; 691 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 692 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 693 if (h < 32) 694 hashes[0] |= (1 << h); 695 else 696 hashes[1] |= (1 << (h - 32)); 697 mcnt++; 698 } | 689 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 690 if (ifma->ifma_addr->sa_family != AF_LINK) 691 continue; 692 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 693 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 694 if (h < 32) 695 hashes[0] |= (1 << h); 696 else 697 hashes[1] |= (1 << (h - 32)); 698 mcnt++; 699 } |
700 IF_ADDR_UNLOCK(ifp); |
|
699 700 if (mcnt) 701 rxfilt |= RL_RXCFG_RX_MULTI; 702 else 703 rxfilt &= ~RL_RXCFG_RX_MULTI; 704 705 CSR_WRITE_4(sc, RL_RXCFG, rxfilt); 706 CSR_WRITE_4(sc, RL_MAR0, hashes[0]); --- 1102 unchanged lines hidden --- | 701 702 if (mcnt) 703 rxfilt |= RL_RXCFG_RX_MULTI; 704 else 705 rxfilt &= ~RL_RXCFG_RX_MULTI; 706 707 CSR_WRITE_4(sc, RL_RXCFG, rxfilt); 708 CSR_WRITE_4(sc, RL_MAR0, hashes[0]); --- 1102 unchanged lines hidden --- |