Commit Graph

76 Commits

Author SHA1 Message Date
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Maxime Henrion
a4d0f4d116 Convert the tx(4) driver to use the busdma API.
Special thanks to brueffer for sending me such a card so that
I could do this work.
2003-04-20 18:08:00 +00:00
Maxime Henrion
b9403c495e Better comment, more style(9) fixes. 2003-04-20 17:36:26 +00:00
Maxime Henrion
2ccf1ce757 style(9). 2003-04-20 01:04:04 +00:00
Maxime Henrion
6d63c80290 Make this file closer to style(9) paradigm. 2003-04-19 17:24:07 +00:00
Maxime Henrion
3566dff0d9 - Enable interrupts only at the end of epic_attach() when all the
other initializations succeeded.
- Initialize the TX and RX rings in epic_attach() rather than in
  epic_init() where we're not supposed to fail.  Similarly, free
  the TX and RX rings in epic_detach() rather than in epic_stop().
- Change epic_init() to be a void function now that it can't fail.
  Also change its parameter to a void * so that we have a correct
  prototype for if_init.
- Now that epic_init() has a correct prototype, don't cast the
  function pointer when initializing if_init.
- Fix nearby style bugs.
2003-04-19 13:51:24 +00:00
Maxime Henrion
f78a230c3c - Correct a comment made bogus by my last commit.
- Use __FBSDID.
2003-04-19 00:28:49 +00:00
Maxime Henrion
8a2ec7627f Various cleanups:
- Don't initialize if_output, ether_ifattach() does this for us.
- Use pci_enable_busmaster() instead of using pci_read_config()
  and pci_write_config() directly.
- Don't try to enable I/O, bus_alloc_resource() does this for us.
2003-04-19 00:21:34 +00:00
Matthew N. Dodd
f246e4a17f - Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)
2003-04-15 06:37:30 +00:00
Bosko Milekic
acc769b2ec Nuke EPIC_MGETCLUSTER entirely. Since 1.60 we don't use it anymore and
instead use our optimized m_getcl().

Submitted by: Hiten Pandya <hiten@unixdaemons.com>
MFC After: 1 week
2003-02-21 23:12:32 +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
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
David E. O'Brien
2d3ce7133a Remove miidevs.h and generate it from miidevs at compile time.
The devlist2h.awk tool to do this has been repocopied to sys/tools/.
2003-01-19 02:59:34 +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
Sam Leffler
57b6353534 o m_adj rx buffer so IP header is 32-bit aligned
o replace EPIC_MGETCLUSER with m_getcl

MFC after:	1 week
2002-10-25 22:06:03 +00:00
Semen Ustimenko
52d0ed1d0d Remove the OpenBSD comatibility stuff. Many changes to be more style(9)
compilant. Split two pieces if code into separate functions to do not
exceed line length due to indentation.
2002-10-22 00:57:51 +00:00
Semen Ustimenko
c5844e091c Stop trying to align malloc()ed memory. Rely on malloc() instead, just like
others.
2002-08-19 20:36:08 +00:00
Semen Ustimenko
714087a2ac Do not reset card in epic_freebsd_attach() as reset is done in
epic_common_attach().
2002-08-19 20:24:13 +00:00
Semen Ustimenko
08279b9cfe Add an epic_stats_update() function (called once per second). Even though
we don't collect any stats in it, we mii_tick() in it! This fix the bug
when autonegotiating fullduplex modes.

Also, pause activity before setting TXCON in epic_miibus_statchg(). Though
i've never seen problmes from not doing that, the documentation says we
need to do it.

MFC after:	1 week
2002-05-01 19:23:04 +00:00
Semen Ustimenko
37f044d650 Implement true multicast filtering.
Inspired by:	dc(4)

MFC after:	1 week
2002-04-25 18:16:15 +00:00
Semen Ustimenko
da1b4964c9 Update the email appearing in copyright string.
MFC after:	1 day
2002-04-20 12:39:41 +00:00
Semen Ustimenko
d09fa37dd9 Merge ``&& must be ||'' bug noticed and fixed in OpenBSD. The only ill effect
was if_baudrate being always 10Mbit.

Obtained from:	OpenBSD
MFC after:	1 day
2002-04-20 12:35:38 +00:00
Semen Ustimenko
9cd64fb3dd Move tx(4) driver to sys/dev/tx. BTW split hardware structures and constants
into if_txreg.h.

MFC after:	1 week
2002-04-19 22:43:57 +00:00
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Peter Wemm
1a8f253b64 Cast pointers to uintptr_t rather than u_int32_t. This doesn't work too
well on machines with 64 bit pointers.
2002-03-19 23:28:35 +00:00
Mike Silbersack
27d5f39f68 Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC after:	3 days
2002-02-11 23:38:30 +00:00
Brooks Davis
5c88c82cf3 Update tx(4) to always enable vlan(4) support.
Approved by:		semenu
2001-09-05 23:04:53 +00:00
Semen Ustimenko
395a636fb2 Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing
common_attach is wrong as common attach initialize some fileds used by
mediainit routine. This was hard to notify because loading driver as kld
lead to mediainit routine being called after common_attach, though probe_phy
is called before.

MFC after:	1 week
2001-08-13 18:37:31 +00:00
Semen Ustimenko
2c9067b16f Add support for 802.1Q VLAN and oversized ethernet frames.
PR:		kern/29235
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
Reviewed by:	Yar Tikhiy <yar@FreeBSD.org>
MFC after:	1 week
2001-08-13 18:32:39 +00:00
Semen Ustimenko
1d57ebcdbf Add initializetion of NVCTL register with EEPROM stored value.
This fix hazardous very slow work for one of my cards.

MFC after:	1 week
2001-06-23 19:30:26 +00:00
Semen Ustimenko
67a9752835 Add support for SMC9432FTX card, possibly othe fiber optic SMC9432 family
cards will work too.
2001-02-07 20:11:02 +00:00
Poul-Henning Kamp
37d4006626 Another round of the <sys/queue.h> FOREACH transmogriffer.
Created with:   sed(1)
Reviewed by:    md5(1)
2001-02-04 16:08:18 +00:00
David Malone
7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Pierre Beyssac
256de9e9ec Add missing delay after card reset.
This fixes randoms lockups when probing the card at boot time, when
more than 1 similar card is found in the machine.

Reviewed by:	semenu
2000-11-09 17:25:49 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +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
Semen Ustimenko
afb279b54b Added support for SMC9432BTX cards. 2000-06-21 19:19:49 +00:00
Archie Cobbs
d61b89e4b3 Avoid double-call to bpf_mtap(). This is now handled in ether_input(). 2000-05-24 00:05:44 +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
Peter Wemm
95a1645553 Depend on miibus.
Note that if_aue doesn't strictly depend on usb because it uses the
method interface for calls rather than using internal symbols, and
because it's a child driver of usb and therefore will not try and do
anything unless the parent usb code is loaded at some point.  if_aue does
strictly depend on miibus as it will fail to link if it is missing.
2000-04-29 13:41:57 +00:00
Semen Ustimenko
0f9ee76b22 Driver is now using miibus, and newbus.
PR:		kern/17601
2000-04-12 06:51:43 +00:00
Eivind Eklund
369dc8ceb8 Change incorrect NULLs to 0s 1999-12-21 11:14:12 +00:00
Semen Ustimenko
1d45e38736 Added code to enable BusMaster operations.
Kurt D. Starsinic <kstar@chapin.edu> had reported
this patch fixing strange behaviour (like timeouts
and RX/TX DMAs stopping errors).
1999-10-29 09:56:52 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Mike Smith
3ed7a59b07 Clean up after removing sys/eventhandler.h from sys/systm.h at the last
minute.  This should cover all of the missed cases (and should let LINT
build again).
1999-08-21 22:10:49 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Dag-Erling Smørgrav
6b5ca0d83e Rename bpfilter to bpf. 1999-07-06 19:23:32 +00:00
Peter Wemm
9929d2a045 Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files.  config will leave the whole file out if configured to do so.
1999-07-03 20:17:08 +00:00
Semen Ustimenko
a1684b9830 Move arpcom structure be the first in softc structure. Needed
for ether_ioctl.

PR:   pending/11754
1999-05-22 06:10:14 +00:00
Peter Wemm
94a8ab8acb #if 0 some unused code (debug?) to quiet a warning. 1999-05-10 00:20:46 +00:00