From b60bd51513c0873fa3caf2031042bd445faf463f Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Sun, 7 Aug 2016 16:08:27 +0200
Subject: [PATCH 3/8] kernel: Remove the old ep(4) and ex(4) network drivers.

Aside from being quite obsolete, their documentation always was in the
i386 so i have my doubts that they still work.

If anyone needs them back for some reason I can't imagine currently,
we can take another look then.
---
 Makefile_upgrade.inc            |   1 +
 UPDATING                        |  11 +-
 share/man/man4/sn.4             |   1 -
 sys/conf/files                  |   4 -
 sys/config/LINT64               |   6 +-
 sys/config/X86_64_GENERIC       |   1 -
 sys/dev/netif/Makefile          |   2 +-
 sys/dev/netif/ep/Makefile       |   5 -
 sys/dev/netif/ep/if_ep.c        | 908 ----------------------------------------
 sys/dev/netif/ep/if_ep_pccard.c | 300 -------------
 sys/dev/netif/ep/if_epreg.h     | 433 -------------------
 sys/dev/netif/ep/if_epvar.h     |  80 ----
 sys/dev/netif/ex/if_ex.c        | 906 ---------------------------------------
 sys/dev/netif/ex/if_ex_pccard.c | 194 ---------
 sys/dev/netif/ex/if_exreg.h     | 206 ---------
 sys/dev/netif/ex/if_exvar.h     |  88 ----
 16 files changed, 9 insertions(+), 3137 deletions(-)
 delete mode 100644 sys/dev/netif/ep/Makefile
 delete mode 100644 sys/dev/netif/ep/if_ep.c
 delete mode 100644 sys/dev/netif/ep/if_ep_pccard.c
 delete mode 100644 sys/dev/netif/ep/if_epreg.h
 delete mode 100644 sys/dev/netif/ep/if_epvar.h
 delete mode 100644 sys/dev/netif/ex/if_ex.c
 delete mode 100644 sys/dev/netif/ex/if_ex_pccard.c
 delete mode 100644 sys/dev/netif/ex/if_exreg.h
 delete mode 100644 sys/dev/netif/ex/if_exvar.h

diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc
index c687fed..9080a72 100644
--- a/Makefile_upgrade.inc
+++ b/Makefile_upgrade.inc
@@ -3121,6 +3121,7 @@ TO_REMOVE+=/usr/share/openssl/man/man3/d2i_509_CRL_fp.3.gz
 TO_REMOVE+=/usr/share/openssl/man/man3/EVP_PKEY_ctrl.3.gz
 TO_REMOVE+=/usr/share/openssl/man/man3/EVP_PKEY_ctrl_str.3.gz
 TO_REMOVE+=/usr/include/emulation
+TO_REMOVE+=/boot/kernel/if_ep.ko
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
diff --git a/UPDATING b/UPDATING
index 5b64336..0216aec 100644
--- a/UPDATING
+++ b/UPDATING
@@ -12,12 +12,13 @@
 +         UPGRADING DRAGONFLY FROM 4.6 TO LATER VERSIONS                +
 +-----------------------------------------------------------------------+
 
-CS DRIVER REMOVED
------------------
+CS and EX DRIVERS REMOVED
+-------------------------
 
-The cs(4) driver has been removed. It's old and seems to be i386
-specific, but it was in X86_64_GENERIC, so custom configurations
-derived from it have to be adjusted.
+The cs(4) and ex(4) drivers have been removed. Both were very old and
+its doubtful they ever worked properly in x86_64 but both were in
+X86_64_GENERIC, so custom configurations derived from it have to be
+adjusted.
 
 +-----------------------------------------------------------------------+
 +         UPGRADING DRAGONFLY FROM 4.4 TO LATER VERSIONS                +
diff --git a/share/man/man4/sn.4 b/share/man/man4/sn.4
index a985070..02618ff 100644
--- a/share/man/man4/sn.4
+++ b/share/man/man4/sn.4
@@ -38,7 +38,6 @@ The
 device driver supports SMC9xxx based PCMCIA cards.
 .Sh SEE ALSO
 .Xr ed 4 ,
-.Xr ep 4 ,
 .Xr intro 4 ,
 .Xr ng_ether 4 ,
 .Xr vx 4 ,
diff --git a/sys/conf/files b/sys/conf/files
index 8d7475f..1cb3cee 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -371,8 +371,6 @@ dev/misc/dcons/dcons_crom.c	optional dcons_crom
 dev/misc/dcons/dcons_os.c	optional dcons
 dev/raid/dpt/dpt_scsi.c	optional dpt
 dev/raid/dpt/dpt_pci.c	optional dpt pci
-dev/netif/ep/if_ep.c		optional ep
-dev/netif/ep/if_ep_pccard.c	optional ep pccard
 dev/netif/em/if_em.c		optional em
 dev/netif/emx/if_emx.c		optional emx
 dev/netif/igb/if_igb.c		optional igb
@@ -407,8 +405,6 @@ dev/netif/ig_hal/e1000_osdep.c	optional ig_hal
 dev/netif/ig_hal/e1000_phy.c	optional ig_hal
 dev/netif/ig_hal/e1000_vf.c	optional ig_hal
 dev/netif/et/if_et.c		optional et
-dev/netif/ex/if_ex.c		optional ex
-dev/netif/ex/if_ex_pccard.c	optional ex pccard
 bus/firewire/firewire.c		optional firewire
 bus/firewire/fwcrom.c		optional firewire
 bus/firewire/fwdev.c		optional firewire
diff --git a/sys/config/LINT64 b/sys/config/LINT64
index 635b1f8..02373e6 100644
--- a/sys/config/LINT64
+++ b/sys/config/LINT64
@@ -1111,10 +1111,8 @@ options 	COM_MULTIPORT		#code for some cards with shared IRQs
 device		puc
 
 #
-# Network interfaces: `ed', `ep', `is', `lnc'
+# Network interfaces: `ed', `is', `lnc'
 #
-# ep: 3Com 3C509
-# ex: Intel EtherExpress Pro/10 and other i82595-based adapters
 # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 & Am79C960)
 # sbsh: Granch SBNI16 SHDSL modem PCI adapters
 # wi: Lucent WaveLAN/IEEE 802.11 PCMCIA adapters. Note: this supports both
@@ -1122,8 +1120,6 @@ device		puc
 #     bridge with a PCMCIA adapter plugged into it.
 # xe: Xircom/Intel EtherExpress Pro100/16 PC Card ethernet controller.
 #
-device ep
-device ex
 device lnc
 device sln
 device sn
diff --git a/sys/config/X86_64_GENERIC b/sys/config/X86_64_GENERIC
index ac86b86..e6381a9 100644
--- a/sys/config/X86_64_GENERIC
+++ b/sys/config/X86_64_GENERIC
@@ -250,7 +250,6 @@ device		bge		# Broadcom BCM570x (``Tigon III'')
 device		stge		# Sundance/Tamarack TC9021 Gigabit Ethernet
 device		msk		# Marvell/SysKonnect Yukon II Gigabit Ethernet
 device		nfe		# NVIDIA nForce MCP 10/100/Gigabit Ethernet
-device		ex
 device		xe		# Xircom Ethernet
 
 # Wireless NIC cards
diff --git a/sys/dev/netif/Makefile b/sys/dev/netif/Makefile
index d8d2964..5b7f293 100644
--- a/sys/dev/netif/Makefile
+++ b/sys/dev/netif/Makefile
@@ -1,5 +1,5 @@
 SUBDIR= age alc ale bce bfe bge \
-	dc em ep et \
+	dc em et \
 	fwe fxp ic jme lge lnc \
 	mii_layer my msk mxge nfe nge oce pcn \
 	re rl sbsh sf sis sk sln ste stge ti tl tx txp \
diff --git a/sys/dev/netif/ep/Makefile b/sys/dev/netif/ep/Makefile
deleted file mode 100644
index 4b4d33c..0000000
--- a/sys/dev/netif/ep/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-KMOD	= if_ep
-SRCS	= if_ep.c if_ep_pccard.c
-SRCS	+= device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h
-
-.include <bsd.kmod.mk>
diff --git a/sys/dev/netif/ep/if_ep.c b/sys/dev/netif/ep/if_ep.c
deleted file mode 100644
index f50e642..0000000
--- a/sys/dev/netif/ep/if_ep.c
+++ /dev/null
@@ -1,908 +0,0 @@
-/*
- * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca>
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by Herb Peyerl.
- * 4. The name of Herb Peyerl 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 ``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 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.
- *
- *	if_ep.c,v 1.19 1995/01/24 20:53:45 davidg Exp
- */
-
-/*
- *	Modified from the FreeBSD 1.1.5.1 version by:
- *		 	Andres Vega Garcia
- *			INRIA - Sophia Antipolis, France
- *			avega@sophia.inria.fr
- */
-
-/*
- * $FreeBSD: src/sys/dev/ep/if_ep.c,v 1.95.2.3 2002/03/06 07:26:35 imp Exp $
- *
- *  Promiscuous mode added and interrupt logic slightly changed
- *  to reduce the number of adapter failures. Transceiver select
- *  logic changed to use value from EEPROM. Autoconfiguration
- *  features added.
- *  Done by:
- *          Serge Babkin
- *          Chelindbank (Chelyabinsk, Russia)
- *          babkin@hq.icb.chel.su
- */
-
-/*
- * Pccard support for 3C589 by:
- *		HAMADA Naoki
- *		nao@tom-yam.or.jp
- */
-
-/*
- * MAINTAINER: Matthew N. Dodd <winter@jurai.net>
- *                             <mdodd@FreeBSD.org>
- */
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/rman.h> 
-#include <sys/thread2.h>
-
-#include <net/if.h>
-#include <net/ifq_var.h>
-#include <net/if_arp.h>
-#include <net/if_media.h> 
-#include <net/ethernet.h>
-#include <net/bpf.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-#include <machine/clock.h>
-
-#include "if_epreg.h"
-#include "if_epvar.h"
-#include "../elink_layer/elink.h"
-
-/* Exported variables */
-devclass_t ep_devclass;
-
-#if 0
-static char *	ep_conn_type[] = {"UTP", "AUI", "???", "BNC"};
-static int	if_media2ep_media[] = { 0, 0, 0, UTP, BNC, AUI };
-#endif
-
-static int	ep_media2if_media[] =
-	{ IFM_10_T, IFM_10_5, IFM_NONE, IFM_10_2, IFM_NONE };
-
-/* if functions */
-static void	ep_if_init	(void *);
-static int	ep_if_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *);
-static void	ep_if_start	(struct ifnet *, struct ifaltq_subque *);
-static void	ep_if_watchdog	(struct ifnet *);
-
-/* if_media functions */
-static int	ep_ifmedia_upd	(struct ifnet *);
-static void	ep_ifmedia_sts	(struct ifnet *, struct ifmediareq *);
-
-static void	epstop		(struct ep_softc *);
-static void	epread		(struct ep_softc *);
-static int	eeprom_rdy	(struct ep_softc *);
-
-DECLARE_DUMMY_MODULE(if_ep);
-
-#define EP_FTST(sc, f)	(sc->stat &   (f))
-#define EP_FSET(sc, f)	(sc->stat |=  (f))
-#define EP_FRST(sc, f)	(sc->stat &= ~(f))
-
-static int
-eeprom_rdy(struct ep_softc *sc)
-{
-    int i;
-
-    for (i = 0; is_eeprom_busy(BASE) && i < MAX_EEPROMBUSY; i++) {
-	DELAY(100);
-    }
-    if (i >= MAX_EEPROMBUSY) {
-	if_printf(&sc->arpcom.ac_if, "eeprom failed to come ready.\n");
-	return (0);
-    }
-    return (1);
-}
-
-/*
- * get_e: gets a 16 bits word from the EEPROM. we must have set the window
- * before
- */
-u_int16_t
-get_e(struct ep_softc *sc, int offset)
-{
-    if (!eeprom_rdy(sc))
-	return (0);
-    outw(BASE + EP_W0_EEPROM_COMMAND, (EEPROM_CMD_RD << sc->epb.cmd_off) | offset);
-    if (!eeprom_rdy(sc))
-	return (0);
-    return (inw(BASE + EP_W0_EEPROM_DATA));
-}
-
-void
-ep_get_macaddr(struct ep_softc *sc, uint8_t *addr)
-{
-	int			i;
-	u_int16_t * 		macaddr = (u_int16_t *)addr;
-
-	GO_WINDOW(0);
-        for(i = EEPROM_NODE_ADDR_0; i <= EEPROM_NODE_ADDR_2; i++) {
-		macaddr[i] = htons(get_e(sc, i));
-        }
-
-	return;
-}
-
-int
-ep_alloc(device_t dev)
-{
-	struct ep_softc	*	sc = device_get_softc(dev);
-	int			rid;
-	int			error = 0;
-
-        rid = 0;
-        sc->iobase = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
-	    RF_ACTIVE);
-        if (!sc->iobase) {
-                device_printf(dev, "No I/O space?!\n");
-		error = ENXIO;
-                goto bad;
-        }
-
-        rid = 0;
-        sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
-        if (!sc->irq) {
-                device_printf(dev, "No irq?!\n");
-		error = ENXIO;
-                goto bad;
-        }
-
-	if_initname(&sc->arpcom.ac_if,
-		    device_get_name(dev), device_get_unit(dev));
-        sc->stat = 0;   /* 16 bit access */
-
-        sc->ep_io_addr = rman_get_start(sc->iobase);
-
-        sc->ep_btag = rman_get_bustag(sc->iobase);
-        sc->ep_bhandle = rman_get_bushandle(sc->iobase);
-
-	sc->ep_connectors = 0;
-	sc->ep_connector = 0;
-
-        GO_WINDOW(0);
-	sc->epb.cmd_off = 0;
-	sc->epb.prod_id = get_e(sc, EEPROM_PROD_ID);
-	sc->epb.res_cfg = get_e(sc, EEPROM_RESOURCE_CFG);
-
-bad:
-	return (error);
-}
-
-void
-ep_get_media(struct ep_softc *sc)
-{
-	u_int16_t		config;
-	
-        GO_WINDOW(0);
-        config = inw(BASE + EP_W0_CONFIG_CTRL);
-        if (config & IS_AUI)
-                sc->ep_connectors |= AUI;
-        if (config & IS_BNC)
-                sc->ep_connectors |= BNC;
-        if (config & IS_UTP)
-                sc->ep_connectors |= UTP;
-
-        if (!(sc->ep_connectors & 7)) {
-		if (bootverbose)
-                	if_printf(&sc->arpcom.ac_if, "no connectors!\n");
-        }
-
-	/*
-	 * This works for most of the cards so we'll do it here.
-	 * The cards that require something different can override
-	 * this later on.
-	 */
-	sc->ep_connector = inw(BASE + EP_W0_ADDRESS_CFG) >> ACF_CONNECTOR_BITS;
-
-	return;
-}
-
-void
-ep_free(device_t dev)
-{
-	struct ep_softc	*	sc = device_get_softc(dev);
-
-	if (sc->iobase)
-		bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->iobase);
-	if (sc->irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq);
-
-	return;
-}
-	
-int
-ep_attach(struct ep_softc *sc)
-{
-	struct ifnet *		ifp = NULL;
-	struct ifmedia *	ifm = NULL;
-	u_short *		p;
-	uint8_t			ether_addr[ETHER_ADDR_LEN];
-	int			i;
-
-	sc->gone = 0;
-
-	ep_get_macaddr(sc, ether_addr);
-
-	/*
-	 * Setup the station address
-	 */
-	p = (u_short*)ether_addr;
-	GO_WINDOW(2);
-	for (i = 0; i < 3; i++) {
-		outw(BASE + EP_W2_ADDR_0 + (i * 2), ntohs(p[i]));
-	}
-  
-	ifp = &sc->arpcom.ac_if;
-
-	ifp->if_softc = sc;
-	ifp->if_mtu = ETHERMTU;
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	ifp->if_start = ep_if_start;
-	ifp->if_ioctl = ep_if_ioctl;
-	ifp->if_watchdog = ep_if_watchdog;
-	ifp->if_init = ep_if_init;
-	ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
-	ifq_set_ready(&ifp->if_snd);
-
-	if (!sc->epb.mii_trans) {
-		ifmedia_init(&sc->ifmedia, 0, ep_ifmedia_upd, ep_ifmedia_sts);
-
-		if (sc->ep_connectors & AUI)
-			ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_5, 0, NULL);
-		if (sc->ep_connectors & UTP)
-			ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
-		if (sc->ep_connectors & BNC)
-			ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_2, 0, NULL);
-		if (!sc->ep_connectors)
-			ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_NONE, 0, NULL);
-	
-		ifmedia_set(&sc->ifmedia, IFM_ETHER|ep_media2if_media[sc->ep_connector]);
-	
-		ifm = &sc->ifmedia;
-		ifm->ifm_media = ifm->ifm_cur->ifm_media;
-		ep_ifmedia_upd(ifp);
-	}
-
-	ether_ifattach(ifp, ether_addr, NULL);
-
-#ifdef EP_LOCAL_STATS
-	sc->rx_no_first = sc->rx_no_mbuf = sc->rx_bpf_disc =
-		sc->rx_overrunf = sc->rx_overrunl = sc->tx_underrun = 0;
-#endif
-	EP_FSET(sc, F_RX_FIRST);
-	sc->top = sc->mcur = 0;
-
-	return 0;
-}
-
-/*
- * The order in here seems important. Otherwise we may not receive
- * interrupts. ?!
- */
-static void
-ep_if_init(void *xsc)
-{
-    struct ep_softc *sc = xsc;
-    struct ifnet *ifp = &sc->arpcom.ac_if;
-    int i;
-
-    if (sc->gone)
-	return;
-
-    crit_enter();
-
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-
-    GO_WINDOW(0);
-    outw(BASE + EP_COMMAND, STOP_TRANSCEIVER);
-    GO_WINDOW(4);
-    outw(BASE + EP_W4_MEDIA_TYPE, DISABLE_UTP);
-    GO_WINDOW(0);
-
-    /* Disable the card */
-    outw(BASE + EP_W0_CONFIG_CTRL, 0);
-
-    /* Enable the card */
-    outw(BASE + EP_W0_CONFIG_CTRL, ENABLE_DRQ_IRQ);
-
-    GO_WINDOW(2);
-
-    /* Reload the ether_addr. */
-    for (i = 0; i < 6; i++)
-	outb(BASE + EP_W2_ADDR_0 + i, sc->arpcom.ac_enaddr[i]);
-
-    outw(BASE + EP_COMMAND, RX_RESET);
-    outw(BASE + EP_COMMAND, TX_RESET);
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-
-    /* Window 1 is operating window */
-    GO_WINDOW(1);
-    for (i = 0; i < 31; i++)
-	inb(BASE + EP_W1_TX_STATUS);
-
-    /* get rid of stray intr's */
-    outw(BASE + EP_COMMAND, ACK_INTR | 0xff);
-
-    outw(BASE + EP_COMMAND, SET_RD_0_MASK | S_5_INTS);
-
-    outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
-
-    if (ifp->if_flags & IFF_PROMISC)
-	outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
-	 FIL_GROUP | FIL_BRDCST | FIL_ALL);
-    else
-	outw(BASE + EP_COMMAND, SET_RX_FILTER | FIL_INDIVIDUAL |
-	 FIL_GROUP | FIL_BRDCST);
-
-    if (!sc->epb.mii_trans) {
-	ep_ifmedia_upd(ifp);
-    }
-
-    outw(BASE + EP_COMMAND, RX_ENABLE);
-    outw(BASE + EP_COMMAND, TX_ENABLE);
-
-    ifp->if_flags |= IFF_RUNNING;
-    ifq_clr_oactive(&ifp->if_snd);	/* just in case */
-
-#ifdef EP_LOCAL_STATS
-    sc->rx_no_first = sc->rx_no_mbuf =
-	sc->rx_overrunf = sc->rx_overrunl = sc->tx_underrun = 0;
-#endif
-    EP_FSET(sc, F_RX_FIRST);
-    if (sc->top) {
-	m_freem(sc->top);
-	sc->top = sc->mcur = 0;
-    }
-    outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_INIT_EARLY_THRESH);
-    outw(BASE + EP_COMMAND, SET_TX_START_THRESH | 16);
-
-    /*
-     * Store up a bunch of mbuf's for use later. (MAX_MBS). First we free up
-     * any that we had in case we're being called from intr or somewhere
-     * else.
-     */
-
-    GO_WINDOW(1);
-
-    if_devstart(ifp);
-
-    crit_exit();
-}
-
-static const char padmap[] = {0, 3, 2, 1};
-
-static void
-ep_if_start(struct ifnet *ifp, struct ifaltq_subque *ifsq)
-{
-    struct ep_softc *sc = ifp->if_softc;
-    u_int len;
-    struct mbuf *m;
-    struct mbuf *top;
-    int pad;
-
-    ASSERT_ALTQ_SQ_DEFAULT(ifp, ifsq);
-
-    if (sc->gone) {
-	ifq_purge(&ifp->if_snd);
-	return;
-    }
-
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-    if (ifq_is_oactive(&ifp->if_snd)) {
-	return;
-    }
-
-    crit_enter();
-
-startagain:
-    /* Sneak a peek at the next packet */
-    m = ifq_dequeue(&ifp->if_snd);
-    if (m == NULL) {
-	crit_exit();
-	return;
-    }
-
-    for (len = 0, top = m; m; m = m->m_next)
-	len += m->m_len;
-    m = top;
-
-    pad = padmap[len & 3];
-
-    /*
-     * The 3c509 automatically pads short packets to minimum ethernet length,
-     * but we drop packets that are too large. Perhaps we should truncate
-     * them instead?
-     */
-    if (len + pad > ETHER_MAX_LEN) {
-	/* packet is obviously too large: toss it */
-	IFNET_STAT_INC(ifp, oerrors, 1);
-	m_freem(m);
-	goto readcheck;
-    }
-    if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4) {
-	/* no room in FIFO */
-	outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | (len + pad + 4));
-	/* make sure */
-	if (inw(BASE + EP_W1_FREE_TX) < len + pad + 4) {
-	    ifq_set_oactive(&ifp->if_snd);
-	    ifq_prepend(&ifp->if_snd, top);
-	    crit_exit();
-	    return;
-	}
-    } else {
-	outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | EP_THRESH_DISABLE);
-    }
-
-    outw(BASE + EP_W1_TX_PIO_WR_1, len); 
-    outw(BASE + EP_W1_TX_PIO_WR_1, 0x0);	/* Second dword meaningless */
-
-    if (EP_FTST(sc, F_ACCESS_32_BITS)) {
-        for (top = m; m != NULL; m = m->m_next) {
-	    outsl(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t),
-		  m->m_len / 4);
-	    if (m->m_len & 3)
-		outsb(BASE + EP_W1_TX_PIO_WR_1,
-		      mtod(m, caddr_t) + (m->m_len & (~3)),
-		      m->m_len & 3);
-	}
-    } else {
-        for (top = m; m != NULL; m = m->m_next) {
-	    outsw(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 2);
-	    if (m->m_len & 1)
-		outb(BASE + EP_W1_TX_PIO_WR_1,
-		     *(mtod(m, caddr_t) + m->m_len - 1));
-	}
-    }
-
-    while (pad--)
-	outb(BASE + EP_W1_TX_PIO_WR_1, 0);	/* Padding */
-
-    BPF_MTAP(ifp, top);
-
-    ifp->if_timer = 2;
-    IFNET_STAT_INC(ifp, opackets, 1);
-    m_freem(top);
-
-    /*
-     * Is another packet coming in? We don't want to overflow the tiny RX
-     * fifo.
-     */
-readcheck:
-    if (inw(BASE + EP_W1_RX_STATUS) & RX_BYTES_MASK) {
-	/*
-	 * we check if we have packets left, in that case we prepare to come
-	 * back later
-	 */
-	if (!ifq_is_empty(&ifp->if_snd))
-	    outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
-
-        crit_exit();
-	return;
-    }
-    goto startagain;
-}
-
-void
-ep_intr(void *arg)
-{
-    struct ep_softc *sc = arg;
-    struct ifnet *ifp = &sc->arpcom.ac_if;
-    int status;
-
-     /*
-      * quick fix: Try to detect an interrupt when the card goes away.
-      */
-    if (sc->gone || inw(BASE + EP_STATUS) == 0xffff) {
-	    return;
-    }
-
-    outw(BASE + EP_COMMAND, SET_INTR_MASK); /* disable all Ints */
-
-rescan:
-
-    while ((status = inw(BASE + EP_STATUS)) & S_5_INTS) {
-
-	/* first acknowledge all interrupt sources */
-	outw(BASE + EP_COMMAND, ACK_INTR | (status & S_MASK));
-
-	if (status & (S_RX_COMPLETE | S_RX_EARLY))
-	    epread(sc);
-	if (status & S_TX_AVAIL) {
-	    /* we need ACK */
-	    ifp->if_timer = 0;
-	    ifq_clr_oactive(&ifp->if_snd);
-	    GO_WINDOW(1);
-	    inw(BASE + EP_W1_FREE_TX);
-	    if_devstart(ifp);
-	}
-	if (status & S_CARD_FAILURE) {
-	    ifp->if_timer = 0;
-#ifdef EP_LOCAL_STATS
-	    kprintf("\n");
-	    if_printf(ifp, "\n\tStatus: %x\n", status);
-	    GO_WINDOW(4);
-	    kprintf("\tFIFO Diagnostic: %x\n", inw(BASE + EP_W4_FIFO_DIAG));
-	    kprintf("\tStat: %x\n", sc->stat);
-	    kprintf("\tIpackets=%d, Opackets=%d\n",
-		ifp->if_ipackets, ifp->if_opackets);
-	    kprintf("\tNOF=%d, NOMB=%d, RXOF=%d, RXOL=%d, TXU=%d\n",
-		   sc->rx_no_first, sc->rx_no_mbuf, sc->rx_overrunf,
-		   sc->rx_overrunl, sc->tx_underrun);
-#else
-
-#ifdef DIAGNOSTIC
-	    if_printf(ifp, "Status: %x (input buffer overflow)\n", status);
-#else
-	    IFNET_STAT_INC(ifp, ierrors, 1);
-#endif
-
-#endif
-	    ep_if_init(sc);
-	    return;
-	}
-	if (status & S_TX_COMPLETE) {
-	    ifp->if_timer = 0;
-	    /* we  need ACK. we do it at the end */
-	    /*
-	     * We need to read TX_STATUS until we get a 0 status in order to
-	     * turn off the interrupt flag.
-	     */
-	    while ((status = inb(BASE + EP_W1_TX_STATUS)) & TXS_COMPLETE) {
-		if (status & TXS_SUCCES_INTR_REQ);
-		else if (status & (TXS_UNDERRUN | TXS_JABBER | TXS_MAX_COLLISION)) {
-		    outw(BASE + EP_COMMAND, TX_RESET);
-		    if (status & TXS_UNDERRUN) {
-#ifdef EP_LOCAL_STATS
-			sc->tx_underrun++;
-#endif
-		    } else {
-			if (status & TXS_JABBER);
-			else	/* TXS_MAX_COLLISION - we shouldn't get here */
-			    IFNET_STAT_INC(ifp, collisions, 1);
-		    }
-		    IFNET_STAT_INC(ifp, oerrors, 1);
-		    outw(BASE + EP_COMMAND, TX_ENABLE);
-		    /*
-		     * To have a tx_avail_int but giving the chance to the
-		     * Reception
-		     */
-		    if (!ifq_is_empty(&ifp->if_snd))
-			outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
-		}
-		outb(BASE + EP_W1_TX_STATUS, 0x0);	/* pops up the next
-							 * status */
-	    }			/* while */
-	    ifq_clr_oactive(&ifp->if_snd);
-	    GO_WINDOW(1);
-	    inw(BASE + EP_W1_FREE_TX);
-	    if_devstart(ifp);
-	}			/* end TX_COMPLETE */
-    }
-
-    outw(BASE + EP_COMMAND, C_INTR_LATCH);	/* ACK int Latch */
-
-    if ((status = inw(BASE + EP_STATUS)) & S_5_INTS)
-	goto rescan;
-
-    /* re-enable Ints */
-    outw(BASE + EP_COMMAND, SET_INTR_MASK | S_5_INTS);
-}
-
-static void
-epread(struct ep_softc *sc)
-{
-    struct mbuf *top, *mcur, *m;
-    struct ifnet *ifp;
-    int lenthisone;
-
-    short rx_fifo2, status;
-    short rx_fifo;
-
-    ifp = &sc->arpcom.ac_if;
-    status = inw(BASE + EP_W1_RX_STATUS);
-
-read_again:
-
-    if (status & ERR_RX) {
-	IFNET_STAT_INC(ifp, ierrors, 1);
-	if (status & ERR_RX_OVERRUN) {
-	    /*
-	     * we can think the rx latency is actually greather than we
-	     * expect
-	     */
-#ifdef EP_LOCAL_STATS
-	    if (EP_FTST(sc, F_RX_FIRST))
-		sc->rx_overrunf++;
-	    else
-		sc->rx_overrunl++;
-#endif
-	}
-	goto out;
-    }
-    rx_fifo = rx_fifo2 = status & RX_BYTES_MASK;
-
-    if (EP_FTST(sc, F_RX_FIRST)) {
-	m = m_getl(rx_fifo, M_NOWAIT, MT_DATA, M_PKTHDR, NULL);
-	if (!m)
-	    goto out;
-	sc->top = sc->mcur = top = m;
-#define EROUND  ((sizeof(struct ether_header) + 3) & ~3)
-#define EOFF    (EROUND - sizeof(struct ether_header))
-	top->m_data += EOFF;
-
-	/* Read what should be the header. */
-	insw(BASE + EP_W1_RX_PIO_RD_1,
-	     mtod(top, caddr_t), sizeof(struct ether_header) / 2);
-	top->m_len = sizeof(struct ether_header);
-	rx_fifo -= sizeof(struct ether_header);
-	sc->cur_len = rx_fifo2;
-    } else {
-	/* come here if we didn't have a complete packet last time */
-	top = sc->top;
-	m = sc->mcur;
-	sc->cur_len += rx_fifo2;
-    }
-
-    /* Reads what is left in the RX FIFO */
-    while (rx_fifo > 0) {
-	lenthisone = min(rx_fifo, M_TRAILINGSPACE(m));
-	if (lenthisone == 0) {	/* no room in this one */
-	    mcur = m;
-	    m = m_getl(rx_fifo, M_NOWAIT, MT_DATA, 0, NULL);
-	    if (!m)
-		goto out;
-	    m->m_len = 0;
-	    mcur->m_next = m;
-	    lenthisone = min(rx_fifo, M_TRAILINGSPACE(m));
-	}
-	if (EP_FTST(sc, F_ACCESS_32_BITS)) { /* default for EISA configured cards*/
-	    insl(BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len,
-		 lenthisone / 4);
-	    m->m_len += (lenthisone & ~3);
-	    if (lenthisone & 3)
-		insb(BASE + EP_W1_RX_PIO_RD_1,
-		     mtod(m, caddr_t) + m->m_len,
-		     lenthisone & 3);
-	    m->m_len += (lenthisone & 3);
-	} else {
-	    insw(BASE + EP_W1_RX_PIO_RD_1, mtod(m, caddr_t) + m->m_len,
-		 lenthisone / 2);
-	    m->m_len += lenthisone;
-	    if (lenthisone & 1)
-		*(mtod(m, caddr_t) + m->m_len - 1) = inb(BASE + EP_W1_RX_PIO_RD_1);
-	}
-	rx_fifo -= lenthisone;
-    }
-
-    if (status & ERR_RX_INCOMPLETE) {	/* we haven't received the complete
-					 * packet */
-	sc->mcur = m;
-#ifdef EP_LOCAL_STATS
-	sc->rx_no_first++;	/* to know how often we come here */
-#endif
-	EP_FRST(sc, F_RX_FIRST);
-	if (!((status = inw(BASE + EP_W1_RX_STATUS)) & ERR_RX_INCOMPLETE)) {
-	    /* we see if by now, the packet has completly arrived */
-	    goto read_again;
-	}
-	outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_NEXT_EARLY_THRESH);
-	return;
-    }
-    outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK);
-    IFNET_STAT_INC(ifp, ipackets, 1);
-    EP_FSET(sc, F_RX_FIRST);
-    top->m_pkthdr.rcvif = &sc->arpcom.ac_if;
-    top->m_pkthdr.len = sc->cur_len;
-
-    ifp->if_input(ifp, top, NULL, -1);
-    sc->top = 0;
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-    outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_INIT_EARLY_THRESH);
-    return;
-
-out:
-    outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK);
-    if (sc->top) {
-	m_freem(sc->top);
-	sc->top = 0;
-#ifdef EP_LOCAL_STATS
-	sc->rx_no_mbuf++;
-#endif
-    }
-    EP_FSET(sc, F_RX_FIRST);
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-    outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | RX_INIT_EARLY_THRESH);
-}
-
-static int 
-ep_ifmedia_upd(struct ifnet *ifp)
-{
-	struct ep_softc *	sc = ifp->if_softc;
-	int			i = 0, j;
-
-	GO_WINDOW(0);
-	outw(BASE + EP_COMMAND, STOP_TRANSCEIVER);
-	GO_WINDOW(4);
-	outw(BASE + EP_W4_MEDIA_TYPE, DISABLE_UTP);
-	GO_WINDOW(0);
-
-	switch (IFM_SUBTYPE(sc->ifmedia.ifm_media)) {
-		case IFM_10_T:
-			if (sc->ep_connectors & UTP) {
-				i = ACF_CONNECTOR_UTP;
-				GO_WINDOW(4);
-				outw(BASE + EP_W4_MEDIA_TYPE, ENABLE_UTP);
-			}
-			break;
-		case IFM_10_2:
-			if (sc->ep_connectors & BNC) {
-				i = ACF_CONNECTOR_BNC;
-				outw(BASE + EP_COMMAND, START_TRANSCEIVER);
-				DELAY(DELAY_MULTIPLE * 1000);
-			}
-			break;
-		case IFM_10_5:
-			if (sc->ep_connectors & AUI)
-				i = ACF_CONNECTOR_AUI;
-			break;
-		default:
-			i = sc->ep_connector;
-			if_printf(ifp, "strange connector type in EEPROM: "
-				  "assuming AUI\n");
-			break;
-	}
-
-	GO_WINDOW(0);
-	j = inw(BASE + EP_W0_ADDRESS_CFG) & 0x3fff;
-	outw(BASE + EP_W0_ADDRESS_CFG, j | (i << ACF_CONNECTOR_BITS));
-
-	return (0);
-}
-
-static void
-ep_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
-	struct ep_softc *	sc = ifp->if_softc;
-
-	ifmr->ifm_active = sc->ifmedia.ifm_media;
-
-	return;
-}
-
-static int
-ep_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr)
-{
-	struct ep_softc *	sc = ifp->if_softc;
-	struct ifreq *		ifr = (struct ifreq *)data;
-	int error = 0;
-
-	crit_enter();
-
-	switch (cmd) {
-	case SIOCSIFFLAGS:
-		if (((ifp->if_flags & IFF_UP) == 0) &&
-		    (ifp->if_flags & IFF_RUNNING)) {
-			ifp->if_flags &= ~IFF_RUNNING;
-			epstop(sc);
-		} else {
-			/* reinitialize card on any parameter change */
-			ep_if_init(sc);
-		}
-		break;
-#ifdef notdef
-	case SIOCGHWADDR:
-		bcopy((caddr_t) sc->sc_addr, (caddr_t) & ifr->ifr_data,
-		      sizeof(sc->sc_addr));
-		break;
-#endif
-	case SIOCADDMULTI:
-	case SIOCDELMULTI:
-		/*
-		 * The Etherlink III has no programmable multicast
-		 * filter.  We always initialize the card to be
-		 * promiscuous to multicast, since we're always a
-		 * member of the ALL-SYSTEMS group, so there's no
-		 * need to process SIOC*MULTI requests.
-		 */
-		error = 0;
-		break;
-	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA:
-		if (!sc->epb.mii_trans) {
-			error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, cmd);
-		} else {
-			error = EINVAL;
-		}
-		break;
-	default:
-		error = ether_ioctl(ifp, cmd, data);
-		break;
-	}
-
-	crit_exit();
-
-	return (error);
-}
-
-static void
-ep_if_watchdog(struct ifnet *ifp)
-{
-    struct ep_softc *sc = ifp->if_softc;
-
-    /*
-    if_printf(ifp, "watchdog\n");
-
-    log(LOG_ERR, "%s: watchdog\n", ifp->if_xname);
-    ifp->if_oerrors++;
-    */
-
-    if (sc->gone) {
-	return;
-    }
-
-    ifq_clr_oactive(&ifp->if_snd);
-    if_devstart(ifp);
-    ep_intr(ifp->if_softc);
-}
-
-static void
-epstop(struct ep_softc *sc)
-{
-    if (sc->gone) {
-	return;
-    }
-
-    outw(BASE + EP_COMMAND, RX_DISABLE);
-    outw(BASE + EP_COMMAND, RX_DISCARD_TOP_PACK);
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-    outw(BASE + EP_COMMAND, TX_DISABLE);
-    outw(BASE + EP_COMMAND, STOP_TRANSCEIVER);
-    outw(BASE + EP_COMMAND, RX_RESET);
-    outw(BASE + EP_COMMAND, TX_RESET);
-    while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-    outw(BASE + EP_COMMAND, C_INTR_LATCH);
-    outw(BASE + EP_COMMAND, SET_RD_0_MASK);
-    outw(BASE + EP_COMMAND, SET_INTR_MASK);
-    outw(BASE + EP_COMMAND, SET_RX_FILTER);
-}
diff --git a/sys/dev/netif/ep/if_ep_pccard.c b/sys/dev/netif/ep/if_ep_pccard.c
deleted file mode 100644
index fe667a0..0000000
--- a/sys/dev/netif/ep/if_ep_pccard.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca>
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by Herb Peyerl.
- * 4. The name of Herb Peyerl 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 ``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 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: src/sys/dev/ep/if_ep_pccard.c,v 1.12.2.2 2000/08/08 23:55:02 peter Exp $
- */
-
-/*
- * Pccard support for 3C589 by:
- *		HAMADA Naoki
- *		nao@tom-yam.or.jp
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/socket.h>
-#include <sys/module.h>
-#include <sys/interrupt.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
- 
-#include <net/ethernet.h>
-#include <net/if.h> 
-#include <net/if_arp.h>
-#include <net/if_media.h>
-#include <net/ifq_var.h>
-
-#include <machine/clock.h>
-
-#include "if_epreg.h"
-#include "if_epvar.h"
-
-#include <bus/pccard/pccardvar.h>
-
-#include "card_if.h"
-#include "pccarddevs.h"
-
-static const char *ep_pccard_identify(u_short id);
-
-/*
- * Initialize the device - called from Slot manager.
- */
-static int
-ep_pccard_probe(device_t dev)
-{
-	struct ep_softc *	sc = device_get_softc(dev);
-	struct ep_board *	epb = &sc->epb;
-	const char *		desc;
-	int			error;
-
-	error = ep_alloc(dev);
-	if (error)
-		return error;
-
-	/*
-	 * XXX - Certain (newer?) 3Com cards need epb->cmd_off ==
-	 * 2. Sadly, you need to have a correct cmd_off in order to
-	 * identify the card.  So we have to hit it with both and
-	 * cross our virtual fingers.  There's got to be a better way
-	 * to do this.  jyoung@accessus.net 09/11/1999 
-	 */
-
-	epb->cmd_off = 0;
-	epb->prod_id = get_e(sc, EEPROM_PROD_ID);
-	if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) {
-		if (bootverbose) 
-			device_printf(dev, "Pass 1 of 2 detection "
-			    "failed (nonfatal)\n");
-		epb->cmd_off = 2;
-		epb->prod_id = get_e(sc, EEPROM_PROD_ID);
-		if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) {
-			device_printf(dev, "Unit failed to come ready or "
-			    "product ID unknown! (id 0x%x)\n", epb->prod_id);
-			ep_free(dev);
-			return (ENXIO);
-		}
-	}
-	device_set_desc(dev, desc);
-
-	/*
-	 * For some reason the 3c574 needs this.
-	 */
-	ep_get_macaddr(sc, (u_char *)&sc->arpcom.ac_enaddr);
-
-	ep_free(dev);
-	return (0);
-}
-
-static const char *
-ep_pccard_identify(u_short id)
-{
-	/* Determine device type and associated MII capabilities  */
-	switch (id) {
-	case 0x6055: /* 3C556 */
-		return ("3Com 3C556");
-	case 0x4057: /* 3C574 */
-		return ("3Com 3C574");
-	case 0x4b57: /* 3C574B */
-		return ("3Com 3C574B, Megahertz 3CCFE574BT or "
-		    "Fast Etherlink 3C574-TX");
-	case 0x2b57: /* 3CXSH572BT */
-		return ("3Com OfficeConnect 572BT");
-	case 0x9058: /* 3C589 */
-		return ("3Com Etherlink III 3C589");
-	case 0x2056: /* 3C562/3C563 */
-		return ("3Com 3C562D/3C563D");
-	}
-	return (NULL);
-}
-
-static int
-ep_pccard_card_attach(struct ep_board *epb)
-{
-	/* Determine device type and associated MII capabilities  */
-	switch (epb->prod_id) {
-	case 0x6055: /* 3C556 */
-	case 0x2b57: /* 3C572BT */
-	case 0x4057: /* 3C574 */
-	case 0x4b57: /* 3C574B */
-		epb->mii_trans = 1;
-		return (1);
-	case 0x2056: /* 3C562D/3C563D */
-	case 0x9058: /* 3C589 */
-		epb->mii_trans = 0;
-		return (1);
-	}
-	return (0);
-}
-
-static int
-ep_pccard_attach(device_t dev)
-{
-	struct ep_softc *	sc = device_get_softc(dev);
-	struct ifnet *		ifp = &sc->arpcom.ac_if;
-	int			error = 0;
-
-	if ((error = ep_alloc(dev))) {
-		device_printf(dev, "ep_alloc() failed! (%d)\n", error);
-		goto bad;
-	}
-
-	sc->epb.cmd_off = 0;
-	sc->epb.prod_id = get_e(sc, EEPROM_PROD_ID);
-	if (!ep_pccard_card_attach(&sc->epb)) {
-		sc->epb.cmd_off = 2;
-		sc->epb.prod_id = get_e(sc, EEPROM_PROD_ID);
-		sc->epb.res_cfg = get_e(sc, EEPROM_RESOURCE_CFG);
-		if (!ep_pccard_card_attach(&sc->epb)) {
-			device_printf(dev,
-			    "Probe found ID, attach failed so ignore card!\n");
-			error = ENXIO;
-			goto bad;
-		}
-	}
-
-	/* ROM size = 0, ROM base = 0 */
-	/* For now, ignore AUTO SELECT feature of 3C589B and later. */
-	outw(BASE + EP_W0_ADDRESS_CFG, get_e(sc, EEPROM_ADDR_CFG) & 0xc000);
-
-	/* Fake IRQ must be 3 */
-	outw(BASE + EP_W0_RESOURCE_CFG, (sc->epb.res_cfg & 0x0fff) | 0x3000);
-
-	outw(BASE + EP_W0_PRODUCT_ID, sc->epb.prod_id);
-
-	if (sc->epb.mii_trans) {
-		/*
-		 * turn on the MII transciever
-		 */
-		GO_WINDOW(3);
-		outw(BASE + EP_W3_OPTIONS, 0x8040);
-		DELAY(1000);
-		outw(BASE + EP_W3_OPTIONS, 0xc040);
-		outw(BASE + EP_COMMAND, RX_RESET);
-		outw(BASE + EP_COMMAND, TX_RESET);
-		while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
-		DELAY(1000);
-		outw(BASE + EP_W3_OPTIONS, 0x8040);
-	} else {
-		ep_get_media(sc);
-	}
-
-	if ((error = ep_attach(sc))) {
-		device_printf(dev, "ep_attach() failed! (%d)\n", error);
-		goto bad;
-	}
-
-	ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
-	error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE, ep_intr,
-				    sc, &sc->ep_intrhand, 
-				    sc->arpcom.ac_if.if_serializer);
-	if (error) {
-		device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
-		goto bad;
-	}
-
-	return (0);
-bad:
-	ep_free(dev);
-	return (error);
-}
-
-static int
-ep_pccard_detach(device_t dev)
-{
-	struct ep_softc *sc = device_get_softc(dev);
-	struct ifnet *ifp = &sc->arpcom.ac_if;
-
-	lwkt_serialize_enter(ifp->if_serializer);
-
-	if (sc->gone) {
-		device_printf(dev, "already unloaded\n");
-		lwkt_serialize_exit(ifp->if_serializer);
-		return (0);
-	}
-	ifp->if_flags &= ~IFF_RUNNING; 
-	sc->gone = 1;
-	bus_teardown_intr(dev, sc->irq, sc->ep_intrhand);
-
-	lwkt_serialize_exit(ifp->if_serializer);
-
-	ether_ifdetach(&sc->arpcom.ac_if);
-	ep_free(dev);
-	return (0);
-}
-
-static const struct pccard_product ep_pccard_products[] = {
-	PCMCIA_CARD(3COM, 3C1, 0),
-	PCMCIA_CARD(3COM, 3C562, 0),
-	PCMCIA_CARD(3COM, 3C574, 0),	/* ROADRUNNER */
-	PCMCIA_CARD(3COM, 3C589, 0),
-	PCMCIA_CARD(3COM, 3CCFEM556BI, 0),	/* ROADRUNNER */
-	PCMCIA_CARD(3COM, 3CXEM556, 0),
-	PCMCIA_CARD(3COM, 3CXEM556INT, 0),
-	{NULL}
-};
-
-static int
-ep_pccard_match(device_t dev)
-{
-	const struct pccard_product *pp;
-
-	if ((pp = pccard_product_lookup(dev, ep_pccard_products,
-		    sizeof(ep_pccard_products[0]), NULL)) != NULL) {
-		if (pp->pp_name != NULL)
-			device_set_desc(dev, pp->pp_name);
-		return 0;
-	}
-	return EIO;
-}
-
-static device_method_t ep_pccard_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe, pccard_compat_probe),
-	DEVMETHOD(device_attach, pccard_compat_attach),
-	DEVMETHOD(device_detach, ep_pccard_detach),
-
-	/* Card interface */
-	DEVMETHOD(card_compat_match, ep_pccard_match),
-	DEVMETHOD(card_compat_probe, ep_pccard_probe),
-	DEVMETHOD(card_compat_attach, ep_pccard_attach),
-
-	DEVMETHOD_END
-};
-
-static driver_t ep_pccard_driver = {
-	"ep",
-	ep_pccard_methods,
-	sizeof(struct ep_softc),
-};
-
-extern devclass_t ep_devclass;
-
-DRIVER_MODULE(if_ep, pccard, ep_pccard_driver, ep_devclass, NULL, NULL);
diff --git a/sys/dev/netif/ep/if_epreg.h b/sys/dev/netif/ep/if_epreg.h
deleted file mode 100644
index be66310..0000000
--- a/sys/dev/netif/ep/if_epreg.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) 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. 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 THE AUTHOR ``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 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: src/sys/dev/ep/if_epreg.h,v 1.29 2000/01/12 06:42:49 mdodd Exp $
- * $DragonFly: src/sys/dev/netif/ep/if_epreg.h,v 1.2 2003/06/17 04:28:25 dillon Exp $
- */
-
-/*
- * DELAY_MULTIPLE: How much to boost "base" delays, except
- * for the inter-bit delays in get_eeprom_data.  A cyrix Media GX needed this.
- */
-#define DELAY_MULTIPLE 10
-#define BIT_DELAY_MULTIPLE 10
-
-/*
- * Some global constants
- */
-#define TX_INIT_RATE         16
-#define TX_INIT_MAX_RATE     64
-#define RX_INIT_LATENCY      64
-#define RX_INIT_EARLY_THRESH 208 /* not less than MINCLSIZE */
-#define RX_NEXT_EARLY_THRESH 500
-
-#define EEPROMSIZE      0x40
-#define MAX_EEPROMBUSY  1000
-#define EP_LAST_TAG     0xd7
-#define EP_MAX_BOARDS   16
-/*
- * This `ID' port is a mere hack.  There's currently no chance to register
- * it with config's idea of the ports that are in use.
- *
- * "After the automatic configuration is completed, the IDS is in its initial
- * state (ID-WAIT), and it monitors all write access to I/O port 01x0h, where
- * 'x' is any hex digit.  If a zero is written to any one of these ports, then
- * that address is remembered and becomes the ID port.  A second zero written
- * to that port resets the ID sequence to its initial state.  The IDS watches
- * for the ID sequence to be written to the ID port."
- *
- * We prefer 0x110 over 0x100 so to not conflict with the Plaque&Pray
- * ports.
- */
-#define EP_ID_PORT      0x110
-#define EP_IOSIZE	16	/* 16 bytes of I/O space used. */
-
-/*
- * some macros to acces long named fields
- */
-#define BASE 	(sc->ep_io_addr)
-
-/*
- * Commands to read/write EEPROM trough EEPROM command register (Window 0,
- * Offset 0xa)
- */
-#define EEPROM_CMD_RD    0x0080	/* Read:  Address required (5 bits) */
-#define EEPROM_CMD_WR    0x0040	/* Write: Address required (5 bits) */
-#define EEPROM_CMD_ERASE 0x00c0	/* Erase: Address required (5 bits) */
-#define EEPROM_CMD_EWEN  0x0030	/* Erase/Write Enable: No data required */
-
-#define EEPROM_BUSY		(1<<15)
-#define EEPROM_TST_MODE		(1<<14)
-
-/*
- * Some short functions, worth to let them be a macro
- */
-#define is_eeprom_busy(b) (inw((b)+EP_W0_EEPROM_COMMAND)&EEPROM_BUSY)
-#define GO_WINDOW(x)      outw(BASE+EP_COMMAND, WINDOW_SELECT|(x))
-
-/**************************************************************************
- *									  *
- * These define the EEPROM data structure.  They are used in the probe
- * function to verify the existence of the adapter after having sent
- * the ID_Sequence.
- *
- **************************************************************************/
-
-#define EEPROM_NODE_ADDR_0	0x0	/* Word */
-#define EEPROM_NODE_ADDR_1	0x1	/* Word */
-#define EEPROM_NODE_ADDR_2	0x2	/* Word */
-#define EEPROM_PROD_ID		0x3	/* 0x9[0-f]50 */
-#define EEPROM_MFG_DATE         0x4     /* Manufacturing date */
-#define EEPROM_MFG_DIVSION      0x5     /* Manufacturing division */
-#define EEPROM_MFG_PRODUCT      0x6     /* Product code */
-#define EEPROM_MFG_ID		0x7	/* 0x6d50 */
-#define EEPROM_ADDR_CFG		0x8	/* Base addr */
-#define EEPROM_RESOURCE_CFG	0x9	/* IRQ. Bits 12-15 */
-#define EEPROM_OEM_ADDR0        0xa
-#define EEPROM_OEM_ADDR1        0xb
-#define EEPROM_OEM_ADDR2        0xc
-#define EEPROM_SOFTINFO         0xd
-#define EEPROM_COMPAT           0xe
-#define EEPROM_SOFTINFO2        0xf
-#define EEPROM_CAP              0x10
-# define CAP_ISA		0x2083
-# define CAP_PCMCIA		0x2082
-#define EEPROM_INT_CONFIG_0	0x12
-#define EEPROM_INT_CONFIG_1	0x13
-/* RAM Partition TX FIFO/RX FIFO */
-# define ICW1_RAM_PART_MASK	0x03
-# define ICW1_RAM_PART_35	0x00	/* 2:5 (only legal if RAM size == 000b default power-up/reset */
-# define ICW1_RAM_PART_13	0x01	/* 1:3 (only legal if RAM size == 000b) */
-# define ICW1_RAM_PART_11	0x10	/* 1:1		*/
-# define ICW1_RAM_PART_RESV	0x11	/* Reserved	*/
-/* ISA Adapter Selection */
-# define ICW1_IAS_MASK		0x0c
-# define ICW1_IAS_DIS		0x00	/* Both mechanisms disabled (default) */
-# define ICW1_IAS_ISA		0x04	/* ISA contention only */
-# define ICW1_IAS_PNP		0x08	/* ISA Plug and Play only */
-# define ICW1_IAS_BOTH		0x0c	/* Both mechanisms enabled */
-
-#define EEPROM_CHECKSUM_EL3     0x17
-
-/**************************************************************************
- *										  *
- * These are the registers for the 3Com 3c509 and their bit patterns when *
- * applicable.  They have been taken out the the "EtherLink III Parallel  *
- * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual *
- * from 3com.								  *
- *										  *
- **************************************************************************/
-
-#define EP_COMMAND		0x0e	/* Write. BASE+0x0e is always a
-					 * command reg. */
-#define EP_STATUS		0x0e	/* Read. BASE+0x0e is always status
-					 * reg. */
-#define EP_WINDOW		0x0f	/* Read. BASE+0x0f is always window
-					 * reg. */
-/*
- * Window 0 registers. Setup.
- */
-/* Write */
-#define EP_W0_EEPROM_DATA	0x0c
-#define EP_W0_EEPROM_COMMAND	0x0a
-#define EP_W0_RESOURCE_CFG	0x08
-#define EP_W0_ADDRESS_CFG	0x06
-#define EP_W0_CONFIG_CTRL	0x04
-/* Read */
-#define EP_W0_PRODUCT_ID	0x02
-#define EP_W0_MFG_ID		0x00
-
-/*
- * Window 1 registers. Operating Set.
- */
-/* Write */
-#define EP_W1_TX_PIO_WR_2	0x02
-#define EP_W1_TX_PIO_WR_1	0x00
-/* Read */
-#define EP_W1_FREE_TX		0x0c
-#define EP_W1_TX_STATUS		0x0b	/* byte */
-#define EP_W1_TIMER		0x0a	/* byte */
-#define EP_W1_RX_STATUS		0x08
-#define EP_W1_RX_PIO_RD_2	0x02
-#define EP_W1_RX_PIO_RD_1	0x00
-
-/*
- * Window 2 registers. Station Address Setup/Read
- */
-/* Read/Write */
-#define EP_W2_ADDR_5		0x05
-#define EP_W2_ADDR_4		0x04
-#define EP_W2_ADDR_3		0x03
-#define EP_W2_ADDR_2		0x02
-#define EP_W2_ADDR_1		0x01
-#define EP_W2_ADDR_0		0x00
-
-/*
- * Window 3 registers.  FIFO Management.
- */
-/* Read */
-#define EP_W3_FREE_TX		0x0c
-#define EP_W3_FREE_RX		0x0a
-#define EP_W3_OPTIONS		0x08
-
-/*
- * Window 4 registers. Diagnostics.
- */
-/* Read/Write */
-#define EP_W4_MEDIA_TYPE	0x0a
-#define EP_W4_CTRLR_STATUS	0x08
-#define EP_W4_NET_DIAG		0x06
-#define EP_W4_FIFO_DIAG		0x04
-#define EP_W4_HOST_DIAG		0x02
-#define EP_W4_TX_DIAG		0x00
-
-/*
- * Window 5 Registers.  Results and Internal status.
- */
-/* Read */
-#define EP_W5_READ_0_MASK	0x0c
-#define EP_W5_INTR_MASK		0x0a
-#define EP_W5_RX_FILTER		0x08
-#define EP_W5_RX_EARLY_THRESH	0x06
-#define EP_W5_TX_AVAIL_THRESH	0x02
-#define EP_W5_TX_START_THRESH	0x00
-
-/*
- * Window 6 registers. Statistics.
- */
-/* Read/Write */
-#define TX_TOTAL_OK		0x0c
-#define RX_TOTAL_OK		0x0a
-#define TX_DEFERRALS		0x08
-#define RX_FRAMES_OK		0x07
-#define TX_FRAMES_OK		0x06
-#define RX_OVERRUNS		0x05
-#define TX_COLLISIONS		0x04
-#define TX_AFTER_1_COLLISION	0x03
-#define TX_AFTER_X_COLLISIONS	0x02
-#define TX_NO_SQE		0x01
-#define TX_CD_LOST		0x00
-
-/****************************************
- *
- * Register definitions.
- *
- ****************************************/
-
-/* 
- * Command parameter that disables threshold interrupts
- *   PIO (3c509) cards use 2044.  The fifo word-oriented and 2044--2047 work.
- *  "busmastering" cards need 8188.
- * The implicit two-bit upshift done by busmastering cards means
- * a value of 2047 disables threshold interrupts on both.
- */   
-#define EP_THRESH_DISABLE    2047
-
-/*
- * Command register. All windows.
- *
- * 16 bit register.
- *     15-11:  5-bit code for command to be executed.
- *     10-0:   11-bit arg if any. For commands with no args;
- *	      this can be set to anything.
- */
-#define GLOBAL_RESET		(u_short) 0x0000	/* Wait at least 1ms
-							 * after issuing */
-#define WINDOW_SELECT		(u_short) (0x1<<11)
-#define START_TRANSCEIVER	(u_short) (0x2<<11)	/* Read ADDR_CFG reg to
-							 * determine whether
-							 * this is needed. If
-							 * so; wait 800 uSec
-							 * before using trans-
-							 * ceiver. */
-#define RX_DISABLE		(u_short) (0x3<<11)	/* state disabled on
-							 * power-up */
-#define RX_ENABLE		(u_short) (0x4<<11)
-#define RX_RESET		(u_short) (0x5<<11)
-#define RX_DISCARD_TOP_PACK	(u_short) (0x8<<11)
-#define TX_ENABLE		(u_short) (0x9<<11)
-#define TX_DISABLE		(u_short) (0xa<<11)
-#define TX_RESET		(u_short) (0xb<<11)
-#define REQ_INTR		(u_short) (0xc<<11)
-#define SET_INTR_MASK		(u_short) (0xe<<11)
-#define SET_RD_0_MASK		(u_short) (0xf<<11)
-#define SET_RX_FILTER		(u_short) (0x10<<11)
-#define FIL_INDIVIDUAL		(u_short) (0x1)
-#define FIL_GROUP		(u_short) (0x2)
-#define FIL_BRDCST		(u_short) (0x4)
-#define FIL_ALL			(u_short) (0x8)
-#define SET_RX_EARLY_THRESH	(u_short) (0x11<<11)
-#define SET_TX_AVAIL_THRESH	(u_short) (0x12<<11)
-#define SET_TX_START_THRESH	(u_short) (0x13<<11)
-#define STATS_ENABLE		(u_short) (0x15<<11)
-#define STATS_DISABLE		(u_short) (0x16<<11)
-#define STOP_TRANSCEIVER	(u_short) (0x17<<11)
-/*
- * The following C_* acknowledge the various interrupts. Some of them don't
- * do anything.  See the manual.
- */
-#define ACK_INTR		(u_short) (0x6800)
-#define C_INTR_LATCH	(u_short) (ACK_INTR|0x1)
-#define C_CARD_FAILURE	(u_short) (ACK_INTR|0x2)
-#define C_TX_COMPLETE	(u_short) (ACK_INTR|0x4)
-#define C_TX_AVAIL	(u_short) (ACK_INTR|0x8)
-#define C_RX_COMPLETE	(u_short) (ACK_INTR|0x10)
-#define C_RX_EARLY	(u_short) (ACK_INTR|0x20)
-#define C_INT_RQD		(u_short) (ACK_INTR|0x40)
-#define C_UPD_STATS	(u_short) (ACK_INTR|0x80)
-#define C_MASK	(u_short) 0xFF /* mask of C_* */
-
-/*
- * Status register. All windows.
- *
- *     15-13:  Window number(0-7).
- *     12:     Command_in_progress.
- *     11:     reserved.
- *     10:     reserved.
- *     9:      reserved.
- *     8:      reserved.
- *     7:      Update Statistics.
- *     6:      Interrupt Requested.
- *     5:      RX Early.
- *     4:      RX Complete.
- *     3:      TX Available.
- *     2:      TX Complete.
- *     1:      Adapter Failure.
- *     0:      Interrupt Latch.
- */
-#define S_INTR_LATCH		(u_short) (0x1)
-#define S_CARD_FAILURE		(u_short) (0x2)
-#define S_TX_COMPLETE		(u_short) (0x4)
-#define S_TX_AVAIL		(u_short) (0x8)
-#define S_RX_COMPLETE		(u_short) (0x10)
-#define S_RX_EARLY		(u_short) (0x20)
-#define S_INT_RQD		(u_short) (0x40)
-#define S_UPD_STATS		(u_short) (0x80)
-#define S_MASK	(u_short) 0xFF /* mask of S_* */
-#define S_5_INTS                (S_CARD_FAILURE|S_TX_COMPLETE|\
-				 S_TX_AVAIL|S_RX_COMPLETE|S_RX_EARLY)
-#define S_COMMAND_IN_PROGRESS	(u_short) (0x1000)
-
-/* Address Config. Register.
- * Window 0/Port 06
- */
-
-#define ACF_CONNECTOR_BITS	14
-#define ACF_CONNECTOR_UTP	0
-#define ACF_CONNECTOR_AUI	1
-#define ACF_CONNECTOR_BNC	3
-
-/* Resource configuration register.
- * Window 0/Port 08
- *
- */
-
-#define SET_IRQ(base,irq)     outw((base) + EP_W0_RESOURCE_CFG, \
-                              ((inw((base) + EP_W0_RESOURCE_CFG) & 0x0fff) | \
-                              ((u_short)(irq)<<12))  ) /* set IRQ i */
-
-/*
- * FIFO Registers.
- * RX Status. Window 1/Port 08
- *
- *     15:     Incomplete or FIFO empty.
- *     14:     1: Error in RX Packet   0: Incomplete or no error.
- *     13-11:  Type of error.
- *	      1000 = Overrun.
- *	      1011 = Run Packet Error.
- *	      1100 = Alignment Error.
- *	      1101 = CRC Error.
- *	      1001 = Oversize Packet Error (>1514 bytes)
- *	      0010 = Dribble Bits.
- *	      (all other error codes, no errors.)
- *
- *     10-0:   RX Bytes (0-1514)
- */
-#define ERR_RX_INCOMPLETE  (u_short) (0x1<<15)
-#define ERR_RX		   (u_short) (0x1<<14)
-#define ERR_RX_OVERRUN 	   (u_short) (0x8<<11)
-#define ERR_RX_RUN_PKT	   (u_short) (0xb<<11)
-#define ERR_RX_ALIGN	   (u_short) (0xc<<11)
-#define ERR_RX_CRC	   (u_short) (0xd<<11)
-#define ERR_RX_OVERSIZE	   (u_short) (0x9<<11)
-#define ERR_RX_DRIBBLE	   (u_short) (0x2<<11)
-
-/*
- * FIFO Registers.
- * TX Status. Window 1/Port 0B
- *
- *   Reports the transmit status of a completed transmission. Writing this
- *   register pops the transmit completion stack.
- *
- *   Window 1/Port 0x0b.
- *
- *     7:      Complete
- *     6:      Interrupt on successful transmission requested.
- *     5:      Jabber Error (TP Only, TX Reset required. )
- *     4:      Underrun (TX Reset required. )
- *     3:      Maximum Collisions.
- *     2:      TX Status Overflow.
- *     1-0:    Undefined.
- *
- */
-#define TXS_COMPLETE		0x80
-#define TXS_SUCCES_INTR_REQ		0x40
-#define TXS_JABBER		0x20
-#define TXS_UNDERRUN		0x10
-#define TXS_MAX_COLLISION	0x8
-#define TXS_STATUS_OVERFLOW	0x4
-
-/*
- * Configuration control register.
- * Window 0/Port 04
- */
-/* Read */
-#define IS_AUI 				(1<<13)
-#define IS_BNC 				(1<<12)
-#define IS_UTP 				(1<<9)
-/* Write */
-#define ENABLE_DRQ_IRQ			0x0001
-#define W0_P4_CMD_RESET_ADAPTER       0x4
-#define W0_P4_CMD_ENABLE_ADAPTER      0x1
-/*
- * Media type and status.
- * Window 4/Port 0A
- */
-#define ENABLE_UTP			0xc0
-#define DISABLE_UTP			0x0
-
-/*
- * Misc defines for various things.
- */
-#define ACTIVATE_ADAPTER_TO_CONFIG 	0xff /* to the id_port */
-#define MFG_ID 				0x6d50 /* in EEPROM and W0 ADDR_CONFIG */
-#define PROD_ID 			0x9150
-
-#define AUI 				0x1
-#define BNC 				0x2
-#define UTP 				0x4
-
-#define RX_BYTES_MASK			(u_short) (0x07ff)
-
-/*
- * Config flags
- */
-#define EP_FLAGS_100TX			0x1
diff --git a/sys/dev/netif/ep/if_epvar.h b/sys/dev/netif/ep/if_epvar.h
deleted file mode 100644
index 7e1d98b..0000000
--- a/sys/dev/netif/ep/if_epvar.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1993 Herb Peyerl (hpeyerl@novatel.ca) 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. 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 THE AUTHOR ``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 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: src/sys/dev/ep/if_epvar.h,v 1.4.2.1 2000/05/24 01:47:45 archie Exp $
- * $DragonFly: src/sys/dev/netif/ep/if_epvar.h,v 1.3 2005/05/31 08:10:44 joerg Exp $
- */
-
-struct ep_board {
-	u_short		prod_id;	/* product ID */
-	int		cmd_off;	/* command offset (bit shift) */
-	int		mii_trans;	/* activate MII transiever */
-	u_short		res_cfg;	/* resource configuration */
-};
-
-/*
- * Ethernet software status per interface.
- */
-struct ep_softc {
-	struct arpcom		arpcom;		/* Ethernet common part	*/
-	struct ifmedia		ifmedia;	/* media info		*/
-
-	struct resource *	iobase;
-	struct resource *	irq;
-
-	bus_space_handle_t	ep_bhandle;
-	bus_space_tag_t		ep_btag;
-	void *			ep_intrhand;
-
-	int			ep_io_addr;	/* i/o bus address	*/
-
-	u_short			ep_connectors;	/* Connectors on this card. */
-	u_char			ep_connector;	/* Configured connector.*/
-
-	struct mbuf *		top;
-	struct mbuf *		mcur;
-	short			cur_len;
-
-	int			stat;		/* some flags */
-#define	F_RX_FIRST		0x001
-#define	F_PROMISC		0x008
-#define	F_ACCESS_32_BITS	0x100
-
-	int			gone;		/* adapter is not present (for PCCARD) */
-
-	struct ep_board		epb;
-
-#ifdef  EP_LOCAL_STATS
-	short		tx_underrun;
-	short		rx_no_first;
-	short		rx_no_mbuf;
-	short		rx_overrunf;
-	short		rx_overrunl;
-#endif
-};
-
-int		ep_alloc	(device_t);
-void		ep_free		(device_t);
-void		ep_get_media	(struct ep_softc *);
-int		ep_attach	(struct ep_softc *);
-void		ep_intr		(void *);
-u_int16_t	get_e		(struct ep_softc *, int);
-void		ep_get_macaddr	(struct ep_softc *, u_char *);
diff --git a/sys/dev/netif/ex/if_ex.c b/sys/dev/netif/ex/if_ex.c
deleted file mode 100644
index d64a118..0000000
--- a/sys/dev/netif/ex/if_ex.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
- * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
- * 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 unmodified, 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: src/sys/dev/ex/if_ex.c,v 1.26.2.3 2001/03/05 05:33:20 imp Exp $
- *
- * MAINTAINER: Matthew N. Dodd <winter@jurai.net>
- *                             <mdodd@FreeBSD.org>
- */
-
-/*
- * Intel EtherExpress Pro/10, Pro/10+ Ethernet driver
- *
- * Revision history:
- *
- * 30-Oct-1996: first beta version. Inet and BPF supported, but no multicast.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-#include <sys/serialize.h>
-#include <sys/thread2.h>
-
-#include <net/if.h>
-#include <net/ifq_var.h>
-#include <net/if_arp.h>
-#include <net/if_media.h> 
-#include <net/ethernet.h>
-#include <net/bpf.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-#include <machine/clock.h>
-
-
-#include <bus/isa/isavar.h>
-#include <bus/isa/pnpvar.h>
-
-#include "if_exreg.h"
-#include "if_exvar.h"
-
-DECLARE_DUMMY_MODULE(if_ex);
-
-#ifdef EXDEBUG
-# define Start_End 1
-# define Rcvd_Pkts 2
-# define Sent_Pkts 4
-# define Status    8
-static int debug_mask = 0;
-static int exintr_count = 0;
-# define DODEBUG(level, action) if (level & debug_mask) action
-#else
-# define DODEBUG(level, action)
-#endif
-
-char irq2eemap[] =
-	{ -1, -1, 0, 1, -1, 2, -1, -1, -1, 0, 3, 4, -1, -1, -1, -1 };
-u_char ee2irqmap[] =
-	{ 9, 3, 5, 10, 11, 0, 0, 0 };
-                
-char plus_irq2eemap[] =
-	{ -1, -1, -1, 0, 1, 2, -1, 3, -1, 4, 5, 6, 7, -1, -1, -1 };
-u_char plus_ee2irqmap[] =
-	{ 3, 4, 5, 7, 9, 10, 11, 12 };
-
-/* Network Interface Functions */
-static void	ex_init		(void *);
-static void	ex_start	(struct ifnet *, struct ifaltq_subque *);
-static int	ex_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *);
-static void	ex_watchdog	(struct ifnet *);
-
-/* ifmedia Functions	*/
-static int	ex_ifmedia_upd	(struct ifnet *);
-static void	ex_ifmedia_sts	(struct ifnet *, struct ifmediareq *);
-
-static int	ex_get_media	(u_int32_t iobase);
-
-static void	ex_reset	(struct ex_softc *);
-
-static void	ex_tx_intr	(struct ex_softc *);
-static void	ex_rx_intr	(struct ex_softc *);
-
-int
-look_for_card (u_int32_t iobase)
-{
-	int count1, count2;
-
-	/*
-	 * Check for the i82595 signature, and check that the round robin
-	 * counter actually advances.
-	 */
-	if (((count1 = inb(iobase + ID_REG)) & Id_Mask) != Id_Sig)
-		return(0);
-	count2 = inb(iobase + ID_REG);
-	count2 = inb(iobase + ID_REG);
-	count2 = inb(iobase + ID_REG);
-
-	return((count2 & Counter_bits) == ((count1 + 0xc0) & Counter_bits));
-}
-
-void
-ex_get_address (u_int32_t iobase, u_char *enaddr)
-{
-	u_int16_t	eaddr_tmp;
-
-	eaddr_tmp = eeprom_read(iobase, EE_Eth_Addr_Lo);
-	enaddr[5] = eaddr_tmp & 0xff;
-	enaddr[4] = eaddr_tmp >> 8;
-	eaddr_tmp = eeprom_read(iobase, EE_Eth_Addr_Mid);
-	enaddr[3] = eaddr_tmp & 0xff;
-	enaddr[2] = eaddr_tmp >> 8;
-	eaddr_tmp = eeprom_read(iobase, EE_Eth_Addr_Hi);
-	enaddr[1] = eaddr_tmp & 0xff;
-	enaddr[0] = eaddr_tmp >> 8;
-	
-	return;
-}
-
-int
-ex_card_type (u_char *enaddr)
-{
-	if ((enaddr[0] == 0x00) && (enaddr[1] == 0xA0) && (enaddr[2] == 0xC9))
-		return (CARD_TYPE_EX_10_PLUS);
-
-	return (CARD_TYPE_EX_10);
-}
-
-/*
- * Caller is responsible for eventually calling
- * ex_release_resources() on failure.
- */
-int
-ex_alloc_resources (device_t dev)
-{
-	struct ex_softc *	sc = device_get_softc(dev);
-	int			error = 0;
-
-	sc->ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ioport_rid,
-	    RF_ACTIVE);
-	if (!sc->ioport) {
-		device_printf(dev, "No I/O space?!\n");
-		error = ENOMEM;
-		goto bad;
-	}
-
-	sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid,
-	    RF_ACTIVE);
-
-	if (!sc->irq) {
-		device_printf(dev, "No IRQ?!\n");
-		error = ENOMEM;
-		goto bad;
-	}
-
-bad:
-	return (error);
-}
-
-void
-ex_release_resources (device_t dev)
-{
-	struct ex_softc *	sc = device_get_softc(dev);
-
-	if (sc->ih) {
-		bus_teardown_intr(dev, sc->irq, sc->ih);
-		sc->ih = NULL;
-	}
-
-	if (sc->ioport) {
-		bus_release_resource(dev, SYS_RES_IOPORT,
-					sc->ioport_rid, sc->ioport);
-		sc->ioport = NULL;
-	}
-
-	if (sc->irq) {
-		bus_release_resource(dev, SYS_RES_IRQ,
-					sc->irq_rid, sc->irq);
-		sc->irq = NULL;
-	}
-
-	return;
-}
-
-int
-ex_attach(device_t dev)
-{
-	struct ex_softc *	sc = device_get_softc(dev);
-	struct ifnet *		ifp = &sc->arpcom.ac_if;
-	struct ifmedia *	ifm;
-	int			unit = device_get_unit(dev);
-	u_int16_t		temp;
-
-	/* work out which set of irq <-> internal tables to use */
-	if (ex_card_type(sc->arpcom.ac_enaddr) == CARD_TYPE_EX_10_PLUS) {
-		sc->irq2ee = plus_irq2eemap;
-		sc->ee2irq = plus_ee2irqmap;
-	} else {
-		sc->irq2ee = irq2eemap;
-		sc->ee2irq = ee2irqmap;
-	}
-
-	sc->mem_size = CARD_RAM_SIZE;	/* XXX This should be read from the card itself. */
-
-	/*
-	 * Initialize the ifnet structure.
-	 */
-	ifp->if_softc = sc;
-	if_initname(ifp, "ex", unit);
-	ifp->if_mtu = ETHERMTU;
-	ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST /* XXX not done yet. | IFF_MULTICAST */;
-	ifp->if_start = ex_start;
-	ifp->if_ioctl = ex_ioctl;
-	ifp->if_watchdog = ex_watchdog;
-	ifp->if_init = ex_init;
-	ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
-	ifq_set_ready(&ifp->if_snd);
-
-	ifmedia_init(&sc->ifmedia, 0, ex_ifmedia_upd, ex_ifmedia_sts);
-
-	temp = eeprom_read(sc->iobase, EE_W5);
-	if (temp & EE_W5_PORT_TPE)
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
-	if (temp & EE_W5_PORT_BNC)
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_2, 0, NULL);
-	if (temp & EE_W5_PORT_AUI)
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_5, 0, NULL);
-
-	ifmedia_set(&sc->ifmedia, ex_get_media(sc->iobase));
-
-	ifm = &sc->ifmedia;
-	ifm->ifm_media = ifm->ifm_cur->ifm_media;
-	ex_ifmedia_upd(ifp);
-
-	/*
-	 * Attach the interface.
-	 */
-	ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL);
-
-	return(0);
-}
-
-static void
-ex_init(void *xsc)
-{
-	struct ex_softc *	sc = (struct ex_softc *) xsc;
-	struct ifnet *		ifp = &sc->arpcom.ac_if;
-	int			i;
-	int			iobase = sc->iobase;
-	unsigned short		temp_reg;
-
-	DODEBUG(Start_End, kprintf("ex_init%d: start\n", ifp->if_dunit););
-
-	ifp->if_timer = 0;
-
-	/*
-	 * Load the ethernet address into the card.
-	 */
-	outb(iobase + CMD_REG, Bank2_Sel);
-	temp_reg = inb(iobase + EEPROM_REG);
-	if (temp_reg & Trnoff_Enable) {
-		outb(iobase + EEPROM_REG, temp_reg & ~Trnoff_Enable);
-	}
-	for (i = 0; i < ETHER_ADDR_LEN; i++) {
-		outb(iobase + I_ADDR_REG0 + i, sc->arpcom.ac_enaddr[i]);
-	}
-	/*
-	 * - Setup transmit chaining and discard bad received frames.
-	 * - Match broadcast.
-	 * - Clear test mode.
-	 * - Set receiving mode.
-	 * - Set IRQ number.
-	 */
-	outb(iobase + REG1, inb(iobase + REG1) | Tx_Chn_Int_Md | Tx_Chn_ErStp | Disc_Bad_Fr);
-	outb(iobase + REG2, inb(iobase + REG2) | No_SA_Ins | RX_CRC_InMem);
-	outb(iobase + REG3, inb(iobase + REG3) & 0x3f /* XXX constants. */ );
-	outb(iobase + CMD_REG, Bank1_Sel);
-	outb(iobase + INT_NO_REG, (inb(iobase + INT_NO_REG) & 0xf8) | sc->irq2ee[sc->irq_no]);
-
-	/*
-	 * Divide the available memory in the card into rcv and xmt buffers.
-	 * By default, I use the first 3/4 of the memory for the rcv buffer,
-	 * and the remaining 1/4 of the memory for the xmt buffer.
-	 */
-	sc->rx_mem_size = sc->mem_size * 3 / 4;
-	sc->tx_mem_size = sc->mem_size - sc->rx_mem_size;
-	sc->rx_lower_limit = 0x0000;
-	sc->rx_upper_limit = sc->rx_mem_size - 2;
-	sc->tx_lower_limit = sc->rx_mem_size;
-	sc->tx_upper_limit = sc->mem_size - 2;
-	outb(iobase + RCV_LOWER_LIMIT_REG, sc->rx_lower_limit >> 8);
-	outb(iobase + RCV_UPPER_LIMIT_REG, sc->rx_upper_limit >> 8);
-	outb(iobase + XMT_LOWER_LIMIT_REG, sc->tx_lower_limit >> 8);
-	outb(iobase + XMT_UPPER_LIMIT_REG, sc->tx_upper_limit >> 8);
-	
-	/*
-	 * Enable receive and transmit interrupts, and clear any pending int.
-	 */
-	outb(iobase + REG1, inb(iobase + REG1) | TriST_INT);
-	outb(iobase + CMD_REG, Bank0_Sel);
-	outb(iobase + MASK_REG, All_Int & ~(Rx_Int | Tx_Int));
-	outb(iobase + STATUS_REG, All_Int);
-
-	/*
-	 * Initialize receive and transmit ring buffers.
-	 */
-	outw(iobase + RCV_BAR, sc->rx_lower_limit);
-	sc->rx_head = sc->rx_lower_limit;
-	outw(iobase + RCV_STOP_REG, sc->rx_upper_limit | 0xfe);
-	outw(iobase + XMT_BAR, sc->tx_lower_limit);
-	sc->tx_head = sc->tx_tail = sc->tx_lower_limit;
-
-	ifp->if_flags |= IFF_RUNNING;
-	ifq_clr_oactive(&ifp->if_snd);
-	DODEBUG(Status, kprintf("OIDLE init\n"););
-	
-	/*
-	 * Final reset of the board, and enable operation.
-	 */
-	outb(iobase + CMD_REG, Sel_Reset_CMD);
-	DELAY(2);
-	outb(iobase + CMD_REG, Rcv_Enable_CMD);
-
-	if (!ifq_is_empty(&ifp->if_snd))
-		if_devstart(ifp);
-
-	DODEBUG(Start_End, kprintf("ex_init%d: finish\n", ifp->if_dunit););
-}
-
-
-static void
-ex_start(struct ifnet *ifp, struct ifaltq_subque *ifsq)
-{
-	struct ex_softc *	sc = ifp->if_softc;
-	int			iobase = sc->iobase;
-	int			i, len, data_len, avail, dest, next;
-	unsigned char		tmp16[2];
-	struct mbuf *		opkt;
-	struct mbuf *		m;
-
-	ASSERT_ALTQ_SQ_DEFAULT(ifp, ifsq);
-	DODEBUG(Start_End, kprintf("ex_start%d: start\n", unit););
-
-	/*
-	 * Main loop: send outgoing packets to network card until there are no
-	 * more packets left, or the card cannot accept any more yet.
-	 */
-	while (!ifq_is_oactive(&ifp->if_snd)) {
-		opkt = ifq_dequeue(&ifp->if_snd);
-		if (opkt == NULL)
-			break;
-
-		/*
-		 * Ensure there is enough free transmit buffer space for
-		 * this packet, including its header. Note: the header
-		 * cannot wrap around the end of the transmit buffer and
-		 * must be kept together, so we allow space for twice the
-		 * length of the header, just in case.
-		 */
-
-		for (len = 0, m = opkt; m != NULL; m = m->m_next) {
-			len += m->m_len;
-		}
-
-		data_len = len;
-
-		DODEBUG(Sent_Pkts, kprintf("1. Sending packet with %d data bytes. ", data_len););
-
-		if (len & 1) {
-			len += XMT_HEADER_LEN + 1;
-		} else {
-			len += XMT_HEADER_LEN;
-		}
-
-		if ((i = sc->tx_tail - sc->tx_head) >= 0) {
-			avail = sc->tx_mem_size - i;
-		} else {
-			avail = -i;
-		}
-
-		DODEBUG(Sent_Pkts, kprintf("i=%d, avail=%d\n", i, avail););
-
-		if (avail >= len + XMT_HEADER_LEN) {
-#ifdef EX_PSA_INTR      
-			/*
-			 * Disable rx and tx interrupts, to avoid corruption
-			 * of the host address register by interrupt service
-			 * routines.
-			 * XXX Is this necessary with splimp() enabled?
-			 */
-			outb(iobase + MASK_REG, All_Int);
-#endif
-
-			/*
-			 * Compute the start and end addresses of this
-			 * frame in the tx buffer.
-			 */
-			dest = sc->tx_tail;
-			next = dest + len;
-
-			if (next > sc->tx_upper_limit) {
-				if ((sc->tx_upper_limit + 2 - sc->tx_tail) <=
-				    XMT_HEADER_LEN) {
-					dest = sc->tx_lower_limit;
-					next = dest + len;
-				} else {
-					next = sc->tx_lower_limit +
-						next - sc->tx_upper_limit - 2;
-				}
-			}
-
-			/*
-			 * Build the packet frame in the card's ring buffer.
-			 */
-			DODEBUG(Sent_Pkts, kprintf("2. dest=%d, next=%d. ", dest, next););
-
-			outw(iobase + HOST_ADDR_REG, dest);
-			outw(iobase + IO_PORT_REG, Transmit_CMD);
-			outw(iobase + IO_PORT_REG, 0);
-			outw(iobase + IO_PORT_REG, next);
-			outw(iobase + IO_PORT_REG, data_len);
-
-			/*
-			 * Output the packet data to the card. Ensure all
-			 * transfers are 16-bit wide, even if individual
-			 * mbufs have odd length.
-			 */
-
-			for (m = opkt, i = 0; m != NULL; m = m->m_next) {
-				DODEBUG(Sent_Pkts, kprintf("[%d]", m->m_len););
-				if (i) {
-					tmp16[1] = *(mtod(m, caddr_t));
-					outsw(iobase + IO_PORT_REG, tmp16, 1);
-				}
-				outsw(iobase + IO_PORT_REG,
-				      mtod(m, caddr_t) + i, (m->m_len - i) / 2);
-
-				if ((i = (m->m_len - i) & 1) != 0) {
-					tmp16[0] = *(mtod(m, caddr_t) +
-						   m->m_len - 1);
-				}
-			}
-			if (i) {
-				outsw(iobase + IO_PORT_REG, tmp16, 1);
-			}
-	
-			/*
-			 * If there were other frames chained, update the
-			 * chain in the last one.
-			 */
-			if (sc->tx_head != sc->tx_tail) {
-				if (sc->tx_tail != dest) {
-					outw(iobase + HOST_ADDR_REG,
-					     sc->tx_last + XMT_Chain_Point);
-					outw(iobase + IO_PORT_REG, dest);
-				}
-				outw(iobase + HOST_ADDR_REG,
-				     sc->tx_last + XMT_Byte_Count);
-				i = inw(iobase + IO_PORT_REG);
-				outw(iobase + HOST_ADDR_REG,
-				     sc->tx_last + XMT_Byte_Count);
-				outw(iobase + IO_PORT_REG, i | Ch_bit);
-			}
-	
-			/*
-			 * Resume normal operation of the card:
-			 * - Make a dummy read to flush the DRAM write
-			 *   pipeline.
-			 * - Enable receive and transmit interrupts.
-			 * - Send Transmit or Resume_XMT command, as
-			 *   appropriate.
-			 */
-			inw(iobase + IO_PORT_REG);
-#ifdef EX_PSA_INTR
-			outb(iobase + MASK_REG, All_Int & ~(Rx_Int | Tx_Int));
-#endif
-			if (sc->tx_head == sc->tx_tail) {
-				outw(iobase + XMT_BAR, dest);
-				outb(iobase + CMD_REG, Transmit_CMD);
-				sc->tx_head = dest;
-				DODEBUG(Sent_Pkts, kprintf("Transmit\n"););
-			} else {
-				outb(iobase + CMD_REG, Resume_XMT_List_CMD);
-				DODEBUG(Sent_Pkts, kprintf("Resume\n"););
-			}
-	
-			sc->tx_last = dest;
-			sc->tx_tail = next;
-     	 
-			BPF_MTAP(ifp, opkt);
-
-			ifp->if_timer = 2;
-			IFNET_STAT_INC(ifp, opackets, 1);
-			m_freem(opkt);
-		} else {
-			ifq_set_oactive(&ifp->if_snd);
-			ifq_prepend(&ifp->if_snd, opkt);
-			DODEBUG(Status, kprintf("OACTIVE start\n"););
-		}
-	}
-	DODEBUG(Start_End, kprintf("ex_start%d: finish\n", unit););
-}
-
-void
-ex_stop(struct ex_softc *sc)
-{
-	int iobase = sc->iobase;
-
-	DODEBUG(Start_End, kprintf("ex_stop%d: start\n", unit););
-
-	/*
-	 * Disable card operation:
-	 * - Disable the interrupt line.
-	 * - Flush transmission and disable reception.
-	 * - Mask and clear all interrupts.
-	 * - Reset the 82595.
-	 */
-	outb(iobase + CMD_REG, Bank1_Sel);
-	outb(iobase + REG1, inb(iobase + REG1) & ~TriST_INT);
-	outb(iobase + CMD_REG, Bank0_Sel);
-	outb(iobase + CMD_REG, Rcv_Stop);
-	sc->tx_head = sc->tx_tail = sc->tx_lower_limit;
-	sc->tx_last = 0; /* XXX I think these two lines are not necessary, because ex_init will always be called again to reinit the interface. */
-	outb(iobase + MASK_REG, All_Int);
-	outb(iobase + STATUS_REG, All_Int);
-	outb(iobase + CMD_REG, Reset_CMD);
-	DELAY(200);
-
-	DODEBUG(Start_End, kprintf("ex_stop%d: finish\n", unit););
-
-	return;
-}
-
-void
-ex_intr(void *arg)
-{
-	struct ex_softc *	sc = (struct ex_softc *)arg;
-	struct ifnet *	ifp = &sc->arpcom.ac_if;
-	int			iobase = sc->iobase;
-	int			int_status, send_pkts;
-
-	DODEBUG(Start_End, kprintf("ex_intr%d: start\n", unit););
-
-#ifdef EXDEBUG
-	if (++exintr_count != 1)
-		kprintf("WARNING: nested interrupt (%d). Mail the author.\n", exintr_count);
-#endif
-
-	send_pkts = 0;
-	while ((int_status = inb(iobase + STATUS_REG)) & (Tx_Int | Rx_Int)) {
-		if (int_status & Rx_Int) {
-			outb(iobase + STATUS_REG, Rx_Int);
-
-			ex_rx_intr(sc);
-		} else if (int_status & Tx_Int) {
-			outb(iobase + STATUS_REG, Tx_Int);
-
-			ex_tx_intr(sc);
-			send_pkts = 1;
-		}
-	}
-
-	/*
-	 * If any packet has been transmitted, and there are queued packets to
-	 * be sent, attempt to send more packets to the network card.
-	 */
-
-	if (send_pkts && !ifq_is_empty(&ifp->if_snd))
-		if_devstart(ifp);
-
-#ifdef EXDEBUG
-	exintr_count--;
-#endif
-
-	DODEBUG(Start_End, kprintf("ex_intr%d: finish\n", unit););
-
-	return;
-}
-
-static void
-ex_tx_intr(struct ex_softc *sc)
-{
-	struct ifnet *	ifp = &sc->arpcom.ac_if;
-	int		iobase = sc->iobase;
-	int		tx_status;
-
-	DODEBUG(Start_End, kprintf("ex_tx_intr%d: start\n", unit););
-
-	/*
-	 * - Cancel the watchdog.
-	 * For all packets transmitted since last transmit interrupt:
-	 * - Advance chain pointer to next queued packet.
-	 * - Update statistics.
-	 */
-
-	ifp->if_timer = 0;
-
-	while (sc->tx_head != sc->tx_tail) {
-		outw(iobase + HOST_ADDR_REG, sc->tx_head);
-
-		if (!(inw(iobase + IO_PORT_REG) & Done_bit))
-			break;
-
-		tx_status = inw(iobase + IO_PORT_REG);
-		sc->tx_head = inw(iobase + IO_PORT_REG);
-
-		if (tx_status & TX_OK_bit) {
-			IFNET_STAT_INC(ifp, opackets, 1);
-		} else {
-			IFNET_STAT_INC(ifp, oerrors, 1);
-		}
-
-		IFNET_STAT_INC(ifp, collisions, tx_status & No_Collisions_bits);
-	}
-
-	/*
-	 * The card should be ready to accept more packets now.
-	 */
-
-	ifq_clr_oactive(&ifp->if_snd);
-
-	DODEBUG(Status, kprintf("OIDLE tx_intr\n"););
-	DODEBUG(Start_End, kprintf("ex_tx_intr%d: finish\n", unit););
-
-	return;
-}
-
-static void
-ex_rx_intr(struct ex_softc *sc)
-{
-	struct ifnet *		ifp = &sc->arpcom.ac_if;
-	int			iobase = sc->iobase;
-	int			rx_status;
-	int			pkt_len;
-	struct mbuf *		m;
-	struct mbuf *		ipkt;
-
-	DODEBUG(Start_End, kprintf("ex_rx_intr%d: start\n", unit););
-
-	/*
-	 * For all packets received since last receive interrupt:
-	 * - If packet ok, read it into a new mbuf and queue it to interface,
-	 *   updating statistics.
-	 * - If packet bad, just discard it, and update statistics.
-	 * Finally, advance receive stop limit in card's memory to new location.
-	 */
-
-	outw(iobase + HOST_ADDR_REG, sc->rx_head);
-
-	while (inw(iobase + IO_PORT_REG) == RCV_Done) {
-
-		rx_status = inw(iobase + IO_PORT_REG);
-		sc->rx_head = inw(iobase + IO_PORT_REG);
-		pkt_len = inw(iobase + IO_PORT_REG);
-
-		if (rx_status & RCV_OK_bit) {
-			MGETHDR(m, M_NOWAIT, MT_DATA);
-			ipkt = m;
-			if (ipkt == NULL) {
-				IFNET_STAT_INC(ifp, iqdrops, 1);
-			} else {
-				ipkt->m_pkthdr.rcvif = ifp;
-				ipkt->m_pkthdr.len = pkt_len;
-				ipkt->m_len = MHLEN;
-
-				while (pkt_len > 0) {
-					if (pkt_len > MINCLSIZE) {
-						MCLGET(m, M_NOWAIT);
-						if (m->m_flags & M_EXT) {
-							m->m_len = MCLBYTES;
-						} else {
-							m_freem(ipkt);
-							IFNET_STAT_INC(ifp, iqdrops, 1);
-							goto rx_another;
-						}
-					}
-					m->m_len = min(m->m_len, pkt_len);
-
-	  /*
-	   * NOTE: I'm assuming that all mbufs allocated are of even length,
-	   * except for the last one in an odd-length packet.
-	   */
-
-					insw(iobase + IO_PORT_REG,
-					     mtod(m, caddr_t), m->m_len / 2);
-
-					if (m->m_len & 1) {
-						*(mtod(m, caddr_t) + m->m_len - 1) = inb(iobase + IO_PORT_REG);
-					}
-					pkt_len -= m->m_len;
-
-					if (pkt_len > 0) {
-						MGET(m->m_next, M_NOWAIT, MT_DATA);
-						if (m->m_next == NULL) {
-							m_freem(ipkt);
-							IFNET_STAT_INC(ifp, iqdrops, 1);
-							goto rx_another;
-						}
-						m = m->m_next;
-						m->m_len = MLEN;
-					}
-				}
-				ifp->if_input(ifp, ipkt, NULL, -1);
-				IFNET_STAT_INC(ifp, ipackets, 1);
-			}
-		} else {
-			IFNET_STAT_INC(ifp, ierrors, 1);
-		}
-		outw(iobase + HOST_ADDR_REG, sc->rx_head);
-rx_another: ;
-	}
-
-	if (sc->rx_head < sc->rx_lower_limit + 2)
-		outw(iobase + RCV_STOP_REG, sc->rx_upper_limit);
-	else
-		outw(iobase + RCV_STOP_REG, sc->rx_head - 2);
-
-	DODEBUG(Start_End, kprintf("ex_rx_intr%d: finish\n", unit););
-
-	return;
-}
-
-
-static int
-ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr)
-{
-	struct ex_softc *	sc = ifp->if_softc;
-	struct ifreq *		ifr = (struct ifreq *)data;
-	int			error = 0;
-
-	DODEBUG(Start_End, kprintf("ex_ioctl%d: start ", ifp->if_dunit););
-
-	switch(cmd) {
-		case SIOCSIFFLAGS:
-			DODEBUG(Start_End, kprintf("SIOCSIFFLAGS"););
-			if ((ifp->if_flags & IFF_UP) == 0 &&
-			    (ifp->if_flags & IFF_RUNNING)) {
-
-				ifp->if_flags &= ~IFF_RUNNING;
-				ex_stop(sc);
-			} else {
-      				ex_init(sc);
-			}
-			break;
-#ifdef NODEF
-		case SIOCGHWADDR:
-			DODEBUG(Start_End, kprintf("SIOCGHWADDR"););
-			bcopy((caddr_t)sc->sc_addr, (caddr_t)&ifr->ifr_data,
-			      sizeof(sc->sc_addr));
-			break;
-#endif
-		case SIOCADDMULTI:
-			DODEBUG(Start_End, kprintf("SIOCADDMULTI"););
-		case SIOCDELMULTI:
-			DODEBUG(Start_End, kprintf("SIOCDELMULTI"););
-			/* XXX Support not done yet. */
-			error = EINVAL;
-			break;
-		case SIOCSIFMEDIA:
-		case SIOCGIFMEDIA:
-			error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, cmd);
-			break;
-		default:
-			DODEBUG(Start_End, kprintf("unknown"););
-			error = ether_ioctl(ifp, cmd, data);
-			break;
-	}
-
-	DODEBUG(Start_End, kprintf("\nex_ioctl%d: finish\n", ifp->if_dunit););
-
-	return(error);
-}
-
-
-static void
-ex_reset(struct ex_softc *sc)
-{
-	DODEBUG(Start_End, kprintf("ex_reset%d: start\n", unit););
-
-	ex_stop(sc);
-	ex_init(sc);
-
-	DODEBUG(Start_End, kprintf("ex_reset%d: finish\n", unit););
-}
-
-static void
-ex_watchdog(struct ifnet *ifp)
-{
-	struct ex_softc *	sc = ifp->if_softc;
-
-	DODEBUG(Start_End, kprintf("ex_watchdog%d: start\n", ifp->if_dunit););
-
-	ifq_clr_oactive(&ifp->if_snd);
-
-	DODEBUG(Status, kprintf("OIDLE watchdog\n"););
-
-	IFNET_STAT_INC(ifp, oerrors, 1);
-	ex_reset(sc);
-	if_devstart(ifp);
-
-	DODEBUG(Start_End, kprintf("ex_watchdog%d: finish\n", ifp->if_dunit););
-
-	return;
-}
-
-static int
-ex_get_media (u_int32_t iobase)
-{
-	int	tmp;
-
-	outb(iobase + CMD_REG, Bank2_Sel);
-	tmp = inb(iobase + REG3);
-	outb(iobase + CMD_REG, Bank0_Sel);
-
-	if (tmp & TPE_bit)
-		return(IFM_ETHER|IFM_10_T);
-	if (tmp & BNC_bit)
-		return(IFM_ETHER|IFM_10_2);
-
-	return (IFM_ETHER|IFM_10_5);
-}
-
-static int
-ex_ifmedia_upd (struct ifnet *ifp)
-{
-
-	return (0);
-}
-
-static void
-ex_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
-	struct ex_softc *       sc = ifp->if_softc;
-
-	ifmr->ifm_active = ex_get_media(sc->iobase);
-
-	return;
-}
-
-u_short
-eeprom_read(u_int32_t iobase, int location)
-{
-	int i;
-	u_short data = 0;
-	int ee_addr;
-	int read_cmd = location | EE_READ_CMD;
-	short ctrl_val = EECS;
-
-	ee_addr = iobase + EEPROM_REG;
-	outb(iobase + CMD_REG, Bank2_Sel);
-	outb(ee_addr, EECS);
-	for (i = 8; i >= 0; i--) {
-		short outval = (read_cmd & (1 << i)) ? ctrl_val | EEDI : ctrl_val;
-		outb(ee_addr, outval);
-		outb(ee_addr, outval | EESK);
-		DELAY(3);
-		outb(ee_addr, outval);
-		DELAY(2);
-	}
-	outb(ee_addr, ctrl_val);
-
-	for (i = 16; i > 0; i--) {
-		outb(ee_addr, ctrl_val | EESK);
-		DELAY(3);
-		data = (data << 1) | ((inb(ee_addr) & EEDO) ? 1 : 0);
-		outb(ee_addr, ctrl_val);
-		DELAY(2);
-	}
-
-	ctrl_val &= ~EECS;
-	outb(ee_addr, ctrl_val | EESK);
-	DELAY(3);
-	outb(ee_addr, ctrl_val);
-	DELAY(2);
-	outb(iobase + CMD_REG, Bank0_Sel);
-	return(data);
-}
diff --git a/sys/dev/netif/ex/if_ex_pccard.c b/sys/dev/netif/ex/if_ex_pccard.c
deleted file mode 100644
index 700a61f..0000000
--- a/sys/dev/netif/ex/if_ex_pccard.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*-
- * Copyright (c) 2000 Mitsuru IWASAKI
- * 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: src/sys/dev/ex/if_ex_pccard.c,v 1.2.2.1 2001/03/05 05:33:20 imp Exp $
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/interrupt.h>
-#include <sys/socket.h>
-#include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-#include <sys/serialize.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/if_media.h> 
-#include <net/ifq_var.h>
-
-#include "if_exreg.h"
-#include "if_exvar.h"
-
-#include <bus/pccard/pccardvar.h>
-
-#include "pccarddevs.h"
-
-static const struct pccard_product ex_pccard_products[] = {
-	PCMCIA_CARD(OLICOM, OC2220, 0),
-	{ NULL }
-};
-
-/* Bus Front End Functions */
-static int	ex_pccard_match		(device_t);
-static int	ex_pccard_probe		(device_t);
-static int	ex_pccard_attach	(device_t);
-static int	ex_pccard_detach	(device_t);
-
-static device_method_t ex_pccard_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		pccard_compat_probe),
-	DEVMETHOD(device_attach,	pccard_compat_attach),
-	DEVMETHOD(device_detach,	ex_pccard_detach),
-
-	/* Card interface */
-	DEVMETHOD(card_compat_match,	ex_pccard_match),
-	DEVMETHOD(card_compat_probe,	ex_pccard_probe),
-	DEVMETHOD(card_compat_attach,	ex_pccard_attach),
-
-	DEVMETHOD_END
-};
-
-static driver_t ex_pccard_driver = {
-	"ex",
-	ex_pccard_methods,
-	sizeof(struct ex_softc),
-};
-
-devclass_t ex_devclass;
-
-DRIVER_MODULE(if_ex, pccard, ex_pccard_driver, ex_devclass, NULL, NULL);
-
-static int
-ex_pccard_match(device_t dev)
-{
-	const struct pccard_product *pp;
-
-	if ((pp = pccard_product_lookup(dev, ex_pccard_products,
-	    sizeof(ex_pccard_products[0]), NULL)) != NULL) {
-		if (pp->pp_name != NULL)
-			device_set_desc(dev, pp->pp_name);
-		return 0;
-	}
-	return EIO;
-}
-
-static int
-ex_pccard_probe(device_t dev)
-{
-	u_int		iobase;
-	u_int		irq;
-
-	iobase = bus_get_resource_start(dev, SYS_RES_IOPORT, 0);
-	if (!iobase) {
-		kprintf("ex: no iobase?\n");
-		return(ENXIO);
-	}
-
-	if (bootverbose)
-		kprintf("ex: ex_pccard_probe() found card at 0x%03x\n", iobase);
-
-	irq = bus_get_resource_start(dev, SYS_RES_IRQ, 0);
-
-	if (irq == 0) {
-		kprintf("ex: invalid IRQ.\n");
-		return(ENXIO);
-	}
-
-	return(0);
-}
-
-static int
-ex_pccard_attach(device_t dev)
-{
-	struct ex_softc *	sc = device_get_softc(dev);
-	struct ifnet *		ifp = &sc->arpcom.ac_if;
-	int			error = 0;
-	int			i;
-	uint8_t			sum;
-	const uint8_t	*	ether_addr;
-
-	sc->dev = dev;
-	sc->ioport_rid = 0;
-	sc->irq_rid = 0;
-
-	if ((error = ex_alloc_resources(dev)) != 0) {
-		device_printf(dev, "ex_alloc_resources() failed!\n");
-		goto bad;
-	}
-
-	/*
-	 * Fill in several fields of the softc structure:
-	 *	- I/O base address.
-	 *	- Hardware Ethernet address.
-	 *	- IRQ number.
-	 */
-	sc->iobase = rman_get_start(sc->ioport);
-	sc->irq_no = rman_get_start(sc->irq);
-
-	ether_addr = pccard_get_ether(dev);
-	for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
-		sum |= ether_addr[i];
-	if (sum)
-		bcopy(ether_addr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
-
-	if ((error = ex_attach(dev)) != 0) {
-		device_printf(dev, "ex_attach() failed!\n");
-		goto bad;
-	}
-
-	ifq_set_cpuid(&ifp->if_snd, rman_get_cpuid(sc->irq));
-
-	error = bus_setup_intr(dev, sc->irq, INTR_MPSAFE,
-				ex_intr, (void *)sc, &sc->ih, 
-				ifp->if_serializer);
-	if (error) {
-		device_printf(dev, "bus_setup_intr() failed!\n");
-		goto bad;
-	}
-
-	return(0);
-bad:
-	ex_release_resources(dev);
-	return (error);
-}
-
-static int
-ex_pccard_detach(device_t dev)
-{
-	struct ex_softc		*sc = device_get_softc(dev);
-	struct ifnet		*ifp = &sc->arpcom.ac_if;
-
-	lwkt_serialize_enter(ifp->if_serializer);
-	ex_stop(sc);
-	ifp->if_flags &= ~IFF_RUNNING;
-	lwkt_serialize_exit(ifp->if_serializer);
-
-	ether_ifdetach(ifp);
-	ex_release_resources(dev);
-	return (0);
-}
diff --git a/sys/dev/netif/ex/if_exreg.h b/sys/dev/netif/ex/if_exreg.h
deleted file mode 100644
index d4b98a9..0000000
--- a/sys/dev/netif/ex/if_exreg.h
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
- * 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 unmodified, 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: src/sys/dev/ex/if_exreg.h,v 1.1.10.2 2001/03/05 05:33:20 imp Exp $
- * $DragonFly: src/sys/dev/netif/ex/if_exreg.h,v 1.2 2003/06/17 04:28:25 dillon Exp $
- */
-
-/*
- * Intel EtherExpress Pro/10 Ethernet driver
- */
-
-/*
- * Several constants.
- */
-
-#define CARD_TYPE_EX_10         1
-#define CARD_TYPE_EX_10_PLUS    2
-
-/* Length of an ethernet address. */
-#define ETHER_ADDR_LEN 6
-/* Default RAM size in board. */
-#define CARD_RAM_SIZE 0x8000
-/* Number of I/O ports used. */
-#define EX_IOSIZE 16
-
-/*
- * Intel EtherExpress Pro (i82595 based) registers
- */
-
-/* Common registers to all banks. */
-
-#define CMD_REG 0
-#define REG1 1
-#define REG2 2
-#define REG3 3
-#define REG4 4
-#define REG5 5
-#define REG6 6
-#define REG7 7
-#define REG8 8
-#define REG9 9
-#define REG10 10
-#define REG11 11
-#define REG12 12
-#define REG13 13
-#define REG14 14
-#define REG15 15
-
-/* Definitions for command register (CMD_REG). */
-
-#define Switch_Bank_CMD 0
-#define MC_Setup_CMD 3
-#define Transmit_CMD 4
-#define Diagnose_CMD 7
-#define Rcv_Enable_CMD 8
-#define Rcv_Stop 11
-#define Reset_CMD 14
-#define Resume_XMT_List_CMD 28
-#define Sel_Reset_CMD 30
-#define Abort 0x20
-#define Bank0_Sel 0x00
-#define Bank1_Sel 0x40
-#define Bank2_Sel 0x80
-
-/* Bank 0 specific registers. */
-
-#define STATUS_REG 1
-#define ID_REG 2
-#define Id_Mask 0x2c
-#define Id_Sig 0x24
-#define Counter_bits 0xc0
-#define MASK_REG 3
-#define Exec_Int 0x08
-#define Tx_Int 0x04
-#define Rx_Int 0x02
-#define Rx_Stp_Int 0x01
-#define All_Int 0x0f
-#define RCV_BAR 4
-#define RCV_BAR_Lo 4
-#define RCV_BAR_Hi 5
-#define RCV_STOP_REG 6
-#define XMT_BAR 10
-#define HOST_ADDR_REG 12	/* 16-bit register */
-#define IO_PORT_REG 14	/* 16-bit register */
-
-/* Bank 1 specific registers. */
-
-#define TriST_INT 0x80
-#define INT_NO_REG 2
-#define RCV_LOWER_LIMIT_REG 8
-#define RCV_UPPER_LIMIT_REG 9
-#define XMT_LOWER_LIMIT_REG 10
-#define XMT_UPPER_LIMIT_REG 11
-
-/* Bank 2 specific registers. */
-
-#define Disc_Bad_Fr 0x80
-#define Tx_Chn_ErStp 0x40
-#define Tx_Chn_Int_Md 0x20
-#define No_SA_Ins 0x10
-#define RX_CRC_InMem 0x04
-#define BNC_bit 0x20
-#define TPE_bit 0x04
-#define I_ADDR_REG0 4
-#define EEPROM_REG 10
-#define Trnoff_Enable 0x10
-
-/* EEPROM memory positions (16-bit wide). */
-
-#define EE_W0			0x00
-# define EE_W0_PNP		0x0001
-# define EE_W0_BUS16		0x0004
-# define EE_W0_FLASH_ADDR_MASK	0x0038
-# define EE_W0_FLASH_ADDR_SHIFT	3
-# define EE_W0_AUTO_IO		0x0040
-# define EE_W0_FLASH		0x0100
-# define EE_W0_AUTO_NEG		0x0200
-# define EE_W0_IO_MASK		0xFC00
-# define EE_W0_IO_SHIFT		10
-
-#define EE_IRQ_No 1
-#define IRQ_No_Mask 0x07
-
-#define EE_W1			0x01
-# define EE_W1_INT_SEL		0x0007
-# define EE_W1_NO_LINK_INT	0x0008	/* Link Integrity Off		*/
-# define EE_W1_NO_POLARITY	0x0010	/* Polarity Correction Off	*/
-# define EE_W1_TPE_AUI		0x0020	/* 1 = TPE, 0 = AUI		*/
-# define EE_W1_NO_JABBER_PREV	0x0040	/* Jabber prevention Off	*/
-# define EE_W1_NO_AUTO_SELECT	0x0080	/* Auto Port Selection Off	*/
-# define EE_W1_SMOUT		0x0100	/* SMout Pin Control 0= Input	*/
-# define EE_W1_PROM		0x0200	/* Flash = 0, PROM = 1		*/
-# define EE_W1_ALT_READY	0x2000	/* Alternate Ready, 0=normal	*/
-# define EE_W1_FULL_DUPLEX	0x8000
-
-#define EE_W2			0x02
-#define EE_W3			0x03
-#define EE_W4			0x04
-
-#define EE_Eth_Addr_Lo 2
-#define EE_Eth_Addr_Mid 3
-#define EE_Eth_Addr_Hi 4
-
-#define EE_W5			0x05
-# define EE_W5_BNC_TPE		0x0001	/* 0 = TPE, 1 = BNC		*/
-# define EE_W5_BOOT_IPX		0x0002
-# define EE_W5_BOOT_ODI		0x0004
-# define EE_W5_BOOT_NDIS	(EE_W5_BOOT_IPX|EE_W5_BOOT_ODI)
-# define EE_W5_NUM_CONN		0x0008	/* 0 = 2, 1 = 3			*/
-# define EE_W5_NOFLASH		0x0010	/* No flash socket present	*/
-# define EE_W5_PORT_TPE		0x0020	/* TPE present			*/
-# define EE_W5_PORT_BNC		0x0040	/* BNC present			*/
-# define EE_W5_PORT_AUI		0x0080	/* AUI present			*/
-# define EE_W5_PWR_MGT		0x0100	/* Power Management		*/
-# define EE_W5_CP		0x0200	/* COncurrent Processing	*/
-
-#define EE_W6			0x05
-# define EE_W6_STEP_MASK	0x000F
-# define EE_W6_BOARD_MASK	0xFFF0
-# define EE_W6_BOARD_SHIFT	4
-
-/* EEPROM serial interface. */
-
-#define EESK 0x01
-#define EECS 0x02
-#define EEDI 0x04
-#define EEDO 0x08
-#define EE_READ_CMD (6 << 6)
-
-/* Frame chain constants. */
-
-/* Transmit header length (in board's ring buffer). */
-#define XMT_HEADER_LEN 8
-#define XMT_Chain_Point 4
-#define XMT_Byte_Count 6
-#define Done_bit 0x0080
-#define Ch_bit 0x8000
-/* Transmit result bits. */
-#define No_Collisions_bits 0x000f
-#define TX_OK_bit 0x2000
-/* Receive result bits. */
-#define RCV_Done 8
-#define RCV_OK_bit 0x2000
diff --git a/sys/dev/netif/ex/if_exvar.h b/sys/dev/netif/ex/if_exvar.h
deleted file mode 100644
index 42503d1..0000000
--- a/sys/dev/netif/ex/if_exvar.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
- * All rights reserved.
- *
- * Copyright (c) 2000 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.
- *
- *	$FreeBSD: src/sys/dev/ex/if_exvar.h,v 1.2.2.1 2001/03/05 05:33:20 imp Exp $
- *	$DragonFly: src/sys/dev/netif/ex/if_exvar.h,v 1.2 2003/06/17 04:28:25 dillon Exp $
- */
-
-struct ex_softc {
-  	struct arpcom	arpcom;		/* Ethernet common data */
-	struct ifmedia	ifmedia;
-
-	device_t	dev;
-	struct resource *ioport;
-	int		ioport_rid;
-	struct resource *irq;
-	int		irq_rid;
-	void *		ih;
-
-	u_int		iobase;		/* I/O base address. */
-	u_short		irq_no;		/* IRQ number. */
-
-	char *		irq2ee;		/* irq <-> internal		*/
-	u_char *	ee2irq;		/* representation conversion	*/
-
-	u_int		mem_size;	/* Total memory size, in bytes. */
-	u_int		rx_mem_size;	/* Rx memory size (by default,	*/
-					/* first 3/4 of total memory).	*/
-
-	u_int		rx_lower_limit;	/* Lower and upper limits of	*/
-	u_int		rx_upper_limit;	/* receive buffer.		*/
-
-	u_int		rx_head;	/* Head of receive ring buffer. */
-	u_int		tx_mem_size;	/* Tx memory size (by default,	*/
-					/* last quarter of total memory).*/
-
-	u_int		tx_lower_limit;	/* Lower and upper limits of	*/
-	u_int		tx_upper_limit;	/* transmit buffer.		*/
-
-	u_int		tx_head;	/* Head and tail of 		*/
-	u_int		tx_tail;	/* transmit ring buffer.	*/
-
-	u_int		tx_last;	/* Pointer to beginning of last	*/
-					/* frame in the chain.		*/
-};
-
-extern char	irq2eemap[];
-extern u_char	ee2irqmap[];
-extern char	plus_irq2eemap[];
-extern u_char	plus_ee2irqmap[];
-
-int		ex_alloc_resources	(device_t);
-void		ex_release_resources	(device_t);
-int		ex_attach		(device_t);
-
-driver_intr_t	ex_intr;
-
-u_int16_t	eeprom_read		(u_int32_t, int);
-
-int		look_for_card		(u_int32_t);
-void		ex_get_address		(u_int32_t, u_char *);
-int		ex_card_type		(u_char *);
-
-void		ex_stop			(struct ex_softc *);
-- 
2.9.2

