Commit Graph

79 Commits

Author SHA1 Message Date
Daniel O'Callaghan
3c3c45471c Remove problematic PHY_WRITE so that autoneg to 10 Mbps
actually works.

Submitted by: Dennis <TD790@aol.com>
Reviewed by:	Bill Paul <wpaul@freebsd.org>
MFC after:	7 days
2002-02-27 02:11:34 +00:00
Archie Cobbs
4fc53c229d Fix reversed definitions for the bits that select half vs. full duplex.
Submitted by:	Darren Croke <djc@packetdesign.com>
2002-01-10 18:06:41 +00:00
Matt Jacob
5aa8fe17f8 Fix declaration disagreement. 2001-10-11 22:02:14 +00:00
Matt Jacob
79a79ad9b8 Note the 'common knowledge' assumption that each NIC's softc starts
with an ifnet structure (so device_get_softc will get one).

If memory allocation fails in mii_phy_probe, don't just march ahead into
a panic- return ENOMEM.

MFC after:	1 week
2001-10-01 22:57:57 +00:00
Jonathan Lemon
d9730b8b53 Cleanup pass for mii drivers.
. Make internal service routines static.
   . Use a consistent ordering of checks in MII_TICK.  Do the work in the
     mii_phy_tick() subroutine if appropriate.
   . Call mii_phy_update() to trigger the callbacks.
2001-09-29 19:18:52 +00:00
Jonathan Lemon
105cb0c6a9 Change the order that we print the media options during device probe to
match the other mii drivers.
2001-09-29 18:59:17 +00:00
Jonathan Lemon
babc535e85 Add field for last active status, as well as function prototypes. 2001-09-29 18:48:52 +00:00
Jonathan Lemon
eb3a764866 Add new device method miibus_linkchg, along with a service routine. 2001-09-29 18:40:06 +00:00
Bill Paul
245dd946e3 Fix typo: BGGPHY -> BRGPHY in one of the #defines I added the other day. 2001-09-27 17:32:49 +00:00
Bill Paul
9aa35f2391 Add some definitions for the DSP programming registers in the BCM5400
and BCM5401 PHYs.
2001-09-25 16:41:56 +00:00
Bill Paul
1d083681bc Tweak the autoneg kickoff code to that it more closely resembles the
method uses in the nsgphy driver.
2001-09-18 00:31:19 +00:00
Bill Paul
516f7ab7ac Regenerate. 2001-09-04 22:00:49 +00:00
Bill Paul
e1968a0d2f Add support for the BCM5401 and BCM5411 10/100/1000Mbps copper gigE PHYs.
This basically updates the brgphy driver to support 10/100 modes in
addition to 1000Mbps modes.
2001-09-04 22:00:33 +00:00
Kris Kennaway
a081aa7d72 Quiet a variable format-string warning.
MFC after:    1 week
2001-07-19 02:16:24 +00:00
Jonathan Lemon
e46e7fa2c2 Only touch the PCR register in order to set bits for the fxp driver.
The 3C509-TX card apparently had a slightly different version of the
chip, and has problems when this register is set.  The problem does
not appear on the 3C509{BC} cards, but since only the fxp driver needs
specific bits set, conditionalize on that.
2001-06-02 19:51:02 +00:00
Bill Paul
95f27dc639 Regenerate 2001-05-23 22:11:25 +00:00
Bill Paul
134c58d3c0 Tweak the xmphy driver a little bit based on something I learned about
the built-in 1000baseX interface in the Level 1 LXT1001 chip. The Level 1
PHY comes up with the isolate bit in the control register set by default,
but it also has the autonegotiate bit set. When you tell the xmphy driver
to select IFM_AUTO mode, it sees that the autoneg bit is already on, and
thus doesn't bother updating the control register. However this means that
the isolate bit is never turned off (unless you manually select 1000baseSX
full or half duplex mode, which does result in the control register being
modified and the ISO bit being turned off).

This subtle and unusual behavioral difference stopped me from being able
to receive packets on the SMC9462TX card for several days, since isolating
the PHY disconnects it from the MAC's data interface. The fix is to omit
the 'is the autoneg big set?' test, since it doesn't really provide much
of an optimization anyway.

This commit also updates the xmphy driver to support the Jato/Level 1
internal PHY. (I'm not sure how Jato Technologies is related to Level 1:
all I know is the OUI from the PHY ID registers maps to Jato in the OUI
database.) This will be used once I add the if_lge driver to support
the LXT10010 chip.
2001-05-23 22:10:55 +00:00
Jonathan Lemon
fae4825cdf Regenerate. 2001-05-11 20:41:20 +00:00
Jonathan Lemon
dafdd7777b Correctly recognize the i82562{EM} PHYs.
Obtained from: OpenBSD
2001-05-11 20:34:38 +00:00
Bill Paul
b680c0ae8b Regenerate 2001-05-11 20:27:39 +00:00
Bill Paul
ce4946daa5 Add support for gigabit ethernet cards based on the NatSemi DP83820
and DP83821 gigabit ethernet MAC chips and the NatSemi DP83861 10/100/1000
copper PHY. There are a whole bunch of very low cost cards available with
this chipset selling for $150USD or less. This includes the SMC9462TX,
D-Link DGE-500T, Asante GigaNIX 1000TA and 1000TPC, and a couple cards
from Addtron.

This chip supports TCP/IP checksum offload, VLAN tagging/insertion.
2048-bit multicast filter, jumbograms and has 8K TX and 32K RX FIFOs.
I have not done serious performance testing with this driver. I know
it works, and I want it under CVS control so I can keep tabs on it.
Note that there's no serious mutex stuff in here yet either: I need
to talk more with jhb to figure out the right way to do this. That
said, I don't think there will be any problems.

This driver should also work on the alpha. It's not turned on in
GENERIC.
2001-05-11 19:56:39 +00:00
Matt Jacob
2a4339f78f Add Marvell PHY support for 10/100/1000 LIVENGOOD_CU Intel NIC.
Parag Patel did all of the grunt work, so he gets the credit.
Register definitions and actions inferred from a Linux driver,
so Intel also gets some 'credit'.
2001-04-09 21:29:44 +00:00
John Baldwin
f34fa851e0 Catch up to header include changes:
- <sys/mutex.h> now requires <sys/systm.h>
- <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
2001-03-28 09:17:56 +00:00
Jonathan Lemon
e3768ebb1b Back out previous commit until I figure out a way to do it properly.
We really want to be able to say "auto NWAY", "limited NWAY", and
"no NWAY".  Unfortunately, this does not appear to be possible with
the current mediaopt structure.
2001-03-28 07:01:45 +00:00
Jonathan Lemon
469961321f Really fix NWAY negotiation for the 82553 PHY. Locking down the
media interface selection should not imply disabling NWAY negotiaton
as well.

Problem pointed out by: peter
2001-03-17 02:50:20 +00:00
Jonathan Lemon
32de04d557 Enable some undocumented bits in the DP83840 PHY, which is needed
when using it with the Intel fxp driver.

Tested by: peter, Ollivier Robert <roberto@eurocontrol.fr>,
	   Peter Schultz <pete@jocose.org>
2001-03-16 14:17:02 +00:00
Jonathan Lemon
83a2d3997e Add drivers for Intel 82553 and 82555 PHYs. 2001-03-12 02:41:57 +00:00
Jonathan Lemon
c49993ab73 Regenerate. 2001-03-12 02:27:58 +00:00
Jonathan Lemon
5a3f7e2c9b Add some definitions for Intel 82553 PHYs 2001-03-12 02:27:10 +00:00
John Baldwin
1798caf635 Add includes of sys/malloc.h so this actually compiles.
Pointy-hat to:	asmodai
2001-02-09 00:16:41 +00:00
Jeroen Ruigrok van der Werven
4b91c22b12 Fix memoryleaks with device_get_children().
Approved by:	wpaul
2001-02-08 21:53:05 +00:00
Semen Ustimenko
e8288d7f9c Oops... I knew i shouldn't use arrows in vi. Fix a typo causing errors in
compilation.
2001-02-07 22:34:15 +00:00
Semen Ustimenko
9526a692c6 Add QS6612, AC101 and LXT970 personal drivers and register definitions.
Obtained from:	NetBSD/OpenBSD
2001-02-07 19:57:40 +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
Bill Paul
34da0ef197 Grrrrr. That last commit was supposed to be to the head, not to -stable
(even though I want the fixes in -stable anyway). I'm sure I'm going
to get flamed now for committing to -stable and -current too quickly.
*sigh*
2000-12-12 19:31:14 +00:00
John Baldwin
35e0e5b311 Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h
2000-10-20 07:58:15 +00:00
Jonathan Chen
feb78939ee NEWCARD/Cardbus -
This commit adds support for Xircom X3201 based cardbus cards.
Support for the TDK 78Q2120 MII is also added.
IBM Etherjet, Intel and Xircom cards uses these chips.

Note that as a result of this commit, some Intel/DEC 21143 based cardbus
cards will also attach, but not get link.  That is being looked at.
2000-10-19 08:34:32 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Bill Paul
d308faacc2 Add #include <machine/mutex.h> since these files need it and don't
include anything else that includes mutex.h. Needed to resolve struct mtx
from struct dc_softc.
2000-10-13 19:15:50 +00:00
Warner Losh
da8e360acf sync to last commit 2000-10-12 00:16:19 +00:00
Warner Losh
0ac8fcedf1 Add mii entry for tdk phy found on some cardbus cards. 2000-10-12 00:15:10 +00:00
Bill Paul
5c1cfac46e Add support for parsing the media blocks from the SROM on 21143
adapters. This is necessary in order to make this driver work with
the built-in ethernet on the alpha Miata machines. These systems
have a 21143-PC chip on-board and optional daughtercards with either
a 10/100 MII transceiver or a 10baseT/10base2 transceiver. In both
cases, you need to twiddle the GPIO bits on the controller in order
to turn the transceivers on, and you have to read the media info
from the SROM in order to find out what bits to twiddle.
2000-10-05 17:36:14 +00:00
Bill Paul
b54acb744c Add a homePNA PHY driver. This is really only a stub: MII-based homePNA
PHYs tend to look like 10mbps PHYs with no autonegotiation. This allows
us to display the proper media type and link status however.
2000-09-20 17:04:30 +00:00
Bill Paul
337771f919 regenerate 2000-09-20 17:02:32 +00:00
Bill Paul
9d960ff86d Add the ID for the built-in homePNA PHY in the AMD 79C798 controller. 2000-09-20 17:02:16 +00:00
Semen Ustimenko
95a4de30e8 Added Altima Communications OUI and their AC101 10/100
media interface to the list of known chips.

miidevs.h regenerated also.
2000-06-21 19:26:01 +00:00
Bill Paul
b6a1416d3a Don't bother checking the link state in dcphy_status() if the interface
isn't up.
2000-06-05 19:37:15 +00:00
Bill Paul
318b02fdb9 Rework the support for the internal autonegotiation on the 21143 and
workalike chips (Macronix 98713A/98715 and PNIC II). Timing is somewhat
critical: you need to bring the link as soon as possible after NWAY
is done, and the old one second polling interval was too long. Now
we poll every 10th of a second until NWAY completes (at which point
we return to the 1 second interval again to keep an eye on the link
state).

I tested all the other cards I had on hand to make sure I didn't bust
any of them and they seem to work (including the MII-based 21143 card).
This should fix some autoneg problems with DE500-BA cards and the
built-in 10/100 ethernet on some alpha systems.

(Now before anyone asks why I never noticed this before, the old code
worked just find with the Intel swich I used for testing back in NY.
Apparently not all switches are as picky about the timing.)
2000-05-31 05:40:53 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00