if_lge.c (192024) | if_lge.c (195049) |
---|---|
1/*- 2 * Copyright (c) 2001 Wind River Systems 3 * Copyright (c) 1997, 1998, 1999, 2000, 2001 4 * Bill Paul <william.paul@windriver.com>. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 * THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Wind River Systems 3 * Copyright (c) 1997, 1998, 1999, 2000, 2001 4 * Bill Paul <william.paul@windriver.com>. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 * THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/dev/lge/if_lge.c 192024 2009-05-12 19:33:36Z brueffer $"); | 35__FBSDID("$FreeBSD: head/sys/dev/lge/if_lge.c 195049 2009-06-26 11:45:06Z rwatson $"); |
36 37/* 38 * Level 1 LXT1001 gigabit ethernet driver for FreeBSD. Public 39 * documentation not available, but ask me nicely. 40 * 41 * The Level 1 chip is used on some D-Link, SMC and Addtron NICs. 42 * It's a 64-bit PCI part that supports TCP/IP checksum offload, 43 * VLAN tagging/insertion, GMII and TBI (1000baseX) ports. There --- 344 unchanged lines hidden (view full) --- 388 return; 389 } 390 391 /* first, zot all the existing hash bits */ 392 CSR_WRITE_4(sc, LGE_MAR0, 0); 393 CSR_WRITE_4(sc, LGE_MAR1, 0); 394 395 /* now program new ones */ | 36 37/* 38 * Level 1 LXT1001 gigabit ethernet driver for FreeBSD. Public 39 * documentation not available, but ask me nicely. 40 * 41 * The Level 1 chip is used on some D-Link, SMC and Addtron NICs. 42 * It's a 64-bit PCI part that supports TCP/IP checksum offload, 43 * VLAN tagging/insertion, GMII and TBI (1000baseX) ports. There --- 344 unchanged lines hidden (view full) --- 388 return; 389 } 390 391 /* first, zot all the existing hash bits */ 392 CSR_WRITE_4(sc, LGE_MAR0, 0); 393 CSR_WRITE_4(sc, LGE_MAR1, 0); 394 395 /* now program new ones */ |
396 IF_ADDR_LOCK(ifp); | 396 if_maddr_rlock(ifp); |
397 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 398 if (ifma->ifma_addr->sa_family != AF_LINK) 399 continue; 400 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 401 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 402 if (h < 32) 403 hashes[0] |= (1 << h); 404 else 405 hashes[1] |= (1 << (h - 32)); 406 } | 397 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 398 if (ifma->ifma_addr->sa_family != AF_LINK) 399 continue; 400 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 401 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 402 if (h < 32) 403 hashes[0] |= (1 << h); 404 else 405 hashes[1] |= (1 << (h - 32)); 406 } |
407 IF_ADDR_UNLOCK(ifp); | 407 if_maddr_runlock(ifp); |
408 409 CSR_WRITE_4(sc, LGE_MAR0, hashes[0]); 410 CSR_WRITE_4(sc, LGE_MAR1, hashes[1]); 411 412 return; 413} 414 415static void --- 1186 unchanged lines hidden --- | 408 409 CSR_WRITE_4(sc, LGE_MAR0, hashes[0]); 410 CSR_WRITE_4(sc, LGE_MAR1, hashes[1]); 411 412 return; 413} 414 415static void --- 1186 unchanged lines hidden --- |