Deleted Added
full compact
if_xl.c (148434) if_xl.c (148654)
1/*-
2 * Copyright (c) 1997, 1998, 1999
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, 1999
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_xl.c 148434 2005-07-27 06:38:55Z imp $");
34__FBSDID("$FreeBSD: head/sys/pci/if_xl.c 148654 2005-08-03 00:18:35Z rwatson $");
35
36/*
37 * 3Com 3c90x Etherlink XL PCI NIC driver
38 *
39 * Supports the 3Com "boomerang", "cyclone" and "hurricane" PCI
40 * bus-master chips (3c90x cards and embedded controllers) including
41 * the following:
42 *

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

772 rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
773
774 if (ifp->if_flags & IFF_ALLMULTI) {
775 rxfilt |= XL_RXFILTER_ALLMULTI;
776 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_FILT|rxfilt);
777 return;
778 }
779
35
36/*
37 * 3Com 3c90x Etherlink XL PCI NIC driver
38 *
39 * Supports the 3Com "boomerang", "cyclone" and "hurricane" PCI
40 * bus-master chips (3c90x cards and embedded controllers) including
41 * the following:
42 *

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

772 rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
773
774 if (ifp->if_flags & IFF_ALLMULTI) {
775 rxfilt |= XL_RXFILTER_ALLMULTI;
776 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_FILT|rxfilt);
777 return;
778 }
779
780 IF_ADDR_LOCK(ifp);
780 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
781 mcnt++;
781 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link)
782 mcnt++;
783 IF_ADDR_UNLOCK(ifp);
782
783 if (mcnt)
784 rxfilt |= XL_RXFILTER_ALLMULTI;
785 else
786 rxfilt &= ~XL_RXFILTER_ALLMULTI;
787
788 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_FILT|rxfilt);
789}

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

812 } else
813 rxfilt &= ~XL_RXFILTER_ALLMULTI;
814
815 /* first, zot all the existing hash bits */
816 for (i = 0; i < XL_HASHFILT_SIZE; i++)
817 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_HASH|i);
818
819 /* now program new ones */
784
785 if (mcnt)
786 rxfilt |= XL_RXFILTER_ALLMULTI;
787 else
788 rxfilt &= ~XL_RXFILTER_ALLMULTI;
789
790 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_FILT|rxfilt);
791}

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

814 } else
815 rxfilt &= ~XL_RXFILTER_ALLMULTI;
816
817 /* first, zot all the existing hash bits */
818 for (i = 0; i < XL_HASHFILT_SIZE; i++)
819 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_HASH|i);
820
821 /* now program new ones */
822 IF_ADDR_LOCK(ifp);
820 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
821 if (ifma->ifma_addr->sa_family != AF_LINK)
822 continue;
823 /*
824 * Note: the 3c905B currently only supports a 64-bit hash
825 * table, which means we really only need 6 bits, but the
826 * manual indicates that future chip revisions will have a
827 * 256-bit hash table, hence the routine is set up to

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

833 * ignored. Grrrr....
834 */
835 h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
836 ifma->ifma_addr), ETHER_ADDR_LEN) & 0xFF;
837 CSR_WRITE_2(sc, XL_COMMAND,
838 h | XL_CMD_RX_SET_HASH | XL_HASH_SET);
839 mcnt++;
840 }
823 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
824 if (ifma->ifma_addr->sa_family != AF_LINK)
825 continue;
826 /*
827 * Note: the 3c905B currently only supports a 64-bit hash
828 * table, which means we really only need 6 bits, but the
829 * manual indicates that future chip revisions will have a
830 * 256-bit hash table, hence the routine is set up to

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

836 * ignored. Grrrr....
837 */
838 h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
839 ifma->ifma_addr), ETHER_ADDR_LEN) & 0xFF;
840 CSR_WRITE_2(sc, XL_COMMAND,
841 h | XL_CMD_RX_SET_HASH | XL_HASH_SET);
842 mcnt++;
843 }
844 IF_ADDR_UNLOCK(ifp);
841
842 if (mcnt)
843 rxfilt |= XL_RXFILTER_MULTIHASH;
844 else
845 rxfilt &= ~XL_RXFILTER_MULTIHASH;
846
847 CSR_WRITE_2(sc, XL_COMMAND, rxfilt | XL_CMD_RX_SET_FILT);
848}

--- 2547 unchanged lines hidden ---
845
846 if (mcnt)
847 rxfilt |= XL_RXFILTER_MULTIHASH;
848 else
849 rxfilt &= ~XL_RXFILTER_MULTIHASH;
850
851 CSR_WRITE_2(sc, XL_COMMAND, rxfilt | XL_CMD_RX_SET_FILT);
852}

--- 2547 unchanged lines hidden ---