summaryrefslogtreecommitdiff
path: root/sys/dev/mii/mvphy.c
AgeCommit message (Collapse)Author
2020-03-15Define and implement a locking protocol for the ifmedia / mii layers:thorpej
- MP-safe drivers provide a mutex to ifmedia that is used to serialize access to media-related structures / hardware regsiters. Converted drivers use the new ifmedia_init_with_lock() function for this. The new name is provided to ease the transition. - Un-converted drivers continue to call ifmedia_init(), which will supply a compatibility lock to be used instead. Several media-related entry points must be aware of this compatibility lock, and are able to acquire it recursively a limited number of times, if needed. This is a SPIN mutex with priority IPL_NET. - This same lock is used to serialize access to PHY registers and other MII-related data structures. The PHY drivers are modified to acquire and release the lock, as needed, and assert the lock is held as a diagnostic aid. The "usbnet" framework has had an overhaul of its internal locking protocols to fit in with the media / mii changes, and the drivers adapted. USB wifi drivers have been changed to provide their own adaptive mutex to the ifmedia later via a new ieee80211_media_init_with_lock() function. This is required because the USB drivers need an adaptive mutex. Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv. mcx also now calls ifmedia_init_with_lock() because it needs to also use an adaptive mutex. The mcx driver still needs to be fully converted to NET_MPSAFE.
2019-11-27- Simplify sc->mii_anegticks setting. Same as FreeBSD.msaitoh
Don't set the default value not in the attach function. Instead, set the default value (MII_ANEGTICKS) first in the beginning of the mii_phy_add_media(). The function already has the code to change the value to MII_ANEGTICKS_GIGE if it's gigabit capable. - Remove extra pmf_device_register() call. It's done in mii_phy_add_media().
2019-03-25 KNF. No functional change.msaitoh
2019-02-24use a macro to tidy up the phydesc array initialization, from FreeBSDchristos
2019-01-23Make evbmips/conf/WGT624V3 compilable:msaitoh
- Modify for new read/write API - Do "#if 0" for unused structures.
2014-06-16 IFM_FDX and IFM_HDX use different bit, so set IFM_HDX bit if it's not fullmsaitoh
duplex. For many drivers, it recognize half duplex if IFM_FDX isn't set, but not for others. Same as {Free|Open}BSD.
2009-06-18Make it compile. Change a commented out printf() to aprint_error_dev().rjs
2008-11-17Reduce code duplication: most PHY drivers call mii_phy_add_media()dyoung
when they attach to the device tree, so call pmf_device_register(9) once there instead of once in more than twenty drivers.
2008-05-04device_t/softc split for all mii(4) devices, and other relatedxtraeme
cosmetic changes.
2008-04-08use aprint_*_dev and device_xnamecegger
2007-12-29Remove the device_is_active() check from each individual PHY'sdyoung
service routine. Add a wrapper for PHY_SERVICE(), called phy_service(), and check device_is_active() there. Make the mii_*() routines call the PHY service routines thorugh phy_service() instead of PHY_SERVICE(). In mii_phy_resume(), restore a PHY's state after resetting it by sending a MII_MEDIACHG command. This change makes bnx(4) resume more reliably and more quickly; it should help other NICs to resume, too, if they attach PHYs through MII.
2007-12-09Merge jmcneill-pm branch.jmcneill
2007-02-17Add a default "dumb" mode, that adds all ports to the same interface.jmcneill
2006-11-16- don't hardcode 5, 10 define and use MII_ANEGTICKS{,_GIGE}christos
- instead of != limit, use <= limit (conservative)
2006-07-21Initial implementation for Marvell 88E6060 10/100 5-port PHY switch, fromgdamore
Sam Leffler, used in various products including AR5312-based designs. This is not enabled in any configs yet, nor tested by anyone other than Sam. I will be testing this more later, and adding it to appropriate configs once I have verified (unless someone else beats me to the punch.)