summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/mlphy.c
Commit message (Collapse)AuthorAgeFilesLines
* - Add IFM_10_2 and IFM_10_5 media via tlphy(4) only in case the respectivemarius2010-10-241-22/+19
| | | | | | | | | | | | interface also has such connectors. - In tl_attach() unify three different ways of obtaining the device and vendor IDs and remove the now obsolete tl_dinfo from tl_softc. - Given that tlphy(4) only handles the integrated PHYs of NICs driven by tl(4) make it only probe on the latter. - Switch mlphy(4) and tlphy(4) to use mii_phy_add_media()/mii_phy_setmedia(). - Simplify looking for the respective companion PHY in mlphy(4) and tlphy(4) by ignoring the native one by just comparing the device_t's directly rather than the device name.
* 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
* - In the spirit of previous simplifications factor out the checks for amarius2010-10-021-33/+4
| | | | | | | | | | | | | | | | | 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.
* Move the code that looks for the companion phy to a subroutine to makeimp2008-08-231-23/+22
| | | | | sure we get the error handling right in both places. This also simplifies the code somewhat.
* It turns out that my analysis of the error handling here was wrong.imp2008-08-231-7/+7
| | | | | | | When there's an error, we don't want to free the children, since it will be stack garbage. While we did fail to dereference it by setting devs to 0, we didn't fail to call free. We never failed to fail, it was the easiest thing to do.
* Set devs to 0 in case device_get_children return an error. The right thingimp2008-08-231-0/+2
| | | | to do here is nothing in that case...
* Some style changes to a couple of PHY drivers:marius2006-12-021-12/+6
| | | | | | | | | | | | | - 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
* 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
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Correct the phy_service() routine case MII_TICK to correctly trackandre2004-05-031-2/+2
| | | | | | | | | | 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
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Remove unnecessary breaks.phk2003-05-311-1/+0
| | | | | | | Remove unused variables. Add XXX comment where a break may be missing. [lxtphy.c] Found by: FlexeLint
* Put function return types on a line by themselves.alfred2002-10-141-6/+10
| | | | | 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-5/+4
| | | | | 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.
* Edging ever closer to NetBSD...phk2002-04-291-2/+2
|
* 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-6/+6
|
* Cleanup pass for mii drivers.jlemon2001-09-291-18/+13
| | | | | | | . 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.
* Add includes of sys/malloc.h so this actually compiles.jhb2001-02-091-1/+1
| | | | Pointy-hat to: asmodai
* Fix memoryleaks with device_get_children().asmodai2001-02-081-0/+2
| | | | Approved by: wpaul
* 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 unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Change && to || in probe routine so that the mlphy driver doesn'twpaul2000-04-141-1/+1
| | | | | | | incorrectly attach itself to ThunderLAN adapters which happen to have a PHY who's model number happens out to be 0. Problem reported by: Peter L. Thomas <Pete@painless-computing.com>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add miibus drivers for the ThunderLAN internal PHY and the Micro Linearwpaul1999-08-271-0/+456
ML6692 PHY. The Micro Linear driver is my own; the ThunderLAN driver is a port of the NetBSD driver with various hacks. The ML driver is necessary to support the Olicom OC-2326 ThunderLAN-based NIC. Also regenerated miidevs.h to pick up the proper 'obtained from' revision string.
OpenPOWER on IntegriCloud