Deleted Added
full compact
if_ex.c (147256) if_ex.c (148654)
1/*-
2 * Copyright (c) 1996, Javier Mart�n Rueda (jmrueda@diatel.upm.es)
3 * 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

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

25 * SUCH DAMAGE.
26 *
27 *
28 * MAINTAINER: Matthew N. Dodd <winter@jurai.net>
29 * <mdodd@FreeBSD.org>
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1996, Javier Mart�n Rueda (jmrueda@diatel.upm.es)
3 * 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

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

25 * SUCH DAMAGE.
26 *
27 *
28 * MAINTAINER: Matthew N. Dodd <winter@jurai.net>
29 * <mdodd@FreeBSD.org>
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/ex/if_ex.c 147256 2005-06-10 16:49:24Z brooks $");
33__FBSDID("$FreeBSD: head/sys/dev/ex/if_ex.c 148654 2005-08-03 00:18:35Z rwatson $");
34
35/*
36 * Intel EtherExpress Pro/10, Pro/10+ Ethernet driver
37 *
38 * Revision history:
39 *
40 * dd-mmm-yyyy: Multicast support ported from NetBSD's if_iy driver.
41 * 30-Oct-1996: first beta version. Inet and BPF supported, but no multicast.

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

835 struct ifmultiaddr *maddr;
836 uint16_t *addr;
837 int count;
838 int timeout, status;
839
840 ifp = sc->ifp;
841
842 count = 0;
34
35/*
36 * Intel EtherExpress Pro/10, Pro/10+ Ethernet driver
37 *
38 * Revision history:
39 *
40 * dd-mmm-yyyy: Multicast support ported from NetBSD's if_iy driver.
41 * 30-Oct-1996: first beta version. Inet and BPF supported, but no multicast.

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

835 struct ifmultiaddr *maddr;
836 uint16_t *addr;
837 int count;
838 int timeout, status;
839
840 ifp = sc->ifp;
841
842 count = 0;
843 IF_ADDR_LOCK(ifp);
843 TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
844 if (maddr->ifma_addr->sa_family != AF_LINK)
845 continue;
846 count++;
847 }
844 TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
845 if (maddr->ifma_addr->sa_family != AF_LINK)
846 continue;
847 count++;
848 }
849 IF_ADDR_UNLOCK(ifp);
848
849 if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI)
850 || count > 63) {
851 /* Interface is in promiscuous mode or there are too many
852 * multicast addresses for the card to handle */
853 CSR_WRITE_1(sc, CMD_REG, Bank2_Sel);
854 CSR_WRITE_1(sc, REG2, CSR_READ_1(sc, REG2) | Promisc_Mode);
855 CSR_WRITE_1(sc, REG3, CSR_READ_1(sc, REG3));

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

866 /* Borrow space from TX buffer; this should be safe
867 * as this is only called from ex_init */
868
869 CSR_WRITE_2(sc, HOST_ADDR_REG, sc->tx_lower_limit);
870 CSR_WRITE_2(sc, IO_PORT_REG, MC_Setup_CMD);
871 CSR_WRITE_2(sc, IO_PORT_REG, 0);
872 CSR_WRITE_2(sc, IO_PORT_REG, 0);
873 CSR_WRITE_2(sc, IO_PORT_REG, (count + 1) * 6);
850
851 if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI)
852 || count > 63) {
853 /* Interface is in promiscuous mode or there are too many
854 * multicast addresses for the card to handle */
855 CSR_WRITE_1(sc, CMD_REG, Bank2_Sel);
856 CSR_WRITE_1(sc, REG2, CSR_READ_1(sc, REG2) | Promisc_Mode);
857 CSR_WRITE_1(sc, REG3, CSR_READ_1(sc, REG3));

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

868 /* Borrow space from TX buffer; this should be safe
869 * as this is only called from ex_init */
870
871 CSR_WRITE_2(sc, HOST_ADDR_REG, sc->tx_lower_limit);
872 CSR_WRITE_2(sc, IO_PORT_REG, MC_Setup_CMD);
873 CSR_WRITE_2(sc, IO_PORT_REG, 0);
874 CSR_WRITE_2(sc, IO_PORT_REG, 0);
875 CSR_WRITE_2(sc, IO_PORT_REG, (count + 1) * 6);
874
876
877 IF_ADDR_LOCK(ifp);
875 TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
876 if (maddr->ifma_addr->sa_family != AF_LINK)
877 continue;
878
879 addr = (uint16_t*)LLADDR((struct sockaddr_dl *)
880 maddr->ifma_addr);
881 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
882 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
883 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
884 }
878 TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) {
879 if (maddr->ifma_addr->sa_family != AF_LINK)
880 continue;
881
882 addr = (uint16_t*)LLADDR((struct sockaddr_dl *)
883 maddr->ifma_addr);
884 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
885 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
886 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
887 }
888 IF_ADDR_UNLOCK(ifp);
885
886 /* Program our MAC address as well */
887 /* XXX: Is this necessary? The Linux driver does this
888 * but the NetBSD driver does not */
889 addr = (uint16_t*)(&IFP2ENADDR(sc->ifp));
890 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
891 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
892 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);

--- 155 unchanged lines hidden ---
889
890 /* Program our MAC address as well */
891 /* XXX: Is this necessary? The Linux driver does this
892 * but the NetBSD driver does not */
893 addr = (uint16_t*)(&IFP2ENADDR(sc->ifp));
894 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
895 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);
896 CSR_WRITE_2(sc, IO_PORT_REG, *addr++);

--- 155 unchanged lines hidden ---