- Newbus'ify and bus_space'ify.

- Separate bus dependent part and independent part.
- Moved source files to sys/dev/fe (repo copied).
- Fixed some comments by chi@bd.mbn.or.jp (Chiharu Shibata)

Tested by:	bsd-nomads@clave.gr.jp and
		FreeBSD98-testers@jp.freebsd.org
This commit is contained in:
Yoshihiro Takahashi 2000-09-14 12:02:07 +00:00
parent c400e7405e
commit b14d7dac8a
11 changed files with 3047 additions and 6835 deletions

View File

@ -148,6 +148,8 @@ dev/ep/if_ep_mca.c optional ep mca
dev/ep/if_ep_pccard.c optional ep card
dev/ex/if_ex.c optional ex
dev/ex/if_ex_isa.c optional ex isa
dev/fe/if_fe.c optional fe
dev/fe/if_fe_pccard.c optional fe card
dev/hea/eni.c optional hea
dev/hea/eni_buffer.c optional hea
dev/hea/eni_globals.c optional hea

View File

@ -106,6 +106,7 @@ dev/fb/fb.c optional fb
dev/fb/fb.c optional vga
dev/fb/splash.c count splash
dev/fb/vga.c optional vga
dev/fe/if_fe_isa.c optional fe isa
dev/kbd/atkbd.c optional atkbd
dev/kbd/atkbdc.c count atkbdc
dev/kbd/kbd.c optional atkbd
@ -234,7 +235,6 @@ i386/isa/gsc.c count gsc
i386/isa/if_ar.c optional ar
i386/isa/if_cx.c optional cx
i386/isa/if_el.c count el
i386/isa/if_fe.c count fe
i386/isa/if_le.c count le
i386/isa/if_rdp.c count rdp
i386/isa/if_sr.c count sr

View File

@ -102,6 +102,7 @@ dev/eisa/eisaconf.c count eisa
dev/fb/fb.c optional fb
dev/fb/fb.c optional gdc
dev/fb/splash.c count splash
dev/fe/if_fe_cbus.c optional fe isa
dev/kbd/kbd.c optional kbd
dev/kbd/kbd.c optional sc
dev/kbd/kbd.c optional ukbd
@ -223,7 +224,6 @@ i386/isa/gsc.c count gsc
i386/isa/if_ar.c optional ar
i386/isa/if_cx.c optional cx
i386/isa/if_el.c count el
i386/isa/if_fe.c count fe
i386/isa/if_le.c count le
i386/isa/if_rdp.c count rdp
i386/isa/if_sr.c count sr

File diff suppressed because it is too large Load Diff

1018
sys/dev/fe/if_fe_cbus.c Normal file

File diff suppressed because it is too large Load Diff

1063
sys/dev/fe/if_fe_isa.c Normal file

File diff suppressed because it is too large Load Diff

277
sys/dev/fe/if_fe_pccard.c Normal file
View File

@ -0,0 +1,277 @@
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
*
* This software may be used, modified, copied, distributed, and sold, in
* both source and binary form provided that the above copyright, these
* terms and the following disclaimer are retained. The name of the author
* and/or the contributor may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND THE CONTRIBUTOR ``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 THE CONTRIBUTOR 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$
*/
#include "opt_fe.h"
#include "opt_inet.h"
#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <machine/clock.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <machine/resource.h>
#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_mib.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <net/bpf.h>
#include <i386/isa/ic/mb86960.h>
#include <dev/fe/if_fereg.h>
#include <dev/fe/if_fevar.h>
#include <dev/pccard/pccardvar.h>
#include <pccard/cardinfo.h>
#include <pccard/slot.h>
/*
* PC-Card (PCMCIA) specific code.
*/
static int fe_pccard_probe(device_t);
static int fe_pccard_attach(device_t);
static int fe_pccard_detach(device_t);
static device_method_t fe_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, fe_pccard_probe),
DEVMETHOD(device_attach, fe_pccard_attach),
DEVMETHOD(device_detach, fe_pccard_detach),
{ 0, 0 }
};
static driver_t fe_pccard_driver = {
"fe",
fe_pccard_methods,
sizeof (struct fe_softc)
};
DRIVER_MODULE(fe, pccard, fe_pccard_driver, fe_devclass, 0, 0);
static int fe_probe_mbh(device_t);
static int fe_probe_tdk(device_t);
/*
* Initialize the device - called from Slot manager.
*/
static int
fe_pccard_probe(device_t dev)
{
struct fe_softc *sc;
int error;
/* Prepare for the device probe process. */
sc = device_get_softc(dev);
sc->sc_unit = device_get_unit(dev);
pccard_get_ether(dev, sc->sc_enaddr);
/* Probe for supported cards. */
if ((error = fe_probe_mbh(dev)) == 0)
goto end;
fe_release_resource(dev);
if ((error = fe_probe_tdk(dev)) == 0)
goto end;
fe_release_resource(dev);
end:
if (error == 0)
error = fe_alloc_irq(dev, 0);
fe_release_resource(dev);
return (error);
}
static int
fe_pccard_attach(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
if (sc->port_used)
fe_alloc_port(dev, sc->port_used);
fe_alloc_irq(dev, 0);
return fe_attach(dev);
}
/*
* feunload - unload the driver and clear the table.
* XXX TODO:
* This is usually called when the card is ejected, but
* can be caused by a modunload of a controller driver.
* The idea is to reset the driver's view of the device
* and ensure that any driver entry points such as
* read and write do not hang.
*/
static int
fe_pccard_detach(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
struct ifnet *ifp = &sc->arpcom.ac_if;
fe_stop(sc);
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
fe_release_resource(dev);
return 0;
}
/*
* Probe and initialization for Fujitsu MBH10302 PCMCIA Ethernet interface.
* Note that this is for 10302 only; MBH10304 is handled by fe_probe_tdk().
*/
static void
fe_init_mbh(struct fe_softc *sc)
{
/* Minimal initialization of 86960. */
DELAY(200);
fe_outb(sc, FE_DLCR6, sc->proto_dlcr6 | FE_D6_DLC_DISABLE);
DELAY(200);
/* Disable all interrupts. */
fe_outb(sc, FE_DLCR2, 0);
fe_outb(sc, FE_DLCR3, 0);
/* Enable master interrupt flag. */
fe_outb(sc, FE_MBH0, FE_MBH0_MAGIC | FE_MBH0_INTR_ENABLE);
}
static int
fe_probe_mbh(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
static struct fe_simple_probe_struct probe_table [] = {
{ FE_DLCR2, 0x58, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
{ FE_DLCR6, 0xFF, 0xB6 },
{ 0 }
};
/* MBH10302 occupies 32 I/O addresses. */
if (fe_alloc_port(dev, 32))
return ENXIO;
/* Ethernet MAC address should *NOT* have been given by pccardd,
if this is a true MBH10302; i.e., Ethernet address must be
"all-zero" upon entry. */
if (sc->sc_enaddr[0] || sc->sc_enaddr[1] || sc->sc_enaddr[2] ||
sc->sc_enaddr[3] || sc->sc_enaddr[4] || sc->sc_enaddr[5])
return ENXIO;
/* Fill the softc struct with default values. */
fe_softc_defaults(sc);
/*
* See if MBH10302 is on its address.
* I'm not sure the following probe code works. FIXME.
*/
if (!fe_simple_probe(sc, probe_table))
return ENXIO;
/* Get our station address from EEPROM. */
fe_inblk(sc, FE_MBH10, sc->sc_enaddr, ETHER_ADDR_LEN);
/* Make sure we got a valid station address. */
if (!valid_Ether_p(sc->sc_enaddr, 0))
return ENXIO;
/* Determine the card type. */
sc->type = FE_TYPE_MBH;
sc->typestr = "MBH10302 (PCMCIA)";
/* We seems to need our own IDENT bits... FIXME. */
sc->proto_dlcr7 = FE_D7_BYTSWP_LH | FE_D7_IDENT_NICE;
/* Setup hooks. We need a special initialization procedure. */
sc->init = fe_init_mbh;
return 0;
}
/*
* Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface.
* by MASUI Kenji <masui@cs.titech.ac.jp>
*
* (Contec uses TDK Ethenet chip -- hosokawa)
*
* This version of fe_probe_tdk has been rewrote to handle
* *generic* PC card implementation of Fujitsu MB8696x family. The
* name _tdk is just for a historical reason. :-)
*/
static int
fe_probe_tdk (device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
static struct fe_simple_probe_struct probe_table [] = {
{ FE_DLCR2, 0x50, 0x00 },
{ FE_DLCR4, 0x08, 0x00 },
/* { FE_DLCR5, 0x80, 0x00 }, Does not work well. */
{ 0 }
};
/* C-NET(PC)C occupies 16 I/O addresses. */
if (fe_alloc_port(dev, 16))
return ENXIO;
/* Fill the softc struct with default values. */
fe_softc_defaults(sc);
/*
* See if C-NET(PC)C is on its address.
*/
if (!fe_simple_probe(sc, probe_table))
return ENXIO;
/* Determine the card type. */
sc->type = FE_TYPE_TDK;
sc->typestr = "Generic MB8696x/78Q837x Ethernet (PCMCIA)";
/* Make sure we got a valid station address. */
if (!valid_Ether_p(sc->sc_enaddr, 0))
return ENXIO;
return 0;
}

View File

@ -76,6 +76,7 @@
/* Card config register #1: IRQ enable */
#define FE_FMV3_IRQENB 0x80 /* IRQ enable. */
/*
* Register(?) specific to AT1700/RE2000.
*/
@ -95,6 +96,7 @@
#define FE_ATI_MODEL_AT1700FT 0x02
#define FE_ATI_MODEL_AT1700AT 0x03
/*
* Registers on MBH10302.
*/
@ -110,9 +112,55 @@
#define FE_MBH0_INTR_ENABLE 0x10 /* Enable interrupts. */
#define FE_MBH0_INTR_DISABLE 0x00 /* Disable interrupts. */
/*
* Registers on RE1000. (*NOT* on RE1000 Plus.)
*/
/* IRQ configuration. */
#define FE_RE1000_IRQCONF 0x10
/*
* Fujitsu MB86965 JLI mode support routines.
*/
/* Datasheet for 86965 explicitly states that it only supports serial
* EEPROM with 16 words (32 bytes) capacity. (I.e., 93C06.) However,
* ones with 64 words (128 bytes) are available in the marked, namely
* 93C46, and are also fully compatible with 86965. It is known that
* some boards (e.g., ICL) actually have 93C46 on them and use extra
* storage to keep various config info. */
#define JLI_EEPROM_SIZE 128
/*
* SSi 78Q8377A support routines.
*/
#define SSI_EEPROM_SIZE 512
#define SSI_DIN 0x01
#define SSI_DAT 0x01
#define SSI_CSL 0x02
#define SSI_CLK 0x04
#define SSI_EEP 0x10
#define FE_SSI_EEP_IRQ 9 /* Irq ??? */
#define FE_SSI_EEP_ADDR 16 /* Station(MAC) address */
#define FE_SSI_EEP_DUPLEX 25 /* Duplex mode ??? */
/*
* TDK/LANX boards support routines.
*/
/* AX012/AX013 equips an X24C01 chip, which has 128 bytes of memory cells. */
#define LNX_EEPROM_SIZE 128
/* Bit assignments and command definitions for the serial EEPROM
interface register in LANX ASIC. */
#define LNX_SDA_HI 0x08 /* Drive SDA line high (logical 1.) */
#define LNX_SDA_LO 0x00 /* Drive SDA line low (logical 0.) */
#define LNX_SDA_FL 0x08 /* Float (don't drive) SDA line. */
#define LNX_SDA_IN 0x01 /* Mask for reading SDA line. */
#define LNX_CLK_HI 0x04 /* Drive clock line high (active.) */
#define LNX_CLK_LO 0x00 /* Drive clock line low (inactive.) */

182
sys/dev/fe/if_fevar.h Normal file
View File

@ -0,0 +1,182 @@
/*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
*
* This software may be used, modified, copied, distributed, and sold, in
* both source and binary form provided that the above copyright, these
* terms and the following disclaimer are retained. The name of the author
* and/or the contributor may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND THE CONTRIBUTOR ``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 THE CONTRIBUTOR 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$
*/
/* How many registers does an fe-supported adapter have at maximum? */
#define MAXREGISTERS 32
/* Shouldn't these be defined somewhere else such as isa_device.h? */
#define NO_IRQ 0
/* Flags for stability. */
#define UNSTABLE_IRQ 0x01 /* IRQ setting may be incorrect. */
#define UNSTABLE_MAC 0x02 /* Probed MAC address may be incorrect. */
#define UNSTABLE_TYPE 0x04 /* Probed vendor/model may be incorrect. */
/* Mapping between media bitmap (in fe_softc.mbitmap) and ifm_media. */
#define MB_HA 0x0001
#define MB_HM 0x0002
#define MB_HT 0x0004
#define MB_H2 0x0008
#define MB_H5 0x0010
#define MB_HF 0x0020
#define MB_FT 0x0040
/* Card types. */
#define FE_TYPE_SSI 1
#define FE_TYPE_JLI 2
#define FE_TYPE_FMV 3
#define FE_TYPE_LNX 4
#define FE_TYPE_UBN 5
#define FE_TYPE_GWY 6
#define FE_TYPE_MBH 7
#define FE_TYPE_TDK 8
#define FE_TYPE_RE1000 9
#define FE_TYPE_CNET9NE 10
#define FE_TYPE_REX 11
/*
* Data type for a multicast address filter on 8696x.
*/
struct fe_filter {
u_char data [FE_FILTER_LEN];
};
/*
* fe_softc: per line info and status
*/
struct fe_softc {
/* Used by "common" codes. */
struct arpcom arpcom; /* Ethernet common */
/* Used by config codes. */
int type;
int port_used;
struct resource * port_res;
bus_space_tag_t iot;
bus_space_handle_t ioh;
struct resource * irq_res;
void * irq_handle;
/* Set by probe() and not modified in later phases. */
char const * typestr; /* printable name of the interface. */
u_short txb_size; /* size of TX buffer, in bytes */
u_char proto_dlcr4; /* DLCR4 prototype. */
u_char proto_dlcr5; /* DLCR5 prototype. */
u_char proto_dlcr6; /* DLCR6 prototype. */
u_char proto_dlcr7; /* DLCR7 prototype. */
u_char proto_bmpr13; /* BMPR13 prototype. */
u_char stability; /* How stable is this? */
u_short priv_info; /* info specific to a vendor/model. */
/* Vendor/model specific hooks. */
void (*init)(struct fe_softc *); /* Just before fe_init(). */
void (*stop)(struct fe_softc *); /* Just after fe_stop(). */
/* Transmission buffer management. */
u_short txb_free; /* free bytes in TX buffer */
u_char txb_count; /* number of packets in TX buffer */
u_char txb_sched; /* number of scheduled packets */
/* Excessive collision counter (see fe_tint() for details.) */
u_char tx_excolls; /* # of excessive collisions. */
/* Multicast address filter management. */
u_char filter_change; /* MARs must be changed ASAP. */
struct fe_filter filter;/* new filter value. */
/* Network management. */
struct ifmib_iso_8802_3 mibdata;
/* Media information. */
struct ifmedia media; /* used by if_media. */
u_short mbitmap; /* bitmap for supported media; see bit2media */
int defmedia; /* default media */
void (* msel)(struct fe_softc *); /* media selector. */
};
#define sc_if arpcom.ac_if
#define sc_unit arpcom.ac_if.if_unit
#define sc_enaddr arpcom.ac_enaddr
struct fe_simple_probe_struct {
u_char port; /* Offset from the base I/O address. */
u_char mask; /* Bits to be checked. */
u_char bits; /* Values to be compared against. */
};
extern devclass_t fe_devclass;
int fe_attach(device_t);
int fe_alloc_port(device_t, int);
int fe_alloc_irq(device_t, int);
void fe_release_resource(device_t);
int fe_simple_probe(struct fe_softc const *,
struct fe_simple_probe_struct const *);
int valid_Ether_p(u_char const *, unsigned);
void fe_softc_defaults(struct fe_softc *);
void fe_stop(struct fe_softc *sc);
void fe_irq_failure(char const *, int, int, char const *);
void fe_msel_965(struct fe_softc *);
void fe_read_eeprom_jli(struct fe_softc *, u_char *);
void fe_init_jli(struct fe_softc *);
void fe_read_eeprom_ssi(struct fe_softc *, u_char *);
void fe_read_eeprom_lnx(struct fe_softc *, u_char *);
void fe_init_lnx(struct fe_softc *);
void fe_init_ubn(struct fe_softc *);
#define fe_inb(sc, port) \
bus_space_read_1((sc)->iot, (sc)->ioh, (port))
#define fe_outb(sc, port, value) \
bus_space_write_1((sc)->iot, (sc)->ioh, (port), (value))
#define fe_inw(sc, port) \
bus_space_read_2((sc)->iot, (sc)->ioh, (port))
#define fe_outw(sc, port, value) \
bus_space_write_2((sc)->iot, (sc)->ioh, (port), (value))
#define fe_insb(sc, port, addr, count) \
bus_space_read_multi_1((sc)->iot, (sc)->ioh, (port), (addr), (count))
#define fe_outsb(sc, port, addr, count) \
bus_space_write_multi_1((sc)->iot, (sc)->ioh, (port), (addr), (count))
#define fe_insw(sc, port, addr, count) \
bus_space_read_multi_2((sc)->iot, (sc)->ioh, (port), (addr), (count))
#define fe_outsw(sc, port, addr, count) \
bus_space_write_multi_2((sc)->iot, (sc)->ioh, (port), (addr), (count))
#define fe_inblk(sc, port, addr, count) \
bus_space_read_region_1((sc)->iot, (sc)->ioh, (port), (addr), (count))
#define fe_outblk(sc, port, addr, count) \
bus_space_write_region_1((sc)->iot, (sc)->ioh, (port), (addr), (count))

File diff suppressed because it is too large Load Diff

View File

@ -1,118 +0,0 @@
/*
* Hardware specification of various 8696x based Ethernet cards.
* Contributed by M. Sekiguchi <seki@sysrap.cs.fujitsu.co.jp>
*
* All Rights Reserved, Copyright (C) Fujitsu Limited 1995
*
* This software may be used, modified, copied, distributed, and sold,
* in both source and binary form provided that the above copyright,
* these terms and the following disclaimer are retained. The name of
* the author and/or the contributor may not be used to endorse or
* promote products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND THE CONTRIBUTOR ``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 THE CONTRIBUTOR 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$ */
/*
* Registers on FMV-180 series' ISA bus interface ASIC.
* I'm not sure the following register names are appropriate.
* Doesn't it look silly, eh? FIXME.
*/
#define FE_FMV0 16 /* Card status register #0 */
#define FE_FMV1 17 /* Card status register #1 */
#define FE_FMV2 18 /* Card config register #0 */
#define FE_FMV3 19 /* Card config register #1 */
#define FE_FMV4 20 /* Station address #1 */
#define FE_FMV5 21 /* Station address #2 */
#define FE_FMV6 22 /* Station address #3 */
#define FE_FMV7 23 /* Station address #4 */
#define FE_FMV8 24 /* Station address #5 */
#define FE_FMV9 25 /* Station address #6 */
#define FE_FMV10 26 /* Buffer RAM control register */
#define FE_FMV11 27 /* Buffer RAM data register */
/*
* FMV-180 series' ASIC register values.
*/
/* FMV0: Card status register #0: Misc info? */
#define FE_FMV0_MEDIA 0x07 /* Supported physical media. */
#define FE_FMV0_PRRDY 0x10 /* ??? */
#define FE_FMV0_PRERR 0x20 /* ??? */
#define FE_FMV0_ERRDY 0x40 /* ??? */
#define FE_FMV0_IREQ 0x80 /* ??? */
#define FE_FMV0_MEDIUM_5 0x01 /* 10base5/Dsub */
#define FE_FMV0_MEDIUM_2 0x02 /* 10base2/BNC */
#define FE_FMV0_MEDIUM_T 0x04 /* 10baseT/RJ45 */
/* Card status register #1: Hardware revision. */
#define FE_FMV1_REV 0x0F /* Card revision */
#define FE_FMV1_UPPER 0xF0 /* Usage unknown */
/* Card config register #0: I/O port address assignment. */
#define FE_FMV2_IOS 0x07 /* I/O selection. */
#define FE_FMV2_MES 0x38 /* ??? boot ROM? */
#define FE_FMV2_IRS 0xC0 /* IRQ selection. */
#define FE_FMV2_IOS_SHIFT 0
#define FE_FMV2_MES_SHIFT 3
#define FE_FMV2_IRS_SHIFT 6
/* Card config register #1: IRQ enable */
#define FE_FMV3_IRQENB 0x80 /* IRQ enable. */
/*
* Register(?) specific to AT1700/RE2000.
*/
#define FE_ATI_RESET 0x1F /* Write to reset the 86965. */
/* EEPROM allocation (offsets) of AT1700/RE2000. */
#define FE_ATI_EEP_ADDR 0x08 /* Station address. (8-13) */
#define FE_ATI_EEP_MEDIA 0x18 /* Media type. */
#define FE_ATI_EEP_MAGIC 0x19 /* XXX Magic. */
#define FE_ATI_EEP_MODEL 0x1e /* Hardware type. */
#define FE_ATI_EEP_REVISION 0x1f /* Hardware revision. */
/* Value for FE_ATI_EEP_MODEL. */
#define FE_ATI_MODEL_AT1700T 0x00
#define FE_ATI_MODEL_AT1700BT 0x01
#define FE_ATI_MODEL_AT1700FT 0x02
#define FE_ATI_MODEL_AT1700AT 0x03
/*
* Registers on MBH10302.
*/
#define FE_MBH0 0x10 /* ??? Including interrupt. */
#define FE_MBH1 0x11 /* ??? */
#define FE_MBH10 0x1A /* Station address. (10 - 15) */
/* Values to be set in MBH0 register. */
#define FE_MBH0_MAGIC 0x0D /* Just a magic constant? */
#define FE_MBH0_INTR 0x10 /* Master interrupt control. */
#define FE_MBH0_INTR_ENABLE 0x10 /* Enable interrupts. */
#define FE_MBH0_INTR_DISABLE 0x00 /* Disable interrupts. */
/*
* Registers on RE1000. (*NOT* on RE1000 Plus.)
*/
/* IRQ configuration. */
#define FE_RE1000_IRQCONF 0x10