mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters.
This driver only supports 10Mb Ethernet using PIO (the hardware supports DMA, but the driver only does PIO). There are not any PCCard adapters supported by this driver, only ISA cards. In addition, it does not use bus_space but instead uses bcopy with volatile pointers triggering a host of warnings. (if_ie.c is one of 3 files always built with -Wno-error) Relnotes: yes
This commit is contained in:
parent
ff59a463a3
commit
21768fa9c0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304513
@ -38,6 +38,8 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20160819: Remove ie(4)
|
||||
OLD_FILES+=usr/share/man/man4/i386/ie.4.gz
|
||||
# 20160819: Remove spic(4)
|
||||
OLD_FILES+=usr/share/man/man4/spic.4.gz
|
||||
# 20160819: Remove wl(4) and wlconfig(8)
|
||||
|
@ -16,7 +16,6 @@ MAN= aic.4 \
|
||||
fe.4 \
|
||||
glxiic.4 \
|
||||
glxsb.4 \
|
||||
ie.4 \
|
||||
longrun.4 \
|
||||
mse.4 \
|
||||
npx.4 \
|
||||
|
@ -1,143 +0,0 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1994, Wilko Bulte
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd July 16, 2005
|
||||
.Dt IE 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ie
|
||||
.Nd "Ethernet device driver"
|
||||
.Sh SYNOPSIS
|
||||
To compile this driver into the kernel,
|
||||
place the following line in your
|
||||
kernel configuration file:
|
||||
.Bd -ragged -offset indent
|
||||
.Cd "device ie"
|
||||
.Ed
|
||||
.Pp
|
||||
Alternatively, to load the driver as a
|
||||
module at boot time, place the following line in
|
||||
.Xr loader.conf 5 :
|
||||
.Bd -literal -offset indent
|
||||
if_ie_load="YES"
|
||||
.Ed
|
||||
.Pp
|
||||
In
|
||||
.Pa /boot/device.hints :
|
||||
.Cd hint.ie.0.at="isa"
|
||||
.Cd hint.ie.0.port="0x300"
|
||||
.Cd hint.ie.0.irq="5"
|
||||
.Cd hint.ie.0.maddr="0xd0000"
|
||||
.Sh HARDWARE
|
||||
The
|
||||
.Nm
|
||||
driver provides supports the following 8 and 16bit ISA Ethernet cards
|
||||
that are based on the Intel i82586 chip:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
3COM 3C507
|
||||
.It
|
||||
AT&T EN100
|
||||
.It
|
||||
AT&T Starlan 10
|
||||
.It
|
||||
AT&T Starlan Fiber
|
||||
.It
|
||||
Intel EtherExpress 16
|
||||
.It
|
||||
RACAL Interlan NI5210
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
.Bl -diag
|
||||
.It "ie%d: unknown board type code %d"
|
||||
An i82586 chip was found, but the driver was unable to determine the actual
|
||||
board type during the probe.
|
||||
.It "ie%d: kernel configured maddr %x doesn't match board configured maddr %x"
|
||||
The device probe detected a different maddr than the one specified in the
|
||||
kernel configuration file.
|
||||
.It "ie%d: can't find shared memory"
|
||||
The device probe could not access the shared memory to determine its size.
|
||||
.It "ie%d: kernel configured msize %d doesn't match board configured msize %d"
|
||||
The device probe found a different size for the shared memory than the one
|
||||
specified in the kernel configuration file.
|
||||
.It "ie%d: kernel configured irq %d doesn't match board configured irq %d"
|
||||
The device probe detected that the board is configured for a different
|
||||
interrupt than the one specified in the kernel configuration file.
|
||||
.It "ie%d: reset"
|
||||
The Intel i82586 had to be reset by the driver.
|
||||
.It "ie%d: transceiver problem"
|
||||
The driver has detected a problem with the Ethernet transceiver.
|
||||
This is
|
||||
usually due to a loose or broken transceiver cable when using an external
|
||||
transceiver.
|
||||
When you experience this problem with an on-card transceiver
|
||||
your card may be incorrectly jumpered for to use an external transceiver.
|
||||
Worst case your on-board transceiver may be broken.
|
||||
.It "ie%d: TDR detected an open %d clocks away"
|
||||
The driver detected an open circuit in the Ethernet cable.
|
||||
Check your
|
||||
coax cable and terminator resistors.
|
||||
.It "ie%d: TDR detected a short %d clocks away"
|
||||
The driver detected a short circuit in the Ethernet cable.
|
||||
Check your
|
||||
coax cable and terminator resistors.
|
||||
.It "ie%d: TDR returned unknown status %x"
|
||||
The driver got an unknown status from the card during the Ethernet cable
|
||||
test.
|
||||
.It "ie%d: multicast address setup command failed"
|
||||
The card could not be put into multicast mode.
|
||||
.It "ie%d: configure command failed"
|
||||
The card refused to respond correctly during configuration.
|
||||
.It "ie%d: individual address setup command failed"
|
||||
The programming of the Ethernet (MAC) address failed.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr arp 4 ,
|
||||
.Xr netintro 4 ,
|
||||
.Xr ng_ether 4 ,
|
||||
.Xr ifconfig 8
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
.Nm
|
||||
device driver was written by
|
||||
.An Garrett A. Wollman ,
|
||||
based on code by
|
||||
.An William F. Jolitz
|
||||
and Lawrence Berkeley Laboratories.
|
||||
.Tn 3C507
|
||||
support was written by
|
||||
.An Charles M. Hannum .
|
||||
This manual page was written by
|
||||
.An Wilko C. Bulte .
|
||||
.Sh CAVEATS
|
||||
The Racal Interlan NI5210 comes in variants with 8 and 16 kbytes of
|
||||
shared memory.
|
||||
It is strongly advisable to use the 16 kbyte variant.
|
||||
You can upgrade your 8 kbyte card to 16 kbyte by adding an additional
|
||||
RAM chip.
|
@ -1579,8 +1579,6 @@ dev/ida/ida.c optional ida
|
||||
dev/ida/ida_disk.c optional ida
|
||||
dev/ida/ida_eisa.c optional ida eisa
|
||||
dev/ida/ida_pci.c optional ida pci
|
||||
dev/ie/if_ie.c optional ie isa nowerror
|
||||
dev/ie/if_ie_isa.c optional ie isa
|
||||
dev/iicbus/ad7418.c optional ad7418
|
||||
dev/iicbus/ds1307.c optional ds1307
|
||||
dev/iicbus/ds133x.c optional ds133x
|
||||
|
1700
sys/dev/ie/if_ie.c
1700
sys/dev/ie/if_ie.c
File diff suppressed because it is too large
Load Diff
@ -1,90 +0,0 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
* Definitions for 3C507
|
||||
*/
|
||||
|
||||
#define IE507_CTRL 6 /* control port */
|
||||
#define IE507_ICTRL 10 /* interrupt control */
|
||||
#define IE507_ATTN 11 /* any write here sends a chan attn */
|
||||
#define IE507_ROM 13 /* rom configuration? */
|
||||
#define IE507_MADDR 14 /* shared memory configuration */
|
||||
#define IE507_IRQ 15 /* IRQ configuration */
|
||||
|
||||
/* Bank 0 -- "*3COM*" signature */
|
||||
#define EL_SIG 0 /* offset of ASCII signature -- "*3COM*" */
|
||||
|
||||
/* Bank 1 -- ethernet address */
|
||||
#define EL_ADDR 0 /* offset of card's ethernet address */
|
||||
|
||||
/* Bank 2 -- card part #, revision, date of manufacture */
|
||||
#define EL_TYPE 0 /* offset of card part # */
|
||||
#define EL_TYPE_HI 0 /* offset of card part # -- high byte */
|
||||
#define EL_TYPE_MID 1 /* offset of card part # -- middle byte */
|
||||
#define EL_TYPE_LOW 2 /* offset of card part # -- low byte */
|
||||
#define EL_REV 3 /* offset of card revision, in BCD */
|
||||
#define EL_DOM_DAY 4 /* offset of date of manf: day in BCD */
|
||||
#define EL_DOM_MY 4 /* offset of date of manf: month, year in BCD */
|
||||
|
||||
/*
|
||||
* Definitions for non-bankswitched registers
|
||||
*/
|
||||
|
||||
/* General control register */
|
||||
#define EL_CTRL_BNK0 0x00 /* register bank 0 */
|
||||
#define EL_CTRL_BNK1 0x01 /* register bank 1 */
|
||||
#define EL_CTRL_BNK2 0x02 /* register bank 2 */
|
||||
#define EL_CTRL_IEN 0x04 /* interrupt enable */
|
||||
#define EL_CTRL_INTL 0x08 /* interrupt active latch */
|
||||
#define EL_CTRL_16BIT 0x10 /* bus width; clear = 8-bit, set = 16-bit */
|
||||
#define EL_CTRL_LOOP 0x20 /* loopback mode */
|
||||
#define EL_CTRL_NRST 0x80 /* turn off to reset */
|
||||
#define EL_CTRL_RESET (EL_CTRL_LOOP)
|
||||
#define EL_CTRL_NORMAL (EL_CTRL_NRST | EL_CTRL_IEN | EL_CTRL_BNK1)
|
||||
|
||||
/* ROM & media control register */
|
||||
#define EL_MEDIA_MASK 0x80 /* m1 = (EL_MEDIA register) & EL_MEDIA_MASK */
|
||||
#define EL_MEDIA_SHIFT 7 /* media index = m1 >> EL_MEDIA_SHIFT */
|
||||
|
||||
/* shared memory control register */
|
||||
#define EL_MADDR_HIGH 0x20 /* memory mapping above 15Meg */
|
||||
#define EL_MADDR_MASK 0x1c /* m1 = (EL_MADDR register) & EL_MADDR_MASK */
|
||||
#define EL_MADDR_SHIFT 12 /* m2 = m1 << EL_MADDR_SHIFT */
|
||||
#define EL_MADDR_BASE 0xc0000 /* maddr = m2 + EL_MADDR_BASE */
|
||||
#define EL_MSIZE_MASK 0x03 /* m1 = (EL_MADDR register) & EL_MSIZE_MASK */
|
||||
#define EL_MSIZE_STEP 16384 /* msize = (m1 + 1) * EL_MSIZE_STEP */
|
||||
|
||||
/* interrupt control register */
|
||||
#define EL_IRQ_MASK 0x0f /* irq = (EL_IRQ register) & EL_IRQ_MASK */
|
||||
|
||||
/*
|
||||
* Definitions for Bank 0 registers
|
||||
*/
|
||||
#define EL_SIG_LEN 6 /* signature length */
|
||||
#define EL_SIGNATURE "*3COM*"
|
||||
|
||||
/*
|
||||
* Definitions for Bank 1 registers
|
||||
*/
|
||||
#define EL_ADDR_LEN 6 /* ether address length */
|
||||
|
||||
/*
|
||||
* Definitions for Bank 2 registers
|
||||
*/
|
||||
#define EL_TYPE_LEN 3 /* card part # length */
|
||||
|
||||
/*
|
||||
* General card-specific macros and definitions
|
||||
*/
|
||||
#define EL_IOBASE_LOW 0x200
|
||||
#define EL_IOBASE_HIGH 0x3e0
|
||||
#define EL_IOSIZE 16
|
||||
|
||||
/*
|
||||
* XXX: It seems that the 3C507-TP is differentiated from AUI/BNC 3C507
|
||||
* by part numbers, but I'm not sure how accurate this test is, seeing
|
||||
* as it's based on the sample of 3 cards I own (2AUI/BNC, 1 TP).
|
||||
*/
|
||||
#define EL_IS_TP(type) ((type)[EL_TYPE_MID] > 0x70)
|
||||
|
||||
#define EL_CARD_BNC 0 /* regular AUI/BNC 3C507 */
|
||||
#define EL_CARD_TP 1 /* 3C507-TP -- no AUI/BNC */
|
@ -1,887 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2003 Matthew N. Dodd
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Portions:
|
||||
* Copyright (c) 1992, 1993, University of Vermont and State
|
||||
* Agricultural College.
|
||||
* Copyright (c) 1992, 1993, Garrett A. Wollman.
|
||||
* Copyright (c) 1990, 1991, William F. Jolitz
|
||||
* Copyright (c) 1990, The Regents of the University of California
|
||||
* Copyright (c) 1993, 1994, Charles M. Hannum
|
||||
* Copyright (c) 1993, 1994, 1995, Rodney W. Grimes
|
||||
* Copyright (c) 1997, Aaron C. Smith
|
||||
*
|
||||
* See if_ie.c for applicable license.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/resource.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <machine/md_var.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_media.h>
|
||||
|
||||
#include <isa/isavar.h>
|
||||
#include <isa/pnpvar.h>
|
||||
|
||||
#include <i386/isa/elink.h>
|
||||
|
||||
#include <dev/ic/i82586.h>
|
||||
#include <dev/ie/if_ie507.h>
|
||||
#include <dev/ie/if_iee16.h>
|
||||
#include <dev/ie/if_iereg.h>
|
||||
#include <dev/ie/if_ievar.h>
|
||||
|
||||
static int ie_modevent (module_t, int, void *);
|
||||
|
||||
static void ie_isa_3C507_identify (driver_t *, device_t);
|
||||
static int ie_isa_3C507_probe (device_t);
|
||||
static int ie_isa_3C507_attach (device_t);
|
||||
static int ie_3C507_port_check (u_int32_t);
|
||||
|
||||
static void ie_isa_ee16_identify (driver_t *, device_t);
|
||||
static int ie_isa_ee16_probe (device_t);
|
||||
static int ie_isa_ee16_attach (device_t);
|
||||
static int ie_isa_ee16_shutdown (device_t);
|
||||
static int ie_ee16_port_check (u_int32_t port);
|
||||
static u_int16_t ie_ee16_hw_read_eeprom (u_int32_t port, int loc);
|
||||
|
||||
static int ie_isa_sl_probe (device_t);
|
||||
static int ie_isa_sl_attach (device_t);
|
||||
static enum ie_hardware ie_isa_sl_get_hard_type (u_int32_t);
|
||||
|
||||
/*
|
||||
* 3Com 3C507 Etherlink 16
|
||||
*/
|
||||
#define IE_3C507_IOBASE_LOW 0x200
|
||||
#define IE_3C507_IOBASE_HIGH 0x3e0
|
||||
#define IE_3C507_IOSIZE 16
|
||||
|
||||
#define IE_3C507_IRQ_MASK 0x0f
|
||||
|
||||
#define IE_3C507_MADDR_HIGH 0x20
|
||||
#define IE_3C507_MADDR_MASK 0x1c
|
||||
#define IE_3C507_MADDR_BASE 0xc0000
|
||||
#define IE_3C507_MADDR_SHIFT 12
|
||||
|
||||
#define IE_3C507_MSIZE_MASK 3
|
||||
#define IE_3C507_MSIZE_SHIFT 14
|
||||
|
||||
static void
|
||||
ie_isa_3C507_identify (driver_t *driver, device_t parent)
|
||||
{
|
||||
char * desc = "3Com 3C507 Etherlink 16";
|
||||
device_t child;
|
||||
u_int32_t port, maddr, msize;
|
||||
u_int8_t irq, data;
|
||||
int error;
|
||||
|
||||
/* Reset and put card in CONFIG state without changing address. */
|
||||
elink_reset();
|
||||
elink_idseq(ELINK_507_POLY);
|
||||
elink_idseq(ELINK_507_POLY);
|
||||
outb(ELINK_ID_PORT, 0xff);
|
||||
|
||||
for (port = IE_3C507_IOBASE_LOW;
|
||||
port <= IE_3C507_IOBASE_HIGH;
|
||||
port += IE_3C507_IOSIZE) {
|
||||
|
||||
if (ie_3C507_port_check(port)) {
|
||||
#ifdef DEBUG
|
||||
if (bootverbose) {
|
||||
device_printf(parent,
|
||||
"(if_ie) (3C507) not found at port %#x\n",
|
||||
port);
|
||||
}
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
outb(port + IE507_CTRL, EL_CTRL_NRST);
|
||||
|
||||
data = inb(port + IE507_IRQ);
|
||||
irq = data & IE_3C507_IRQ_MASK;
|
||||
|
||||
data = inb(port + IE507_MADDR);
|
||||
|
||||
if (data & IE_3C507_MADDR_HIGH) {
|
||||
if (bootverbose) {
|
||||
device_printf(parent,
|
||||
"(if_ie) can't map 3C507 RAM in high memory\n");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
maddr = IE_3C507_MADDR_BASE +
|
||||
((data & IE_3C507_MADDR_MASK)
|
||||
<< IE_3C507_MADDR_SHIFT);
|
||||
msize = ((data & IE_3C507_MSIZE_MASK) + 1)
|
||||
<< IE_3C507_MSIZE_SHIFT;
|
||||
|
||||
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "ie", -1);
|
||||
device_set_desc_copy(child, desc);
|
||||
device_set_driver(child, driver);
|
||||
|
||||
error = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
|
||||
if (error) {
|
||||
device_printf(parent, "(if_ie) Unable to set IRQ resource %d.\n",
|
||||
irq);
|
||||
error = device_delete_child(parent, child);
|
||||
continue;
|
||||
}
|
||||
|
||||
error = bus_set_resource(child, SYS_RES_IOPORT, 0, port, IE_3C507_IOSIZE);
|
||||
if (error) {
|
||||
device_printf(parent, "(if_ie) Unable to set IOPORT resource %#x-%#x.\n",
|
||||
port, port+IE_3C507_IOSIZE);
|
||||
error = device_delete_child(parent, child);
|
||||
continue;
|
||||
}
|
||||
|
||||
error = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, msize);
|
||||
if (error) {
|
||||
device_printf(parent, "(if_ie) Unable to set MEMORY resource %#x-%#x.\n",
|
||||
maddr, maddr+msize);
|
||||
error = device_delete_child(parent, child);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bootverbose) {
|
||||
device_printf(parent,
|
||||
"(if_ie) <%s> at port %#x-%#x irq %d iomem %#lx-%#lx (%dKB)\n",
|
||||
desc,
|
||||
port, (port + IE_3C507_IOSIZE) - 1,
|
||||
irq,
|
||||
(u_long)maddr, (u_long)(maddr + msize) - 1,
|
||||
(msize / 1024));
|
||||
}
|
||||
}
|
||||
|
||||
/* go to RUN state */
|
||||
outb(ELINK_ID_PORT, 0x00);
|
||||
elink_idseq(ELINK_507_POLY);
|
||||
outb(ELINK_ID_PORT, 0x00);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
ie_isa_3C507_probe (device_t dev)
|
||||
{
|
||||
u_int32_t iobase;
|
||||
|
||||
/* No ISA-PnP support */
|
||||
if (isa_get_vendorid(dev)) {
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
/* No ISA-HINT support */
|
||||
if (!device_get_desc(dev)) {
|
||||
return (EBUSY);
|
||||
}
|
||||
|
||||
/* Have we at least an ioport? */
|
||||
if ((iobase = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0) {
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
/* Is this thing really a 3c507? */
|
||||
if (ie_3C507_port_check(iobase)) {
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ie_isa_3C507_attach (device_t dev)
|
||||
{
|
||||
struct ie_softc * sc;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
sc->io_rid = 0;
|
||||
sc->irq_rid = 0;
|
||||
sc->mem_rid = 0;
|
||||
|
||||
error = ie_alloc_resources(dev);
|
||||
if (error) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
sc->bus_use = 0;
|
||||
sc->ie_reset_586 = el_reset_586;
|
||||
sc->ie_chan_attn = el_chan_attn;
|
||||
sc->hard_type = IE_3C507;
|
||||
sc->hard_vers = 0;
|
||||
|
||||
outb(PORT(sc) + IE507_CTRL, EL_CTRL_NORMAL);
|
||||
|
||||
if (!check_ie_present(sc)) {
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
sl_read_ether(sc, sc->enaddr);
|
||||
|
||||
/* Clear the interrupt latch just in case. */
|
||||
outb(PORT(sc) + IE507_ICTRL, 1);
|
||||
|
||||
error = ie_attach(dev);
|
||||
if (error) {
|
||||
device_printf(dev, "ie_attach() failed.\n");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
return (0);
|
||||
bad:
|
||||
ie_release_resources(dev);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* If a 3c507 is present, return 0
|
||||
* else, return 1.
|
||||
*/
|
||||
static int
|
||||
ie_3C507_port_check (u_int32_t port)
|
||||
{
|
||||
u_char * signature = "*3COM*";
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
if (inb(port + i) != signature[i])
|
||||
return (ENXIO);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Intel EtherExpress 16
|
||||
*/
|
||||
#define IE_EE16_ID_PORT 0x0f
|
||||
#define IE_EE16_ID 0xbaba
|
||||
#define IE_EE16_EEPROM_CONFIG1 0x00
|
||||
#define IE_EE16_EEPROM_IRQ_MASK 0xe000
|
||||
#define IE_EE16_EEPROM_IRQ_SHIFT 13
|
||||
#define IE_EE16_EEPROM_MEMCFG 0x06
|
||||
#define IE_EE16_IOSIZE 16
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* Test for 8/16 bit mode.
|
||||
* Test for invalid mem sizes.
|
||||
*/
|
||||
static void
|
||||
ie_isa_ee16_identify (driver_t *driver, device_t parent)
|
||||
{
|
||||
char * desc = "Intel EtherExpress 16";
|
||||
device_t child;
|
||||
u_int16_t ports[] = {
|
||||
0x300, 0x310, 0x320, 0x330,
|
||||
0x340, 0x350, 0x360, 0x370,
|
||||
0x200, 0x210, 0x220, 0x230,
|
||||
0x240, 0x250, 0x260, 0x270,
|
||||
0
|
||||
};
|
||||
u_int16_t irqs[] = { 0, 0x09, 0x03, 0x04, 0x05, 0x0a, 0x0b, 0 };
|
||||
u_int32_t port, maddr, msize;
|
||||
u_int8_t irq;
|
||||
u_int16_t data;
|
||||
int i, error;
|
||||
|
||||
for (i = 0; ports[i]; i++) {
|
||||
port = ports[i];
|
||||
|
||||
if (ie_ee16_port_check(port)) {
|
||||
#ifdef DEBUG
|
||||
if (bootverbose) {
|
||||
device_printf(parent,
|
||||
"if_ie: (EE16) not found at port %#x\n",
|
||||
port);
|
||||
}
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
/* reset any ee16 at the current iobase */
|
||||
outb(port + IEE16_ECTRL, IEE16_RESET_ASIC);
|
||||
outb(port + IEE16_ECTRL, 0);
|
||||
DELAY(240);
|
||||
|
||||
data = ie_ee16_hw_read_eeprom(port, IE_EE16_EEPROM_CONFIG1);
|
||||
irq = irqs[((data & IE_EE16_EEPROM_IRQ_MASK)
|
||||
>> IE_EE16_EEPROM_IRQ_SHIFT)];
|
||||
|
||||
data = ie_ee16_hw_read_eeprom(port, IE_EE16_EEPROM_MEMCFG);
|
||||
maddr = 0xc0000 + ((ffs(data & 0x00ff) - 1) * 0x4000);
|
||||
msize = (fls((data & 0x00ff) >> (ffs(data & 0x00ff) - 1)))
|
||||
* 0x4000;
|
||||
|
||||
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "ie", -1);
|
||||
device_set_desc_copy(child, desc);
|
||||
device_set_driver(child, driver);
|
||||
|
||||
error = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
|
||||
if (error) {
|
||||
device_printf(parent, "(if_ie) Unable to set IRQ resource %d.\n",
|
||||
irq);
|
||||
error = device_delete_child(parent, child);
|
||||
continue;
|
||||
}
|
||||
|
||||
error = bus_set_resource(child, SYS_RES_IOPORT, 0, port, IE_EE16_IOSIZE);
|
||||
if (error) {
|
||||
device_printf(parent, "(if_ie) Unable to set IOPORT resource %#x-%#x.\n",
|
||||
port, port+IE_EE16_IOSIZE);
|
||||
error = device_delete_child(parent, child);
|
||||
continue;
|
||||
}
|
||||
|
||||
error = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, msize);
|
||||
if (error) {
|
||||
device_printf(parent, "(if_ie) Unable to set MEMORY resource %#x-%#x.\n",
|
||||
maddr, maddr+msize);
|
||||
error = device_delete_child(parent, child);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bootverbose) {
|
||||
device_printf(parent,
|
||||
"if_ie: <%s> at port %#x-%#x irq %d iomem %#lx-%#lx (%dKB)\n",
|
||||
desc,
|
||||
port, (port + IE_EE16_IOSIZE) - 1,
|
||||
irq,
|
||||
(u_long)maddr, (u_long)(maddr + msize) - 1,
|
||||
(msize / 1024));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
ie_isa_ee16_probe (device_t dev)
|
||||
{
|
||||
u_int32_t iobase;
|
||||
|
||||
/* No ISA-PnP support */
|
||||
if (isa_get_vendorid(dev))
|
||||
return (ENXIO);
|
||||
|
||||
/* No ISA-HINT support */
|
||||
if (!device_get_desc(dev))
|
||||
return (EBUSY);
|
||||
|
||||
/* Have we at least an ioport? */
|
||||
if ((iobase = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0)
|
||||
return (ENXIO);
|
||||
|
||||
/* Is this really an EE16? */
|
||||
if (ie_ee16_port_check(iobase))
|
||||
return (ENXIO);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ie_isa_ee16_attach (device_t dev)
|
||||
{
|
||||
struct ie_softc * sc;
|
||||
int i, error;
|
||||
u_int16_t checksum;
|
||||
u_short eaddrtemp, pg, adjust, decode, edecode;
|
||||
u_char bart_config;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
sc->io_rid = 0;
|
||||
sc->irq_rid = 0;
|
||||
sc->mem_rid = 0;
|
||||
|
||||
error = ie_alloc_resources(dev);
|
||||
if (error) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
sc->bus_use = 0;
|
||||
sc->ie_reset_586 = ee16_reset_586;
|
||||
sc->ie_chan_attn = ee16_chan_attn;
|
||||
sc->hard_type = IE_EE16;
|
||||
sc->hard_vers = 0;
|
||||
sc->iomem = 0;
|
||||
|
||||
/* reset any ee16 at the current iobase */
|
||||
outb(PORT(sc) + IEE16_ECTRL, IEE16_RESET_ASIC);
|
||||
outb(PORT(sc) + IEE16_ECTRL, 0);
|
||||
DELAY(240);
|
||||
|
||||
/* Is this really an EE16? */
|
||||
if (ie_ee16_port_check(PORT(sc))) {
|
||||
device_printf(dev, "ie_ee16_port_check() failed\n");
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* need to put the 586 in RESET while we access the eeprom. */
|
||||
outb(PORT(sc) + IEE16_ECTRL, IEE16_RESET_586);
|
||||
|
||||
/* read the eeprom and checksum it, should == IE_E16_ID */
|
||||
checksum = 0;
|
||||
for (i = 0; i < 0x40; i++)
|
||||
checksum += ie_ee16_hw_read_eeprom(PORT(sc), i);
|
||||
|
||||
if (checksum != IE_EE16_ID) {
|
||||
device_printf(dev, "invalid eeprom checksum: %x\n", checksum);
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if ((kvtop(sc->iomembot) < 0xC0000) ||
|
||||
(kvtop(sc->iomembot) + sc->iosize > 0xF0000)) {
|
||||
device_printf(sc->dev, "mapped memory location %p out of range\n",
|
||||
(void *)sc->iomembot);
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
pg = ((kvtop(sc->iomembot)) & 0x3C000) >> 14;
|
||||
adjust = IEE16_MCTRL_FMCS16 | (pg & 0x3) << 2;
|
||||
decode = ((1 << (sc->iosize / 16384)) - 1) << pg;
|
||||
edecode = ((~decode >> 4) & 0xF0) | (decode >> 8);
|
||||
|
||||
/* ZZZ This should be checked against eeprom location 6, low byte */
|
||||
outb(PORT(sc) + IEE16_MEMDEC, decode & 0xFF);
|
||||
/* ZZZ This should be checked against eeprom location 1, low byte */
|
||||
outb(PORT(sc) + IEE16_MCTRL, adjust);
|
||||
/* ZZZ Now if I could find this one I would have it made */
|
||||
outb(PORT(sc) + IEE16_MPCTRL, (~decode & 0xFF));
|
||||
/* ZZZ I think this is location 6, high byte */
|
||||
outb(PORT(sc) + IEE16_MECTRL, edecode); /* XXX disable Exxx */
|
||||
|
||||
#if 0
|
||||
(void) kvtop(sc->iomembot);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* first prime the stupid bart DRAM controller so that it works,
|
||||
* then zero out all of memory.
|
||||
*/
|
||||
bzero(sc->iomembot, 32);
|
||||
bzero(sc->iomembot, sc->iosize);
|
||||
|
||||
/* Get the encoded interrupt number from the EEPROM */
|
||||
sc->irq_encoded = ie_ee16_hw_read_eeprom(PORT(sc),
|
||||
IE_EE16_EEPROM_CONFIG1);
|
||||
sc->irq_encoded = (sc->irq_encoded & IE_EE16_EEPROM_IRQ_MASK) >>
|
||||
IE_EE16_EEPROM_IRQ_SHIFT;
|
||||
|
||||
/*
|
||||
* Get the hardware ethernet address from the EEPROM and save it in
|
||||
* the softc for use by the 586 setup code.
|
||||
*/
|
||||
eaddrtemp = ie_ee16_hw_read_eeprom(PORT(sc), IEE16_EEPROM_ENET_HIGH);
|
||||
sc->enaddr[1] = eaddrtemp & 0xFF;
|
||||
sc->enaddr[0] = eaddrtemp >> 8;
|
||||
eaddrtemp = ie_ee16_hw_read_eeprom(PORT(sc), IEE16_EEPROM_ENET_MID);
|
||||
sc->enaddr[3] = eaddrtemp & 0xFF;
|
||||
sc->enaddr[2] = eaddrtemp >> 8;
|
||||
eaddrtemp = ie_ee16_hw_read_eeprom(PORT(sc), IEE16_EEPROM_ENET_LOW);
|
||||
sc->enaddr[5] = eaddrtemp & 0xFF;
|
||||
sc->enaddr[4] = eaddrtemp >> 8;
|
||||
|
||||
/* disable the board interrupts */
|
||||
outb(PORT(sc) + IEE16_IRQ, sc->irq_encoded);
|
||||
|
||||
/* enable loopback to keep bad packets off the wire */
|
||||
bart_config = inb(PORT(sc) + IEE16_CONFIG);
|
||||
bart_config |= IEE16_BART_LOOPBACK;
|
||||
bart_config |= IEE16_BART_MCS16_TEST;/* inb doesn't get bit! */
|
||||
outb(PORT(sc) + IEE16_CONFIG, bart_config);
|
||||
bart_config = inb(PORT(sc) + IEE16_CONFIG);
|
||||
|
||||
/* take the board out of reset state */
|
||||
outb(PORT(sc) + IEE16_ECTRL, 0);
|
||||
DELAY(100);
|
||||
|
||||
if (!check_ie_present(sc)) {
|
||||
device_printf(dev, "check_ie_present() returned false.\n");
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
error = ie_attach(dev);
|
||||
if (error) {
|
||||
device_printf(dev, "ie_attach() failed.\n");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
return (0);
|
||||
bad:
|
||||
ie_release_resources(dev);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
ie_isa_ee16_shutdown(device_t dev)
|
||||
{
|
||||
struct ie_softc * sc;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
IE_LOCK(sc);
|
||||
ee16_shutdown(sc);
|
||||
IE_UNLOCK(sc);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* If an EE16 is present, return 0
|
||||
* else, return 1.
|
||||
*/
|
||||
static int
|
||||
ie_ee16_port_check (u_int32_t port)
|
||||
{
|
||||
int i;
|
||||
u_int16_t board_id;
|
||||
u_int8_t data;
|
||||
|
||||
board_id = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
data = inb(port + IE_EE16_ID_PORT);
|
||||
board_id |= ((data >> 4) << ((data & 0x03) << 2));
|
||||
}
|
||||
|
||||
if (board_id != IE_EE16_ID)
|
||||
return (1);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
ie_ee16_hw_eeprom_clock (u_int32_t port, int state)
|
||||
{
|
||||
u_int8_t ectrl;
|
||||
|
||||
ectrl = inb(port + IEE16_ECTRL);
|
||||
ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EESK);
|
||||
|
||||
if (state) {
|
||||
ectrl |= IEE16_ECTRL_EESK;
|
||||
}
|
||||
outb(port + IEE16_ECTRL, ectrl);
|
||||
DELAY(9); /* EESK must be stable for 8.38 uSec */
|
||||
}
|
||||
|
||||
static void
|
||||
ie_ee16_hw_eeprom_out (u_int32_t port, u_int16_t edata, int count)
|
||||
{
|
||||
u_int8_t ectrl;
|
||||
int i;
|
||||
|
||||
ectrl = inb(port + IEE16_ECTRL);
|
||||
ectrl &= ~IEE16_RESET_ASIC;
|
||||
|
||||
for (i = count - 1; i >= 0; i--) {
|
||||
ectrl &= ~IEE16_ECTRL_EEDI;
|
||||
if (edata & (1 << i)) {
|
||||
ectrl |= IEE16_ECTRL_EEDI;
|
||||
}
|
||||
outb(port + IEE16_ECTRL, ectrl);
|
||||
DELAY(1); /* eeprom data must be setup for 0.4 uSec */
|
||||
ie_ee16_hw_eeprom_clock(port, 1);
|
||||
ie_ee16_hw_eeprom_clock(port, 0);
|
||||
}
|
||||
ectrl &= ~IEE16_ECTRL_EEDI;
|
||||
outb(port + IEE16_ECTRL, ectrl);
|
||||
DELAY(1); /* eeprom data must be held for 0.4 uSec */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static u_int16_t
|
||||
ie_ee16_hw_eeprom_in (u_int32_t port)
|
||||
{
|
||||
u_int8_t ectrl;
|
||||
u_int16_t edata;
|
||||
int i;
|
||||
|
||||
ectrl = inb(port + IEE16_ECTRL);
|
||||
ectrl &= ~IEE16_RESET_ASIC;
|
||||
|
||||
for (edata = 0, i = 0; i < 16; i++) {
|
||||
edata = edata << 1;
|
||||
ie_ee16_hw_eeprom_clock(port, 1);
|
||||
ectrl = inb(port + IEE16_ECTRL);
|
||||
if (ectrl & IEE16_ECTRL_EEDO) {
|
||||
edata |= 1;
|
||||
}
|
||||
ie_ee16_hw_eeprom_clock(port, 0);
|
||||
}
|
||||
return (edata);
|
||||
}
|
||||
|
||||
static u_int16_t
|
||||
ie_ee16_hw_read_eeprom (u_int32_t port, int loc)
|
||||
{
|
||||
u_int8_t ectrl;
|
||||
u_int16_t edata;
|
||||
|
||||
ectrl = inb(port + IEE16_ECTRL);
|
||||
ectrl &= IEE16_ECTRL_MASK;
|
||||
ectrl |= IEE16_ECTRL_EECS;
|
||||
outb(port + IEE16_ECTRL, ectrl);
|
||||
|
||||
ie_ee16_hw_eeprom_out(port, IEE16_EEPROM_READ, IEE16_EEPROM_OPSIZE1);
|
||||
ie_ee16_hw_eeprom_out(port, loc, IEE16_EEPROM_ADDR_SIZE);
|
||||
edata = ie_ee16_hw_eeprom_in(port);
|
||||
|
||||
ectrl = inb(port + IEE16_ECTRL);
|
||||
ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EEDI | IEE16_ECTRL_EECS);
|
||||
outb(port + IEE16_ECTRL, ectrl);
|
||||
|
||||
ie_ee16_hw_eeprom_clock(port, 1);
|
||||
ie_ee16_hw_eeprom_clock(port, 0);
|
||||
|
||||
return (edata);
|
||||
}
|
||||
|
||||
/*
|
||||
* AT&T StarLan/
|
||||
*/
|
||||
|
||||
static int
|
||||
ie_isa_sl_probe (device_t dev)
|
||||
{
|
||||
u_int32_t iobase;
|
||||
|
||||
/* No ISA-PnP support */
|
||||
if (isa_get_vendorid(dev))
|
||||
return (ENXIO);
|
||||
|
||||
/* ISA-HINT support only! */
|
||||
if (device_get_desc(dev))
|
||||
return (EBUSY);
|
||||
|
||||
/* Have we at least an ioport? */
|
||||
if ((iobase = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0)
|
||||
return (ENXIO);
|
||||
|
||||
/* Is this really an SL board? */
|
||||
if (ie_isa_sl_get_hard_type(iobase) == IE_NONE)
|
||||
return (ENXIO);
|
||||
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
static int
|
||||
ie_isa_sl_attach (device_t dev)
|
||||
{
|
||||
struct ie_softc * sc;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
sc->io_rid = 0;
|
||||
sc->irq_rid = 0;
|
||||
sc->mem_rid = 0;
|
||||
|
||||
error = ie_alloc_resources(dev);
|
||||
if (error) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* Is this really an SL board? */
|
||||
if ((sc->hard_type = ie_isa_sl_get_hard_type(PORT(sc))) == IE_NONE) {
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
sc->hard_vers = SL_REV(inb(PORT(sc) + IEATT_REVISION));
|
||||
if (sc->hard_type == IE_NI5210) {
|
||||
sc->bus_use = 1;
|
||||
} else {
|
||||
sc->bus_use = 0;
|
||||
}
|
||||
|
||||
sc->ie_reset_586 = sl_reset_586;
|
||||
sc->ie_chan_attn = sl_chan_attn;
|
||||
|
||||
if (!check_ie_present(sc)) {
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
|
||||
switch (sc->hard_type) {
|
||||
case IE_EN100:
|
||||
case IE_STARLAN10:
|
||||
case IE_SLFIBER:
|
||||
case IE_NI5210:
|
||||
sl_read_ether(sc, sc->enaddr);
|
||||
break;
|
||||
default:
|
||||
if (bootverbose)
|
||||
device_printf(sc->dev, "unknown AT&T board type code %d\n", sc->hard_type);
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
break;
|
||||
}
|
||||
|
||||
error = ie_attach(dev);
|
||||
if (error) {
|
||||
device_printf(dev, "ie_attach() failed.\n");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
return (0);
|
||||
bad:
|
||||
ie_release_resources(dev);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
static enum ie_hardware
|
||||
ie_isa_sl_get_hard_type (u_int32_t port)
|
||||
{
|
||||
u_char c;
|
||||
enum ie_hardware retval;
|
||||
|
||||
c = inb(port + IEATT_REVISION);
|
||||
switch (SL_BOARD(c)) {
|
||||
case SL1_BOARD:
|
||||
if (inb(port + IEATT_ATTRIB) != NI5210_BOARD)
|
||||
retval = IE_NONE;
|
||||
retval = IE_NI5210;
|
||||
break;
|
||||
case SL10_BOARD:
|
||||
retval = IE_STARLAN10;
|
||||
break;
|
||||
case EN100_BOARD:
|
||||
retval = IE_EN100;
|
||||
break;
|
||||
case SLFIBER_BOARD:
|
||||
retval = IE_SLFIBER;
|
||||
break;
|
||||
default:
|
||||
retval = IE_NONE;
|
||||
}
|
||||
return (retval);
|
||||
}
|
||||
|
||||
static devclass_t ie_devclass;
|
||||
|
||||
static device_method_t ie_isa_3C507_methods[] = {
|
||||
DEVMETHOD(device_identify, ie_isa_3C507_identify),
|
||||
DEVMETHOD(device_probe, ie_isa_3C507_probe),
|
||||
DEVMETHOD(device_attach, ie_isa_3C507_attach),
|
||||
DEVMETHOD(device_detach, ie_detach),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t ie_isa_3C507_driver = {
|
||||
"ie",
|
||||
ie_isa_3C507_methods,
|
||||
sizeof(struct ie_softc),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ie_3C507, isa, ie_isa_3C507_driver, ie_devclass, ie_modevent, 0);
|
||||
MODULE_DEPEND(ie_3C507, elink, 1, 1, 1);
|
||||
|
||||
static device_method_t ie_isa_ee16_methods[] = {
|
||||
DEVMETHOD(device_identify, ie_isa_ee16_identify),
|
||||
DEVMETHOD(device_probe, ie_isa_ee16_probe),
|
||||
DEVMETHOD(device_attach, ie_isa_ee16_attach),
|
||||
DEVMETHOD(device_shutdown, ie_isa_ee16_shutdown),
|
||||
DEVMETHOD(device_detach, ie_detach),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t ie_isa_ee16_driver = {
|
||||
"ie",
|
||||
ie_isa_ee16_methods,
|
||||
sizeof(struct ie_softc),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ie, isa, ie_isa_ee16_driver, ie_devclass, ie_modevent, 0);
|
||||
|
||||
static device_method_t ie_isa_sl_methods[] = {
|
||||
DEVMETHOD(device_probe, ie_isa_sl_probe),
|
||||
DEVMETHOD(device_attach, ie_isa_sl_attach),
|
||||
DEVMETHOD(device_detach, ie_detach),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t ie_isa_sl_driver = {
|
||||
"ie",
|
||||
ie_isa_sl_methods,
|
||||
sizeof(struct ie_softc),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ie_SL, isa, ie_isa_sl_driver, ie_devclass, ie_modevent, 0);
|
||||
|
||||
static int
|
||||
ie_modevent (mod, what, arg)
|
||||
module_t mod;
|
||||
int what;
|
||||
void * arg;
|
||||
{
|
||||
device_t * devs;
|
||||
int count;
|
||||
int i;
|
||||
|
||||
switch (what) {
|
||||
case MOD_LOAD:
|
||||
break;
|
||||
case MOD_UNLOAD:
|
||||
devclass_get_devices(ie_devclass, &devs, &count);
|
||||
for (i = 0; i < count; i++)
|
||||
device_delete_child(device_get_parent(devs[i]), devs[i]);
|
||||
free(devs, M_TEMP);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995
|
||||
* Rodney W. Grimes, Milwaukie, Oregon 97222. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer as
|
||||
* the first lines of this file unmodified.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Rodney W. Grimes.
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY RODNEY W. GRIMES ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL RODNEY W. GRIMES BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for EtherExpress 16
|
||||
*/
|
||||
|
||||
#define IEE16_DATAPORT 0x00 /* shared memory data port */
|
||||
#define IEE16_WRITEPTR 0x02 /* shared memory write pointer */
|
||||
#define IEE16_READPTR 0x04 /* shared memory read pointer */
|
||||
|
||||
#define IEE16_ATTN 0x06 /* channel attention control */
|
||||
#define IEE16_IRQ 0x07 /* IRQ configuration */
|
||||
#define IEE16_IRQ_DISABLE 0x00 /* disable board interrupts */
|
||||
#define IEE16_IRQ_ENABLE 0x08 /* enable board interrupts */
|
||||
|
||||
#define IEE16_SHADOWPTR 0x08 /* shadow memory pointer */
|
||||
|
||||
#define IEE16_MEMDEC 0x0a /* memory decode */
|
||||
#define IEE16_MCTRL 0x0b /* memory control */
|
||||
#define IEE16_MCTRL_FMCS16 0x10 /* MEMCS16- for F000 */
|
||||
|
||||
#define IEE16_MPCTRL 0x0c /* memory page control */
|
||||
#define IEE16_CONFIG 0x0d /* config register */
|
||||
#define IEE16_BART_LOOPBACK 0x02 /* loopback, 0=none, 1=loopback */
|
||||
#define IEE16_BART_IOCHRDY_LATE 0x10 /* iochrdy late control bit */
|
||||
#define IEE16_BART_IO_TEST_EN 0x20 /* enable iochrdy timing test */
|
||||
#define IEE16_BART_IO_RESULT 0x40 /* result of the iochrdy test */
|
||||
#define IEE16_BART_MCS16_TEST 0x80 /* enable memcs16 select test */
|
||||
|
||||
#define IEE16_ECTRL 0x0e /* eeprom control */
|
||||
#define IEE16_ECTRL_EESK 0x01 /* EEPROM clock bit */
|
||||
#define IEE16_ECTRL_EECS 0x02 /* EEPROM chip select */
|
||||
#define IEE16_ECTRL_EEDI 0x04 /* EEPROM data in bit */
|
||||
#define IEE16_ECTRL_EEDO 0x08 /* EEPROM data out bit */
|
||||
#define IEE16_RESET_ASIC 0x40 /* reset ASIC (bart) pin */
|
||||
#define IEE16_RESET_586 0x80 /* reset 82586 pin */
|
||||
#define IEE16_ECTRL_MASK 0xb2 /* and'ed with ECTRL to enable read */
|
||||
|
||||
#define IEE16_MECTRL 0x0f /* memory control, 0xe000 seg 'W' */
|
||||
#define IEE16_ID_PORT 0x0f /* auto-id port 'R' */
|
||||
|
||||
#define IEE16_ID 0xbaba /* known id of EE16 */
|
||||
|
||||
#define IEE16_EEPROM_READ 0x06 /* EEPROM read opcode */
|
||||
#define IEE16_EEPROM_OPSIZE1 0x03 /* size of EEPROM opcodes */
|
||||
#define IEE16_EEPROM_ADDR_SIZE 0x06 /* size of EEPROM address */
|
||||
|
||||
/* Locations in the EEPROM */
|
||||
#define IEE16_EEPROM_CONFIG1 0x00 /* Configuration register 1 */
|
||||
#define IEE16_EEPROM_MEDIA_EXT 0x1000 /* Using external transceiver 0 = AUI */
|
||||
|
||||
#define IEE16_EEPROM_IRQ 0xE000 /* Encoded IRQ */
|
||||
#define IEE16_EEPROM_IRQ_SHIFT 13 /* To shift IRQ to lower bits */
|
||||
#define IEE16_EEPROM_LOCK_ADDR 0x01 /* contains the lock bit */
|
||||
#define IEE16_EEPROM_LOCKED 0x01 /* means that it is locked */
|
||||
|
||||
#define IEE16_EEPROM_ENET_LOW 0x02 /* Ethernet address, low word */
|
||||
#define IEE16_EEPROM_ENET_MID 0x03 /* Ethernet address, middle word */
|
||||
#define IEE16_EEPROM_ENET_HIGH 0x04 /* Ethernet address, high word */
|
||||
|
||||
#define IEE16_EEPROM_MEDIA 0x05 /* Selects between TP/BNC */
|
||||
#define IEE16_EEPROM_MEDIA_TP 0x01 /* if ON, using TP, else BNC */
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
* definitions for AT&T StarLAN 10 etc...
|
||||
*/
|
||||
|
||||
#define IEATT_RESET 0 /* any write here resets the 586 */
|
||||
#define IEATT_ATTN 1 /* any write here sends a Chan attn */
|
||||
#define IEATT_REVISION 6 /* read here to figure out this board */
|
||||
#define IEATT_ATTRIB 7 /* more information about this board */
|
||||
|
||||
#define SL_BOARD(x) ((x) & 0x0f)
|
||||
#define SL_REV(x) ((x) >> 4)
|
||||
|
||||
#define SL1_BOARD 0x00
|
||||
#define SL10_BOARD 0x01
|
||||
#define EN100_BOARD 0x02
|
||||
#define SLFIBER_BOARD 0x03
|
||||
#define NI5210_BOARD 0x55
|
||||
|
||||
#define SL_ATTR_WIDTH 0x04 /* bus width: clear -> 8-bit */
|
||||
#define SL_ATTR_SPEED 0x08 /* medium speed: clear -> 10 Mbps */
|
||||
#define SL_ATTR_CODING 0x10 /* encoding: clear -> Manchester */
|
||||
#define SL_ATTR_HBW 0x20 /* host bus width: clear -> 16-bit */
|
||||
#define SL_ATTR_TYPE 0x40 /* medium type: clear -> Ethernet */
|
||||
#define SL_ATTR_BOOTROM 0x80 /* set -> boot ROM present */
|
@ -1,98 +0,0 @@
|
||||
/*-
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
enum ie_hardware {
|
||||
IE_NONE,
|
||||
IE_STARLAN10,
|
||||
IE_EN100,
|
||||
IE_SLFIBER,
|
||||
IE_3C507,
|
||||
IE_NI5210,
|
||||
IE_EE16,
|
||||
IE_UNKNOWN
|
||||
};
|
||||
|
||||
/*
|
||||
* Ethernet status, per interface.
|
||||
*/
|
||||
struct ie_softc {
|
||||
struct ifnet *ifp;
|
||||
void (*ie_reset_586) (struct ie_softc *);
|
||||
void (*ie_chan_attn) (struct ie_softc *);
|
||||
enum ie_hardware hard_type;
|
||||
int hard_vers;
|
||||
u_char enaddr[6];
|
||||
|
||||
device_t dev;
|
||||
|
||||
struct resource * io_res;
|
||||
int io_rid;
|
||||
bus_space_tag_t io_bt;
|
||||
bus_space_handle_t io_bh;
|
||||
|
||||
struct resource * irq_res;
|
||||
int irq_rid;
|
||||
void * irq_ih;
|
||||
|
||||
struct resource * mem_res;
|
||||
int mem_rid;
|
||||
bus_space_tag_t mem_bt;
|
||||
bus_space_handle_t mem_bh;
|
||||
|
||||
u_int port; /* i/o base address for this interface */
|
||||
caddr_t iomem; /* memory size */
|
||||
caddr_t iomembot; /* memory base address */
|
||||
unsigned iosize;
|
||||
int bus_use; /* 0 means 16bit, 1 means 8 bit adapter */
|
||||
|
||||
int want_mcsetup;
|
||||
int promisc;
|
||||
int nframes;
|
||||
int nrxbufs;
|
||||
int ntxbufs;
|
||||
volatile struct ie_int_sys_conf_ptr *iscp;
|
||||
volatile struct ie_sys_ctl_block *scb;
|
||||
volatile struct ie_recv_frame_desc **rframes; /* nframes worth */
|
||||
volatile struct ie_recv_buf_desc **rbuffs; /* nrxbufs worth */
|
||||
volatile u_char **cbuffs; /* nrxbufs worth */
|
||||
int rfhead, rftail, rbhead, rbtail;
|
||||
|
||||
volatile struct ie_xmit_cmd **xmit_cmds; /* ntxbufs worth */
|
||||
volatile struct ie_xmit_buf **xmit_buffs; /* ntxbufs worth */
|
||||
volatile u_char **xmit_cbuffs; /* ntxbufs worth */
|
||||
int xmit_count;
|
||||
|
||||
struct ie_en_addr mcast_addrs[MAXMCAST + 1];
|
||||
int mcast_count;
|
||||
|
||||
u_short irq_encoded; /* encoded interrupt on IEE16 */
|
||||
|
||||
struct mtx lock;
|
||||
};
|
||||
#define PORT(sc) sc->port
|
||||
#define MEM(sc) sc->iomem
|
||||
|
||||
#define IE_LOCK(sc) mtx_lock(&(sc)->lock)
|
||||
#define IE_UNLOCK(sc) mtx_unlock(&(sc)->lock)
|
||||
#define IE_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED)
|
||||
|
||||
void ie_intr (void *);
|
||||
int ie_alloc_resources (device_t);
|
||||
void ie_release_resources (device_t);
|
||||
int ie_attach (device_t);
|
||||
int ie_detach (device_t);
|
||||
|
||||
void el_reset_586 (struct ie_softc *);
|
||||
void el_chan_attn (struct ie_softc *);
|
||||
|
||||
void sl_reset_586 (struct ie_softc *);
|
||||
void sl_chan_attn (struct ie_softc *);
|
||||
|
||||
void ee16_reset_586 (struct ie_softc *);
|
||||
void ee16_chan_attn (struct ie_softc *);
|
||||
void ee16_shutdown (struct ie_softc *);
|
||||
|
||||
void sl_read_ether (struct ie_softc *, unsigned char *);
|
||||
int check_ie_present (struct ie_softc *);
|
||||
|
@ -624,12 +624,6 @@ hint.ed.0.at="isa"
|
||||
hint.ed.0.port="0x280"
|
||||
hint.ed.0.irq="5"
|
||||
hint.ed.0.maddr="0xd8000"
|
||||
device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
|
||||
# Hints only required for Starlan
|
||||
hint.ie.2.at="isa"
|
||||
hint.ie.2.port="0x300"
|
||||
hint.ie.2.irq="5"
|
||||
hint.ie.2.maddr="0xd0000"
|
||||
device ipw # Intel 2100 wireless NICs.
|
||||
device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs.
|
||||
device iwn # Intel 4965/1000/5000/6000 wireless NICs.
|
||||
|
@ -141,7 +141,6 @@ SUBDIR= \
|
||||
${_ibcs2} \
|
||||
${_ichwd} \
|
||||
${_ida} \
|
||||
${_ie} \
|
||||
if_bridge \
|
||||
if_disc \
|
||||
if_edsc \
|
||||
@ -705,7 +704,6 @@ _elink= elink
|
||||
_glxiic= glxiic
|
||||
_glxsb= glxsb
|
||||
#_ibcs2= ibcs2
|
||||
_ie= ie
|
||||
_mse= mse
|
||||
_ncr= ncr
|
||||
_ncv= ncv
|
||||
|
@ -1,11 +0,0 @@
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.PATH: ${.CURDIR}/../../dev/ie
|
||||
|
||||
KMOD= if_ie
|
||||
SRCS= if_ie.c if_ie_isa.c \
|
||||
isa_if.h bus_if.h device_if.h
|
||||
WERROR=
|
||||
|
||||
.include <bsd.kmod.mk>
|
@ -390,11 +390,6 @@ hint.ed.0.at="isa"
|
||||
hint.ed.0.port="0x280"
|
||||
hint.ed.0.irq="5"
|
||||
hint.ed.0.maddr="0xd8000"
|
||||
device ie # Hints only required for Starlan
|
||||
hint.ie.2.at="isa"
|
||||
hint.ie.2.port="0x300"
|
||||
hint.ie.2.irq="5"
|
||||
hint.ie.2.maddr="0xd0000"
|
||||
#device le
|
||||
# Hint for the PC98-only C-NET(98)S C-bus front-end of le(4).
|
||||
hint.le.0.at="isa"
|
||||
|
Loading…
Reference in New Issue
Block a user