Commit Graph

91 Commits

Author SHA1 Message Date
Matthew N. Dodd
79a9057038 HEADS UP! All 3c5x9 users!
- Rip out all the static softc stuff and do softc allocation the right way.
- Rewrite most of the ISA code so that it provides a DEVICE_IDENTIFY
  method to enumerate all non-PnP ISA devices.

  This has the following consequences:

	- No 'ep' devices may be hardwired.
	  - All hardwired devices will probably be detected twice.
	    By hardwired I mean:

		device          ep0     at isa? port 0x300 irq 10

	- 'ep' devices are ordered by bus, slot, and then MAC address.

- Make 3c509B cards work in PnP mode.  Yes, they really work.
- Convert over to using ifmedia for media selection.  No more of this
  lame 'linkX' stuff.
- Consolidate a lot of duplicated code.
- Make a stab at not breaking MII based PCCARD devices.
  I doubt that the PCCARD stuff works any more than it did before my
  changes but theres hope.  My PCCARD hardware should arrive in a
  week or so.
- Retreive the media settings from the card EEPROM rather than guessing.
  I've got a 3c509-TPO that thinks its got an AUI port and if others
  can report similar problems I'll write a bit of clever code that will
  fix this but right now it works correctly on all but 1 card.
- Clean up a few things and make some cosmetic changes.
- Add myself as the MAINTAINER since nobody else wants to.  I'm
  in the best position to do this as I've got an example of most
  of the cards:

	EISA	3c579	bnc/aui
	MCA	3c529	tp/aui
	ISA	3c509	tpo
	ISA-PnP	3c509B	combo

   If someone wants to send me a any cards I don't have I'd appriciate
   it.  Also welcome are 3c59x boards since I'll be folding if_vx and
   if_ep at some point.
1999-10-27 06:25:16 +00:00
Warner Losh
758b76dc94 Add newbus attachment for pccard driver. Heavily tested by me, and
I'm committing this from a laptop running this driver.  Have only one
devclass for all ep devices (at least for pccard and eisa) so unit
numbering is sane.  Might not work with both isa and non-isa devices
on the same system until ep is updated (Matt has some patches in the
pipeline which should resolve this, he wanted me to commit this so he
can resolve any conflicts against cvs rather than my patches).

Reviewed by: Matt Dodd <mdodd@freebsd.org>
1999-10-25 02:52:16 +00:00
Matthew N. Dodd
39b547ce4d - Split out the ISA and PCCARD specific code.
- Split out the prototypes, externs and struct decls from if_epreg.h into
  if_epvar.h.

- Add support for MCA based Etherlink III (3c529) devices.

None of this code is used right now; the old if_ep driver is still
in place and used.

I will eventually get around to converting if_ep_isa.c to newbus once I've
had a talk with Peter and DFR about the DEVICE_IDENTIFY() method.

I have tested this code on my PS/2.  It works.  I would like EISA and ISA
testers since my example hardware hasn't arrived yet.

Add:

dev/ep/if_ep.c          optional ep
dev/ep/if_ep_isa.c      optional ep isa
dev/ep/if_ep_eisa.c     optional ep eisa
dev/ep/if_ep_mca.c      optional ep mca
dev/ep/if_ep_pccard.c   optional ep card

to sys/conf/files

Remove:

i386/eisa/3c5x9.c             optional        ep
i386/isa/if_ep.c              optional        ep

from sys/i386/conf/files.i386

PCCARD testers wanted!

I will switch off and cvs rm the old driver in favor of this copy once
I've had positive feedback or have the hardware to verify that it works.
1999-09-26 06:42:36 +00:00
Poul-Henning Kamp
46783fb897 Remove NBPF conditionality of bpf calls in most of our network drivers.
This means that we will not have to have a bpf and a non-bpf version
of our driver modules.

This does not open any security hole, because the bpf core isn't loadable

The drivers left unchanged are the "cross platform" drivers where the respective
maintainers are urged to DTRT, whatever that may be.

Add a couple of missing FreeBSD tags.
1999-09-25 12:06:01 +00:00
David E. O'Brien
2b832347ec Switch the order of a two tests so that the error actually has to occur
for you to be told there was an error [during verbose boot].

I poked him for the fix, he poked me to get it committed.

Submitted by:	Jason Young <doogie@anet-stl.com>
1999-09-24 16:27:32 +00:00
David E. O'Brien
424baf384e This adds support for the 3Com Megahertz 574B ethernet 16-bit PC-Card.
1) Reworked the probe routine
   2) Addition of the 574B's product ID.
   3) Added useful info when booting verbosely.

Submitted by:	Jason Young <doogie@anet-stl.com>
1999-09-19 06:20:23 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Matthew N. Dodd
e4fd6edfd8 Set ifp->if_init to the right function.
if_init_f_t is passed void * containing the address of ifp->if_softc
not the unit number.

Someone tell me if these things don't work as I don't have the hardware
needed to test them. (thats a first.)

I'll get if_ze and if_zp later.

Pointed out by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
1999-08-20 14:12:14 +00:00
Matthew N. Dodd
4b31e9d6a7 Make these actually compile. I got a little delete happy pruning includes
and used 'command' instead of 'cmd' in a few cases.  Also clear up some
unused variables.

Pointed out by: phk
1999-08-18 22:14:24 +00:00
Matthew N. Dodd
b2864868b3 SIOCSIFADDR, SIOCGIFADDR, and SIOCSIFMTU are implemented in
sys/net/if_ethersubr.c:ether_ioctl().  Drivers need not implement generic
behavior.

PR: kern/12126
Submitted by: in part by Boris Popov <bp@butya.kz>
1999-08-18 06:12:00 +00:00
Tatsumi Hosokawa
6afaf5d480 3C574TX 16bit FastEtherlink PC-card support.
Reviewed by:	HAMADA Naoki <nao@tom-yam.or.jp>
Submitted by:	Osamu MIHARA <mihara@prd.fc.nec.co.jp>
1999-07-25 01:20:37 +00:00
Dag-Erling Smørgrav
6b5ca0d83e Rename bpfilter to bpf. 1999-07-06 19:23:32 +00:00
Peter Dufault
e419eecba9 Move the "fetch serial data" delay so that it is an inter-bit delay.
Increase the overall length of the delay by 10.

Without this a 3C509 card on my MediaGX crash box can't be reliably
read.  With this it is solid.

I've left a delay multiplier in instead of just changing the base
delay because I'm surprised I had to increase it so much and expect
there may be another problem.
1999-01-31 22:41:51 +00:00
Peter Wemm
d17e4ee67d Update the pccard hooks to use a module style declaration instead. 1999-01-19 00:21:53 +00:00
Bruce Evans
fe310de802 Initialize isa_devtab entries for interrupt handlers in individual
device drivers, not in ioconf.c.  Use a different hack in isa_device.h
so that a new config(8) is not required yet.

pc98 parts approved by: kato
1998-10-22 05:58:45 +00:00
Bruce Evans
be160d60ab Removed unused includes. 1998-06-21 18:02:50 +00:00
Doug Rabson
ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
Bruce Evans
3c1300a6b3 Removed unused #includes. 1998-03-28 13:25:01 +00:00
Mike Smith
9a70f9f75f Fix some style nits and remove an unused header.
Submitted by:	bde
1998-02-27 05:38:32 +00:00
Eivind Eklund
0b08f5f737 Back out DIAGNOSTIC changes. 1998-02-06 12:14:30 +00:00
Eivind Eklund
47cfdb166d Turn DIAGNOSTIC into a new-style option. 1998-02-04 22:34:03 +00:00
Eivind Eklund
1d5e9e2255 Make INET a proper option.
This will not make any of object files that LINT create change; there
might be differences with INET disabled, but hardly anything compiled
before without INET anyway.  Now the 'obvious' things will give a
proper error if compiled without inet - ipx_ip, ipfw, tcp_debug.  The
only thing that _should_ work (but can't be made to compile reasonably
easily) is sppp :-(

This commit move struct arpcom from <netinet/if_ether.h> to
<net/if_arp.h>.
1998-01-08 23:42:31 +00:00
Eivind Eklund
430df5f4b7 Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.
The #ifdef IPXIP in netipx/ipx_if.h is OK (used from ipx_usrreq.c and
ifconfig.c only).

I also fixed a typo IPXTUNNEL -> IPTUNNEL (and #ifdef'ed out the code
inside, as it never could have compiled - doh.)
1997-12-15 20:31:25 +00:00
KATO Takenori
ead6305baa Recognize 3C569 network interface when `PC98' is defined.
Submitted by:	HAMADA Naoki <hamada@astec.co.jp>
1997-11-27 12:59:46 +00:00
Nate Williams
133c8c2f49 - Renamed <pccard/card.h> -> <pccard/cardinfo.h>.
Forgotten by:		me
Reminded by:		Bruce
1997-11-20 15:48:41 +00:00
Poul-Henning Kamp
4a11ca4e29 Remove a bunch of variables which were unused both in GENERIC and LINT.
Found by:	-Wunused
1997-11-07 08:53:44 +00:00
Bill Fenner
cca13d34b9 Fix a comment about multicast; since the Etherlink III has no
multicast filter the driver will never learn how to program it.
1997-10-27 00:02:33 +00:00
Nate Williams
075a76a29e - Instead of relying on a functional call to register PCARD-capable drivers,
use a Linker Set.  Note, if a driver is loaded as an LKM  if will have
  to use the function call, but since none of the existing drivers
  are loadable, this made things cleaner and boot messages nicer.

Obtained from:	PAO-970616
1997-10-26 21:08:42 +00:00
Nate Williams
8bb7a8fc95 - Functional changes to PCCARD support.
* Kill individual drivers 'suspend' routines, since there's no simple/safe
   way to suspend/resume a card w/out going through the complete probe
   at initialization time.
 * Default to using the apm_pccard_resume sysctl code, which basically
   pretends the card was removed, and then re-inserted.  Suspend/resume
   is now 'emulated' with a fake insert/removal.  (Hence we no longer
   need the driver-specific suspend routines.)
1997-10-26 04:54:16 +00:00
Nate Williams
e7e437dbfa - Do a bunch of gratuitous changes intended to make the code easier to
follow.
 * Rename/reorder all of the pccard structures, change many of the member
   names to be descriptive, and follow more closely other 'bus' drivers
   naming schemes.
 * Rename a bunch of parameter and local variable names to be more
   consistant in the code.
 * Renamed the PCCARD 'crd' device to be the 'card' device
 * KNF and make the code consistant where it was obvious.
 * ifdef'd out some unused code
1997-10-26 04:36:24 +00:00
Jun-ichiro itojun Hagino
7c66fb14b3 if_ep.c clarification/simplification.
- irq = 9 problem (PR 4693)
- mbuf chaining oddity fixed. (PR 4693)
- trailer protocol has gone. (PR 4693)
- removed mbuf kludge, we got higher performance. (PR 4693)
- some indentation fixes

I'm sorry that I couldn't make a 2.2.5-RELEASE deadline.

PR:		4693
Reviewed by:	babkin@hq.icb.chel.su
Submitted by:	hamada@tom-yam.or.jp
1997-10-14 06:56:09 +00:00
Bruce Evans
4d1d4912ae Added used #include - don't depend on <sys/mbuf.h> including
<sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).
1997-09-02 01:19:47 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Bruce Evans
51a534883a Don't include <sys/ioctl.h> in the kernel. Stage 2: include
<sys/sockio.h> instead of <sys/ioctl.h> in network files.
1997-03-24 11:33:46 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
KATO Takenori
95d98df162 Submitted by: Naoki Hamada <nao@sbl.cl.nec.co.jp>
Support 3COM 3C569 network card on PC98.
1996-12-19 10:31:10 +00:00
Garrett Wollman
59562606b9 Convert the interface address and IP interface address structures
to TAILQs.  Fix places which referenced these for no good reason
that I can see (the references remain, but were fixed to compile
again; they are still questionable).
1996-12-13 21:29:07 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Atsushi Murai
826702b23d Under the heavy load for transmiting condition, it will be write error
and then never accept for sending packet from upper layer anymore
(i.e. ping -f )
Reviewed by:	David Greenman <dg@root.com>
Submitted by:	amurai@spec.co.jp
1996-07-27 12:40:31 +00:00
Atsushi Murai
0ed091876d Add interrupt register set up with original register value
before attaching. Without this fix, 3c579(EISA) never make
any H/W inturrupt.
Reviewed by:	"Justin T. Gibbs" <gibbs@freefall.freebsd.org>, nao@sbl.cl.nec.co.jp and owner-current on mailing list ;-)
Submitted by:	amurai@spec.co.jp, nao@sbl.cl.nec.co.jp
1996-07-19 13:20:05 +00:00
David Greenman
4611b39710 Enable transmit complete interrupt...
(author's explaination):

 Bit 15 is the flag to request a transmit complete interrupt.  The
driver was apparently written to minimize interrupts, and if not for a
3-COM design quirk, everything would be just ducky.
 Prior to loading the outbound packet into the FIFO, the driver checks
to see if there's enough space to contain the packet.  If not, the
driver requests a transmit-available interrupt when there is
sufficient room.  Unfortunately, the card is continuing to process the
prior FIFO, and by the time the driver sets the threshold for a
transmit available interrupt, the space is already available.  When
this occurs, the 3COM card ignores the interrupt request, and the
driver is hung waiting for an interrupt that will never occur.
There's probably a more elegant solution, but requesting the transmit
complete interrupt was the easiest to implement.  An alternative fix
might be to check free FIFO space again, after requesting the transmit
available interrupt, but I haven't bothered pursuing this.  Since the
patch, my 3C590 (PCI, same FIFO interface as 3C509) has been rock
solid.

Submitted by:	mevans@candle.com (Mike Evans)
1996-07-13 10:49:53 +00:00
Bruce Evans
9b2b0822b7 Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn').  isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).
1996-06-18 01:22:40 +00:00
Nate Williams
771acaaa0a Whoops, I accidentally deleted a necessary ":" which is part of the
parameters to printf() using the "D" format.  (Why this even worked on
my box during testing I don't know, but as soon as I powered it on/off
it quite working.)
1996-06-15 00:43:03 +00:00
Nate Williams
333f7d7bb6 At long last, we know have support for the 3C589 in a FreeBSD release
using the existing files using the existing PCCARD support.  Now that
this is in place I would like to fixup the PCCARD hooks and remove the
if_zp driver.  At this point, we support everything we used to support
*AND MORE* with the PCCARD code.

Submitted by:	Naoki Hamada <nao@sbl.cl.nec.co.jp> (via the Nomad release)

[ This works on both my 3C589B and 3C589C ]
1996-06-14 22:11:38 +00:00
Nate Williams
8ca7c1c4a0 Better code for switching the ethernet transceiver.
My 3C509B-COMBO works fine with the following patch. Switching between
UTP and BNC is quite easy. (Just type 'ifconfig ep0 link1 -link2' or 'ifconifg
ep0 link2 -link1'.)

[ I tested this with the additional PC-CARD patches and it works on both
connectors on my 3C589B and 3C589C ]

Reviewed by:	nate
Submitted by:	Naoki Hamada <nao@sbl.cl.nec.co.jp>
1996-06-14 21:28:35 +00:00
Gary Palmer
c23670e294 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
Justin T. Gibbs
c6841cd18f Properly determine the offset of the remaining bytes we need to transfer
after outsl'ing all the long words we can during transmission in 32bit mode.

Closes PR:i386/1243
Submitted by:	flash@eru.tubank.msk.su
1996-05-24 15:22:36 +00:00
Justin T. Gibbs
6398c75dc7 Fix media type determination. 1996-02-28 17:19:04 +00:00
Justin T. Gibbs
eea817fc73 Clean up the 3c5x9 driver and add an eisaconf probe to it. This should
prevent it from conflicting with other drivers (like the aic7xxx driver).
Most of the work was in spliting out common portions of the driver and
making them generic enough to be called from the eisaconf probe.
1996-02-26 01:05:36 +00:00