summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/amphy.c
Commit message (Collapse)AuthorAgeFilesLines
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Consistently always explicitly set IFM_HDX for half-duplex.marius2010-10-031-5/+5
| | | | Obtained from: OpenBSD (mostly)
* - In the spirit of previous simplifications factor out the checks for amarius2010-10-021-27/+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.
* Fix a typo in a comment.marius2008-01-271-1/+1
|
* IEEE 802.3 Annex 28B.3 explicitly specifies the following relativeyongari2007-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | priorities of the technologies supported by 802.3 Selector Field value. 1000BASE-T full duplex 1000BASE-T 100BASE-T2 full duplex 100BASE-TX full duplex 100BASE-T2 100BASE-T4 100BASE-TX 10BASE-T full duplex 10BAST-T However PHY drivers didn't honor the order such that 100BASE-T4 had higher priority than 100BASE-TX full duplex. Fix that long standing bugs such that have PHY drivers choose the highest common denominator ability. Fix a bug in dcphy which inadvertently aceepts 100BASE-T4. PR: 92599
* Use mii_phy_add_media()/mii_phy_setmedia()-compatible media tablemarius2007-01-121-1/+1
| | | | | | indices when manually adding media. Some of these I've missed while converting drivers to take advantage of said fuctions recently, others where longstanding bugs.
* - Probe Davicom DM9102 PHYs.marius2006-12-021-30/+8
| | | | | | | | | | | | | | - Don't set MIIF_NOISOLATE so amphy(4) can be used in configurations with multiple PHYs. There doesn't seem to be a problem with isolating AM79c873 and workalikes per se nor in combination with the NICs they're used with and amphy(4) was already adding IFM_NONE anyway. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia(). - Fix a whitespace nit. Obtained from: NetBSD dmphy(4) (except for the last item) MFC after: 2 weeks
* Add a helper function mii_phy_dev_probe(), which wraps around themarius2006-12-021-15/+7
| | | | | | | | | | | 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
* Replace hard-coded magic constants to system defined constantsyongari2006-07-031-1/+1
| | | | | | | (BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc). There is no functional changes. Reviewed by: oleg, scottl
* 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 some missing <sys/module.h> includes which are masked by thephk2004-05-301-0/+1
| | | | one on death-row in <sys/kernel.h>
* Remove double __FBSDID and move the remaining one into a common place aftermarius2004-05-291-3/+0
| | | | | the license(s) and before the driver comment (the latter only in drivers not having __FBSDID at that location).
* Use __FBSDID().obrien2003-08-241-0/+3
| | | | Also some minor style cleanups.
* Use __FBSDID rather than rcsid[].obrien2003-04-031-7/+3
|
* Remove miidevs.h and generate it from miidevs at compile time.obrien2003-01-191-1/+1
| | | | The devlist2h.awk tool to do this has been repocopied to sys/tools/.
* Put function return types on a line by themselves.alfred2002-10-141-4/+6
| | | | | Cleanup my earlier de-__P sweep and remove whitespace between function names and paramters.
* Clean up mii/phy drivers: Remove the MIIF_DOINGAUTO which doesn't reallyphk2002-05-041-1/+1
| | | | | do anything at the end of the day except bloat the drivers which has copy&pasted it.
* Make one generic mii_phy_detach() to replace 19 slightly different ones.phk2002-04-291-17/+1
| | | | | | | Rename mii_phy_auto_stop() mii_phy_down(). Introduce mii_down(), use it from nge. Do not indirect it to 19 identical case's in 19 switchstatements like NetBSD did.
* Don't pass three args when one will do just fine, and even preventphk2002-04-281-1/+1
| | | | mistakes like the one brgphy.c (now corrected).
* Improve an API by about 4 lines per driver.phk2002-04-281-5/+1
|
* Remove __P.alfred2002-03-201-5/+5
|
* Cleanup pass for mii drivers.jlemon2001-09-291-41/+7
| | | | | | | . 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.
* Grrrrr. That last commit was supposed to be to the head, not to -stablewpaul2000-12-121-0/+1
| | | | | | (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*
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Allow the AMD PHY driver to support the DM9101 PHY. The DM9101 and thewpaul1999-09-191-3/+10
| | | | | AMD AM79c873 have identical registers. I'm not sure why; one is probably a clone of the other.
* Add a driver for the AMD AM79c873 10/100 PHY. By some strange coincidence,wpaul1999-09-061-0/+344
this PHY and the Davicom DM9101 have exactly the same register definitions. One of them is probably a clone of the other. I'm not sure which. This is needed for the Davicom DM9102 10/100 PCI ethernet driver which will be committed shortly.
OpenPOWER on IntegriCloud