Deleted Added
full compact
if_ie.c (148654) if_ie.c (148887)
1/*-
2 * Copyright (c) 1992, 1993, University of Vermont and State
3 * Agricultural College.
4 * Copyright (c) 1992, 1993, Garrett A. Wollman.
5 *
6 * Portions:
7 * Copyright (c) 1990, 1991, William F. Jolitz
8 * Copyright (c) 1990, The Regents of the University of California

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

46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 *
50 * MAINTAINER: Matthew N. Dodd <winter@jurai.net>
51 */
52
53#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1992, 1993, University of Vermont and State
3 * Agricultural College.
4 * Copyright (c) 1992, 1993, Garrett A. Wollman.
5 *
6 * Portions:
7 * Copyright (c) 1990, 1991, William F. Jolitz
8 * Copyright (c) 1990, The Regents of the University of California

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

46 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 *
50 * MAINTAINER: Matthew N. Dodd <winter@jurai.net>
51 */
52
53#include <sys/cdefs.h>
54__FBSDID("$FreeBSD: head/sys/dev/ie/if_ie.c 148654 2005-08-03 00:18:35Z rwatson $");
54__FBSDID("$FreeBSD: head/sys/dev/ie/if_ie.c 148887 2005-08-09 10:20:02Z rwatson $");
55
56/*
57 * Intel 82586 Ethernet chip
58 * Register, bit, and structure definitions.
59 *
60 * Written by GAW with reference to the Clarkson Packet Driver code for this
61 * chip written by Russ Nelson and others.
62 *

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

461 */
462static int
463ietint(struct ie_softc *sc)
464{
465 int status;
466 int i;
467
468 sc->ifp->if_timer = 0;
55
56/*
57 * Intel 82586 Ethernet chip
58 * Register, bit, and structure definitions.
59 *
60 * Written by GAW with reference to the Clarkson Packet Driver code for this
61 * chip written by Russ Nelson and others.
62 *

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

461 */
462static int
463ietint(struct ie_softc *sc)
464{
465 int status;
466 int i;
467
468 sc->ifp->if_timer = 0;
469 sc->ifp->if_flags &= ~IFF_OACTIVE;
469 sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
470
471 for (i = 0; i < sc->xmit_count; i++) {
472 status = sc->xmit_cmds[i]->ie_xmit_status;
473
474 if (status & IE_XS_LATECOLL) {
475 printf("ie%d: late collision\n", sc->unit);
476 sc->ifp->if_collisions++;
477 sc->ifp->if_oerrors++;

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

922 u_short len;
923
924 /*
925 * This is not really volatile, in this routine, but it makes gcc
926 * happy.
927 */
928 volatile u_short *bptr = &sc->scb->ie_command_list;
929
470
471 for (i = 0; i < sc->xmit_count; i++) {
472 status = sc->xmit_cmds[i]->ie_xmit_status;
473
474 if (status & IE_XS_LATECOLL) {
475 printf("ie%d: late collision\n", sc->unit);
476 sc->ifp->if_collisions++;
477 sc->ifp->if_oerrors++;

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

922 u_short len;
923
924 /*
925 * This is not really volatile, in this routine, but it makes gcc
926 * happy.
927 */
928 volatile u_short *bptr = &sc->scb->ie_command_list;
929
930 if (!(ifp->if_flags & IFF_RUNNING))
930 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
931 return;
931 return;
932 if (ifp->if_flags & IFF_OACTIVE)
932 if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
933 return;
934
935 do {
936 IF_DEQUEUE(&sc->ifp->if_snd, m);
937 if (!m)
938 break;
939
940 buffer = sc->xmit_cbuffs[sc->xmit_count];

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

980 IE_CMD_LAST | IE_CMD_INTR;
981
982 /*
983 * By passing the command pointer as a null, we tell
984 * command_and_wait() to pretend that this isn't an action
985 * command. I wish I understood what was happening here.
986 */
987 command_and_wait(sc, IE_CU_START, 0, 0);
933 return;
934
935 do {
936 IF_DEQUEUE(&sc->ifp->if_snd, m);
937 if (!m)
938 break;
939
940 buffer = sc->xmit_cbuffs[sc->xmit_count];

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

980 IE_CMD_LAST | IE_CMD_INTR;
981
982 /*
983 * By passing the command pointer as a null, we tell
984 * command_and_wait() to pretend that this isn't an action
985 * command. I wish I understood what was happening here.
986 */
987 command_and_wait(sc, IE_CU_START, 0, 0);
988 ifp->if_flags |= IFF_OACTIVE;
988 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
989 }
990 return;
991}
992
993/*
994 * Check to see if there's an 82586 out there.
995 */
996int

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

1596 bart_config = inb(PORT(sc) + IEE16_CONFIG);
1597 bart_config &= ~IEE16_BART_LOOPBACK;
1598 /* inb doesn't get bit! */
1599 bart_config |= IEE16_BART_MCS16_TEST;
1600 outb(PORT(sc) + IEE16_CONFIG, bart_config);
1601 ee16_interrupt_enable(sc);
1602 ee16_chan_attn(sc);
1603 }
989 }
990 return;
991}
992
993/*
994 * Check to see if there's an 82586 out there.
995 */
996int

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

1596 bart_config = inb(PORT(sc) + IEE16_CONFIG);
1597 bart_config &= ~IEE16_BART_LOOPBACK;
1598 /* inb doesn't get bit! */
1599 bart_config |= IEE16_BART_MCS16_TEST;
1600 outb(PORT(sc) + IEE16_CONFIG, bart_config);
1601 ee16_interrupt_enable(sc);
1602 ee16_chan_attn(sc);
1603 }
1604 sc->ifp->if_flags |= IFF_RUNNING; /* tell higher levels
1604 sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* tell higher levels
1605 * we're here */
1605 * we're here */
1606 sc->ifp->if_flags &= ~IFF_OACTIVE;
1606 sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1607
1608 start_receiver(sc);
1609
1610 return;
1611}
1612
1613static void
1614ie_stop(struct ie_softc *sc)

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

1627 switch (command) {
1628 case SIOCSIFFLAGS:
1629 /*
1630 * Note that this device doesn't have an "all multicast"
1631 * mode, so we must turn on promiscuous mode and do the
1632 * filtering manually.
1633 */
1634 if ((ifp->if_flags & IFF_UP) == 0 &&
1607
1608 start_receiver(sc);
1609
1610 return;
1611}
1612
1613static void
1614ie_stop(struct ie_softc *sc)

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

1627 switch (command) {
1628 case SIOCSIFFLAGS:
1629 /*
1630 * Note that this device doesn't have an "all multicast"
1631 * mode, so we must turn on promiscuous mode and do the
1632 * filtering manually.
1633 */
1634 if ((ifp->if_flags & IFF_UP) == 0 &&
1635 (ifp->if_flags & IFF_RUNNING)) {
1636 ifp->if_flags &= ~IFF_RUNNING;
1635 (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
1636 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1637 ie_stop(sc);
1638 } else if ((ifp->if_flags & IFF_UP) &&
1637 ie_stop(sc);
1638 } else if ((ifp->if_flags & IFF_UP) &&
1639 (ifp->if_flags & IFF_RUNNING) == 0) {
1639 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
1640 sc->promisc =
1641 ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
1642 ieinit(sc);
1643 } else if (sc->promisc ^
1644 (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI))) {
1645 sc->promisc =
1646 ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
1647 ieinit(sc);

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

1789
1790 sc = device_get_softc(dev);
1791 ifp = sc->ifp;
1792
1793 if (sc->hard_type == IE_EE16)
1794 ee16_shutdown(sc, 0);
1795
1796 ie_stop(sc);
1640 sc->promisc =
1641 ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
1642 ieinit(sc);
1643 } else if (sc->promisc ^
1644 (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI))) {
1645 sc->promisc =
1646 ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI);
1647 ieinit(sc);

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

1789
1790 sc = device_get_softc(dev);
1791 ifp = sc->ifp;
1792
1793 if (sc->hard_type == IE_EE16)
1794 ee16_shutdown(sc, 0);
1795
1796 ie_stop(sc);
1797 ifp->if_flags &= ~IFF_RUNNING;
1797 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1798 ether_ifdetach(ifp);
1799 if_free(ifp);
1800 ie_release_resources(dev);
1801
1802 return (0);
1803}
1798 ether_ifdetach(ifp);
1799 if_free(ifp);
1800 ie_release_resources(dev);
1801
1802 return (0);
1803}