Commit Graph

182 Commits

Author SHA1 Message Date
Warner Losh
1c4c419607 MFp4:
o Remove redundant $FreeBSD$
o Better comments about ep_get_macaddr.
o remove one tab in a switch statement (style only)
o Recognize ID 0x0035 as the device ID for the 3CXEM556 that I have.  This
  makes the 3CXEM556 work for me.  Not 100% sure this is the assigned ID,
  as I don't have the datasheets for this part, but it does work and get
  the correct ethrnet address.
o Comment about the whole fake IRQ 3 thing.  some need it, some don't, all
  work with it.
2003-11-02 20:13:39 +00:00
Warner Losh
02b80cde42 MFp4:
o Minor tweak to error processing in ep_alloc.
2003-11-02 20:10:09 +00:00
Warner Losh
5c30ae1f77 MFP4:
o define EP_W2_ALT_EEPROM.  we don't use it yet, but may soon.
2003-11-02 20:08:58 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
Warner Losh
6b5dc774ed Pass sc to GO_WINDOW macro.
Use SET_IRQ for pccard case, rather than exapnding it inline.

Requested by: mdodd
2003-10-26 22:28:20 +00:00
Warner Losh
1e56655e43 Minor style nits suggested by sam and mdodd:
o give an argument to EP_BUSY_WAIT
o use foo_locked rather than foo_body
o Add locking assertions for extra safety.
2003-10-25 21:28:40 +00:00
Warner Losh
c365ed47e4 Whole grab-bag of changes:
o Make the driver MPSAFE
o Some changes due to diff reduction effort with vx.
o Removed some obsolete junk.

Reviewed by: sam, modd
2003-10-25 04:09:49 +00:00
Warner Losh
71d72f8892 Fix mismerge from one tree to another: add ( 2003-10-23 05:33:53 +00:00
Warner Losh
537db6f8b0 Learn basic C.
((uint32_t *) v) + 10 != ((caddr_t) v) + 10
so apply the cast later.
2003-10-23 03:42:47 +00:00
Warner Losh
0f08d52a60 Finish the removal of the bst/bsh confusion. 2003-10-19 17:38:04 +00:00
Bruce M Simpson
3eb4d8a3bc Fix LINT build by correcting a missed change. 2003-10-19 09:31:07 +00:00
Warner Losh
38e7cb26d4 Don't confuse tags and handles. 2003-10-19 00:03:10 +00:00
Bruce M Simpson
fc1cbf4331 Fix a typo. The module has the EISA front-end commented out, therefore the
error may not have been picked up right away.

Reviewed by:	mdodd
Submitted by:	Stuart Walsh
2003-10-18 20:44:23 +00:00
Warner Losh
3dc59524c7 Transition to using bus_space macros rather than the inb/outb/etc.
Use EP_{READ,WRITE}{,_MULTI}_{1,2,4} instead.  I've had several people
submit patches like this over the years of varying qualities, markm
being the last.  The names were chosen in consulation with mdodd on
irc.

I've tested this with only PCMCIA cards: 3CCE589EC and 3CCSH572BT.
I've not tried with my more extensive ISA, EISA and cbus collection.

Reviewed by: mdodd
2003-10-18 15:22:43 +00:00
Mark Murray
024351e027 Style fixes of the whitespace variety. Fix long lines and tabs. 2003-08-30 08:10:58 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Olivier Houchard
a7e15683be Use bus_child_present() to make sure the card is still there before calling
epstop() in ep_detach().
This fixes a freeze that happens when ejecting a ep(4) pcmcia card.
2003-08-19 14:06:42 +00:00
Mark Murray
5146af6d82 Style(9) cleanup. There was no consistent style in this driver, and
The next round of commits will be to fix up locking in it. This lot
is to at least give a consistent base to work off.

OK'ed by:	imp, mdodd
2003-07-17 19:37:56 +00:00
Maxime Henrion
e542f156cc Other minor style nits I missed in ep_if_start() in my previous
commit.
2003-06-26 17:02:52 +00:00
Maxime Henrion
52eec71b80 Make if_ep_start() look a bit more like other if_start() functions,
by calling the first mbuf in the chain m0 and fixing a few nearby
style bugs, mostly s/0/NULL/.
2003-06-26 14:28:35 +00:00
Maxime Henrion
c7d24cc1a2 Fix a race condition that was introduced since pccbb interrupts are
flag'ed INTR_MPSAFE.  In ep_if_start(), use the IF_DEQUEUE macro to
grab the next mbuf to send, and use IF_PREPEND if the card is busy
and we actually can't handle it right now.

The old code was first getting the mbuf by taking it from the queue
without using the macros, thus without locking, and without removing
it from the queue either.  It was later assuming that IF_DEQUEUE would
give him this same mbuf.

Tested by:	mich
2003-06-26 13:27:44 +00:00
Warner Losh
f5746231ff Make sure that pp_name is non-null before setting the device
description.  This allows us to rely entirely on the CIS entries if
necessary...
2003-04-10 04:36:02 +00:00
Matthew N. Dodd
d938c3689d Revert 1.21; this was local code that should not have been
committed.
2003-03-30 08:13:47 +00:00
Matthew N. Dodd
672fc9ebf6 - Free interrupt handler in ep_free().
- Move ep_pccard_detach() to if_ep.c and rename to ep_detach()
- Specify detach methods for all bus frontends.
2003-03-29 22:27:41 +00:00
Matthew N. Dodd
18e03d5e08 Checksum the configuration EEPROM. 2003-03-29 21:57:32 +00:00
Matthew N. Dodd
bb25efadc4 - Return error status instead of value in get_e().
- Modify ep_get_macaddr() to return an error status.
- Reverse the return value logic of eeprom_rdy().
2003-03-29 21:44:46 +00:00
Matthew N. Dodd
b26809608c Register dependency on the elink module. 2003-03-29 13:45:17 +00:00
Marcel Moolenaar
1583e8d08e Fix compilation on non-i386 machines. Inconsistent conditional
compilation yielded definitions that we're used.
2003-02-23 03:39:22 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Matthew N. Dodd
8ae37ad0ba Bandaid the bits that use the elink_foo() functions which are
i386 only at this point.
2003-02-13 23:01:59 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Sam Leffler
673d91916d network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets
  up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by:	many
Approved by:	re
2002-11-14 23:54:55 +00:00
Takanori Watanabe
6e8f09ca61 Fix build breakage on my pccard related commit. 2002-05-31 01:08:49 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Warner Losh
3fe83829bf Two fixes from Jonathan Hanna:
1) We shouldn't continue when we get a RX complete because we ack it
	   and the TX complete.
	2) Fix a couple of spl leaks
(why splbio is needed in ISR, I cannot understand).

MFC after: 3 days
2002-02-12 05:32:58 +00:00
Warner Losh
bca07edc83 More devices. Obtained from NetBSD. 2001-11-15 07:57:38 +00:00
Warner Losh
9de4df498c Migrate to PCMCIA_CARD() macros 2001-11-15 07:52:49 +00:00
Warner Losh
269b3a8211 s/PCCARD_/PCMCIA_/g in NEWCARD device tables to enable easier NetBSD sharing 2001-11-11 20:17:10 +00:00
Warner Losh
64c30c9cb5 Commit part of the patch that I have for card eject problems with the
ep driver.  The rest of the patch will wait until I can put the time
into it to get it righter than the kludge it is.

This protects us against card eject problems at all times,e xecpt when
we're in the epintr ISR.
2001-06-05 22:29:16 +00:00
Warner Losh
828e38343a Use PCCARD_CIS_xxx #defines for the table of oem ids. These usually
translate to all NULLs (as for all the ones in this commit).
2001-01-21 08:15:37 +00:00
Peter Wemm
ce1c1e5def Add the 3COM ID's that I could find in the pccarddevs file that seemed
to match the pccard.conf file.  There are more ID's that need adding, but
these seem to be the common ones.

This was committed on an ep0 interface under NEWCARD:
ep0: <3Com 3c589 10Mbps Ethernet> at port 0x300-0x30f irq 9 function 0 config 1 on pccard1
ep0: Ethernet address 00:10:4b:df:48:57

Reviewed by: imp
2001-01-07 21:24:41 +00:00
Yoshihiro Takahashi
8297c2fc98 Fixed to support 3Com 3C569B for PC-98.
Submitted by:	"Hirokazu WATANABE" <gwna@geocities.co.jp>
2000-12-09 04:25:07 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Warner Losh
07dad7e607 Remove 7 unnecessary includes frmo phk's script 2000-09-20 19:31:37 +00:00
Warner Losh
2276cee521 Implement indirection in the pccard probe/attach. This should make it
possible to have different probe/attach semantics between the two
systems and yet still use the same driver for both.

Compatibility methods for OLDCARD drivers.  We use these routines to make
it possible to call the OLDCARD driver's probe routine in the context that
it expects.  For OLDCARD these are implemented as pass throughs to the
device_{probe,attach} routines.  For NEWCARD they are implemented such
such that probe becomes strictly a matching routine and attach does both
the old probe and old attach.

compat devices should use the following:

	/* Device interface */
	DEVMETHOD(device_probe),	pccard_compat_probe),
	DEVMETHOD(device_attach),	pccard_compat_attach),
	/* Card interface */
	DEVMETHOD(card_compat_match,	foo_match),	/* newly written */
	DEVMETHOD(card_compat_probe,	foo_probe),	/* old probe */
	DEVMETHOD(card_compat_attach,	foo_attach),	/* old attach */

This will allow a single driver binary image to be used for both
OLDCARD and NEWCARD.

Drivers wishing to not retain OLDCARD compatibility needn't do this.

ep driver minorly updated.

sn driver updated more than minorly.  Add module dependencies to allow
module to load.  Also change name to if_sn.  Add some debugging code.
attempt to fix the cannot allocate memory problem I'd been seeing.
Minor formatting nits.
2000-09-19 04:39:20 +00:00
Warner Losh
4bae64510b Add ID for 3C1. It is a etherlink iii in a CompactFlash form factor.
It doesn't seem to work, but at least is identified correctly.  Minor
tree housekeeping on my part.
2000-09-13 03:57:37 +00:00
Matthew N. Dodd
5ce6286805 Properly detect ISA cards in EISA mode and skip them in the ISA identify
routine so that they will be picked up by the EISA front end.

PR:		i386/2598
2000-07-18 06:37:08 +00:00
Archie Cobbs
21b8ebd926 Make all Ethernet drivers attach using ether_ifattach() and detach using
ether_ifdetach().

The former consolidates the operations of if_attach(), ng_ether_attach(),
and bpfattach(). The latter consolidates the corresponding detach operations.

Reviewed by:	julian, freebsd-net
2000-07-13 22:54:34 +00:00
Archie Cobbs
2e2de7f23f Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input().
Also, remove the (incomplete) hack for matching ethernet headers
in the ip_fw code.

The good news: net result of 1016 lines removed, and this should make
bridging now work with *all* Ethernet drivers.

The bad news: it's nearly impossible to test every driver, especially
for bridging, and I was unable to get much testing help on the mailing
lists.

Reviewed by:	freebsd-net
2000-05-14 02:18:43 +00:00
Poul-Henning Kamp
eb95c536ad Remove unneeded #include <sys/kernel.h> 2000-04-29 15:36:14 +00:00