You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge branch 'legacy-isa-delete' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
Paul Gortmaker says:
====================
The Ethernet-HowTo was maintained for roughly 10 years, from 1993 to 2003.
Fortunately sane hardware probing and auto detection (via PCI and ISA/PnP)
largely made the document a relic of the past, hence it being abandoned
a decade ago.
However, there is one last useful thing that we can extract from the
effort made in maintaining that document. We can use it to guide us
with respect to what rare, experimental and/or super ancient 10Mbit
ISA drivers don't make sense to maintain in-tree anymore.
Nobody will argue that ISA is obsolete. Availability went away at about
the time Pentium3 motherboards moved from 500MHz Slot1/SECC processors
to the green 500MHz Socket 370 Pentium3 chips, at the turn of the century.
In theory, it is possible that someone could still be running one of these
12+ year old P3 machines and want 3.9+ bleeding edge kernels (but unlikely).
In light of the above (remote) possibility, we can defer the removal of some
ISA network drivers that were highly popular and well tested. Typically
that means the stuff more from the mid to late '90s, some with ISA PnP
support, like the 3c509, the wd/SMC 8390 based stuff, PCnet/lance etc.
But a lot of other drivers, typically from the early 1990s were for rare
hardware, and experimental (to the point of requiring a cron job that would
do a test ping, and then ifconfig down/up and/or a rmmod/insmod!). And
some of these drivers (znet, and lp486e to name two) are physically tied
to platforms with on motherboard ethernet -- of 486 machines that date
from the early 1990s and can only have single digit amounts of memory.
What I'd like to achieve here with this series, is to get rid of those old
drivers that are no longer being used. In an earlier discussion where
I'd proposed deleting a single driver, Alan suggested we instead dump
all the historical stuff in one go, to make it "...immediately obvious
where the break point is..."[1] and that it was "perfectly reasonable it
(and a pile of other ISA cards) ought to be shown the door"[2]. So that
is the goal here - make a clear line in the sand where the really ancient
stuff finally gets kicked to the curb.
Two old parallel port drivers are considered for removal here as well,
since in early 386/486 ISA machines, the parallel port was typically found
with the UARTS on the multi-I/O ISA controller card. These drivers also date
from the early 1990's; parallel ports are no longer found on modern boards,
and their performance was not even capable of 10% of 10Mbit bandwidth.
Allow me a preemptive justification against the inevitable comments from
well meaning bystanders who suggest "why not just leave all this alone?".
Dead drivers cost us all if they are left in tree. If you think that
is false, then please first consider:
-every time you type "git status", you are checking to see if modifications
have been made by you to all that dead code.
-every time you type "git grep <regex>" you are searching through files
which contain that dead code that simply does not interest you.
-every time you build a "allyesconfig" and an "allmodconfig" (don't tell
me you skip this step before submitting your changes to a maintainer),
you waste CPU cycles building this dead code.
-every time there is a tree wide API change, or cleanup, or file relocation,
we pay the cost of updating dead code, or moving dead code.
-daily regression tests (take linux-next as the most transparent
example) spend time building (and possibly running) this dead code.
-hard working people who regularly run auditing tools looking for lurking
bugs (sparse/coverity/smatch/coccinelle) are wasting time checking for,
and fixing bugs in this dead code.
This last one is key. Please take a look at the git history for the
files that are proposed for removal here. Look at the git history for
any one of them ("git whatchanged --follow drivers/net/.../driver.c")
Mentally sort the changes into two bins -- (1) the robotic tree-wide
changes, and (2) the "look I found a real run-time bug while using this"
category. You will see that category #2 is essentially empty.
Further to that, realize that drivers don't simply disappear. We are
not operating in the binary-only distribution space like other OS. All
these drivers remain in the git history forever. If a person is an
enthusiast for extreme legacy hardware, they are probably already
customizing their kernel source and building it themselves to support
such systems. Also keep in mind that they could still build the 3.8
kernel exactly as-is, and run it (or a 3.8.x stable variant of it) for
several more years if they were really determined to cling to these old
experimental ISA drivers for some reason.
In summary, I hope that folks can be pragmatic about this, and not
get swept up in nostalgia. Ask yourself whether it is realistic to
expect a person would have a genuine use case where they would
need to build a 3.9+ modern kernel and install it on some legacy hardware
that has no option but to absolutely _require_ one of the drivers
that are deleted here.
The following series was created with --irreversible-delete for
ease of review (it skips showing the content of files that are
deleted); however the complete patches can be pulled as per below.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -52,8 +52,6 @@ de4x5.txt
|
||||
- the Digital EtherWORKS DE4?? and DE5?? PCI Ethernet driver
|
||||
decnet.txt
|
||||
- info on using the DECnet networking layer in Linux.
|
||||
depca.txt
|
||||
- the Digital DEPCA/EtherWORKS DE1?? and DE2?? LANCE Ethernet driver
|
||||
dl2k.txt
|
||||
- README for D-Link DL2000-based Gigabit Ethernet Adapters (dl2k.ko).
|
||||
dm9000.txt
|
||||
@@ -72,8 +70,6 @@ e1000e.txt
|
||||
- README for the Intel Gigabit Ethernet Driver (e1000e).
|
||||
eql.txt
|
||||
- serial IP load balancing
|
||||
ewrk3.txt
|
||||
- the Digital EtherWORKS 3 DE203/4/5 Ethernet driver
|
||||
fib_trie.txt
|
||||
- Level Compressed Trie (LC-trie) notes: a structure for routing.
|
||||
filter.txt
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
Released 1994-06-13
|
||||
|
||||
|
||||
CONTENTS:
|
||||
|
||||
1. Introduction.
|
||||
2. License.
|
||||
3. Files in this release.
|
||||
4. Installation.
|
||||
5. Problems and tuning.
|
||||
6. Using the drivers with earlier releases.
|
||||
7. Acknowledgments.
|
||||
|
||||
|
||||
1. INTRODUCTION.
|
||||
|
||||
This is a set of Ethernet drivers for the D-Link DE-600/DE-620
|
||||
pocket adapters, for the parallel port on a Linux based machine.
|
||||
Some adapter "clones" will also work. Xircom is _not_ a clone...
|
||||
These drivers _can_ be used as loadable modules,
|
||||
and were developed for use on Linux 1.1.13 and above.
|
||||
For use on Linux 1.0.X, or earlier releases, see below.
|
||||
|
||||
I have used these drivers for NFS, ftp, telnet and X-clients on
|
||||
remote machines. Transmissions with ftp seems to work as
|
||||
good as can be expected (i.e. > 80k bytes/sec) from a
|
||||
parallel port...:-) Receive speeds will be about 60-80% of this.
|
||||
Depending on your machine, somewhat higher speeds can be achieved.
|
||||
|
||||
All comments/fixes to Bjorn Ekwall (bj0rn@blox.se).
|
||||
|
||||
|
||||
2. LICENSE.
|
||||
|
||||
This program is free software; you can redistribute it
|
||||
and/or modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
|
||||
02139, USA.
|
||||
|
||||
|
||||
3. FILES IN THIS RELEASE.
|
||||
|
||||
README.DLINK This file.
|
||||
de600.c The Source (may it be with You :-) for the DE-600
|
||||
de620.c ditto for the DE-620
|
||||
de620.h Macros for de620.c
|
||||
|
||||
If you are upgrading from the d-link tar release, there will
|
||||
also be a "dlink-patches" file that will patch Linux 1.1.18:
|
||||
linux/drivers/net/Makefile
|
||||
linux/drivers/net/CONFIG
|
||||
linux/drivers/net/MODULES
|
||||
linux/drivers/net/Space.c
|
||||
linux/config.in
|
||||
Apply the patch by:
|
||||
"cd /usr/src; patch -p0 < linux/drivers/net/dlink-patches"
|
||||
The old source, "linux/drivers/net/d_link.c", can be removed.
|
||||
|
||||
|
||||
4. INSTALLATION.
|
||||
|
||||
o Get the latest net binaries, according to current net.wisdom.
|
||||
|
||||
o Read the NET-2 and Ethernet HOWTOs and modify your setup.
|
||||
|
||||
o If your parallel port has a strange address or irq,
|
||||
modify "linux/drivers/net/CONFIG" accordingly, or adjust
|
||||
the parameters in the "tuning" section in the sources.
|
||||
|
||||
If you are going to use the drivers as loadable modules, do _not_
|
||||
enable them while doing "make config", but instead make sure that
|
||||
the drivers are included in "linux/drivers/net/MODULES".
|
||||
|
||||
If you are _not_ going to use the driver(s) as loadable modules,
|
||||
but instead have them included in the kernel, remember to enable
|
||||
the drivers while doing "make config".
|
||||
|
||||
o To include networking and DE600/DE620 support in your kernel:
|
||||
# cd /linux
|
||||
(as modules:)
|
||||
# make config (answer yes on CONFIG_NET and CONFIG_INET)
|
||||
(else included in the kernel:)
|
||||
# make config (answer yes on CONFIG _NET, _INET and _DE600 or _DE620)
|
||||
# make clean
|
||||
# make zImage (or whatever magic you usually do)
|
||||
|
||||
o I use lilo to boot multiple kernels, so that I at least
|
||||
can have one working kernel :-). If you do too, append
|
||||
these lines to /etc/lilo/config:
|
||||
|
||||
image = /linux/zImage
|
||||
label = newlinux
|
||||
root = /dev/hda2 (or whatever YOU have...)
|
||||
|
||||
# /etc/lilo/install
|
||||
|
||||
o Do "sync" and reboot the new kernel with a D-Link
|
||||
DE-600/DE-620 pocket adapter connected.
|
||||
|
||||
o The adapter can be configured with ifconfig eth?
|
||||
where the actual number is decided by the kernel
|
||||
when the drivers are initialized.
|
||||
|
||||
|
||||
5. "PROBLEMS" AND TUNING,
|
||||
|
||||
o If you see error messages from the driver, and if the traffic
|
||||
stops on the adapter, try to do "ifconfig" and "route" once
|
||||
more, just as in "rc.inet1". This should take care of most
|
||||
problems, including effects from power loss, or adapters that
|
||||
aren't connected to the printer port in some way or another.
|
||||
You can somewhat change the behaviour by enabling/disabling
|
||||
the macro SHUTDOWN_WHEN_LOST in the "tuning" section.
|
||||
For the DE-600 there is another macro, CHECK_LOST_DE600,
|
||||
that you might want to read about in the "tuning" section.
|
||||
|
||||
o Some machines have trouble handling the parallel port and
|
||||
the adapter at high speed. If you experience problems:
|
||||
|
||||
DE-600:
|
||||
- The adapter is not recognized at boot, i.e. an Ethernet
|
||||
address of 00:80:c8:... is not shown, try to add another
|
||||
"; SLOW_DOWN_IO"
|
||||
at DE600_SLOW_DOWN in the "tuning" section. As a last resort,
|
||||
uncomment: "#define REALLY_SLOW_IO" (see <asm/io.h> for hints).
|
||||
|
||||
- You experience "timeout" messages: first try to add another
|
||||
"; SLOW_DOWN_IO"
|
||||
at DE600_SLOW_DOWN in the "tuning" section, _then_ try to
|
||||
increase the value (original value: 5) at
|
||||
"if (tickssofar < 5)" near line 422.
|
||||
|
||||
DE-620:
|
||||
- Your parallel port might be "sluggish". To cater for
|
||||
this, there are the macros LOWSPEED and READ_DELAY/WRITE_DELAY
|
||||
in the "tuning" section. Your first step should be to enable
|
||||
LOWSPEED, and after that you can "tune" the XXX_DELAY values.
|
||||
|
||||
o If the adapter _is_ recognized at boot but you get messages
|
||||
about "Network Unreachable", then the problem is probably
|
||||
_not_ with the driver. Check your net configuration instead
|
||||
(ifconfig and route) in "rc.inet1".
|
||||
|
||||
o There is some rudimentary support for debugging, look at
|
||||
the source. Use "-DDE600_DEBUG=3" or "-DDE620_DEBUG=3"
|
||||
when compiling, or include it in "linux/drivers/net/CONFIG".
|
||||
IF YOU HAVE PROBLEMS YOU CAN'T SOLVE: PLEASE COMPILE THE DRIVER
|
||||
WITH DEBUGGING ENABLED, AND SEND ME THE RESULTING OUTPUT!
|
||||
|
||||
|
||||
6. USING THE DRIVERS WITH EARLIER RELEASES.
|
||||
|
||||
The later 1.1.X releases of the Linux kernel include some
|
||||
changes in the networking layer (a.k.a. NET3). This affects
|
||||
these drivers in a few places. The hints that follow are
|
||||
_not_ tested by me, since I don't have the disk space to keep
|
||||
all releases on-line.
|
||||
Known needed changes to date:
|
||||
- release patchfile: some patches will fail, but they should
|
||||
be easy to apply "by hand", since they are trivial.
|
||||
(Space.c: d_link_init() is now called de600_probe())
|
||||
- de600.c: change "mark_bh(NET_BH)" to "mark_bh(INET_BH)".
|
||||
- de620.c: (maybe) change the code around "netif_rx(skb);" to be
|
||||
similar to the code around "dev_rint(...)" in de600.c
|
||||
|
||||
|
||||
7. ACKNOWLEDGMENTS.
|
||||
|
||||
These drivers wouldn't have been done without the base
|
||||
(and support) from Ross Biro, and D-Link Systems Inc.
|
||||
The driver relies upon GPL-ed source from D-Link Systems Inc.
|
||||
and from Russel Nelson at Crynwr Software <nelson@crynwr.com>.
|
||||
|
||||
Additional input also from:
|
||||
Donald Becker <becker@super.org>, Alan Cox <A.Cox@swansea.ac.uk>
|
||||
and Fred N. van Kempen <waltje@uWalt.NL.Mugnet.ORG>
|
||||
|
||||
DE-600 alpha release primary victim^H^H^H^H^H^Htester:
|
||||
- Erik Proper <erikp@cs.kun.nl>.
|
||||
Good input also from several users, most notably
|
||||
- Mark Burton <markb@ordern.demon.co.uk>.
|
||||
|
||||
DE-620 alpha release victims^H^H^H^H^H^H^Htesters:
|
||||
- J. Joshua Kopper <kopper@rtsg.mot.com>
|
||||
- Olav Kvittem <Olav.Kvittem@uninett.no>
|
||||
- Germano Caronni <caronni@nessie.cs.id.ethz.ch>
|
||||
- Jeremy Fitzhardinge <jeremy@suite.sw.oz.au>
|
||||
|
||||
|
||||
Happy hacking!
|
||||
|
||||
Bjorn Ekwall == bj0rn@blox.se
|
||||
@@ -1,92 +0,0 @@
|
||||
|
||||
DE10x
|
||||
=====
|
||||
|
||||
Memory Addresses:
|
||||
|
||||
SW1 SW2 SW3 SW4
|
||||
64K on on on on d0000 dbfff
|
||||
off on on on c0000 cbfff
|
||||
off off on on e0000 ebfff
|
||||
|
||||
32K on on off on d8000 dbfff
|
||||
off on off on c8000 cbfff
|
||||
off off off on e8000 ebfff
|
||||
|
||||
DBR ROM on on dc000 dffff
|
||||
off on cc000 cffff
|
||||
off off ec000 effff
|
||||
|
||||
Note that the 2K mode is set by SW3/SW4 on/off or off/off. Address
|
||||
assignment is through the RBSA register.
|
||||
|
||||
I/O Address:
|
||||
SW5
|
||||
0x300 on
|
||||
0x200 off
|
||||
|
||||
Remote Boot:
|
||||
SW6
|
||||
Disable on
|
||||
Enable off
|
||||
|
||||
Remote Boot Timeout:
|
||||
SW7
|
||||
2.5min on
|
||||
30s off
|
||||
|
||||
IRQ:
|
||||
SW8 SW9 SW10 SW11 SW12
|
||||
2 on off off off off
|
||||
3 off on off off off
|
||||
4 off off on off off
|
||||
5 off off off on off
|
||||
7 off off off off on
|
||||
|
||||
DE20x
|
||||
=====
|
||||
|
||||
Memory Size:
|
||||
|
||||
SW3 SW4
|
||||
64K on on
|
||||
32K off on
|
||||
2K on off
|
||||
2K off off
|
||||
|
||||
Start Addresses:
|
||||
|
||||
SW1 SW2 SW3 SW4
|
||||
64K on on on on c0000 cffff
|
||||
on off on on d0000 dffff
|
||||
off on on on e0000 effff
|
||||
|
||||
32K on on off off c8000 cffff
|
||||
on off off off d8000 dffff
|
||||
off on off off e8000 effff
|
||||
|
||||
Illegal off off - - - -
|
||||
|
||||
I/O Address:
|
||||
SW5
|
||||
0x300 on
|
||||
0x200 off
|
||||
|
||||
Remote Boot:
|
||||
SW6
|
||||
Disable on
|
||||
Enable off
|
||||
|
||||
Remote Boot Timeout:
|
||||
SW7
|
||||
2.5min on
|
||||
30s off
|
||||
|
||||
IRQ:
|
||||
SW8 SW9 SW10 SW11 SW12
|
||||
5 on off off off off
|
||||
9 off on off off off
|
||||
10 off off on off off
|
||||
11 off off off on off
|
||||
15 off off off off on
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
The EtherWORKS 3 driver in this distribution is designed to work with all
|
||||
kernels > 1.1.33 (approx) and includes tools in the 'ewrk3tools'
|
||||
subdirectory to allow set up of the card, similar to the MSDOS
|
||||
'NICSETUP.EXE' tools provided on the DOS drivers disk (type 'make' in that
|
||||
subdirectory to make the tools).
|
||||
|
||||
The supported cards are DE203, DE204 and DE205. All other cards are NOT
|
||||
supported - refer to 'depca.c' for running the LANCE based network cards and
|
||||
'de4x5.c' for the DIGITAL Semiconductor PCI chip based adapters from
|
||||
Digital.
|
||||
|
||||
The ability to load this driver as a loadable module has been included and
|
||||
used extensively during the driver development (to save those long reboot
|
||||
sequences). To utilise this ability, you have to do 8 things:
|
||||
|
||||
0) have a copy of the loadable modules code installed on your system.
|
||||
1) copy ewrk3.c from the /linux/drivers/net directory to your favourite
|
||||
temporary directory.
|
||||
2) edit the source code near line 1898 to reflect the I/O address and
|
||||
IRQ you're using.
|
||||
3) compile ewrk3.c, but include -DMODULE in the command line to ensure
|
||||
that the correct bits are compiled (see end of source code).
|
||||
4) if you are wanting to add a new card, goto 5. Otherwise, recompile a
|
||||
kernel with the ewrk3 configuration turned off and reboot.
|
||||
5) insmod ewrk3.o
|
||||
[Alan Cox: Changed this so you can insmod ewrk3.o irq=x io=y]
|
||||
[Adam Kropelin: Multiple cards now supported by irq=x1,x2 io=y1,y2]
|
||||
6) run the net startup bits for your new eth?? interface manually
|
||||
(usually /etc/rc.inet[12] at boot time).
|
||||
7) enjoy!
|
||||
|
||||
Note that autoprobing is not allowed in loadable modules - the system is
|
||||
already up and running and you're messing with interrupts.
|
||||
|
||||
To unload a module, turn off the associated interface
|
||||
'ifconfig eth?? down' then 'rmmod ewrk3'.
|
||||
|
||||
The performance we've achieved so far has been measured through the 'ttcp'
|
||||
tool at 975kB/s. This measures the total TCP stack performance which
|
||||
includes the card, so don't expect to get much nearer the 1.25MB/s
|
||||
theoretical Ethernet rate.
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
Dave
|
||||
12
MAINTAINERS
12
MAINTAINERS
@@ -2974,11 +2974,6 @@ S: Maintained
|
||||
F: include/linux/netfilter_bridge/
|
||||
F: net/bridge/
|
||||
|
||||
ETHERTEAM 16I DRIVER
|
||||
M: Mika Kuoppala <miku@iki.fi>
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/fujitsu/eth16i.c
|
||||
|
||||
EXT2 FILE SYSTEM
|
||||
M: Jan Kara <jack@suse.cz>
|
||||
L: linux-ext4@vger.kernel.org
|
||||
@@ -5370,13 +5365,6 @@ F: include/linux/sunrpc/
|
||||
F: include/uapi/linux/nfs*
|
||||
F: include/uapi/linux/sunrpc/
|
||||
|
||||
NI5010 NETWORK DRIVER
|
||||
M: Jan-Pascal van Best <janpascal@vanbest.org>
|
||||
M: Andreas Mohr <andi@lisas.de>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/ethernet/racal/ni5010.*
|
||||
|
||||
NILFS2 FILESYSTEM
|
||||
M: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
|
||||
L: linux-nilfs@vger.kernel.org
|
||||
|
||||
@@ -40,26 +40,11 @@
|
||||
extern struct net_device *hp100_probe(int unit);
|
||||
extern struct net_device *ultra_probe(int unit);
|
||||
extern struct net_device *wd_probe(int unit);
|
||||
extern struct net_device *el2_probe(int unit);
|
||||
extern struct net_device *ne_probe(int unit);
|
||||
extern struct net_device *hp_probe(int unit);
|
||||
extern struct net_device *hp_plus_probe(int unit);
|
||||
extern struct net_device *express_probe(int unit);
|
||||
extern struct net_device *eepro_probe(int unit);
|
||||
extern struct net_device *at1700_probe(int unit);
|
||||
extern struct net_device *fmv18x_probe(int unit);
|
||||
extern struct net_device *eth16i_probe(int unit);
|
||||
extern struct net_device *i82596_probe(int unit);
|
||||
extern struct net_device *ewrk3_probe(int unit);
|
||||
extern struct net_device *el1_probe(int unit);
|
||||
extern struct net_device *el16_probe(int unit);
|
||||
extern struct net_device *elplus_probe(int unit);
|
||||
extern struct net_device *e2100_probe(int unit);
|
||||
extern struct net_device *ni5010_probe(int unit);
|
||||
extern struct net_device *ni52_probe(int unit);
|
||||
extern struct net_device *ni65_probe(int unit);
|
||||
extern struct net_device *sonic_probe(int unit);
|
||||
extern struct net_device *seeq8005_probe(int unit);
|
||||
extern struct net_device *smc_init(int unit);
|
||||
extern struct net_device *atarilance_probe(int unit);
|
||||
extern struct net_device *sun3lance_probe(int unit);
|
||||
@@ -74,9 +59,6 @@ extern struct net_device *mac89x0_probe(int unit);
|
||||
extern struct net_device *cops_probe(int unit);
|
||||
extern struct net_device *ltpc_probe(void);
|
||||
|
||||
/* Detachable devices ("pocket adaptors") */
|
||||
extern struct net_device *de620_probe(int unit);
|
||||
|
||||
/* Fibre Channel adapters */
|
||||
extern int iph5526_probe(struct net_device *dev);
|
||||
|
||||
@@ -120,18 +102,6 @@ static struct devprobe2 isa_probes[] __initdata = {
|
||||
#ifdef CONFIG_WD80x3
|
||||
{wd_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_EL2 /* 3c503 */
|
||||
{el2_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_HPLAN
|
||||
{hp_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_HPLAN_PLUS
|
||||
{hp_plus_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_E2100 /* Cabletron E21xx series. */
|
||||
{e2100_probe, 0},
|
||||
#endif
|
||||
#if defined(CONFIG_NE2000) || \
|
||||
defined(CONFIG_NE_H8300) /* ISA (use ne2k-pci for PCI cards) */
|
||||
{ne_probe, 0},
|
||||
@@ -142,60 +112,20 @@ static struct devprobe2 isa_probes[] __initdata = {
|
||||
#ifdef CONFIG_SMC9194
|
||||
{smc_init, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_SEEQ8005
|
||||
{seeq8005_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_CS89x0
|
||||
#ifndef CONFIG_CS89x0_PLATFORM
|
||||
{cs89x0_probe, 0},
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_AT1700
|
||||
{at1700_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_ETH16I
|
||||
{eth16i_probe, 0}, /* ICL EtherTeam 16i/32 */
|
||||
#endif
|
||||
#ifdef CONFIG_EEXPRESS /* Intel EtherExpress */
|
||||
{express_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */
|
||||
{eepro_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
|
||||
{ewrk3_probe, 0},
|
||||
#endif
|
||||
#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */
|
||||
#if defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */
|
||||
{i82596_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_EL1 /* 3c501 */
|
||||
{el1_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_EL16 /* 3c507 */
|
||||
{el16_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_ELPLUS /* 3c505 */
|
||||
{elplus_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_NI5010
|
||||
{ni5010_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_NI52
|
||||
{ni52_probe, 0},
|
||||
#endif
|
||||
#ifdef CONFIG_NI65
|
||||
{ni65_probe, 0},
|
||||
#endif
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
static struct devprobe2 parport_probes[] __initdata = {
|
||||
#ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
|
||||
{de620_probe, 0},
|
||||
#endif
|
||||
{NULL, 0},
|
||||
};
|
||||
|
||||
static struct devprobe2 m68k_probes[] __initdata = {
|
||||
#ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
|
||||
{atarilance_probe, 0},
|
||||
@@ -234,8 +164,7 @@ static void __init ethif_probe2(int unit)
|
||||
return;
|
||||
|
||||
(void)( probe_list2(unit, m68k_probes, base_addr == 0) &&
|
||||
probe_list2(unit, isa_probes, base_addr == 0) &&
|
||||
probe_list2(unit, parport_probes, base_addr == 0));
|
||||
probe_list2(unit, isa_probes, base_addr == 0));
|
||||
}
|
||||
|
||||
/* Statically configured drivers -- order matters here. */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
||||
|
||||
/*
|
||||
* Index to functions.
|
||||
*/
|
||||
|
||||
static int el1_probe1(struct net_device *dev, int ioaddr);
|
||||
static int el_open(struct net_device *dev);
|
||||
static void el_timeout(struct net_device *dev);
|
||||
static netdev_tx_t el_start_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
static irqreturn_t el_interrupt(int irq, void *dev_id);
|
||||
static void el_receive(struct net_device *dev);
|
||||
static void el_reset(struct net_device *dev);
|
||||
static int el1_close(struct net_device *dev);
|
||||
static void set_multicast_list(struct net_device *dev);
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
|
||||
#define EL1_IO_EXTENT 16
|
||||
|
||||
#ifndef EL_DEBUG
|
||||
#define EL_DEBUG 0 /* use 0 for production, 1 for devel., >2 for debug */
|
||||
#endif /* Anything above 5 is wordy death! */
|
||||
#define debug el_debug
|
||||
static int el_debug = EL_DEBUG;
|
||||
|
||||
/*
|
||||
* Board-specific info in netdev_priv(dev).
|
||||
*/
|
||||
|
||||
struct net_local
|
||||
{
|
||||
int tx_pkt_start; /* The length of the current Tx packet. */
|
||||
int collisions; /* Tx collisions this packet */
|
||||
int loading; /* Spot buffer load collisions */
|
||||
int txing; /* True if card is in TX mode */
|
||||
spinlock_t lock; /* Serializing lock */
|
||||
};
|
||||
|
||||
|
||||
#define RX_STATUS (ioaddr + 0x06)
|
||||
#define RX_CMD RX_STATUS
|
||||
#define TX_STATUS (ioaddr + 0x07)
|
||||
#define TX_CMD TX_STATUS
|
||||
#define GP_LOW (ioaddr + 0x08)
|
||||
#define GP_HIGH (ioaddr + 0x09)
|
||||
#define RX_BUF_CLR (ioaddr + 0x0A)
|
||||
#define RX_LOW (ioaddr + 0x0A)
|
||||
#define RX_HIGH (ioaddr + 0x0B)
|
||||
#define SAPROM (ioaddr + 0x0C)
|
||||
#define AX_STATUS (ioaddr + 0x0E)
|
||||
#define AX_CMD AX_STATUS
|
||||
#define DATAPORT (ioaddr + 0x0F)
|
||||
#define TX_RDY 0x08 /* In TX_STATUS */
|
||||
|
||||
#define EL1_DATAPTR 0x08
|
||||
#define EL1_RXPTR 0x0A
|
||||
#define EL1_SAPROM 0x0C
|
||||
#define EL1_DATAPORT 0x0f
|
||||
|
||||
/*
|
||||
* Writes to the ax command register.
|
||||
*/
|
||||
|
||||
#define AX_OFF 0x00 /* Irq off, buffer access on */
|
||||
#define AX_SYS 0x40 /* Load the buffer */
|
||||
#define AX_XMIT 0x44 /* Transmit a packet */
|
||||
#define AX_RX 0x48 /* Receive a packet */
|
||||
#define AX_LOOP 0x0C /* Loopback mode */
|
||||
#define AX_RESET 0x80
|
||||
|
||||
/*
|
||||
* Normal receive mode written to RX_STATUS. We must intr on short packets
|
||||
* to avoid bogus rx lockups.
|
||||
*/
|
||||
|
||||
#define RX_NORM 0xA8 /* 0x68 == all addrs, 0xA8 only to me. */
|
||||
#define RX_PROM 0x68 /* Senior Prom, uhmm promiscuous mode. */
|
||||
#define RX_MULT 0xE8 /* Accept multicast packets. */
|
||||
#define TX_NORM 0x0A /* Interrupt on everything that might hang the chip */
|
||||
|
||||
/*
|
||||
* TX_STATUS register.
|
||||
*/
|
||||
|
||||
#define TX_COLLISION 0x02
|
||||
#define TX_16COLLISIONS 0x04
|
||||
#define TX_READY 0x08
|
||||
|
||||
#define RX_RUNT 0x08
|
||||
#define RX_MISSED 0x01 /* Missed a packet due to 3c501 braindamage. */
|
||||
#define RX_GOOD 0x30 /* Good packet 0x20, or simple overflow 0x10. */
|
||||
|
||||
@@ -18,20 +18,6 @@ config NET_VENDOR_3COM
|
||||
|
||||
if NET_VENDOR_3COM
|
||||
|
||||
config EL1
|
||||
tristate "3c501 \"EtherLink\" support"
|
||||
depends on ISA
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y and read
|
||||
the Ethernet-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>. Also, consider buying a
|
||||
new card, since the 3c501 is slow, broken, and obsolete: you will
|
||||
have problems. Some people suggest to ping ("man ping") a nearby
|
||||
machine every minute ("man cron") when using this card.
|
||||
|
||||
To compile this driver as a module, choose M here. The module
|
||||
will be called 3c501.
|
||||
|
||||
config EL3
|
||||
tristate "3c509/3c579 \"EtherLink III\" support"
|
||||
depends on (ISA || EISA)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# Makefile for the 3Com Ethernet device drivers
|
||||
#
|
||||
|
||||
obj-$(CONFIG_EL1) += 3c501.o
|
||||
obj-$(CONFIG_EL3) += 3c509.o
|
||||
obj-$(CONFIG_3C515) += 3c515.o
|
||||
obj-$(CONFIG_PCMCIA_3C589) += 3c589_cs.o
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
||||
/* Definitions for the 3Com 3c503 Etherlink 2. */
|
||||
/* This file is distributed under the GPL.
|
||||
Many of these names and comments are directly from the Crynwr packet
|
||||
drivers, which are released under the GPL. */
|
||||
|
||||
#define EL2H (dev->base_addr + 0x400)
|
||||
#define EL2L (dev->base_addr)
|
||||
|
||||
/* Vendor unique hardware addr. prefix. 3Com has 2 because they ran
|
||||
out of available addresses on the first one... */
|
||||
|
||||
#define OLD_3COM_ID 0x02608c
|
||||
#define NEW_3COM_ID 0x0020af
|
||||
|
||||
/* Shared memory management parameters. NB: The 8 bit cards have only
|
||||
one bank (MB1) which serves both Tx and Rx packet space. The 16bit
|
||||
cards have 2 banks, MB0 for Tx packets, and MB1 for Rx packets.
|
||||
You choose which bank appears in the sh. mem window with EGACFR_MBSn */
|
||||
|
||||
#define EL2_MB0_START_PG (0x00) /* EL2/16 Tx packets go in bank 0 */
|
||||
#define EL2_MB1_START_PG (0x20) /* First page of bank 1 */
|
||||
#define EL2_MB1_STOP_PG (0x40) /* Last page +1 of bank 1 */
|
||||
|
||||
/* 3Com 3c503 ASIC registers */
|
||||
#define E33G_STARTPG (EL2H+0) /* Start page, matching EN0_STARTPG */
|
||||
#define E33G_STOPPG (EL2H+1) /* Stop page, must match EN0_STOPPG */
|
||||
#define E33G_DRQCNT (EL2H+2) /* DMA burst count */
|
||||
#define E33G_IOBASE (EL2H+3) /* Read of I/O base jumpers. */
|
||||
/* (non-useful, but it also appears at the end of EPROM space) */
|
||||
#define E33G_ROMBASE (EL2H+4) /* Read of memory base jumpers. */
|
||||
#define E33G_GACFR (EL2H+5) /* Config/setup bits for the ASIC GA */
|
||||
#define E33G_CNTRL (EL2H+6) /* Board's main control register */
|
||||
#define E33G_STATUS (EL2H+7) /* Status on completions. */
|
||||
#define E33G_IDCFR (EL2H+8) /* Interrupt/DMA config register */
|
||||
/* (Which IRQ to assert, DMA chan to use) */
|
||||
#define E33G_DMAAH (EL2H+9) /* High byte of DMA address reg */
|
||||
#define E33G_DMAAL (EL2H+10) /* Low byte of DMA address reg */
|
||||
/* "Vector pointer" - if this address matches a read, the EPROM (rather than
|
||||
shared RAM) is mapped into memory space. */
|
||||
#define E33G_VP2 (EL2H+11)
|
||||
#define E33G_VP1 (EL2H+12)
|
||||
#define E33G_VP0 (EL2H+13)
|
||||
#define E33G_FIFOH (EL2H+14) /* FIFO for programmed I/O moves */
|
||||
#define E33G_FIFOL (EL2H+15) /* ... low byte of above. */
|
||||
|
||||
/* Bits in E33G_CNTRL register: */
|
||||
|
||||
#define ECNTRL_RESET (0x01) /* Software reset of the ASIC and 8390 */
|
||||
#define ECNTRL_THIN (0x02) /* Onboard xcvr enable, AUI disable */
|
||||
#define ECNTRL_AUI (0x00) /* Onboard xcvr disable, AUI enable */
|
||||
#define ECNTRL_SAPROM (0x04) /* Map the station address prom */
|
||||
#define ECNTRL_DBLBFR (0x20) /* FIFO configuration bit */
|
||||
#define ECNTRL_OUTPUT (0x40) /* PC-to-3C503 direction if 1 */
|
||||
#define ECNTRL_INPUT (0x00) /* 3C503-to-PC direction if 0 */
|
||||
#define ECNTRL_START (0x80) /* Start the DMA logic */
|
||||
|
||||
/* Bits in E33G_STATUS register: */
|
||||
|
||||
#define ESTAT_DPRDY (0x80) /* Data port (of FIFO) ready */
|
||||
#define ESTAT_UFLW (0x40) /* Tried to read FIFO when it was empty */
|
||||
#define ESTAT_OFLW (0x20) /* Tried to write FIFO when it was full */
|
||||
#define ESTAT_DTC (0x10) /* Terminal Count from PC bus DMA logic */
|
||||
#define ESTAT_DIP (0x08) /* DMA In Progress */
|
||||
|
||||
/* Bits in E33G_GACFR register: */
|
||||
|
||||
#define EGACFR_NIM (0x80) /* NIC interrupt mask */
|
||||
#define EGACFR_TCM (0x40) /* DMA term. count interrupt mask */
|
||||
#define EGACFR_RSEL (0x08) /* Map a bank of card mem into system mem */
|
||||
#define EGACFR_MBS2 (0x04) /* Memory bank select, bit 2. */
|
||||
#define EGACFR_MBS1 (0x02) /* Memory bank select, bit 1. */
|
||||
#define EGACFR_MBS0 (0x01) /* Memory bank select, bit 0. */
|
||||
|
||||
#define EGACFR_NORM (0x49) /* TCM | RSEL | MBS0 */
|
||||
#define EGACFR_IRQOFF (0xc9) /* TCM | RSEL | MBS0 | NIM */
|
||||
|
||||
/*
|
||||
MBS2 MBS1 MBS0 Sh. mem windows card mem at:
|
||||
---- ---- ---- -----------------------------
|
||||
0 0 0 0x0000 -- bank 0
|
||||
0 0 1 0x2000 -- bank 1 (only choice for 8bit card)
|
||||
0 1 0 0x4000 -- bank 2, not used
|
||||
0 1 1 0x6000 -- bank 3, not used
|
||||
|
||||
There was going to be a 32k card that used bank 2 and 3, but it
|
||||
never got produced.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/* End of 3C503 parameter definitions */
|
||||
@@ -21,18 +21,6 @@ config NET_VENDOR_8390
|
||||
|
||||
if NET_VENDOR_8390
|
||||
|
||||
config EL2
|
||||
tristate "3c503 \"EtherLink II\" support"
|
||||
depends on ISA
|
||||
select CRC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y and read
|
||||
the Ethernet-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here. The module
|
||||
will be called 3c503.
|
||||
|
||||
config PCMCIA_AXNET
|
||||
tristate "Asix AX88190 PCMCIA support"
|
||||
depends on PCMCIA
|
||||
@@ -62,42 +50,6 @@ config AX88796_93CX6
|
||||
---help---
|
||||
Select this if your platform comes with an external 93CX6 eeprom.
|
||||
|
||||
config E2100
|
||||
tristate "Cabletron E21xx support"
|
||||
depends on ISA
|
||||
select CRC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y and read
|
||||
the Ethernet-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here. The module
|
||||
will be called e2100.
|
||||
|
||||
config HPLAN_PLUS
|
||||
tristate "HP PCLAN+ (27247B and 27252A) support"
|
||||
depends on ISA
|
||||
select CRC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y and read
|
||||
the Ethernet-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here. The module
|
||||
will be called hp-plus.
|
||||
|
||||
config HPLAN
|
||||
tristate "HP PCLAN (27245 and other 27xxx series) support"
|
||||
depends on ISA
|
||||
select CRC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y and read
|
||||
the Ethernet-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto>.
|
||||
|
||||
To compile this driver as a module, choose M here. The module
|
||||
will be called hp.
|
||||
|
||||
config HYDRA
|
||||
tristate "Hydra support"
|
||||
depends on ZORRO
|
||||
|
||||
@@ -6,10 +6,6 @@ obj-$(CONFIG_MAC8390) += mac8390.o
|
||||
obj-$(CONFIG_APNE) += apne.o 8390.o
|
||||
obj-$(CONFIG_ARM_ETHERH) += etherh.o
|
||||
obj-$(CONFIG_AX88796) += ax88796.o
|
||||
obj-$(CONFIG_E2100) += e2100.o 8390.o
|
||||
obj-$(CONFIG_EL2) += 3c503.o 8390p.o
|
||||
obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390p.o
|
||||
obj-$(CONFIG_HPLAN) += hp.o 8390p.o
|
||||
obj-$(CONFIG_HYDRA) += hydra.o 8390.o
|
||||
obj-$(CONFIG_MCF8390) += mcf8390.o 8390.o
|
||||
obj-$(CONFIG_NE2000) += ne.o 8390p.o
|
||||
|
||||
@@ -1,489 +0,0 @@
|
||||
/* e2100.c: A Cabletron E2100 series ethernet driver for linux. */
|
||||
/*
|
||||
Written 1993-1994 by Donald Becker.
|
||||
|
||||
Copyright 1994 by Donald Becker.
|
||||
Copyright 1993 United States Government as represented by the
|
||||
Director, National Security Agency. This software may be used and
|
||||
distributed according to the terms of the GNU General Public License,
|
||||
incorporated herein by reference.
|
||||
|
||||
This is a driver for the Cabletron E2100 series ethercards.
|
||||
|
||||
The Author may be reached as becker@scyld.com, or C/O
|
||||
Scyld Computing Corporation
|
||||
410 Severn Ave., Suite 210
|
||||
Annapolis MD 21403
|
||||
|
||||
The E2100 series ethercard is a fairly generic shared memory 8390
|
||||
implementation. The only unusual aspect is the way the shared memory
|
||||
registers are set: first you do an inb() in what is normally the
|
||||
station address region, and the low three bits of next outb() *address*
|
||||
is used as the write value for that register. Either someone wasn't
|
||||
too used to dem bit en bites, or they were trying to obfuscate the
|
||||
programming interface.
|
||||
|
||||
There is an additional complication when setting the window on the packet
|
||||
buffer. You must first do a read into the packet buffer region with the
|
||||
low 8 address bits the address setting the page for the start of the packet
|
||||
buffer window, and then do the above operation. See mem_on() for details.
|
||||
|
||||
One bug on the chip is that even a hard reset won't disable the memory
|
||||
window, usually resulting in a hung machine if mem_off() isn't called.
|
||||
If this happens, you must power down the machine for about 30 seconds.
|
||||
*/
|
||||
|
||||
static const char version[] =
|
||||
"e2100.c:v1.01 7/21/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#include "8390.h"
|
||||
|
||||
#define DRV_NAME "e2100"
|
||||
|
||||
static int e21_probe_list[] = {0x300, 0x280, 0x380, 0x220, 0};
|
||||
|
||||
/* Offsets from the base_addr.
|
||||
Read from the ASIC register, and the low three bits of the next outb()
|
||||
address is used to set the corresponding register. */
|
||||
#define E21_NIC_OFFSET 0 /* Offset to the 8390 NIC. */
|
||||
#define E21_ASIC 0x10
|
||||
#define E21_MEM_ENABLE 0x10
|
||||
#define E21_MEM_ON 0x05 /* Enable memory in 16 bit mode. */
|
||||
#define E21_MEM_ON_8 0x07 /* Enable memory in 8 bit mode. */
|
||||
#define E21_MEM_BASE 0x11
|
||||
#define E21_IRQ_LOW 0x12 /* The low three bits of the IRQ number. */
|
||||
#define E21_IRQ_HIGH 0x14 /* The high IRQ bit and media select ... */
|
||||
#define E21_MEDIA 0x14 /* (alias). */
|
||||
#define E21_ALT_IFPORT 0x02 /* Set to use the other (BNC,AUI) port. */
|
||||
#define E21_BIG_MEM 0x04 /* Use a bigger (64K) buffer (we don't) */
|
||||
#define E21_SAPROM 0x10 /* Offset to station address data. */
|
||||
#define E21_IO_EXTENT 0x20
|
||||
|
||||
static inline void mem_on(short port, volatile char __iomem *mem_base,
|
||||
unsigned char start_page )
|
||||
{
|
||||
/* This is a little weird: set the shared memory window by doing a
|
||||
read. The low address bits specify the starting page. */
|
||||
readb(mem_base+start_page);
|
||||
inb(port + E21_MEM_ENABLE);
|
||||
outb(E21_MEM_ON, port + E21_MEM_ENABLE + E21_MEM_ON);
|
||||
}
|
||||
|
||||
static inline void mem_off(short port)
|
||||
{
|
||||
inb(port + E21_MEM_ENABLE);
|
||||
outb(0x00, port + E21_MEM_ENABLE);
|
||||
}
|
||||
|
||||
/* In other drivers I put the TX pages first, but the E2100 window circuitry
|
||||
is designed to have a 4K Tx region last. The windowing circuitry wraps the
|
||||
window at 0x2fff->0x0000 so that the packets at e.g. 0x2f00 in the RX ring
|
||||
appear contiguously in the window. */
|
||||
#define E21_RX_START_PG 0x00 /* First page of RX buffer */
|
||||
#define E21_RX_STOP_PG 0x30 /* Last page +1 of RX ring */
|
||||
#define E21_BIG_RX_STOP_PG 0xF0 /* Last page +1 of RX ring */
|
||||
#define E21_TX_START_PG E21_RX_STOP_PG /* First page of TX buffer */
|
||||
|
||||
static int e21_probe1(struct net_device *dev, int ioaddr);
|
||||
|
||||
static int e21_open(struct net_device *dev);
|
||||
static void e21_reset_8390(struct net_device *dev);
|
||||
static void e21_block_input(struct net_device *dev, int count,
|
||||
struct sk_buff *skb, int ring_offset);
|
||||
static void e21_block_output(struct net_device *dev, int count,
|
||||
const unsigned char *buf, int start_page);
|
||||
static void e21_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
|
||||
int ring_page);
|
||||
static int e21_open(struct net_device *dev);
|
||||
static int e21_close(struct net_device *dev);
|
||||
|
||||
|
||||
/* Probe for the E2100 series ethercards. These cards have an 8390 at the
|
||||
base address and the station address at both offset 0x10 and 0x18. I read
|
||||
the station address from offset 0x18 to avoid the dataport of NE2000
|
||||
ethercards, and look for Ctron's unique ID (first three octets of the
|
||||
station address).
|
||||
*/
|
||||
|
||||
static int __init do_e2100_probe(struct net_device *dev)
|
||||
{
|
||||
int *port;
|
||||
int base_addr = dev->base_addr;
|
||||
int irq = dev->irq;
|
||||
|
||||
if (base_addr > 0x1ff) /* Check a single specified location. */
|
||||
return e21_probe1(dev, base_addr);
|
||||
else if (base_addr != 0) /* Don't probe at all. */
|
||||
return -ENXIO;
|
||||
|
||||
for (port = e21_probe_list; *port; port++) {
|
||||
dev->irq = irq;
|
||||
if (e21_probe1(dev, *port) == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#ifndef MODULE
|
||||
struct net_device * __init e2100_probe(int unit)
|
||||
{
|
||||
struct net_device *dev = alloc_ei_netdev();
|
||||
int err;
|
||||
|
||||
if (!dev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
sprintf(dev->name, "eth%d", unit);
|
||||
netdev_boot_setup_check(dev);
|
||||
|
||||
err = do_e2100_probe(dev);
|
||||
if (err)
|
||||
goto out;
|
||||
return dev;
|
||||
out:
|
||||
free_netdev(dev);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct net_device_ops e21_netdev_ops = {
|
||||
.ndo_open = e21_open,
|
||||
.ndo_stop = e21_close,
|
||||
|
||||
.ndo_start_xmit = ei_start_xmit,
|
||||
.ndo_tx_timeout = ei_tx_timeout,
|
||||
.ndo_get_stats = ei_get_stats,
|
||||
.ndo_set_rx_mode = ei_set_multicast_list,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_change_mtu = eth_change_mtu,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
.ndo_poll_controller = ei_poll,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int __init e21_probe1(struct net_device *dev, int ioaddr)
|
||||
{
|
||||
int i, status, retval;
|
||||
unsigned char *station_addr = dev->dev_addr;
|
||||
static unsigned version_printed;
|
||||
|
||||
if (!request_region(ioaddr, E21_IO_EXTENT, DRV_NAME))
|
||||
return -EBUSY;
|
||||
|
||||
/* First check the station address for the Ctron prefix. */
|
||||
if (inb(ioaddr + E21_SAPROM + 0) != 0x00 ||
|
||||
inb(ioaddr + E21_SAPROM + 1) != 0x00 ||
|
||||
inb(ioaddr + E21_SAPROM + 2) != 0x1d) {
|
||||
retval = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Verify by making certain that there is a 8390 at there. */
|
||||
outb(E8390_NODMA + E8390_STOP, ioaddr);
|
||||
udelay(1); /* we want to delay one I/O cycle - which is 2MHz */
|
||||
status = inb(ioaddr);
|
||||
if (status != 0x21 && status != 0x23) {
|
||||
retval = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Read the station address PROM. */
|
||||
for (i = 0; i < 6; i++)
|
||||
station_addr[i] = inb(ioaddr + E21_SAPROM + i);
|
||||
|
||||
inb(ioaddr + E21_MEDIA); /* Point to media selection. */
|
||||
outb(0, ioaddr + E21_ASIC); /* and disable the secondary interface. */
|
||||
|
||||
if (ei_debug && version_printed++ == 0)
|
||||
printk(version);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
printk(" %02X", station_addr[i]);
|
||||
|
||||
if (dev->irq < 2) {
|
||||
static const int irqlist[] = {15, 11, 10, 12, 5, 9, 3, 4};
|
||||
for (i = 0; i < ARRAY_SIZE(irqlist); i++)
|
||||
if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) {
|
||||
dev->irq = irqlist[i];
|
||||
break;
|
||||
}
|
||||
if (i >= ARRAY_SIZE(irqlist)) {
|
||||
printk(" unable to get IRQ %d.\n", dev->irq);
|
||||
retval = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
} else if (dev->irq == 2) /* Fixup luser bogosity: IRQ2 is really IRQ9 */
|
||||
dev->irq = 9;
|
||||
|
||||
/* The 8390 is at the base address. */
|
||||
dev->base_addr = ioaddr;
|
||||
|
||||
ei_status.name = "E2100";
|
||||
ei_status.word16 = 1;
|
||||
ei_status.tx_start_page = E21_TX_START_PG;
|
||||
ei_status.rx_start_page = E21_RX_START_PG;
|
||||
ei_status.stop_page = E21_RX_STOP_PG;
|
||||
ei_status.saved_irq = dev->irq;
|
||||
|
||||
/* Check the media port used. The port can be passed in on the
|
||||
low mem_end bits. */
|
||||
if (dev->mem_end & 15)
|
||||
dev->if_port = dev->mem_end & 7;
|
||||
else {
|
||||
dev->if_port = 0;
|
||||
inb(ioaddr + E21_MEDIA); /* Turn automatic media detection on. */
|
||||
for(i = 0; i < 6; i++)
|
||||
if (station_addr[i] != inb(ioaddr + E21_SAPROM + 8 + i)) {
|
||||
dev->if_port = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Never map in the E21 shared memory unless you are actively using it.
|
||||
Also, the shared memory has effective only one setting -- spread all
|
||||
over the 128K region! */
|
||||
if (dev->mem_start == 0)
|
||||
dev->mem_start = 0xd0000;
|
||||
|
||||
ei_status.mem = ioremap(dev->mem_start, 2*1024);
|
||||
if (!ei_status.mem) {
|
||||
printk("unable to remap memory\n");
|
||||
retval = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifdef notdef
|
||||
/* These values are unused. The E2100 has a 2K window into the packet
|
||||
buffer. The window can be set to start on any page boundary. */
|
||||
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
|
||||
dev->mem_end = ei_status.rmem_end = dev->mem_start + 2*1024;
|
||||
#endif
|
||||
|
||||
printk(", IRQ %d, %s media, memory @ %#lx.\n", dev->irq,
|
||||
dev->if_port ? "secondary" : "primary", dev->mem_start);
|
||||
|
||||
ei_status.reset_8390 = &e21_reset_8390;
|
||||
ei_status.block_input = &e21_block_input;
|
||||
ei_status.block_output = &e21_block_output;
|
||||
ei_status.get_8390_hdr = &e21_get_8390_hdr;
|
||||
|
||||
dev->netdev_ops = &e21_netdev_ops;
|
||||
NS8390_init(dev, 0);
|
||||
|
||||
retval = register_netdev(dev);
|
||||
if (retval)
|
||||
goto out;
|
||||
return 0;
|
||||
out:
|
||||
release_region(ioaddr, E21_IO_EXTENT);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
e21_open(struct net_device *dev)
|
||||
{
|
||||
short ioaddr = dev->base_addr;
|
||||
int retval;
|
||||
|
||||
if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev)))
|
||||
return retval;
|
||||
|
||||
/* Set the interrupt line and memory base on the hardware. */
|
||||
inb(ioaddr + E21_IRQ_LOW);
|
||||
outb(0, ioaddr + E21_ASIC + (dev->irq & 7));
|
||||
inb(ioaddr + E21_IRQ_HIGH); /* High IRQ bit, and if_port. */
|
||||
outb(0, ioaddr + E21_ASIC + (dev->irq > 7 ? 1:0)
|
||||
+ (dev->if_port ? E21_ALT_IFPORT : 0));
|
||||
inb(ioaddr + E21_MEM_BASE);
|
||||
outb(0, ioaddr + E21_ASIC + ((dev->mem_start >> 17) & 7));
|
||||
|
||||
ei_open(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
e21_reset_8390(struct net_device *dev)
|
||||
{
|
||||
short ioaddr = dev->base_addr;
|
||||
|
||||
outb(0x01, ioaddr);
|
||||
if (ei_debug > 1) printk("resetting the E2180x3 t=%ld...", jiffies);
|
||||
ei_status.txing = 0;
|
||||
|
||||
/* Set up the ASIC registers, just in case something changed them. */
|
||||
|
||||
if (ei_debug > 1) printk("reset done\n");
|
||||
}
|
||||
|
||||
/* Grab the 8390 specific header. We put the 2k window so the header page
|
||||
appears at the start of the shared memory. */
|
||||
|
||||
static void
|
||||
e21_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
|
||||
{
|
||||
|
||||
short ioaddr = dev->base_addr;
|
||||
char __iomem *shared_mem = ei_status.mem;
|
||||
|
||||
mem_on(ioaddr, shared_mem, ring_page);
|
||||
|
||||
#ifdef notdef
|
||||
/* Officially this is what we are doing, but the readl() is faster */
|
||||
memcpy_fromio(hdr, shared_mem, sizeof(struct e8390_pkt_hdr));
|
||||
#else
|
||||
((unsigned int*)hdr)[0] = readl(shared_mem);
|
||||
#endif
|
||||
|
||||
/* Turn off memory access: we would need to reprogram the window anyway. */
|
||||
mem_off(ioaddr);
|
||||
|
||||
}
|
||||
|
||||
/* Block input and output are easy on shared memory ethercards.
|
||||
The E21xx makes block_input() especially easy by wrapping the top
|
||||
ring buffer to the bottom automatically. */
|
||||
static void
|
||||
e21_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
|
||||
{
|
||||
short ioaddr = dev->base_addr;
|
||||
char __iomem *shared_mem = ei_status.mem;
|
||||
|
||||
mem_on(ioaddr, shared_mem, (ring_offset>>8));
|
||||
|
||||
memcpy_fromio(skb->data, ei_status.mem + (ring_offset & 0xff), count);
|
||||
|
||||
mem_off(ioaddr);
|
||||
}
|
||||
|
||||
static void
|
||||
e21_block_output(struct net_device *dev, int count, const unsigned char *buf,
|
||||
int start_page)
|
||||
{
|
||||
short ioaddr = dev->base_addr;
|
||||
volatile char __iomem *shared_mem = ei_status.mem;
|
||||
|
||||
/* Set the shared memory window start by doing a read, with the low address
|
||||
bits specifying the starting page. */
|
||||
readb(shared_mem + start_page);
|
||||
mem_on(ioaddr, shared_mem, start_page);
|
||||
|
||||
memcpy_toio(shared_mem, buf, count);
|
||||
mem_off(ioaddr);
|
||||
}
|
||||
|
||||
static int
|
||||
e21_close(struct net_device *dev)
|
||||
{
|
||||
short ioaddr = dev->base_addr;
|
||||
|
||||
if (ei_debug > 1)
|
||||
printk("%s: Shutting down ethercard.\n", dev->name);
|
||||
|
||||
free_irq(dev->irq, dev);
|
||||
dev->irq = ei_status.saved_irq;
|
||||
|
||||
/* Shut off the interrupt line and secondary interface. */
|
||||
inb(ioaddr + E21_IRQ_LOW);
|
||||
outb(0, ioaddr + E21_ASIC);
|
||||
inb(ioaddr + E21_IRQ_HIGH); /* High IRQ bit, and if_port. */
|
||||
outb(0, ioaddr + E21_ASIC);
|
||||
|
||||
ei_close(dev);
|
||||
|
||||
/* Double-check that the memory has been turned off, because really
|
||||
really bad things happen if it isn't. */
|
||||
mem_off(ioaddr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MODULE
|
||||
#define MAX_E21_CARDS 4 /* Max number of E21 cards per module */
|
||||
static struct net_device *dev_e21[MAX_E21_CARDS];
|
||||
static int io[MAX_E21_CARDS];
|
||||
static int irq[MAX_E21_CARDS];
|
||||
static int mem[MAX_E21_CARDS];
|
||||
static int xcvr[MAX_E21_CARDS]; /* choose int. or ext. xcvr */
|
||||
|
||||
module_param_array(io, int, NULL, 0);
|
||||
module_param_array(irq, int, NULL, 0);
|
||||
module_param_array(mem, int, NULL, 0);
|
||||
module_param_array(xcvr, int, NULL, 0);
|
||||
MODULE_PARM_DESC(io, "I/O base address(es)");
|
||||
MODULE_PARM_DESC(irq, "IRQ number(s)");
|
||||
MODULE_PARM_DESC(mem, " memory base address(es)");
|
||||
MODULE_PARM_DESC(xcvr, "transceiver(s) (0=internal, 1=external)");
|
||||
MODULE_DESCRIPTION("Cabletron E2100 ISA ethernet driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
/* This is set up so that only a single autoprobe takes place per call.
|
||||
ISA device autoprobes on a running machine are not recommended. */
|
||||
|
||||
int __init init_module(void)
|
||||
{
|
||||
struct net_device *dev;
|
||||
int this_dev, found = 0;
|
||||
|
||||
for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
|
||||
if (io[this_dev] == 0) {
|
||||
if (this_dev != 0) break; /* only autoprobe 1st one */
|
||||
printk(KERN_NOTICE "e2100.c: Presently autoprobing (not recommended) for a single card.\n");
|
||||
}
|
||||
dev = alloc_ei_netdev();
|
||||
if (!dev)
|
||||
break;
|
||||
dev->irq = irq[this_dev];
|
||||
dev->base_addr = io[this_dev];
|
||||
dev->mem_start = mem[this_dev];
|
||||
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
|
||||
if (do_e2100_probe(dev) == 0) {
|
||||
dev_e21[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
free_netdev(dev);
|
||||
printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]);
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
return 0;
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static void cleanup_card(struct net_device *dev)
|
||||
{
|
||||
/* NB: e21_close() handles free_irq */
|
||||
iounmap(ei_status.mem);
|
||||
release_region(dev->base_addr, E21_IO_EXTENT);
|
||||
}
|
||||
|
||||
void __exit
|
||||
cleanup_module(void)
|
||||
{
|
||||
int this_dev;
|
||||
|
||||
for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
|
||||
struct net_device *dev = dev_e21[this_dev];
|
||||
if (dev) {
|
||||
unregister_netdev(dev);
|
||||
cleanup_card(dev);
|
||||
free_netdev(dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* MODULE */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,438 +0,0 @@
|
||||
/* hp.c: A HP LAN ethernet driver for linux. */
|
||||
/*
|
||||
Written 1993-94 by Donald Becker.
|
||||
|
||||
Copyright 1993 United States Government as represented by the
|
||||
Director, National Security Agency.
|
||||
|
||||
This software may be used and distributed according to the terms
|
||||
of the GNU General Public License, incorporated herein by reference.
|
||||
|
||||
The author may be reached as becker@scyld.com, or C/O
|
||||
Scyld Computing Corporation
|
||||
410 Severn Ave., Suite 210
|
||||
Annapolis MD 21403
|
||||
|
||||
This is a driver for the HP PC-LAN adaptors.
|
||||
|
||||
Sources:
|
||||
The Crynwr packet driver.
|
||||
*/
|
||||
|
||||
static const char version[] =
|
||||
"hp.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
|
||||
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#include "8390.h"
|
||||
|
||||
#define DRV_NAME "hp"
|
||||
|
||||
/* A zero-terminated list of I/O addresses to be probed. */
|
||||
static unsigned int hppclan_portlist[] __initdata =
|
||||
{ 0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240, 0};
|
||||
|
||||
#define HP_IO_EXTENT 32
|
||||
|
||||
#define HP_DATAPORT 0x0c /* "Remote DMA" data port. */
|
||||
#define HP_ID 0x07
|
||||
#define HP_CONFIGURE 0x08 /* Configuration register. */
|
||||
#define HP_RUN 0x01 /* 1 == Run, 0 == reset. */
|
||||
#define HP_IRQ 0x0E /* Mask for software-configured IRQ line. */
|
||||
#define HP_DATAON 0x10 /* Turn on dataport */
|
||||
#define NIC_OFFSET 0x10 /* Offset the 8390 registers. */
|
||||
|
||||
#define HP_START_PG 0x00 /* First page of TX buffer */
|
||||
#define HP_8BSTOP_PG 0x80 /* Last page +1 of RX ring */
|
||||
#define HP_16BSTOP_PG 0xFF /* Same, for 16 bit cards. */
|
||||
|
||||
static int hp_probe1(struct net_device *dev, int ioaddr);
|
||||
|
||||
static void hp_reset_8390(struct net_device *dev);
|
||||
static void hp_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
|
||||
int ring_page);
|
||||
static void hp_block_input(struct net_device *dev, int count,
|
||||
struct sk_buff *skb , int ring_offset);
|
||||
static void hp_block_output(struct net_device *dev, int count,
|
||||
const unsigned char *buf, int start_page);
|
||||
|
||||
static void hp_init_card(struct net_device *dev);
|
||||
|
||||
/* The map from IRQ number to HP_CONFIGURE register setting. */
|
||||
/* My default is IRQ5 0 1 2 3 4 5 6 7 8 9 10 11 */
|
||||
static char irqmap[16] __initdata= { 0, 0, 4, 6, 8,10, 0,14, 0, 4, 2,12,0,0,0,0};
|
||||
|
||||
|
||||
/* Probe for an HP LAN adaptor.
|
||||
Also initialize the card and fill in STATION_ADDR with the station
|
||||
address. */
|
||||
|
||||
static int __init do_hp_probe(struct net_device *dev)
|
||||
{
|
||||
int i;
|
||||
int base_addr = dev->base_addr;
|
||||
int irq = dev->irq;
|
||||
|
||||
if (base_addr > 0x1ff) /* Check a single specified location. */
|
||||
return hp_probe1(dev, base_addr);
|
||||
else if (base_addr != 0) /* Don't probe at all. */
|
||||
return -ENXIO;
|
||||
|
||||
for (i = 0; hppclan_portlist[i]; i++) {
|
||||
if (hp_probe1(dev, hppclan_portlist[i]) == 0)
|
||||
return 0;
|
||||
dev->irq = irq;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#ifndef MODULE
|
||||
struct net_device * __init hp_probe(int unit)
|
||||
{
|
||||
struct net_device *dev = alloc_eip_netdev();
|
||||
int err;
|
||||
|
||||
if (!dev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
sprintf(dev->name, "eth%d", unit);
|
||||
netdev_boot_setup_check(dev);
|
||||
|
||||
err = do_hp_probe(dev);
|
||||
if (err)
|
||||
goto out;
|
||||
return dev;
|
||||
out:
|
||||
free_netdev(dev);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __init hp_probe1(struct net_device *dev, int ioaddr)
|
||||
{
|
||||
int i, retval, board_id, wordmode;
|
||||
const char *name;
|
||||
static unsigned version_printed;
|
||||
|
||||
if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
|
||||
return -EBUSY;
|
||||
|
||||
/* Check for the HP physical address, 08 00 09 xx xx xx. */
|
||||
/* This really isn't good enough: we may pick up HP LANCE boards
|
||||
also! Avoid the lance 0x5757 signature. */
|
||||
if (inb(ioaddr) != 0x08
|
||||
|| inb(ioaddr+1) != 0x00
|
||||
|| inb(ioaddr+2) != 0x09
|
||||
|| inb(ioaddr+14) == 0x57) {
|
||||
retval = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Set up the parameters based on the board ID.
|
||||
If you have additional mappings, please mail them to me -djb. */
|
||||
if ((board_id = inb(ioaddr + HP_ID)) & 0x80) {
|
||||
name = "HP27247";
|
||||
wordmode = 1;
|
||||
} else {
|
||||
name = "HP27250";
|
||||
wordmode = 0;
|
||||
}
|
||||
|
||||
if (ei_debug && version_printed++ == 0)
|
||||
printk(version);
|
||||
|
||||
printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);
|
||||
|
||||
for(i = 0; i < ETH_ALEN; i++)
|
||||
dev->dev_addr[i] = inb(ioaddr + i);
|
||||
|
||||
printk(" %pM", dev->dev_addr);
|
||||
|
||||
/* Snarf the interrupt now. Someday this could be moved to open(). */
|
||||
if (dev->irq < 2) {
|
||||
static const int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};
|
||||
static const int irq_8list[] = { 7, 5, 3, 4, 9, 0};
|
||||
const int *irqp = wordmode ? irq_16list : irq_8list;
|
||||
do {
|
||||
int irq = *irqp;
|
||||
if (request_irq (irq, NULL, 0, "bogus", NULL) != -EBUSY) {
|
||||
unsigned long cookie = probe_irq_on();
|
||||
/* Twinkle the interrupt, and check if it's seen. */
|
||||
outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
|
||||
outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
|
||||
if (irq == probe_irq_off(cookie) /* It's a good IRQ line! */
|
||||
&& request_irq (irq, eip_interrupt, 0, DRV_NAME, dev) == 0) {
|
||||
printk(" selecting IRQ %d.\n", irq);
|
||||
dev->irq = *irqp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (*++irqp);
|
||||
if (*irqp == 0) {
|
||||
printk(" no free IRQ lines.\n");
|
||||
retval = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if (dev->irq == 2)
|
||||
dev->irq = 9;
|
||||
if ((retval = request_irq(dev->irq, eip_interrupt, 0, DRV_NAME, dev))) {
|
||||
printk (" unable to get IRQ %d.\n", dev->irq);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the base address to point to the NIC, not the "real" base! */
|
||||
dev->base_addr = ioaddr + NIC_OFFSET;
|
||||
dev->netdev_ops = &eip_netdev_ops;
|
||||
|
||||
ei_status.name = name;
|
||||
ei_status.word16 = wordmode;
|
||||
ei_status.tx_start_page = HP_START_PG;
|
||||
ei_status.rx_start_page = HP_START_PG + TX_PAGES;
|
||||
ei_status.stop_page = wordmode ? HP_16BSTOP_PG : HP_8BSTOP_PG;
|
||||
|
||||
ei_status.reset_8390 = hp_reset_8390;
|
||||
ei_status.get_8390_hdr = hp_get_8390_hdr;
|
||||
ei_status.block_input = hp_block_input;
|
||||
ei_status.block_output = hp_block_output;
|
||||
hp_init_card(dev);
|
||||
|
||||
retval = register_netdev(dev);
|
||||
if (retval)
|
||||
goto out1;
|
||||
return 0;
|
||||
out1:
|
||||
free_irq(dev->irq, dev);
|
||||
out:
|
||||
release_region(ioaddr, HP_IO_EXTENT);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
hp_reset_8390(struct net_device *dev)
|
||||
{
|
||||
int hp_base = dev->base_addr - NIC_OFFSET;
|
||||
int saved_config = inb_p(hp_base + HP_CONFIGURE);
|
||||
|
||||
if (ei_debug > 1) printk("resetting the 8390 time=%ld...", jiffies);
|
||||
outb_p(0x00, hp_base + HP_CONFIGURE);
|
||||
ei_status.txing = 0;
|
||||
/* Pause just a few cycles for the hardware reset to take place. */
|
||||
udelay(5);
|
||||
|
||||
outb_p(saved_config, hp_base + HP_CONFIGURE);
|
||||
udelay(5);
|
||||
|
||||
if ((inb_p(hp_base+NIC_OFFSET+EN0_ISR) & ENISR_RESET) == 0)
|
||||
printk("%s: hp_reset_8390() did not complete.\n", dev->name);
|
||||
|
||||
if (ei_debug > 1) printk("8390 reset done (%ld).", jiffies);
|
||||
}
|
||||
|
||||
static void
|
||||
hp_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
|
||||
{
|
||||
int nic_base = dev->base_addr;
|
||||
int saved_config = inb_p(nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
|
||||
outb_p(saved_config | HP_DATAON, nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base);
|
||||
outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
|
||||
outb_p(0, nic_base + EN0_RCNTHI);
|
||||
outb_p(0, nic_base + EN0_RSARLO); /* On page boundary */
|
||||
outb_p(ring_page, nic_base + EN0_RSARHI);
|
||||
outb_p(E8390_RREAD+E8390_START, nic_base);
|
||||
|
||||
if (ei_status.word16)
|
||||
insw(nic_base - NIC_OFFSET + HP_DATAPORT, hdr, sizeof(struct e8390_pkt_hdr)>>1);
|
||||
else
|
||||
insb(nic_base - NIC_OFFSET + HP_DATAPORT, hdr, sizeof(struct e8390_pkt_hdr));
|
||||
|
||||
outb_p(saved_config & (~HP_DATAON), nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
}
|
||||
|
||||
/* Block input and output, similar to the Crynwr packet driver. If you are
|
||||
porting to a new ethercard look at the packet driver source for hints.
|
||||
The HP LAN doesn't use shared memory -- we put the packet
|
||||
out through the "remote DMA" dataport. */
|
||||
|
||||
static void
|
||||
hp_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
|
||||
{
|
||||
int nic_base = dev->base_addr;
|
||||
int saved_config = inb_p(nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
int xfer_count = count;
|
||||
char *buf = skb->data;
|
||||
|
||||
outb_p(saved_config | HP_DATAON, nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base);
|
||||
outb_p(count & 0xff, nic_base + EN0_RCNTLO);
|
||||
outb_p(count >> 8, nic_base + EN0_RCNTHI);
|
||||
outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);
|
||||
outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
|
||||
outb_p(E8390_RREAD+E8390_START, nic_base);
|
||||
if (ei_status.word16) {
|
||||
insw(nic_base - NIC_OFFSET + HP_DATAPORT,buf,count>>1);
|
||||
if (count & 0x01)
|
||||
buf[count-1] = inb(nic_base - NIC_OFFSET + HP_DATAPORT), xfer_count++;
|
||||
} else {
|
||||
insb(nic_base - NIC_OFFSET + HP_DATAPORT, buf, count);
|
||||
}
|
||||
/* This is for the ALPHA version only, remove for later releases. */
|
||||
if (ei_debug > 0) { /* DMA termination address check... */
|
||||
int high = inb_p(nic_base + EN0_RSARHI);
|
||||
int low = inb_p(nic_base + EN0_RSARLO);
|
||||
int addr = (high << 8) + low;
|
||||
/* Check only the lower 8 bits so we can ignore ring wrap. */
|
||||
if (((ring_offset + xfer_count) & 0xff) != (addr & 0xff))
|
||||
printk("%s: RX transfer address mismatch, %#4.4x vs. %#4.4x (actual).\n",
|
||||
dev->name, ring_offset + xfer_count, addr);
|
||||
}
|
||||
outb_p(saved_config & (~HP_DATAON), nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
}
|
||||
|
||||
static void
|
||||
hp_block_output(struct net_device *dev, int count,
|
||||
const unsigned char *buf, int start_page)
|
||||
{
|
||||
int nic_base = dev->base_addr;
|
||||
int saved_config = inb_p(nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
|
||||
outb_p(saved_config | HP_DATAON, nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
/* Round the count up for word writes. Do we need to do this?
|
||||
What effect will an odd byte count have on the 8390?
|
||||
I should check someday. */
|
||||
if (ei_status.word16 && (count & 0x01))
|
||||
count++;
|
||||
/* We should already be in page 0, but to be safe... */
|
||||
outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base);
|
||||
|
||||
#ifdef NE8390_RW_BUGFIX
|
||||
/* Handle the read-before-write bug the same way as the
|
||||
Crynwr packet driver -- the NatSemi method doesn't work. */
|
||||
outb_p(0x42, nic_base + EN0_RCNTLO);
|
||||
outb_p(0, nic_base + EN0_RCNTHI);
|
||||
outb_p(0xff, nic_base + EN0_RSARLO);
|
||||
outb_p(0x00, nic_base + EN0_RSARHI);
|
||||
#define NE_CMD 0x00
|
||||
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
|
||||
/* Make certain that the dummy read has occurred. */
|
||||
inb_p(0x61);
|
||||
inb_p(0x61);
|
||||
#endif
|
||||
|
||||
outb_p(count & 0xff, nic_base + EN0_RCNTLO);
|
||||
outb_p(count >> 8, nic_base + EN0_RCNTHI);
|
||||
outb_p(0x00, nic_base + EN0_RSARLO);
|
||||
outb_p(start_page, nic_base + EN0_RSARHI);
|
||||
|
||||
outb_p(E8390_RWRITE+E8390_START, nic_base);
|
||||
if (ei_status.word16) {
|
||||
/* Use the 'rep' sequence for 16 bit boards. */
|
||||
outsw(nic_base - NIC_OFFSET + HP_DATAPORT, buf, count>>1);
|
||||
} else {
|
||||
outsb(nic_base - NIC_OFFSET + HP_DATAPORT, buf, count);
|
||||
}
|
||||
|
||||
/* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here -- it's broken! */
|
||||
|
||||
/* This is for the ALPHA version only, remove for later releases. */
|
||||
if (ei_debug > 0) { /* DMA termination address check... */
|
||||
int high = inb_p(nic_base + EN0_RSARHI);
|
||||
int low = inb_p(nic_base + EN0_RSARLO);
|
||||
int addr = (high << 8) + low;
|
||||
if ((start_page << 8) + count != addr)
|
||||
printk("%s: TX Transfer address mismatch, %#4.4x vs. %#4.4x.\n",
|
||||
dev->name, (start_page << 8) + count, addr);
|
||||
}
|
||||
outb_p(saved_config & (~HP_DATAON), nic_base - NIC_OFFSET + HP_CONFIGURE);
|
||||
}
|
||||
|
||||
/* This function resets the ethercard if something screws up. */
|
||||
static void __init
|
||||
hp_init_card(struct net_device *dev)
|
||||
{
|
||||
int irq = dev->irq;
|
||||
NS8390p_init(dev, 0);
|
||||
outb_p(irqmap[irq&0x0f] | HP_RUN,
|
||||
dev->base_addr - NIC_OFFSET + HP_CONFIGURE);
|
||||
}
|
||||
|
||||
#ifdef MODULE
|
||||
#define MAX_HP_CARDS 4 /* Max number of HP cards per module */
|
||||
static struct net_device *dev_hp[MAX_HP_CARDS];
|
||||
static int io[MAX_HP_CARDS];
|
||||
static int irq[MAX_HP_CARDS];
|
||||
|
||||
module_param_array(io, int, NULL, 0);
|
||||
module_param_array(irq, int, NULL, 0);
|
||||
MODULE_PARM_DESC(io, "I/O base address(es)");
|
||||
MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
|
||||
MODULE_DESCRIPTION("HP PC-LAN ISA ethernet driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
/* This is set up so that only a single autoprobe takes place per call.
|
||||
ISA device autoprobes on a running machine are not recommended. */
|
||||
int __init
|
||||
init_module(void)
|
||||
{
|
||||
struct net_device *dev;
|
||||
int this_dev, found = 0;
|
||||
|
||||
for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
|
||||
if (io[this_dev] == 0) {
|
||||
if (this_dev != 0) break; /* only autoprobe 1st one */
|
||||
printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n");
|
||||
}
|
||||
dev = alloc_eip_netdev();
|
||||
if (!dev)
|
||||
break;
|
||||
dev->irq = irq[this_dev];
|
||||
dev->base_addr = io[this_dev];
|
||||
if (do_hp_probe(dev) == 0) {
|
||||
dev_hp[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
free_netdev(dev);
|
||||
printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]);
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
return 0;
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static void cleanup_card(struct net_device *dev)
|
||||
{
|
||||
free_irq(dev->irq, dev);
|
||||
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
|
||||
}
|
||||
|
||||
void __exit
|
||||
cleanup_module(void)
|
||||
{
|
||||
int this_dev;
|
||||
|
||||
for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
|
||||
struct net_device *dev = dev_hp[this_dev];
|
||||
if (dev) {
|
||||
unregister_netdev(dev);
|
||||
cleanup_card(dev);
|
||||
free_netdev(dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* MODULE */
|
||||
@@ -135,7 +135,6 @@ config ETHOC
|
||||
source "drivers/net/ethernet/packetengines/Kconfig"
|
||||
source "drivers/net/ethernet/pasemi/Kconfig"
|
||||
source "drivers/net/ethernet/qlogic/Kconfig"
|
||||
source "drivers/net/ethernet/racal/Kconfig"
|
||||
source "drivers/net/ethernet/realtek/Kconfig"
|
||||
source "drivers/net/ethernet/renesas/Kconfig"
|
||||
source "drivers/net/ethernet/rdc/Kconfig"
|
||||
|
||||
@@ -53,7 +53,6 @@ obj-$(CONFIG_ETHOC) += ethoc.o
|
||||
obj-$(CONFIG_NET_PACKET_ENGINE) += packetengines/
|
||||
obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/
|
||||
obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/
|
||||
obj-$(CONFIG_NET_VENDOR_RACAL) += racal/
|
||||
obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/
|
||||
obj-$(CONFIG_SH_ETH) += renesas/
|
||||
obj-$(CONFIG_NET_VENDOR_RDC) += rdc/
|
||||
|
||||
@@ -105,19 +105,6 @@ config DECLANCE
|
||||
DEC (now Compaq) based on the AMD LANCE chipset, including the
|
||||
DEPCA series. (This chipset is better known via the NE2100 cards.)
|
||||
|
||||
config DEPCA
|
||||
tristate "DEPCA, DE10x, DE200, DE201, DE202, DE422 support"
|
||||
depends on (ISA || EISA)
|
||||
select CRC32
|
||||
---help---
|
||||
If you have a network (Ethernet) card of this type, say Y and read
|
||||
the Ethernet-HOWTO, available from
|
||||
<http://www.tldp.org/docs.html#howto> as well as
|
||||
<file:drivers/net/ethernet/amd/depca.c>.
|
||||
|
||||
To compile this driver as a module, choose M here. The module
|
||||
will be called depca.
|
||||
|
||||
config HPLANCE
|
||||
bool "HP on-board LANCE support"
|
||||
depends on DIO
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user