Deleted Added
sdiff udiff text old ( 150136 ) new ( 154924 )
full compact
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

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/dev/ed/if_ed_cbus.c 150136 2005-09-14 19:03:14Z ru $
28 */
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/socket.h>
33#include <sys/kernel.h>
34
35#include <sys/module.h>

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

49
50#include <dev/ed/if_edvar.h>
51#include <dev/ed/if_edreg.h>
52#include <dev/ed/if_ed98.h>
53
54static int ed98_alloc_port(device_t, int);
55static int ed98_alloc_memory(device_t, int);
56static int ed_pio_testmem(struct ed_softc *, int, int, int);
57static int ed_probe_SIC98(device_t, int, int);
58static int ed_probe_CNET98(device_t, int, int);
59static int ed_probe_CNET98EL(device_t, int, int);
60static int ed_probe_NEC77(device_t, int, int);
61static int ed_probe_NW98X(device_t, int, int);
62static int ed_probe_SB98(device_t, int, int);
63static int ed_probe_EZ98(device_t, int, int);
64static int ed98_probe_Novell(device_t, int, int);
65static int ed98_probe_generic8390(struct ed_softc *);
66static void ed_reset_CNET98(struct ed_softc *, int);
67static void ed_winsel_CNET98(struct ed_softc *, u_short);
68static void ed_get_SB98(struct ed_softc *);
69
70static int ed_cbus_probe(device_t);
71static int ed_cbus_attach(device_t);

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

783 for (n = 0; n < ETHER_ADDR_LEN; n++)
784 sc->enaddr[n] = romdata[n * (sc->isa16bit + 1)];
785 break;
786 }
787
788 /* clear any pending interrupts that might have occurred above */
789 ed_nic_outb(sc, ED_P0_ISR, 0xff);
790
791 return (0);
792}
793
794/*
795 * Probe and vendor-specific initialization routine for SIC-98 boards
796 */
797static int
798ed_probe_SIC98(device_t dev, int port_rid, int flags)

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

883 sc->txb_cnt = 2;
884 sc->tx_page_start = 0;
885
886 sc->rec_page_start = sc->tx_page_start + ED_TXBUF_SIZE * sc->txb_cnt;
887 sc->rec_page_stop = sc->tx_page_start + sc->mem_size / ED_PAGE_SIZE;
888
889 sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE;
890
891 return (0);
892}
893
894/*
895 * Contec C-NET(98) series support routines
896 */
897static void
898ed_reset_CNET98(struct ed_softc *sc, int flags)

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

1132 * Set interrupt mask.
1133 * bit7:1 all interrupt mask
1134 * bit1:1 timer interrupt mask
1135 * bit0:0 NS controler interrupt enable
1136 */
1137 ed_asic_outb(sc, ED_CNET98_INT_MASK, 0x7e);
1138 DELAY(1000);
1139
1140 return (0);
1141}
1142
1143/*
1144 * Probe and vendor-specific initialization routine for C-NET(98)E/L boards
1145 */
1146static int
1147ed_probe_CNET98EL(device_t dev, int port_rid, int flags)

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

1226 /* Get station address from on-board ROM */
1227 ed_pio_readmem(sc, 16384, romdata, sizeof(romdata));
1228 for (i = 0; i < ETHER_ADDR_LEN; i++)
1229 sc->enaddr[i] = romdata[i * 2];
1230
1231 /* clear any pending interrupts that might have occurred above */
1232 ed_nic_outb(sc, ED_P0_ISR, 0xff);
1233
1234 return (0);
1235}
1236
1237/*
1238 * Probe and vendor-specific initialization routine for PC-9801-77 boards
1239 */
1240static int
1241ed_probe_NEC77(device_t dev, int port_rid, int flags)

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

1493 DELAY(5000);
1494
1495 /* Make sure that we really have an 8390 based board */
1496 if (!ed98_probe_generic8390(sc))
1497 return (ENXIO);
1498
1499 /* Test memory via PIO */
1500 sc->cr_proto = ED_CR_RD2;
1501 if (!ed_pio_testmem(sc, 16384, 1, flags)) {
1502 return (ENXIO);
1503 }
1504
1505 /* This looks like an SB9801 board. */
1506 sc->type_str = "SB9801";
1507
1508 /* Get station address */
1509 ed_get_SB98(sc);
1510
1511 /* clear any pending interrupts that might have occurred above */
1512 ed_nic_outb(sc, ED_P0_ISR, 0xff);
1513
1514 return (0);
1515}
1516
1517/*
1518 * Test the ability to read and write to the NIC memory.
1519 */
1520static int
1521ed_pio_testmem(struct ed_softc *sc, int page_offset, int isa16bit, int flags)

--- 100 unchanged lines hidden ---