Deleted Added
full compact
if_pcn.c (147256) if_pcn.c (148654)
1/*-
2 * Copyright (c) 2000 Berkeley Software Design, Inc.
3 * Copyright (c) 1997, 1998, 1999, 2000
4 * Bill Paul <wpaul@osd.bsdi.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) 2000 Berkeley Software Design, Inc.
3 * Copyright (c) 1997, 1998, 1999, 2000
4 * Bill Paul <wpaul@osd.bsdi.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/pci/if_pcn.c 147256 2005-06-10 16:49:24Z brooks $");
35__FBSDID("$FreeBSD: head/sys/pci/if_pcn.c 148654 2005-08-03 00:18:35Z rwatson $");
36
37/*
38 * AMD Am79c972 fast ethernet PCI NIC driver. Datasheets are available
39 * from http://www.amd.com.
40 *
41 * The AMD PCnet/PCI controllers are more advanced and functional
42 * versions of the venerable 7990 LANCE. The PCnet/PCI chips retain
43 * backwards compatibility with the LANCE and thus can be made

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

346 return;
347 }
348
349 /* first, zot all the existing hash bits */
350 for (i = 0; i < 4; i++)
351 pcn_csr_write(sc, PCN_CSR_MAR0 + i, 0);
352
353 /* now program new ones */
36
37/*
38 * AMD Am79c972 fast ethernet PCI NIC driver. Datasheets are available
39 * from http://www.amd.com.
40 *
41 * The AMD PCnet/PCI controllers are more advanced and functional
42 * versions of the venerable 7990 LANCE. The PCnet/PCI chips retain
43 * backwards compatibility with the LANCE and thus can be made

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

346 return;
347 }
348
349 /* first, zot all the existing hash bits */
350 for (i = 0; i < 4; i++)
351 pcn_csr_write(sc, PCN_CSR_MAR0 + i, 0);
352
353 /* now program new ones */
354 IF_ADDR_LOCK(ifp);
354 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
355 if (ifma->ifma_addr->sa_family != AF_LINK)
356 continue;
357 h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
358 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
359 hashes[h >> 4] |= 1 << (h & 0xF);
360 }
355 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
356 if (ifma->ifma_addr->sa_family != AF_LINK)
357 continue;
358 h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
359 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
360 hashes[h >> 4] |= 1 << (h & 0xF);
361 }
362 IF_ADDR_UNLOCK(ifp);
361
362 for (i = 0; i < 4; i++)
363 pcn_csr_write(sc, PCN_CSR_MAR0 + i, hashes[i]);
364
365 PCN_CSR_CLRBIT(sc, PCN_CSR_EXTCTL1, PCN_EXTCTL1_SPND);
366
367 return;
368}

--- 1081 unchanged lines hidden ---
363
364 for (i = 0; i < 4; i++)
365 pcn_csr_write(sc, PCN_CSR_MAR0 + i, hashes[i]);
366
367 PCN_CSR_CLRBIT(sc, PCN_CSR_EXTCTL1, PCN_EXTCTL1_SPND);
368
369 return;
370}

--- 1081 unchanged lines hidden ---