Commit Graph

118 Commits

Author SHA1 Message Date
Warner Losh
e9cb811b17 Commit kernel part of patches to get the 3Com OfficeConnect 3CXSH572BT
working on -current.

Submitted by: Eric D. Futch <efutch@nyct.net>
Approved by: mdodd
2000-01-10 02:32:43 +00:00
Warner Losh
5aa701b662 kill debug printf that says detach 1999-12-10 07:24:39 +00:00
Matthew N. Dodd
a4e3d8de0c Add defines for additional EEPROM locations and register definitions. 1999-12-06 09:29:34 +00:00
Matthew N. Dodd
d6eb71ddd5 Whitespace cleanups. 1999-12-06 09:16:13 +00:00
Matthew N. Dodd
8d133d9561 Add a delay (per the databook) to the get_eeprom_data() loop so
that the read EEPROM command has time to execute.

I didn't observe any difference in behavior on my test system but
this is the documented "correct behavior".
1999-12-06 08:59:52 +00:00
Matthew N. Dodd
0613716013 Standardize device descriptions so that there is parity between PnP
descriptions and non-PnP descriptions.
1999-12-06 08:40:59 +00:00
Matthew N. Dodd
94d49d9a35 Correctly implement the non-PnP enumeration of ISA board.
We now correctly skip boards that have PnP support enabled, or are in
test mode.  The 3c509s support a number of combinations of device
probing, as per the databook.

	- ISA only
	- PnP only
	- ISA or PnP

We will allow cards that can be dealt with by PnP to be attached by the
PnP enumerator.

This fixes the bogus detection of boards at weird ioports.
1999-12-06 08:31:47 +00:00
Warner Losh
e09f49b6fa Fix the hang on card eject problem and maybe the hang on suspend
problem.

o Create new timeout routine so we don't detach the card inside a ISR
  but instead drop back to spl0 via a timeout of 0.
o Actually delete the child of the pccard device rather than just faking
  it badly.
o Fix sio, ed and ep to have pccard detach routines that are int rather
  than void.
o Fix ep and ed pccard detach routines to use if_detach rather than just
  if_down.  if_detach destroys the device, while if_down just marks it
  down.  In this incarnation of the pccard things, we map the disable
  the slot action to detach the driver, which removes the driver from the
  device tree.  When that is done, a panic would soon follow as the
  ifconfig tried to down the device.

Didn't fix:
o Should cache the pccard dev child's pointer in struct slot
o remove now unused parts of struct slot
o Any driver using softc after detach has been called.  sio's softc used
  to be statically allocated, so you could check sc->gone, but that is
  now gone.
o Didn't remove gone from softc of drivers that use the old pccard method.

Didn't test:
o ed driver changes
o sio driver changes on pccards
o suspend (no laptop or apm support on my desktop)
1999-12-01 07:38:54 +00:00
Warner Losh
b1ef7ecbc7 Kill unneeded #includes. They were left over from the short period of
time when a strcmp against the device name was required.  Sio patches
sent to peter for review.
1999-11-20 05:16:14 +00:00
Warner Losh
5eafefaf7a Add (untested) support for the 3C562D/3C563D. I have been unable to
test this support since I don't have the dongle for the card in
question and the dongle I have for my 3C589D doesn't seem to work on
it.  I don't know if this is due to the damage I did to the 562 card
in transit from freebsdcon, or a mis-matched dongle...
1999-10-29 06:27:07 +00:00
Warner Losh
c864a1a7e8 Fix identify code. This also fixes the eeprom messages.
pccard attachments must activate the resources they want to access.
ep didn't do this, so of course thee eeprom came back as busy.  ed and
sio already did this.  It was only due to a bug in the logic that the
probe succeeded.  These problems have been fixed.
1999-10-28 06:12:58 +00:00
Warner Losh
806338b15d Last change to pccard_nbk now obviates the need to check the name of
the device in question.
Also fix warnings on if_ep_pccard.c
1999-10-28 05:06:14 +00:00
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
7366fe57d4 Fix includes. I missed this the first time around. 1999-10-02 20:22:26 +00:00
Matthew N. Dodd
58e4bcc53a Duplicated '(' removed.
Noticed by: Mark Murray <mark@grondar.za>
1999-09-26 18:04:26 +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
Matthew N. Dodd
0d6ab4a16a Move the specification of EDGE/LEVEL triggered interrupts to
eisa_add_intr() which now takes an additional arguement (one of
EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE).

The flag RR_SHAREABLE has no effect when passed to
bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as
the eisa_alloc_resource() call (bus_alloc_resource method) now deals
with this flag directly, depending on the device ivars.

This change does nothing more than move all the 'shared = inb(foo + iobsse)'
nonesense to the device probe methods rather than the device attach.

Also, print out 'edge' or 'level' in the IRQ announcement message.

Reviewed by: dfr
1999-08-01 22:57:09 +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
Doug Rabson
566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Peter Wemm
a49a3d4433 Implement an EISA new-bus framework. The old driver probe mechanism
had a quirk that made a shim rather hard to implement properly and it was
just easier to convert the drivers in one go.  The changes to the
buslogic driver go beyond just this - the whole driver was new-bus'ed
including pci and isa.  I have only tested the EISA part of this so far.

Submitted by:	 Doug Rabson <dfr@nlsystems.com>
1999-04-18 15:50:35 +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
Dag-Erling Smørgrav
dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +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
Joerg Wunsch
03940bd636 Move the EP_ID_PORT out to 0x110, so it doesn't conflict with other port
usage at 0x100.  Quoted Justin's quotation from the manual as well, to
explain the technical background.

PR:		kern/4559
Submitted by:	Stephen J. Roznowski <sjr@home.net>
1997-10-27 06:15:10 +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