Commit Graph

77 Commits

Author SHA1 Message Date
Pyun YongHyeon
f8e0f10069 Restore link state handling which was broken in rev 1.69.
Also report current link state while auto-negotiation is in
progress.
With this change link loss should be reported within a second
and drivers that rely on link state should work.

Reported by:	Pete French < petefrench at ticketswitch dot com >
Tested by:	Pete French < petefrench at ticketswitch dot com >
MFC after:	1 week
2008-08-12 00:57:39 +00:00
Pyun YongHyeon
366dbcbd4a Remove 'cr' at the end of line. 2008-08-12 00:55:03 +00:00
Pyun YongHyeon
104d1d8401 Remove whitespace at the end of line. 2008-08-12 00:52:10 +00:00
David Christensen
d75672d1c4 - Added support for BCM5709 and BCM5716.
MFC after:	2 weeks
2008-06-13 01:20:29 +00:00
John Baldwin
38cc658ff6 Add support for the BCM5906[M] adapters. These adapters only support
10/100 operation and place the mailbox registers at a different offset.
They also do not have an EEPROM, so the MAC address must be read from
NVRAM instead.

MFC after:	1 month
PR:		kern/118975
Submitted by:	benjsc, Thomas Nyström  thn at saeab dot se
Submitted by:	sephe (original patch for DragonflyBSD)
2008-04-29 19:47:13 +00:00
John Baldwin
bcc20328f5 Flesh out support for the BCM5722 by recognizing the phy on the 5722 and
the specific ASIC revision.

MFC after:	1 week
Obtained from:	OpenBSD (mii/phy bits)
2008-03-06 21:42:48 +00:00
David Christensen
bf10880210 - Add PHY ID for BCM5709C 1000Base-T controllers.
MFC after:	1 week
2008-03-05 22:58:02 +00:00
Jung-uk Kim
86543395c1 Add a flag for Ethernet@WireSpeed capability and correct chip revisions.
The idea was taken from OpenBSD and cross-referenced with Linux driver.
2008-01-18 22:09:50 +00:00
David Christensen
599741f908 - Fixed a problem that caused autonegotiation failures.
Submitted by:	tor.egge@cvsup.no.freebsd.org
MFC after:	4 weeks
2007-06-08 02:34:44 +00:00
David Christensen
7656f58e1c New features:
- Moved BCM5706S/5708S SerDes support to brgphy (since they are not technically
  TBI interfaces)
- Added 2.5G support for BCM5708S

Comments:
Since this driver is shared with bge I tested several available controllers
supported by bge and all worked as expected, however the list was not
exhaustive.  Need wider testing.

MFC after:	4 weeks
2007-06-07 02:21:38 +00:00
Marius Strobl
2f9f08b635 - Take advantage of mii_phy_add_media() for adding media and setting
sc->mii_anegticks according to whether the respective BGE chip
  supports Fast Ethernet only or also Gigabit Ethernet.
- At least the BGE chips I've tested with wedge when isolating them
  so document this as the reason for setting MIIF_NOISOLATE and
  remove the unused (and partially even #ifdef'ed out) isolation
  related code. Add code that panics if we encounter a non-zero MII
  instance as generally there's no way a PHY requiring MIIF_NOISOLATE
  can be handled gracefully in a multi-PHY configuration (it's ok for
  the internal PHY of single-PHY-only-NIC to not support isolation
  though).
- Additionally set MIIF_NOLOOP as loopback doesn't seem to work
  either and remove the #ifdef'ed out code for adding respective
  media. The MIIF_NOLOOP flag currently triggers nothing but
  hopefully will be respected by mii_phy_setmedia() later on.

Reviewed by:	jkim, yongari
MFC after:	1 month
2007-04-30 22:35:33 +00:00
Marius Strobl
5abeece6ab Let brgphy(4) attach for the Broadcom BCM5755 ASIC based chipsets
as well.

Obtained from:	OpenBSD
MFC after:	1 week
2007-04-10 20:43:23 +00:00
Jung-uk Kim
9239bab2fe Revert couple of changes from 1.51 and 1.52. Reading link status with BMSR
is okay for most of the chipsets but BCM5701 PHY does not seem to like it.
Set media to IFM_NONE if link is not up instead of the previous value.

Reported by:	Goran Lowkrantz (goran dot lowkrantz at ismobile dot com)
2007-03-19 23:17:39 +00:00
John Baldwin
f7a66f06ec Restore support for the 5706C bce(4) phy that was broken during the
addition of SerDes support.  According to the docs, the 5706C and 5708C
phys are supposed to use the same MII model that is separate from the
SerDes parts, but the 5706C actually uses the MII model of the SerDes
parts.  To fix this, readd the old 5706C entry to miidevs and add a
special check in brgphy_probe() for phys that match the 5706C ID.  If
the phy is supported by the gentbi(4) driver, then it's a SerDes phy, so
we fail the probe and let gentbi(4) grab it.  Otherwise, it's a 5706C phy,
so we let brgphy(4) grab it.

In coordination with:	dwhite
2007-02-21 18:17:44 +00:00
Jung-uk Kim
b0e42d5c0c Fix a typo from the previous commit.
Pointed out by:	brad@openbsd.org
2007-02-14 18:21:32 +00:00
Jung-uk Kim
5033133005 Fix typos in comments while I am here. 2007-02-13 00:34:32 +00:00
Jung-uk Kim
1ec4c3a889 Add BCM5701 A0/B0 CRC bug workaround. Magic values taken from Linux driver. 2007-02-12 23:58:52 +00:00
Jung-uk Kim
797b2220ae Fix style(9).
Pointed out by:	many
2007-02-12 23:33:05 +00:00
Jung-uk Kim
08bf8bb7c1 Add PHY DSP code for BCM5755M.
Obtained from:	OpenBSD
2007-02-12 22:51:25 +00:00
Jung-uk Kim
bef098d808 BCM5701 PHY cannot read-modify-write. Just re-use the magic number from DSP
init code.
2007-02-12 20:26:56 +00:00
Jung-uk Kim
7ca000fd87 Replace magic numbers with corresponding definitions. 2007-02-12 19:33:22 +00:00
Doug White
3c3d8e1e45 Collapse 5706C and 5708C PHYs into one entry. ID 0x15 is actually used for
the SERDES PHY on these chips and we want gentbi to pick this up, not brgphy.
2007-01-26 17:05:24 +00:00
Jung-uk Kim
b2430c5000 Correct driver_t brgphy_driver, which was forgotten from the last commit. 2007-01-16 17:48:57 +00:00
Jung-uk Kim
900e97a881 Move MII model and revision into softc. 2007-01-16 00:52:26 +00:00
Jung-uk Kim
d69e0bb92e - Move Ethernet@WireSpeed and jumbo frame configurations to separate
functions.  The idea is taken from OpenBSD.
- Set/clear jumbo frame configurations for bge(4).
- Re-add BCM5750 PHY workaround for bce(4), which was mistakenly removed
from the previous commit.
2007-01-15 22:21:44 +00:00
Jung-uk Kim
5ee49a3a58 - Fix BCM5754 support found in Dell PowerEdge SC440.
- Move some PHY bug detections from brgphy.c to if_bge.c.
- Do not penalize working PHYs.
- Re-arrange bge_flags roughly by their categories.
- Fix minor style(9) nits.

PR:		kern/107257
Obtained from:	OpenBSD
Tested by:	Mike Hibler <mike at flux dot utah dot edu>
2007-01-15 21:43:43 +00:00
Jung-uk Kim
1beb06dd0d Use BMSR for link status in one more place and clean up more. 2006-12-20 00:34:12 +00:00
Jung-uk Kim
d56df7ca25 - Do not depend on auto negotiation for link speed/duplex status.
- Read link status from BMSR instead of auxilary status register.
- Clean up style(9) nits.
2006-12-20 00:08:47 +00:00
Oleg Bulyzhin
25ff664232 - Fix autonegotiation timer.
- Use MII_ANEGTICKS/MII_ANEGTICKS_GIGE defines instead of hardcoded value.
- Fix some comments.
- style(9)

MFC after:	2 month
2006-12-19 08:41:48 +00:00
Scott Long
66dfa04f7c Teach the brgphy about some new Broadcom IDs.
Submitted by: David Christenson
Sponsored by: www.UIA.net
2006-12-11 01:29:40 +00:00
Marius Strobl
028ccec463 Some style changes to a couple of PHY drivers:
- Fix some whitespace nits.
- Fix some spelling in comments.
- Use MII_ANEGTICKS instead of 5.
- Don't define variables in nested scope.
- Remove superfluous returns at the end of void functions.
- Remove unused static global rgephy_mii_model.
- Remove dupe $Id$ in tdkphy(4).
- Sort brgphys table.

MFC after:	2 weeks
2006-12-02 19:36:25 +00:00
Marius Strobl
a35b933378 Add a helper function mii_phy_dev_probe(), which wraps around the
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.

Reviewed by:	yongari
MFC after:	2 weeks
2006-12-02 15:32:34 +00:00
Pyun YongHyeon
73810ef739 Add PHY support for BCM5752.
Tested by:	delphij, Ganbold < ganbold AT micom DOT mng DOT net >
2006-08-31 11:15:18 +00:00
Gleb Smirnoff
42953da8a7 Pack several boolean fields into single bge_flags field. 2006-08-23 15:37:07 +00:00
Pyun YongHyeon
f14119a8e0 Use mii_phy_match to reduce duplicated code.
Reviewed by:	glebius
2006-07-03 08:01:27 +00:00
Pyun YongHyeon
5358725ab4 Replace hard-coded magic constants to system defined constants
(BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc).
There is no functional changes.

Reviewed by:	oleg, scottl
2006-07-03 02:53:40 +00:00
Poul-Henning Kamp
c40da00ca3 Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
2006-05-16 14:37:58 +00:00
Paul Saab
7b76202b5a Fix the PHY support for the 5780. I mis-merged this from my sources. 2006-04-12 18:34:00 +00:00
Paul Saab
6caf734fd9 Add a driver for the Broadcom NetXtreme II (BCM5706/BCM5708)
PCI/PCIe Gigabit Ethernet adapeter.

Submitted by:	David Christensen
2006-04-10 19:55:23 +00:00
Oleg Bulyzhin
f78e78fd2f Add basic support for BCM5780 PHY.
Submitted by:	grehan
Approved by:	glebius (mentor)
MFC after:	1 week
2006-03-23 09:53:39 +00:00
Oleg Bulyzhin
dab5cd0588 1) fix tiny bug in bge_start_locked()
2) rework link state detection code & use it in POLLING mode
3) fix 2 bugs in link state detection code:
	a) driver unable to detect link loss on bcm5721
	b) on bcm570x chips (tested on bcm5700 bcm5701 bcm5702) driver fails
	   to detect link loss with probability 1/6 (solved in brgphy.c)

Devices working in TBI mode should not be affected by this change.

Approved by:	glebius (mentor)
MFC after:	1 month
2005-12-08 13:31:52 +00:00
Peter Grehan
b9284f0f45 The BCM5401 dspcode load on media changes also applies
to the 100/1000 BCM5400 phy. This fixes the problem with
the GEM port not syncing up on Sawtooth G4's.

Obtained from:  NetBSD
Reported by:    Ben Rosengart <ben + freebsd org at narcissus net>
2005-10-16 05:29:14 +00:00
Warner Losh
7d830ac9c2 Use ansi function definitions in preference to K&R to reduce diffs
with NetBSD (and cause it looks cooler).
2005-09-30 19:39:27 +00:00
Paul Saab
419c028b36 Support the 5714C
Submitted by:	John Cagle <john dot cagle at hp dot com>
2005-05-19 21:08:59 +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
Paul Saab
e53d81eee9 Add support for the BCM5750/5751. Unfortunately the documentation
I have from Broadcom does not give much information on these devices,
so the Broadcom Linux driver was used for clues to what these chips
support.  It turns out they are similar to the 5705 with the 5751
being the PCI-Express version and needing special work-arounds and
settings.
2004-09-24 22:24:33 +00:00
Poul-Henning Kamp
41ee9f1c69 Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>
2004-05-30 17:57:46 +00:00
Marius Strobl
50aa106108 Remove double __FBSDID and move the remaining one into a common place after
the license(s) and before the driver comment (the latter only in drivers not
having __FBSDID at that location).
2004-05-29 18:09:10 +00:00
Andre Oppermann
9a54cbb95d Correct the phy_service() routine case MII_TICK to correctly track
the falling edge of a media state change.

This is in preparation for media state change notification to the
routing socket.

No objections by:	sam, wpaul, ru, bms
Brucification by:	bde
2004-05-03 13:01:34 +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