FCP-101: Remove ex(4).
Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230
This commit is contained in:
parent
e153ee663a
commit
3ee01a1385
@ -46,6 +46,7 @@ OLD_FILES+=usr/share/man/man4/if_de.4
|
||||
OLD_FILES+=usr/share/man/man4/ed.4
|
||||
OLD_FILES+=usr/share/man/man4/if_ed.4
|
||||
OLD_FILES+=usr/share/man/man4/ep.4
|
||||
OLD_FILES+=usr/share/man/man4/ex.4
|
||||
# 20190513: libcap_sysctl interface change
|
||||
OLD_FILES+=lib/casper/libcap_sysctl.1
|
||||
# 20190509: tests/sys/opencrypto requires the net/py-dpkt package.
|
||||
|
@ -8,7 +8,6 @@ MAN= apm.4 \
|
||||
CPU_ELAN.4 \
|
||||
ctau.4 \
|
||||
cx.4 \
|
||||
ex.4 \
|
||||
fe.4 \
|
||||
glxiic.4 \
|
||||
glxsb.4 \
|
||||
|
@ -1,127 +0,0 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1997 David E. O'Brien
|
||||
.\"
|
||||
.\" 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 DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 24, 2018
|
||||
.Dt EX 4 i386
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ex
|
||||
.Nd "Ethernet device driver for the Intel EtherExpress Pro/10 and Pro/10+"
|
||||
.Sh SYNOPSIS
|
||||
To compile this driver into the kernel,
|
||||
place the following line in your
|
||||
kernel configuration file:
|
||||
.Bd -ragged -offset indent
|
||||
.Cd "device ex"
|
||||
.Ed
|
||||
.Pp
|
||||
Alternatively, to load the driver as a
|
||||
module at boot time, place the following line in
|
||||
.Xr loader.conf 5 :
|
||||
.Bd -literal -offset indent
|
||||
if_ex_load="YES"
|
||||
.Ed
|
||||
.Sh DEPRECATION NOTICE
|
||||
The
|
||||
.Nm
|
||||
driver is not present in
|
||||
.Fx 13.0
|
||||
and later.
|
||||
See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more
|
||||
information.
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for Ethernet adapters based on the Intel
|
||||
i82595 chip.
|
||||
.Pp
|
||||
On the ISA bus, the card will be searched for in the
|
||||
I/O address range 0x200 - 0x3a0.
|
||||
The IRQ will be read from the EEPROM on the card.
|
||||
For correct operation Plug-N-Play support should be disabled.
|
||||
.Pp
|
||||
On the PC Card bus, the card will be automatically recognized and
|
||||
configured.
|
||||
.Sh HARDWARE
|
||||
The
|
||||
.Nm
|
||||
driver supports the following Ethernet adapters:
|
||||
.Pp
|
||||
.Bl -bullet -compact
|
||||
.It
|
||||
Intel EtherExpress Pro/10 ISA
|
||||
.It
|
||||
Intel EtherExpress Pro/10+ ISA
|
||||
.It
|
||||
Olicom OC2220 Ethernet PC Card
|
||||
.It
|
||||
Olicom OC2232 Ethernet/Modem PC Card
|
||||
.It
|
||||
Silicom Ethernet LAN PC Card
|
||||
.It
|
||||
Silicom EtherSerial LAN PC Card
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
.Bl -diag
|
||||
.It "ex%d: Intel EtherExpress Pro/10, address %6D, connector %s"
|
||||
The device probe found an installed card, and was able to correctly install
|
||||
the device driver.
|
||||
.It "ex%d: WARNING: board's EEPROM is configured for IRQ %d, using %d"
|
||||
The device probe detected that the board is configured for a different
|
||||
interrupt than the one specified in the kernel configuration file.
|
||||
.It "ex%d: invalid IRQ."
|
||||
The device probe detected an invalid IRQ setting.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr arp 4 ,
|
||||
.Xr netintro 4 ,
|
||||
.Xr ng_ether 4 ,
|
||||
.Xr ifconfig 8
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device driver first appeared in
|
||||
.Fx 2.2 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
.Nm
|
||||
device driver was written by
|
||||
.An Javier Mart\('in Rueda .
|
||||
The PC Card attachment was written by
|
||||
.An Mitsuru ISAWAKI
|
||||
and
|
||||
.An Warner Losh .
|
||||
This manual page was written by
|
||||
.An David E. O'Brien .
|
||||
.Sh BUGS
|
||||
Currently the driver does not support multicast.
|
||||
.Pp
|
||||
The Silicom EtherSerial card's serial port does not currently work.
|
||||
The Olicom OC2232 PC Card should work with the
|
||||
.Nm
|
||||
driver, but is currently completely broken.
|
@ -1937,8 +1937,6 @@ device xmphy # XaQti XMAC II
|
||||
# LinkSys LNE100TX, LNE100TX V2.0, Jaton XpressNet, Alfa Inc GFC2204,
|
||||
# KNE110TX.
|
||||
# em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters.
|
||||
# ex: Intel EtherExpress Pro/10 and other i82595-based adapters,
|
||||
# Olicom Ethernet PC Card devices.
|
||||
# fe: Fujitsu MB86960A/MB86965A Ethernet
|
||||
# fxp: Intel EtherExpress Pro/100B
|
||||
# (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping)
|
||||
@ -2042,7 +2040,6 @@ device xmphy # XaQti XMAC II
|
||||
|
||||
# Order for ISA devices is important here
|
||||
|
||||
device ex
|
||||
device fe
|
||||
hint.fe.0.at="isa"
|
||||
hint.fe.0.port="0x300"
|
||||
|
@ -1664,9 +1664,6 @@ dev/evdev/evdev.c optional evdev
|
||||
dev/evdev/evdev_mt.c optional evdev
|
||||
dev/evdev/evdev_utils.c optional evdev
|
||||
dev/evdev/uinput.c optional evdev uinput
|
||||
dev/ex/if_ex.c optional ex
|
||||
dev/ex/if_ex_isa.c optional ex isa
|
||||
dev/ex/if_ex_pccard.c optional ex pccard
|
||||
dev/exca/exca.c optional cbb
|
||||
dev/extres/clk/clk.c optional ext_resources clk fdt
|
||||
dev/extres/clk/clkdev_if.m optional ext_resources clk fdt
|
||||
|
1079
sys/dev/ex/if_ex.c
1079
sys/dev/ex/if_ex.c
File diff suppressed because it is too large
Load Diff
@ -1,340 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/resource.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/if_media.h>
|
||||
|
||||
|
||||
#include <isa/isavar.h>
|
||||
#include <isa/pnpvar.h>
|
||||
|
||||
#include <dev/ex/if_exreg.h>
|
||||
#include <dev/ex/if_exvar.h>
|
||||
|
||||
/* Bus Front End Functions */
|
||||
static void ex_isa_identify(driver_t *, device_t);
|
||||
static int ex_isa_probe(device_t);
|
||||
static int ex_isa_attach(device_t);
|
||||
|
||||
static int ex_look_for_card(struct ex_softc *);
|
||||
|
||||
#if 0
|
||||
static void ex_pnp_wakeup(void *);
|
||||
|
||||
SYSINIT(ex_pnpwakeup, SI_SUB_CPU, SI_ORDER_ANY, ex_pnp_wakeup, NULL);
|
||||
#endif
|
||||
|
||||
static device_method_t ex_isa_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_identify, ex_isa_identify),
|
||||
DEVMETHOD(device_probe, ex_isa_probe),
|
||||
DEVMETHOD(device_attach, ex_isa_attach),
|
||||
DEVMETHOD(device_detach, ex_detach),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t ex_isa_driver = {
|
||||
"ex",
|
||||
ex_isa_methods,
|
||||
sizeof(struct ex_softc),
|
||||
};
|
||||
|
||||
static struct isa_pnp_id ex_ids[] = {
|
||||
{ 0x3110d425, NULL }, /* INT1031 */
|
||||
{ 0x3010d425, NULL }, /* INT1030 */
|
||||
{ 0, NULL },
|
||||
};
|
||||
|
||||
#if 0
|
||||
#define EX_PNP_WAKE 0x279
|
||||
|
||||
static uint8_t ex_pnp_wake_seq[] =
|
||||
{ 0x6A, 0xB5, 0xDA, 0xED, 0xF6, 0xFB, 0x7D, 0xBE,
|
||||
0xDF, 0x6F, 0x37, 0x1B, 0x0D, 0x86, 0xC3, 0x61,
|
||||
0xB0, 0x58, 0x2C, 0x16, 0x8B, 0x45, 0xA2, 0xD1,
|
||||
0xE8, 0x74, 0x3A, 0x9D, 0xCE, 0xE7, 0x73, 0x43 };
|
||||
|
||||
static void
|
||||
ex_pnp_wakeup (void * dummy)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
if (bootverbose)
|
||||
printf("ex_pnp_wakeup()\n");
|
||||
|
||||
outb(EX_PNP_WAKE, 0);
|
||||
outb(EX_PNP_WAKE, 0);
|
||||
for (tmp = 0; tmp < 32; tmp++) {
|
||||
outb(EX_PNP_WAKE, ex_pnp_wake_seq[tmp]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Non-destructive identify.
|
||||
*/
|
||||
static void
|
||||
ex_isa_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
device_t child;
|
||||
bus_addr_t ioport;
|
||||
u_char enaddr[6];
|
||||
u_int irq;
|
||||
int tmp;
|
||||
const char * desc;
|
||||
struct ex_softc sc;
|
||||
int rid;
|
||||
|
||||
if (bootverbose)
|
||||
printf("ex_isa_identify()\n");
|
||||
|
||||
for (ioport = 0x200; ioport < 0x3a0; ioport += 0x10) {
|
||||
rid = 0;
|
||||
sc.ioport = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid,
|
||||
ioport, ioport, 0x10, RF_ACTIVE);
|
||||
if (sc.ioport == NULL)
|
||||
continue;
|
||||
|
||||
/* No board found at address */
|
||||
if (!ex_look_for_card(&sc)) {
|
||||
bus_release_resource(parent, SYS_RES_IOPORT, rid,
|
||||
sc.ioport);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bootverbose)
|
||||
printf("ex: Found card at 0x%03lx!\n", (unsigned long)ioport);
|
||||
|
||||
/* Board in PnP mode */
|
||||
if (ex_eeprom_read(&sc, EE_W0) & EE_W0_PNP) {
|
||||
/* Reset the card. */
|
||||
CSR_WRITE_1(&sc, CMD_REG, Reset_CMD);
|
||||
DELAY(500);
|
||||
if (bootverbose)
|
||||
printf("ex: card at 0x%03lx in PnP mode!\n", (unsigned long)ioport);
|
||||
bus_release_resource(parent, SYS_RES_IOPORT, rid,
|
||||
sc.ioport);
|
||||
continue;
|
||||
}
|
||||
|
||||
bzero(enaddr, sizeof(enaddr));
|
||||
|
||||
/* Reset the card. */
|
||||
CSR_WRITE_1(&sc, CMD_REG, Reset_CMD);
|
||||
DELAY(400);
|
||||
|
||||
ex_get_address(&sc, enaddr);
|
||||
tmp = ex_eeprom_read(&sc, EE_W1) & EE_W1_INT_SEL;
|
||||
|
||||
/* work out which set of irq <-> internal tables to use */
|
||||
if (ex_card_type(enaddr) == CARD_TYPE_EX_10_PLUS) {
|
||||
irq = plus_ee2irqmap[tmp];
|
||||
desc = "Intel Pro/10+";
|
||||
} else {
|
||||
irq = ee2irqmap[tmp];
|
||||
desc = "Intel Pro/10";
|
||||
}
|
||||
|
||||
bus_release_resource(parent, SYS_RES_IOPORT, rid, sc.ioport);
|
||||
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "ex", -1);
|
||||
device_set_desc_copy(child, desc);
|
||||
device_set_driver(child, driver);
|
||||
bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
|
||||
bus_set_resource(child, SYS_RES_IOPORT, 0, ioport, EX_IOSIZE);
|
||||
if (bootverbose)
|
||||
printf("ex: Adding board at 0x%03lx, irq %d\n",
|
||||
(unsigned long)ioport, irq);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
ex_isa_probe(device_t dev)
|
||||
{
|
||||
bus_addr_t iobase;
|
||||
u_int irq;
|
||||
char * irq2ee;
|
||||
u_char * ee2irq;
|
||||
u_char enaddr[6];
|
||||
int tmp;
|
||||
int error;
|
||||
struct ex_softc *sc = device_get_softc(dev);
|
||||
|
||||
/* Check isapnp ids */
|
||||
error = ISA_PNP_PROBE(device_get_parent(dev), dev, ex_ids);
|
||||
|
||||
/* If the card had a PnP ID that didn't match any we know about */
|
||||
if (error == ENXIO)
|
||||
return(error);
|
||||
|
||||
/* If we had some other problem. */
|
||||
if (!(error == 0 || error == ENOENT))
|
||||
return(error);
|
||||
|
||||
error = ex_alloc_resources(dev);
|
||||
if (error != 0)
|
||||
goto bad;
|
||||
iobase = bus_get_resource_start(dev, SYS_RES_IOPORT, 0);
|
||||
if (!ex_look_for_card(sc)) {
|
||||
if (bootverbose)
|
||||
printf("ex: no card found at 0x%03lx.\n", (unsigned long)iobase);
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
if (bootverbose)
|
||||
printf("ex: ex_isa_probe() found card at 0x%03lx\n", (unsigned long)iobase);
|
||||
|
||||
/*
|
||||
* Reset the card.
|
||||
*/
|
||||
CSR_WRITE_1(sc, CMD_REG, Reset_CMD);
|
||||
DELAY(800);
|
||||
|
||||
ex_get_address(sc, enaddr);
|
||||
|
||||
/* work out which set of irq <-> internal tables to use */
|
||||
if (ex_card_type(enaddr) == CARD_TYPE_EX_10_PLUS) {
|
||||
irq2ee = plus_irq2eemap;
|
||||
ee2irq = plus_ee2irqmap;
|
||||
} else {
|
||||
irq2ee = irq2eemap;
|
||||
ee2irq = ee2irqmap;
|
||||
}
|
||||
|
||||
tmp = ex_eeprom_read(sc, EE_W1) & EE_W1_INT_SEL;
|
||||
irq = bus_get_resource_start(dev, SYS_RES_IRQ, 0);
|
||||
if (irq > 0) {
|
||||
/* This will happen if board is in PnP mode. */
|
||||
if (ee2irq[tmp] != irq) {
|
||||
device_printf(dev,
|
||||
"WARNING: IRQ mismatch: EEPROM %d, using %d\n",
|
||||
ee2irq[tmp], irq);
|
||||
}
|
||||
} else {
|
||||
irq = ee2irq[tmp];
|
||||
bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1);
|
||||
}
|
||||
|
||||
if (irq == 0) {
|
||||
printf("ex: invalid IRQ.\n");
|
||||
error = ENXIO;
|
||||
}
|
||||
|
||||
bad:;
|
||||
ex_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
ex_isa_attach(device_t dev)
|
||||
{
|
||||
struct ex_softc * sc = device_get_softc(dev);
|
||||
int error = 0;
|
||||
uint16_t temp;
|
||||
|
||||
sc->dev = dev;
|
||||
sc->ioport_rid = 0;
|
||||
sc->irq_rid = 0;
|
||||
sc->flags |= HAS_INT_NO_REG;
|
||||
|
||||
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 (if not supplied in config file, read it from EEPROM).
|
||||
* - Connector type.
|
||||
*/
|
||||
sc->irq_no = rman_get_start(sc->irq);
|
||||
|
||||
ex_get_address(sc, sc->enaddr);
|
||||
|
||||
temp = ex_eeprom_read(sc, EE_W0);
|
||||
device_printf(sc->dev, "%s config, %s bus, ",
|
||||
(temp & EE_W0_PNP) ? "PnP" : "Manual",
|
||||
(temp & EE_W0_BUS16) ? "16-bit" : "8-bit");
|
||||
|
||||
temp = ex_eeprom_read(sc, EE_W6);
|
||||
printf("board id 0x%03x, stepping 0x%01x\n",
|
||||
(temp & EE_W6_BOARD_MASK) >> EE_W6_BOARD_SHIFT,
|
||||
temp & EE_W6_STEP_MASK);
|
||||
|
||||
if ((error = ex_attach(dev)) != 0) {
|
||||
device_printf(dev, "ex_attach() failed!\n");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
return(0);
|
||||
bad:
|
||||
ex_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
ex_look_for_card(struct ex_softc *sc)
|
||||
{
|
||||
int count1, count2;
|
||||
|
||||
/*
|
||||
* Check for the i82595 signature, and check that the round robin
|
||||
* counter actually advances.
|
||||
*/
|
||||
if (((count1 = CSR_READ_1(sc, ID_REG)) & Id_Mask) != Id_Sig)
|
||||
return(0);
|
||||
count2 = CSR_READ_1(sc, ID_REG);
|
||||
count2 = CSR_READ_1(sc, ID_REG);
|
||||
count2 = CSR_READ_1(sc, ID_REG);
|
||||
|
||||
return((count2 & Counter_bits) == ((count1 + 0xc0) & Counter_bits));
|
||||
}
|
||||
|
||||
DRIVER_MODULE(ex, isa, ex_isa_driver, ex_devclass, 0, 0);
|
||||
ISA_PNP_INFO(ex_ids);
|
@ -1,233 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/resource.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/if_media.h>
|
||||
|
||||
#include <dev/ex/if_exreg.h>
|
||||
#include <dev/ex/if_exvar.h>
|
||||
|
||||
#include <dev/pccard/pccardvar.h>
|
||||
#include <dev/pccard/pccard_cis.h>
|
||||
#include "pccarddevs.h"
|
||||
|
||||
static const struct pccard_product ex_pccard_products[] = {
|
||||
PCMCIA_CARD(OLICOM, OC2220),
|
||||
PCMCIA_CARD(OLICOM, OC2231),
|
||||
PCMCIA_CARD(OLICOM, OC2232),
|
||||
PCMCIA_CARD(INTEL, ETHEREXPPRO),
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* Bus Front End Functions */
|
||||
static int ex_pccard_probe(device_t);
|
||||
static int ex_pccard_attach(device_t);
|
||||
|
||||
static int
|
||||
ex_pccard_enet_ok(u_char *enaddr)
|
||||
{
|
||||
int i;
|
||||
u_char sum;
|
||||
|
||||
if (enaddr[0] == 0xff)
|
||||
return (0);
|
||||
for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
|
||||
sum |= enaddr[i];
|
||||
return (sum != 0);
|
||||
}
|
||||
|
||||
static int
|
||||
ex_pccard_silicom_cb(const struct pccard_tuple *tuple, void *arg)
|
||||
{
|
||||
u_char *enaddr = arg;
|
||||
int i;
|
||||
|
||||
if (tuple->code != CISTPL_FUNCE)
|
||||
return (0);
|
||||
if (tuple->length != 15)
|
||||
return (0);
|
||||
if (pccard_tuple_read_1(tuple, 6) != 6)
|
||||
return (0);
|
||||
for (i = 0; i < 6; i++)
|
||||
enaddr[i] = pccard_tuple_read_1(tuple, 7 + i);
|
||||
return (1);
|
||||
}
|
||||
|
||||
static void
|
||||
ex_pccard_get_silicom_mac(device_t dev, u_char *ether_addr)
|
||||
{
|
||||
pccard_cis_scan(dev, ex_pccard_silicom_cb, ether_addr);
|
||||
}
|
||||
|
||||
static int
|
||||
ex_pccard_probe(device_t dev)
|
||||
{
|
||||
const struct pccard_product *pp;
|
||||
int error, i, j;
|
||||
uint32_t fcn = PCCARD_FUNCTION_UNSPEC;
|
||||
|
||||
if ((pp = pccard_product_lookup(dev, ex_pccard_products,
|
||||
sizeof(ex_pccard_products[0]), NULL)) == NULL)
|
||||
return (EIO);
|
||||
if (pp->pp_name != NULL)
|
||||
device_set_desc(dev, pp->pp_name);
|
||||
/*
|
||||
* Olicom 22.8k and 33.6k modems need to activate the right
|
||||
* CFE. The odd formula below replicates the sequence of cfes
|
||||
* that have multiple resources:
|
||||
* 9, 11, 13, 15, 0 + 9
|
||||
* 25, 27, 29, 31, 16 + 9
|
||||
* 41, 43, 45, 47, 32 + 9
|
||||
* 57, 59, 61, 63 48 + 9
|
||||
* (entries 8, 24, 40 and 56 are single resoruce cfes)
|
||||
* Fortunately the code that enables and disables the multiple
|
||||
* fuctions of the card won't mess with the lower bit for cards
|
||||
* that aren't stanards conforming MFC cards (which these olicom
|
||||
* cards aren't).
|
||||
*
|
||||
* Note: These cards still don't get interrupts for reasons
|
||||
* unknown, even when the right cfe is selected. There's likely
|
||||
* something in the CCR that needs to be manually tweaked, but
|
||||
* the COR bits seem to all be used. Bit 0 and 3 are always set
|
||||
* and the other bits select the config to use. Maybe one of those
|
||||
* two bits needs to be cleared, or there's something else in the
|
||||
* CCR that needs tweaking. The pattern of resources suggests
|
||||
* bit 0 turns on the ethernet, however...
|
||||
*/
|
||||
if (pp->pp_vendor == PCMCIA_VENDOR_OLICOM &&
|
||||
(pp->pp_product == PCMCIA_PRODUCT_OLICOM_OC2231 ||
|
||||
pp->pp_product == PCMCIA_PRODUCT_OLICOM_OC2232)) {
|
||||
if (pccard_select_cfe(dev, 1) == 0)
|
||||
goto good;
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
printf("Trying %d %d\n", i, j);
|
||||
if (pccard_select_cfe(dev,
|
||||
(i << 4) + (j << 1) + 9) == 0)
|
||||
goto good;
|
||||
}
|
||||
}
|
||||
/* Can't activate the net entries, punt */
|
||||
return (EIO);
|
||||
}
|
||||
/*
|
||||
* All other cards supported by this driver don't need specail
|
||||
* treatment, so just filter based on the type of card. The
|
||||
* special treatment ones are setup to 'fail safe' to a modem so
|
||||
* this check would effectively filter them out as well.
|
||||
*/
|
||||
error = pccard_get_function(dev, &fcn);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (fcn != PCCARD_FUNCTION_NETWORK)
|
||||
return (EIO);
|
||||
good:;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ex_pccard_attach(device_t dev)
|
||||
{
|
||||
struct ex_softc * sc = device_get_softc(dev);
|
||||
int error = 0;
|
||||
u_char ether_addr[ETHER_ADDR_LEN];
|
||||
|
||||
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:
|
||||
* - Hardware Ethernet address.
|
||||
* - IRQ number.
|
||||
*/
|
||||
sc->irq_no = rman_get_start(sc->irq);
|
||||
|
||||
/* Try to get the ethernet address from the chip, then the CIS */
|
||||
ex_get_address(sc, ether_addr);
|
||||
if (!ex_pccard_enet_ok(ether_addr))
|
||||
pccard_get_ether(dev, ether_addr);
|
||||
if (!ex_pccard_enet_ok(ether_addr))
|
||||
ex_pccard_get_silicom_mac(dev, ether_addr);
|
||||
if (!ex_pccard_enet_ok(ether_addr)) {
|
||||
device_printf(dev, "No NIC address found.\n");
|
||||
error = ENXIO;
|
||||
goto bad;
|
||||
}
|
||||
bcopy(ether_addr, sc->enaddr, ETHER_ADDR_LEN);
|
||||
|
||||
if ((error = ex_attach(dev)) != 0) {
|
||||
device_printf(dev, "ex_attach() failed!\n");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
return(0);
|
||||
bad:
|
||||
ex_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
static device_method_t ex_pccard_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, ex_pccard_probe),
|
||||
DEVMETHOD(device_attach, ex_pccard_attach),
|
||||
DEVMETHOD(device_detach, ex_detach),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t ex_pccard_driver = {
|
||||
"ex",
|
||||
ex_pccard_methods,
|
||||
sizeof(struct ex_softc),
|
||||
};
|
||||
|
||||
DRIVER_MODULE(ex, pccard, ex_pccard_driver, ex_devclass, 0, 0);
|
||||
MODULE_DEPEND(ex, pccard, 1, 1, 1);
|
||||
PCCARD_PNP_INFO(ex_pccard_products);
|
@ -1,211 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* 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$
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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 Multi_IA 0x20
|
||||
#define No_SA_Ins 0x10
|
||||
#define RX_CRC_InMem 0x04
|
||||
#define Promisc_Mode 0x01
|
||||
#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
|
@ -1,118 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 1996, Javier Mart^mn 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$
|
||||
*/
|
||||
|
||||
struct ex_softc {
|
||||
struct ifnet *ifp;
|
||||
struct ifmedia ifmedia;
|
||||
u_char enaddr[6];
|
||||
|
||||
device_t dev;
|
||||
struct resource *ioport;
|
||||
int ioport_rid;
|
||||
struct resource *irq;
|
||||
int irq_rid;
|
||||
void * ih;
|
||||
|
||||
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. */
|
||||
struct mtx lock;
|
||||
struct callout timer;
|
||||
int tx_timeout;
|
||||
int flags;
|
||||
#define HAS_INT_NO_REG 1
|
||||
};
|
||||
|
||||
extern devclass_t ex_devclass;
|
||||
|
||||
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);
|
||||
int ex_detach(device_t);
|
||||
|
||||
driver_intr_t ex_intr;
|
||||
|
||||
u_int16_t ex_eeprom_read(struct ex_softc *, int);
|
||||
void ex_get_address(struct ex_softc *, u_char *);
|
||||
int ex_card_type(u_char *);
|
||||
|
||||
void ex_stop(struct ex_softc *);
|
||||
|
||||
#define CSR_READ_1(sc, off) (bus_read_1((sc)->ioport, off))
|
||||
#define CSR_READ_2(sc, off) (bus_read_2((sc)->ioport, off))
|
||||
#define CSR_WRITE_1(sc, off, val) \
|
||||
bus_write_1((sc)->ioport, off, val)
|
||||
#define CSR_WRITE_2(sc, off, val) \
|
||||
bus_write_2((sc)->ioport, off, val)
|
||||
#define CSR_WRITE_MULTI_1(sc, off, addr, count) \
|
||||
bus_write_multi_1((sc)->ioport, off, addr, count)
|
||||
#define CSR_WRITE_MULTI_2(sc, off, addr, count) \
|
||||
bus_write_multi_2((sc)->ioport, off, addr, count)
|
||||
#define CSR_WRITE_MULTI_4(sc, off, addr, count) \
|
||||
bus_write_multi_4((sc)->ioport, off, addr, count)
|
||||
#define CSR_READ_MULTI_1(sc, off, addr, count) \
|
||||
bus_read_multi_1((sc)->ioport, off, addr, count)
|
||||
#define CSR_READ_MULTI_2(sc, off, addr, count) \
|
||||
bus_read_multi_2((sc)->ioport, off, addr, count)
|
||||
#define CSR_READ_MULTI_4(sc, off, addr, count) \
|
||||
bus_read_multi_4((sc)->ioport, off, addr, count)
|
||||
|
||||
#define EX_LOCK(sc) mtx_lock(&(sc)->lock)
|
||||
#define EX_UNLOCK(sc) mtx_unlock(&(sc)->lock)
|
||||
#define EX_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED)
|
@ -271,7 +271,6 @@ device wb # Winbond W89C840F
|
||||
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
|
||||
|
||||
# ISA Ethernet NICs. pccard NICs included.
|
||||
device ex # Intel EtherExpress Pro/10 and Pro/10+
|
||||
device fe # Fujitsu MB8696x based cards
|
||||
device sn # SMC's 9000 series of Ethernet chips
|
||||
device xe # Xircom pccard Ethernet
|
||||
|
@ -114,7 +114,6 @@ SUBDIR= \
|
||||
esp \
|
||||
${_et} \
|
||||
evdev \
|
||||
${_ex} \
|
||||
${_exca} \
|
||||
ext2fs \
|
||||
fdc \
|
||||
@ -747,7 +746,6 @@ _sbni= sbni
|
||||
.if ${MK_SOURCELESS_UCODE} != "no"
|
||||
_ctau= ctau
|
||||
.endif
|
||||
_ex= ex
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "arm"
|
||||
|
@ -1,12 +0,0 @@
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
.PATH: ${SRCTOP}/sys/dev/ex
|
||||
|
||||
KMOD= if_ex
|
||||
SRCS= if_ex.c \
|
||||
if_ex_isa.c isa_if.h \
|
||||
if_ex_pccard.c card_if.h \
|
||||
bus_if.h device_if.h pccarddevs.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
Loading…
x
Reference in New Issue
Block a user