Deleted Added
full compact
if_lge.c (147256) if_lge.c (148654)
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 147256 2005-06-10 16:49:24Z brooks $");
35__FBSDID("$FreeBSD: head/sys/dev/lge/if_lge.c 148654 2005-08-03 00:18:35Z 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

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

385 return;
386 }
387
388 /* first, zot all the existing hash bits */
389 CSR_WRITE_4(sc, LGE_MAR0, 0);
390 CSR_WRITE_4(sc, LGE_MAR1, 0);
391
392 /* 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

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

385 return;
386 }
387
388 /* first, zot all the existing hash bits */
389 CSR_WRITE_4(sc, LGE_MAR0, 0);
390 CSR_WRITE_4(sc, LGE_MAR1, 0);
391
392 /* now program new ones */
393 IF_ADDR_LOCK(ifp);
393 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
394 if (ifma->ifma_addr->sa_family != AF_LINK)
395 continue;
396 h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
397 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
398 if (h < 32)
399 hashes[0] |= (1 << h);
400 else
401 hashes[1] |= (1 << (h - 32));
402 }
394 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
395 if (ifma->ifma_addr->sa_family != AF_LINK)
396 continue;
397 h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
398 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
399 if (h < 32)
400 hashes[0] |= (1 << h);
401 else
402 hashes[1] |= (1 << (h - 32));
403 }
404 IF_ADDR_UNLOCK(ifp);
403
404 CSR_WRITE_4(sc, LGE_MAR0, hashes[0]);
405 CSR_WRITE_4(sc, LGE_MAR1, hashes[1]);
406
407 return;
408}
409
410static void

--- 1162 unchanged lines hidden ---
405
406 CSR_WRITE_4(sc, LGE_MAR0, hashes[0]);
407 CSR_WRITE_4(sc, LGE_MAR1, hashes[1]);
408
409 return;
410}
411
412static void

--- 1162 unchanged lines hidden ---