Commit Graph

58 Commits

Author SHA1 Message Date
Warner Losh
9fbcec7d02 kill traling white space 2018-03-23 15:35:07 +00:00
Warner Losh
6efa5583c7 Fix typos from last commit, these should have been #. 2017-12-22 20:48:49 +00:00
Warner Losh
d2064cf030 Use '#' rather than some made up name for fields we want to ignore. 2017-12-22 17:53:27 +00:00
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
Pedro F. Giffuni
73a1170a8c sys/dev: use our nitems() macro when it is avaliable through param.h.
No functional change, only trivial cases are done in this sweep,
Drivers that can get further enhancements will be done independently.

Discussed in:	freebsd-current
2016-04-19 23:37:24 +00:00
Warner Losh
efd2408900 Add PNP info for ISA and PCI to the ed driver to prove design.
Differential Review: https://reviews.freebsd.org/D3458
2015-12-11 05:28:07 +00:00
Warner Losh
e94b9f21a8 Prodded by Yongari, add support for Holtek HT80232. Add the device
ID, plus the ability to force '16-bit mode' which really means NE-2000
mode.  Other open source drivers suggest that the Holtek misbehaves if
you allow the 8-bit probe.  Also, all of the PCI chips emulate
NE-2000ish cards, so always force 16-bit mode for memory transfers.

PR:		84202 (patch not used)
2010-08-25 02:03:48 +00:00
Warner Losh
74677fb82b Establish the interrupt handler AFTER we successfully attach. We need
to do this in case we have a shared interrupt that fires during the
attach process....
2009-04-18 03:10:28 +00:00
Warner Losh
1cac1dbfab Provide a generic ifmedia set of routines as a fallback. The
DP8390-based cards have no generic way of reporting status of the link
or setting the media type.  Some specific versions of these cards do,
however, allow for this, and we already support some of them.  Make
the 'ed' experience more uniform by providing "autoselect" as the
meida and status "active" always.  This won't affect the chips that
provide more specific details.
2009-04-07 05:41:38 +00:00
Warner Losh
8ac3902acc Add Winbond W89C940F to the list. Also, stub in some entries for two
Holtek cards that will need some special support later, but leave them
commented out for now.

These ID's are transcribed from the Linux ne2k-pci.c
2007-12-31 03:29:02 +00:00
Paolo Pisati
ef544f6312 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
2007-02-23 12:19:07 +00:00
Warner Losh
92a6736a5b If we can't probe the RTL80x9 for some reason, fall back to probing it
as a Novell NE-2000.  This is necessary for unpatched qemu working
correctly.  qemu claims to be a RTL8029, but doesn't implement the
RTL8029 specific registers at this time.  I've created patches for
that, but there's no reason we can't use qemu's emulation w/o these
patches.  This should make life easier for those folks that boot
FreeBSD via qemu.
2005-10-13 22:12:34 +00:00
Warner Losh
95a2adef58 MFp4:
o Add support for Tamarack TC5299J + MII found on SMC 8041TX V.2
	  and corega PCCCCTXD
	o Add support for ISA/PCI RTL80[12]9 chips
	o Improve support for the ax88790 based
	o minor code movement

Submitted by: (#2) David Madole
2005-10-05 05:21:07 +00:00
Ruslan Ermilov
9abf4b7a1d Make device_detach methods really work. 2005-09-14 19:03:14 +00:00
Warner Losh
c3ee3aa526 Use smaller names. The "NE2000 PCI Ethernet" is largerly redundant
with edX at pciY.  This removes 8*22 bytes from the strings. Not a
huge win, but a cheap one.
2005-09-13 19:07:00 +00:00
Warner Losh
f1c4694df3 Finish conversion to bus space and make ed MP safe.
o Lock ed
o Fix extra newline in probe messages
o Eliminate gone.
o Make detach less-racy.
o Eliminate spl*
o Switch from timeout/untimeout to callout interface.
o Read/write card memory using bus_space calls.
o generalize readmem so that we don't need ifs in the code.
o Fix memory stuff to be consistant.
o Remove OLDCARD compat stuff.
o Mark interrupt as MPSAFE.

# sic, hpp not tested at all
# ISA and PCI attachments lightly tested
2005-08-28 23:56:25 +00:00
Warner Losh
591223e66b Use tabs instead of spaces to indent, per style(9)
Noticed by: njl
2005-06-09 18:46:36 +00:00
Warner Losh
7999556019 My abstracting out the MAC reading code to fix pccard broke pci. Add
back the reading of the MAC address in the 'standard' way.

Reported by: Jeremie Le Hen ( jeremie at le-hen dot org )
2005-06-08 23:15:33 +00:00
Warner Losh
538565c4a5 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
Warner Losh
eb01f10be1 Minor style nits missed in earlier passes 2005-02-22 18:58:34 +00:00
Warner Losh
b3f44d7907 If either ed_probe_Novell or ed_attach returns an error, release the
resources too.
2005-02-09 17:35:13 +00:00
Warner Losh
9d512034e3 Make it possible to unload ed. Move the ed_pccard_detach routine to
if_ed and rename it to ed_detach().  Tell other busses to use this
routine for detach.

Since I don't actually have any non-pccard ed hardware I can test
with, I've only tested with my pccards.

More improvements in this area likely are possible.

Prodded by: rwatson
2005-02-08 05:45:35 +00:00
Warner Losh
33481e9d67 MFp4: u_intXX_t to uintXX_t. 2005-01-19 07:37:32 +00:00
Warner Losh
973796c882 A couple more style(9) nits I should have included in last commit 2004-06-18 01:28:54 +00:00
Warner Losh
b3cb6e3742 Style nits in the prototypes 2004-06-18 01:27:19 +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
John Baldwin
e27951b29c Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by:	imp, gibbs
Tested by:		i386 LINT
2003-09-02 17:30:40 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +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
Alfred Perlstein
e51a25f850 Remove __P. 2002-03-20 02:08:01 +00:00
Warner Losh
f2fdbb57ca Add support for Dlink DL10022 to the ed driver. This is a mii part
bolted to a ne-2000 chip.  This is necessary for the NetGear FA-410TX
and other cards.

This also requires you add mii to your kernel if you have an ed driver
configured.

This code will result in a couple of timeout messages for ed on the
impacted cards.  Additional work will be needed, but this does work
right now, and many people need these cards.

Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
2001-03-03 08:31:37 +00:00
Warner Losh
cc9e9343cd Minor newbus/style(9) cleanups.
o Move the ax88190 code to its own function.
o Move all device_method_t, driver_t and DRIVER_MODULE definitions to the
  end of files.
o Wrap a few lines > 80 characters.
o Use the same devclass for all ed drivers.  This allows machines with
  multiple types of cards to have their cards numbered correctly.  Before,
  you could wind up with two ed0's.
o Protect if_edvar.h from multiple includes because I was there.
2000-12-26 06:38:04 +00:00
Warner Losh
727928f866 Remove unnecessary includes found by phk's script. I've been building
these locally for ages.
2000-12-13 06:28:37 +00:00
Mike Smith
1b97a6c6a9 Network modules are all "if_foo" not "foo". Avoid the confusing spew that
ensues when ifconfig tries to load if_ed.ko when it's already in the kernel.
2000-10-15 20:23:27 +00:00
Yoshihiro Takahashi
82583dd564 - Fixed the conversion to bus_space interface.
- Added PC-98 Cbus devices support.
  The original patch is submitted by chi@bd.mbn.or.jp (Chiharu Shibata)
- Removed old ed driver.
2000-08-17 12:15:45 +00:00
Matthew N. Dodd
cb5d0c333f I forgot to remove the "NCARD == 0" hacks that kept this driver
from blowing up on PCMCIA systems.  The hack isn't needed anymore.

Reminded by: Blaz Zupan <blaz@gold.amis.net>
1999-11-20 09:28:01 +00:00
Matthew N. Dodd
14bacef14e - Remove the ISA, PCI, and PCCARD specific code from if_ed.c; it
now lives in the respective bus front end files.
- Add various function prototypes to if_edvar.h
- Clean up some debugging code that snuck into if_ed_isa.c
- Turn on the right bits in files.i386
1999-10-15 03:12:48 +00:00
Peter Wemm
814e16091b Make if_ed work again on pci, isa, isapnp. The hack to make it work on
PCCARD is pretty revolting but should buy us time while the pccard driver
angle is sorted out.  A commit for the MCA ed attachment will follow
shortly.
1999-09-20 05:48:16 +00:00
Peter Wemm
599d7638dd Commit a checkpoint of an updated if_ed driver. This is pretty much
Doug Rabson's work, with a few tweaks from Warner Losh and I.  There are
still some quirks to resolve, but the old driver is presently breaking
the build.
1999-09-03 19:10:56 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +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
Peter Wemm
579f45fa60 Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it.  Driver writers can do
this if it's not defined.  (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)
1999-05-09 17:07:30 +00:00
Peter Wemm
96b3554e5c Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.
1999-04-24 20:17:05 +00:00
Matthew Dillon
35f069d08b pci_device pd_probe function changed from returning char * to returning
const char *.  Originally I was going to add casts from const char * to
    char * in some of the pci device drivers, but the reality is that the
    pci device probes return constant quoted strings.
1998-12-14 05:47:29 +00:00
Daniel O'Callaghan
b9e8979b7b PR: i386/6040
Submitted by:	nakagawa@jp.freebsd.org
Add new PCI NE2000 (VIA VT86C926)
1998-03-17 10:54:23 +00:00
Stefan Eßer
ebef4c231e Add PCI device ID of Surecom NE-34 1998-02-27 22:30:36 +00:00
Mike Smith
19352b8532 Add Winbond W89C940 ID to the list.
Submitted by:	Micha Class <michael_class@hpbbse.bbn.hp.com>
1997-11-22 06:19:59 +00:00
Daniel O'Callaghan
26bb051a7b Add the NetVin 5000 series NE2000 PCI card vendor and device IDs. 1997-08-14 07:53:07 +00:00
David Nugent
a473e68b78 Rearrange pci network card identification for easier additions.
Added KTI NE2000 clone.
1997-04-18 04:44:37 +00:00