summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/ciphy.c
Commit message (Collapse)AuthorAgeFilesLines
* - Even after masking the media with IFM_GMASK the result may have bitsmarius2011-01-141-14/+11
| | | | | | | | | | besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Simplify ciphy_service() to only set the manual configuration bits once after we have figured them all out. This also means we no longer unnecessarily update the hardware along the road. MFC after: 1 week
* o Flesh out the generic IEEE 802.3 annex 31B full duplex flow controlmarius2010-11-141-20/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support in mii(4): - Merge generic flow control advertisement (which can be enabled by passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD, IFM_FLOW isn't implemented as a global option via the "don't care mask" but instead as a media specific option this. This has the following advantages: o allows flow control advertisement with autonegotiation to be turned on and off via ifconfig(8) with the default typically being off (though MIIF_FORCEPAUSE has been added causing flow control to be always advertised, allowing to easily MFC this changes for drivers that previously used home-grown support for flow control that behaved that way without breaking POLA) o allows to deal with PHY drivers where flow control advertisement with manual selection doesn't work or at least isn't implemented, like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4), by setting MIIF_NOMANPAUSE o the available combinations of media options are readily available from the `ifconfig -m` output - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so these are understood by ifconfig(8). o Make the master/slave support in mii(4) actually usable: - Change IFM_ETH_MASTER from being implemented as a global option via the "don't care mask" to a media specific one as it actually is only applicable to IFM_1000_T to date. - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to actually configure manually selected slave mode (like we also do in the PHY specific implementations). - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it is understood by ifconfig(8). o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4), e1000phy(4) and ip1000phy(4) to use the generic flow control support instead of home-grown solutions via IFM_FLAGs. This includes changing these PHY drivers and smcphy(4) to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set) and implemented for these media variants, i.e. typically only for copper. o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0 and some IFM_FLAGn. o Switch brgphy(4) to add at least the the supported copper media based on the contents of the BMSR via mii_phy_add_media() instead of hardcoding them. The latter approach seems to have developed historically, besides causing unnecessary code duplication it was also undesirable because brgphy_mii_phy_auto() already based the capability advertisement on the contents of the BMSR though. o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not just BCM5701. Apparently this was a misinterpretation of a workaround in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but this doesn't mean we can't set these as well on other PHYs for manual media selection. o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so IFM_1000_T master mode support now is generally available with all PHY drivers. o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's not applicable there. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) MFC after: 2 weeks
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | | the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari
* - In the spirit of previous simplifications factor out the checks for amarius2010-10-021-25/+2
| | | | | | | | | | | | | | | | | different PHY instance being selected and isolation out into the wrappers around the service methods rather than duplicating them over and over again (besides, a PHY driver shouldn't need to care about which instance it actually is). - Centralize the check for the need to isolate a non-zero PHY instance not supporting isolation in mii_mediachg() and just ignore it rather than panicing, which should sufficient given that a) things are likely to just work anyway if one doesn't plug in more than one port at a time and b) refusing to attach in this case just leaves us in a unknown but most likely also not exactly correct configuration (besides several drivers setting MIIF_NOISOLATE didn't care about these anyway, probably due to setting this flag for no real reason). - Minor fixes like removing unnecessary setting of sc->mii_anegticks, using sc->mii_anegticks instead of hardcoded values etc.
* Use the mii_data provided via mii_attach_args and mii_pdata respectivelymarius2010-09-271-1/+1
| | | | instead of reaching out for the softc of the parent.
* Correct PHY description and OUI of VSC8211. Previously VSC8211 wasyongari2008-10-231-2/+2
| | | | | | | not recognized by ciphy(4) due to the incorrect OUI. Reported by: nork Tested by: nork
* Add Vitesse VSC8211 PHY which is found on Planex GU-1000T.yongari2008-09-301-0/+2
| | | | HW donated by: nork
* Explicitly mark IFM_HDX for half-duplex media.yongari2008-09-301-0/+2
|
* Report current link state while auto-negotiation is in progress.yongari2008-09-301-1/+1
|
* Use mii_anegticks instead of hardcoded MII_ANEGTICKS.yongari2008-09-301-2/+2
|
* Announce link loss right after it happens.yongari2008-09-301-1/+4
|
* Recognize Cicada CS8244 phy chip (among others, can be found on MPC8572DSraj2008-04-261-1/+3
| | | | | | development systems). Obtained from: Freescale, Semihalf
* Recognize the quad-port Cicada (Vitesse) CS8204 10/100/1000TX PHY.raj2008-03-031-1/+3
| | | | | | | | This PHY is found on many embedded development boards: among others MPC8555CDS evaluation systems use it. Approved by: cognet (mentor) MFp4: e500
* Add support Vitesse VSC8601 PHY that is found on nVidia networkyongari2007-06-061-0/+20
| | | | | | | | adapters. Submitted by: Shigeaki Tagashira < shigeaki AT se DOT hiroshima-u DOT ac DOT jp > Tested by: Yuri Pankov < yuri.pankov AT gmail DOT com>, Rainer Hurling <rhurlin AT gwdg DOT de >
* Some style changes to a couple of PHY drivers:marius2006-12-021-8/+2
| | | | | | | | | | | | | - 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
* Add a helper function mii_phy_dev_probe(), which wraps around themarius2006-12-021-22/+8
| | | | | | | | | | | 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
* - Remove a dupe $FreeBSD$.marius2006-11-281-10/+8
| | | | - Fix some whitespace nits.
* Replace hard-coded magic constants to system defined constantsyongari2006-07-031-3/+3
| | | | | | | (BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc). There is no functional changes. Reviewed by: oleg, scottl
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Use ansi function definitions in preference to K&R to reduce diffsimp2005-09-301-10/+4
| | | | with NetBSD (and cause it looks cooler).
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Add device driver support for the VIA Networking Technologieswpaul2004-09-101-0/+433
VT6122 gigabit ethernet chip and integrated 10/100/1000 copper PHY. The vge driver has been added to GENERIC for i386, pc98 and amd64, but not to sparc or ia64 since I don't have the ability to test it there. The vge(4) driver supports VLANs, checksum offload and jumbo frames. Also added the lge(4) and nge(4) drivers to GENERIC for i386 and pc98 since I was in the neighborhood. There's no reason to leave them out anymore.
OpenPOWER on IntegriCloud