Commit Graph

41 Commits

Author SHA1 Message Date
Warner Losh
f6cea53f9d Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO building
block. Use it in all the PNP drivers to export either the current PNP
table. For uart, create a custom table and export it using
MODULE_PNP_INFO since it's the only one that matches on function
number.

Differential Review: https://reviews.freebsd.org/D3461
2015-12-11 05:27:56 +00:00
Gleb Smirnoff
76039bc84f The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 17:58:36 +00:00
Robert Watson
efffdeda35 Fix comment typo.
Submitted by:	Marc Balmer <marc at msys.ch>
MFC after:	3 days
2009-11-25 13:31:17 +00:00
Warner Losh
f066fc09ea It appears that the TDK LAK CD011 works with fe driver. I don't have
a dongle for the card, but it passes the sanity testsin the
probe/attach routines and returns the correct MAC address.
2009-03-25 22:12:07 +00:00
Warner Losh
d557a26b80 Generalize the workaround for the Hitachi HT-4840-11. The Contec
C-NET(PC) has a cfe at location 1 that has both an odd irq mask (it
matches pc98 machines, so maybe it was a flag for pc98 operation) as
well as a memory map.  Since this driver doesn't know how to cope, we
start with cfe2, which is purely an I/O space mapped and that seems to
make it work.  I say 'seems' here, because the card I have doesn't
seem to have the right dongle for full testing...
2009-03-15 02:31:34 +00:00
Warner Losh
b1db3b7a40 Fix the whitespace in this file to be consistent with itself and with
the rest of the project's files.

s/sn_/fe_/ in a routine name that I copied from sn.
2009-03-12 07:18:27 +00:00
Warner Losh
3ca789f14a Add support for Hitachi HT-4840-11. This card is supposedly just like
the J181, but not quite.  This card's CIS has some quirks that means
we have to ignore CFE's 1-9.
2009-03-11 08:12:28 +00:00
John Baldwin
a43561c252 - Use bus_foo() rather than bus_space_foo() and retire the bus tag and handle
from the softc.
- Rework the watchdog timer to match other NIC drivers:
  - Start a timer in fe_init() that runs once a second and checks a counter
    in the softc that is identical to the deprecated 'if_timer'.
  - Just adjust the softc tx timeout value when sending packets instead of
    scheduling the timer.
- Use IFQ_SET_MAXLEN().

Tested by:	WATANABE Kazuhiro
2008-06-23 18:16:25 +00:00
John Baldwin
36d05d0ebc Make fe(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Don't leak bus resources if if_alloc() fails during attach.
- Setup the interrupt handler after calling ether_ifattach().
- Use a private timer to manage the transmit watchdog.

Tested by:	 WATANABE Kazuhiro  CQG00620 of nifty.ne.jp
2008-06-02 19:58:48 +00:00
Warner Losh
e2bf685dd4 Return 0 if we are a network card and do match. Previously, we'd bogusly
fail and the card wouldn't be detected.

Submitted by: Bryan Blackburn
2005-11-19 23:26:57 +00:00
Warner Losh
2a0146bdf1 Preliminary support for Xircom Credit Card Adapter. Not to be
confused with the Credit Card Adapter II and its spawn (which the xe
driver supports).  These changes get my card probing and attaching.  I
recently won one of these (and a NEC rebadged version) in an lot
auction.  The NEC didn't work, so I took it apart and found the
MB86960A chip and then modified if_fe_pccard.c to attach.  I can't
test this card further since I have no dongle for this card.
2005-10-25 03:49:24 +00:00
Warner Losh
a1f72203b1 PC Card instead of other variants 2005-09-22 05:52:54 +00:00
Warner Losh
d39ab32b08 Remove OLDCARD support by removing compat shims 2005-09-20 19:54:11 +00:00
Warner Losh
ad4f426ef6 Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt
handler depended on the ifp being still alive, this could, in theory,
cause a crash.  Eliminate this possibility by moving the if_free to
after the bus_teardown_intr() call.
2005-09-19 03:10:21 +00:00
Warner Losh
ab581af779 Eliminate unused argument in PCMCIA_CARD macro.
Provide a backwards compatible way to have the extra macro by defining
PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that
want/need to have the same driver on 5 and 6 with pccard attachments.

Approved by: re (dwhite)
2005-06-24 14:36:54 +00:00
Brooks Davis
fc74a9f93a Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
 - Struct arpcom is no longer referenced in normal interface code.
   Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
   To enforce this ac_enaddr has been renamed to _ac_enaddr.
 - The second argument to ether_ifattach is now always the mac address
   from driver private storage rather than sometimes being ac_enaddr.

Reviewed by:	sobomax, sam
2005-06-10 16:49:24 +00:00
Warner Losh
df889dba95 Perliminary support for Fujitsu SCSI LAN combo card. At least for the
LAN side of things.  It appears that all that's necessary is to relax
the check on the DLCR2 register in the probe.
2005-02-20 19:40:29 +00:00
Warner Losh
8600638b4c Back out part of 1.23. This was a work in progress to support the
Fujitsu LAN SCSI card's ethernet side.
2005-02-20 19:38:38 +00:00
Warner Losh
2f3ed70a98 Forced commit after moving mb86960.h from i386/isa/ic to dev/fe. It
is only used by the fe driver, and isn't MD.
2005-02-20 19:33:13 +00:00
Warner Losh
327f4aba35 we don't need the offset in the attr memory to get the ethernet
address, nor do we need the alignment requirements, so eliminate them.
This likely means that we can now collapse some of the entries as we
have no need of them anymore (they match other entries and were there
only to get the right attr memory offset of the enet addr).
2005-01-21 19:51:23 +00:00
Poul-Henning Kamp
27d62ec5a6 Remove prototype of undefined function so this compiles again. 2005-01-21 10:19:17 +00:00
Warner Losh
3b36b3703e Rework pccard attachment a little. Now both of my fe based ethernet
cards work.  These changes depend on the expanded funce parsing that
just was committed to pccard_cis.c.  In NetBSD the ethernet address
was read out of attr memory directly.  We rely on the kernel pccard
parser to pulll this information out of what appears to be an obsolete
funce with the information in it.

# I'm still getting the no rx interrupt sometimes with some hub/switches
# for reasons unknown...  But usually only one and only when dhclient
# runs.
2005-01-21 02:14:40 +00:00
Warner Losh
0c2c006362 Only attach to network functions. This should be a nop since I'm not
aware of any fe based cards that do anything except network (well,
maybe the fujitsu scsi/lan card, but I've only seen two of those on
ebay in the last 3 years).
2005-01-20 20:08:18 +00:00
Warner Losh
e1239d17fe Minor nit 2005-01-20 07:05:59 +00:00
Warner Losh
4704348247 Add a few cards from NetBSD. They don't work yet, since the code to
read the ethernet address from the attribute space hasn't been
implemented.  Also add flags for the MBH10302.  The flags and maddr
fields will be used when reading from the attribute space...
2005-01-11 06:48:38 +00:00
Warner Losh
f829c24893 don't pollute global namespace with valid_Ether_p, instead, prepend
fe_ to it.
2005-01-10 09:29:48 +00:00
Warner Losh
eae30283ee NE200 -> NE200T 2005-01-10 08:08:30 +00:00
Warner Losh
47cb54ecd0 Add support for:
fe1: <EAGLE Technology NE200 ETHERNET LAN MBH10302  04>

As reported by Sean Shapira.  This appears to be working.  Eagle used
Fujitsu's vendor number, with a product number of 4 (which is the same
as the vendor number, which is a little suspect).  Since there's no
apparent conflict, go ahead and use it.

Submitted by: Sean Shapira
2005-01-10 03:48:17 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Warner Losh
2e31e339d1 Fix disordering of pccarddevs.h noticed by bde. Also remove a few
redundant includes and fix some of the include disordering.

Submitted by: bde
2004-05-27 03:49:45 +00:00
Warner Losh
dba6dd177b Move to generating pccarddevs.h on the fly, both for the kernel and
the modules.

Also generate usbdevs.h automatically now, but a non-kernel file is
stopping that at the moment.
2004-05-26 00:53:10 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +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
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
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
Takeshi Shibagaki
c8dab10220 Update the fe driver to probe and attach under a NEWCARD kernel.
Reviewed by: imp
Obtained from: NetBSD
2001-09-02 06:27:07 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Poul-Henning Kamp
398bc678aa Move DELAY() from <machine/clock.h> to <sys/systm.h> 2000-10-15 09:51:49 +00:00
Yoshihiro Takahashi
12ad26560f Removed unneeded include files.
Submitted by:	phk
2000-09-22 09:59:23 +00:00
Yoshihiro Takahashi
b14d7dac8a - Newbus'ify and bus_space'ify.
- Separate bus dependent part and independent part.
- Moved source files to sys/dev/fe (repo copied).
- Fixed some comments by chi@bd.mbn.or.jp (Chiharu Shibata)

Tested by:	bsd-nomads@clave.gr.jp and
		FreeBSD98-testers@jp.freebsd.org
2000-09-14 12:02:07 +00:00