Deleted Added
full compact
if_ed.c (257176) if_ed.c (260050)
1/*-
2 * Copyright (c) 1995, David Greenman
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

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1995, David Greenman
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

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed.c 257176 2013-10-26 17:58:36Z glebius $");
29__FBSDID("$FreeBSD: head/sys/dev/ed/if_ed.c 260050 2013-12-29 19:21:59Z marius $");
30
31/*
32 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
33 * adapters. By David Greenman, 29-April-1993
34 *
35 * Currently supports the Western Digital/SMC 8003 and 8013 series,
36 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
37 * and a variety of similar clones.

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

586 * Counter overflow and Remote DMA complete are *not* enabled.
587 */
588 ed_nic_outb(sc, ED_P0_IMR,
589 ED_IMR_PRXE | ED_IMR_PTXE | ED_IMR_RXEE | ED_IMR_TXEE | ED_IMR_OVWE);
590
591 /*
592 * Program Command Register for page 1
593 */
30
31/*
32 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
33 * adapters. By David Greenman, 29-April-1993
34 *
35 * Currently supports the Western Digital/SMC 8003 and 8013 series,
36 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
37 * and a variety of similar clones.

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

586 * Counter overflow and Remote DMA complete are *not* enabled.
587 */
588 ed_nic_outb(sc, ED_P0_IMR,
589 ED_IMR_PRXE | ED_IMR_PTXE | ED_IMR_RXEE | ED_IMR_TXEE | ED_IMR_OVWE);
590
591 /*
592 * Program Command Register for page 1
593 */
594 ed_nic_barrier(sc, ED_P0_CR, 1,
595 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
594 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STP);
596 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STP);
597 ed_nic_barrier(sc, ED_P0_CR, 1,
598 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
595
596 /*
597 * Copy out our station address
598 */
599 for (i = 0; i < ETHER_ADDR_LEN; ++i)
600 ed_nic_outb(sc, ED_P1_PAR(i), IF_LLADDR(sc->ifp)[i]);
601
602 /*

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

796 struct ed_ring packet_hdr;
797 bus_size_t packet_ptr;
798
799 ED_ASSERT_LOCKED(sc);
800
801 /*
802 * Set NIC to page 1 registers to get 'current' pointer
803 */
599
600 /*
601 * Copy out our station address
602 */
603 for (i = 0; i < ETHER_ADDR_LEN; ++i)
604 ed_nic_outb(sc, ED_P1_PAR(i), IF_LLADDR(sc->ifp)[i]);
605
606 /*

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

800 struct ed_ring packet_hdr;
801 bus_size_t packet_ptr;
802
803 ED_ASSERT_LOCKED(sc);
804
805 /*
806 * Set NIC to page 1 registers to get 'current' pointer
807 */
808 ed_nic_barrier(sc, ED_P0_CR, 1,
809 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
804 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STA);
810 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STA);
811 ed_nic_barrier(sc, ED_P0_CR, 1,
812 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
805
806 /*
807 * 'sc->next_packet' is the logical beginning of the ring-buffer -
808 * i.e. it points to where new data has been buffered. The 'CURR'
809 * (current) register points to the logical end of the ring-buffer -
810 * i.e. it points to where additional new data will be added. We loop
811 * here until the logical beginning equals the logical end (or in
812 * other words, until the ring-buffer is empty).

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

907 */
908 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA);
909 ed_nic_outb(sc, ED_P0_BNRY, boundry);
910
911 /*
912 * Set NIC to page 1 registers before looping to top (prepare
913 * to get 'CURR' current pointer)
914 */
813
814 /*
815 * 'sc->next_packet' is the logical beginning of the ring-buffer -
816 * i.e. it points to where new data has been buffered. The 'CURR'
817 * (current) register points to the logical end of the ring-buffer -
818 * i.e. it points to where additional new data will be added. We loop
819 * here until the logical beginning equals the logical end (or in
820 * other words, until the ring-buffer is empty).

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

915 */
916 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA);
917 ed_nic_outb(sc, ED_P0_BNRY, boundry);
918
919 /*
920 * Set NIC to page 1 registers before looping to top (prepare
921 * to get 'CURR' current pointer)
922 */
923 ed_nic_barrier(sc, ED_P0_CR, 1,
924 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
915 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STA);
925 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STA);
926 ed_nic_barrier(sc, ED_P0_CR, 1,
927 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
916 }
917}
918
919/*
920 * Ethernet interface interrupt processor
921 */
922void
923edintr(void *arg)

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

1551 /* Bit 6 in AX88190 RCR register must be set. */
1552 if (sc->chip_type == ED_CHIP_TYPE_AX88190 ||
1553 sc->chip_type == ED_CHIP_TYPE_AX88790)
1554 reg1 = ED_RCR_INTT;
1555 else
1556 reg1 = 0x00;
1557
1558 /* set page 1 registers */
928 }
929}
930
931/*
932 * Ethernet interface interrupt processor
933 */
934void
935edintr(void *arg)

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

1563 /* Bit 6 in AX88190 RCR register must be set. */
1564 if (sc->chip_type == ED_CHIP_TYPE_AX88190 ||
1565 sc->chip_type == ED_CHIP_TYPE_AX88790)
1566 reg1 = ED_RCR_INTT;
1567 else
1568 reg1 = 0x00;
1569
1570 /* set page 1 registers */
1571 ed_nic_barrier(sc, ED_P0_CR, 1,
1572 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
1559 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STP);
1573 ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_PAGE_1 | ED_CR_STP);
1574 ed_nic_barrier(sc, ED_P0_CR, 1,
1575 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);
1560
1561 if (ifp->if_flags & IFF_PROMISC) {
1562
1563 /*
1564 * Reconfigure the multicast filter.
1565 */
1566 for (i = 0; i < 8; i++)
1567 ed_nic_outb(sc, ED_P1_MAR(i), 0xff);

--- 222 unchanged lines hidden ---
1576
1577 if (ifp->if_flags & IFF_PROMISC) {
1578
1579 /*
1580 * Reconfigure the multicast filter.
1581 */
1582 for (i = 0; i < 8; i++)
1583 ed_nic_outb(sc, ED_P1_MAR(i), 0xff);

--- 222 unchanged lines hidden ---