summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo from the previous commit.jkim2007-02-141-1/+1
| | | | Pointed out by: brad@openbsd.org
* Fix typos in comments while I am here.jkim2007-02-132-28/+29
|
* Add BCM5701 A0/B0 CRC bug workaround. Magic values taken from Linux driver.jkim2007-02-121-0/+22
|
* Fix style(9).jkim2007-02-122-236/+236
| | | | Pointed out by: many
* Add PHY DSP code for BCM5755M.jkim2007-02-122-0/+27
| | | | Obtained from: OpenBSD
* BCM5701 PHY cannot read-modify-write. Just re-use the magic number from DSPjkim2007-02-121-4/+9
| | | | init code.
* Replace magic numbers with corresponding definitions.jkim2007-02-121-8/+8
|
* Fix problem with RTL8201L PHY. From submitter:imp2007-02-081-2/+17
| | | | | | | | | | | | | | | | | | | | | | | Bugfix for the Realtek PHY driver... an RTL8201L standalone PHY needs different handling than the integrated ones in terms of speed detection. There was a bogus test based on the parent device driver name string controlling which speed register to query. That test began failing when the rl driver was split into separate rl and re drivers some time ago. Apparently nobody ever noticed because the buggy code only executes if NWAY negotiation failed. Since we happen to be testing with an ancient dumb hub rather than a modern switch, we found it. To fix it all, have the attach() routine notice whether we're dealing with an integrated PHY or an RTL8201L and store that info in a struct accessible to the status() routine that needs to know which register to query. I touched up the fixes because they were relative to RELENG_6 and to bring a few nits into line with style(9). MFC After: 2 weeks Submitted by: Ian Lepore
* Add missing MIIBUS_MEDIAINIT() call.dwhite2007-01-261-0/+1
|
* Collapse 5706C and 5708C PHYs into one entry. ID 0x15 is actually used fordwhite2007-01-262-3/+1
| | | | the SERDES PHY on these chips and we want gentbi to pick this up, not brgphy.
* Correct a logic bug in the previous change.marius2007-01-211-1/+1
|
* - In miibus_attach() remove IFM_IMASK from the dontcare_mask of themarius2007-01-201-2/+17
| | | | | | | | | | | | | | | | ifmedia_init() invocation. IFM_IMASK makes only sense here when all of the maxium of 32 PHYs on each one MII bus support disjoint sets of media, which generally isn't the case (though it would be nice if we had a way to let NIC drivers indicate that for the few card models where the PHY configuration is known/fixed and IFM_IMASK actually makes sense). - Add and use a miibus_print_child() for the bus_print_child method which additionally prints the PHY number (which actually is the PHY address) so one can figure out the media instance <-> PHY number mapping from the PHY driver attach output. This is intented to be usefull in situations where the addresses of the PHYs on the bus are known (f.e. of internal/ integrated PHYs) so one can feed the appropriate media instance number to ifconfig(8) (with the upcoming change for ifconfig(8)). This is more or less inspired by the NetBSD mii_print().
* - Don't set MIIF_NOISOLATE so ukphy(4) can be used in configurations withmarius2007-01-201-3/+1
| | | | | | | | | multiple PHYs. In case some PHYs currently driven by ukphy(4) exhibit problems when isolating due to incomplete implementations or silicon bugs we'll need to add specific drivers for these. Looking at NetBSD and OpenBSD I don't expect problems here though (quite the contrary; we still seem to set MIIF_NOISOLATE without good reason in a bunch of PHY drivers). - Fix a style(9) whitespace nit.
* Correct driver_t brgphy_driver, which was forgotten from the last commit.jkim2007-01-161-1/+1
|
* Move MII model and revision into softc.jkim2007-01-161-14/+24
|
* - Move Ethernet@WireSpeed and jumbo frame configurations to separatejkim2007-01-151-48/+60
| | | | | | | 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.
* - Fix BCM5754 support found in Dell PowerEdge SC440.jkim2007-01-152-22/+49
| | | | | | | | | | | - 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>
* After another thought there is another nail for the mii_phy_dev_probe()-marius2007-01-131-19/+12
| | | | hammer.
* Remove mii_media_from_bmcr(); all previous users have been converted tomarius2007-01-132-20/+0
| | | | use mii_phy_add_media()/mii_phy_setmedia().
* - Take advantage of mii_phy_dev_probe() and mii_phy_setmedia().marius2007-01-131-52/+22
| | | | | | | | | | | - Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP flag currently triggers nothing but hopefully will be respected by mii_phy_setmedia() later on. - Use MII_ANEGTICKS instead of 5. - Remove an unused macro. - Fix some whitespace nits. MFC after: 1 week
* - Take advantage of mii_phy_dev_probe().marius2007-01-121-39/+19
| | | | | | | | | | - In exphy_service() for the MII_TICK case don't bother to check whether the currently selected media is of type IFM_AUTO as auto-negotiation doesn't need to be kicked anyway. - Remove #if 0'ed unapplicable code. - Fix some whitespace nits. MFC after: 1 week
* Set MIIF_HAVE_FIBER and add IFM_100_FX media when the AC_MCTL_FX_SELmarius2007-01-121-0/+13
| | | | | | | | | and thus the FX_DIS pin indicates fibre media. This is part 1/2 of adding support for the 100baseFX interface/port of AT-2700 series adaptors. Idea from: NetBSD MFC after: 1 week
* - Correct the AC_MCTL_BYP_PCS constant.marius2007-01-121-14/+14
| | | | - Correct whitespace nits (use #define<tab>, remove trailing whitespace).
* Use mii_phy_add_media()/mii_phy_setmedia()-compatible media tablemarius2007-01-126-7/+7
| | | | | | 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.
* MFp4: add basic driver for RTL8305SC switch in PHY emulationticso2007-01-052-0/+426
|
* Use BMSR for link status in one more place and clean up more.jkim2006-12-201-10/+9
|
* - Do not depend on auto negotiation for link speed/duplex status.jkim2006-12-201-68/+81
| | | | | - Read link status from BMSR instead of auxilary status register. - Clean up style(9) nits.
* - Fix autonegotiation timer.oleg2006-12-191-30/+22
| | | | | | | | - Use MII_ANEGTICKS/MII_ANEGTICKS_GIGE defines instead of hardcoded value. - Fix some comments. - style(9) MFC after: 2 month
* Correct the previous change:marius2006-12-181-0/+3
| | | | | | - If we want mii_phy_add_media() to add 1000baseT media, we need to supply sc->mii_extcapabilities. - Fix formatting when announcing autonegotiation support.
* o Add support code for newer Marvell PHYs.yongari2006-12-111-127/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Remove unused static global variable e1000phy_debug. o Take advantage of mii_phy_dev_probe(). o Use MII_ANEGTICKS/MII_ANEGTICKS_GIGE instead of magic number 5. o Add IFM_NONE as e1000phy(4) supports it without issues. o Nuke magic PHY programming sequence in PHY reset and follow correct reset sequence. [1] o Make manual media selection work for all supported media types. o Don't set MIIF_NOISOLATE so e1000phy(4) can be used in configurations with multiple PHYs. o In 1000baseT, when setting the link manually, one side must be the master and the other the slave. If LINK0 is set, program the PHY to be a master, otherwise it's a slave. o When we lost a link, reset mii_ticks immediately so it correctly check number of seconds elapsed in autonegotiation phase. o Announce link loss right after it happens. o After kicking autonegotiation, report PHY status instead of returning immediatly. o When link state check is in progress, check auto negotiation completion bit only when auto negotiation is enbaled. o When PHY is resolved to a master, show it with IFM_FLAG2. Special thanks to marius who fixed several nits in original patch. In half-duplex mode, nfe(4) fails to send packets. I think it's a bug in nfe(4) as the same PHY works without problems on msk(4). Obtained from: em(4) [1] Reviewed by: marius Tested by: bz
* Add additional Marvell PHY registers.yongari2006-12-111-0/+10
|
* Add a bunch of new Marvell PHY ids.yongari2006-12-111-0/+14
|
* style(9)yongari2006-12-111-5/+4
|
* Teach the brgphy about some new Broadcom IDs.scottl2006-12-112-0/+3
| | | | | Submitted by: David Christenson Sponsored by: www.UIA.net
* - 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
* - In acphy_service() for the MII_TICK case don't bother to check whethermarius2006-12-021-30/+7
| | | | | | | | | | | | | | | | | | | the currently selected media is of type IFM_AUTO as auto-negotiation doesn't need to be kicked anyway. - Fix a whitespace nit. - Probe another Altima PHY, which is a AC101 workalike and integrated in at least ADMtek ADM8511 but apparently is not mentioned in any publically available data sheet so the actual identifier is unknown. - Don't set MIIF_NOISOLATE so acphy(4) can be used in configurations with multiple PHYs. There doesn't seem to be a problem with isolating AC101 and workalikes per se nor in combination with the NICs they're used with. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia(). Obtained from: NetBSD (except for the first and second item) MFC after: 2 weeks
* - Add another Altima PHY, which is a AC101 workalike and integratedmarius2006-12-021-1/+3
| | | | | | | | | | | in at least ADMtek ADM8511 but apparently is not mentioned in any publically available data sheet so the actual identifier is unknown. - Add Davicom DM9102 PHY. - Add DM9101 to the description of AMD 79C873 as at least some Davicom DM9101F identify identical to AMD 79C873. Obtained from: NetBSD MFC after: 2 weeks
* - Don't set MIIF_NOISOLATE so tdkphy(4) can be used in configurationsmarius2006-12-021-37/+9
| | | | | | | | | | | | | | | | | with multiple PHYs. There doesn't seem to be a problem with isolating 78Q2120 per se nor in combination with the NICs they're used with and tdkphy(4) was already adding IFM_NONE anyway. - Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP flag currently triggers nothing but hopefully will be respected by mii_phy_setmedia() later on. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia(). Thanks to Hans-Joerg Sirtl for lending me test hardware. Obtained from: NetBSD tqphy(4) MFC after: 2 weeks
* - Don't set MIIF_NOISOLATE so rgephy(4) can be used in configurationsmarius2006-12-021-13/+3
| | | | | | | | | | | with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG rgephy_service(). There doesn't seem to be a problem with isolating RTL8169S and their internal PHY. - Take advantage of mii_phy_add_media(). [1] Obtained from: NetBSD [1] Tested by: yongari MFC after: 2 weeks
* Some style changes to a couple of PHY drivers:marius2006-12-027-94/+53
| | | | | | | | | | | | | - 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-0219-249/+135
| | | | | | | | | | | 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
* - In rlphy_service() for the MII_TICK case don't bother to check whethermarius2006-11-281-45/+10
| | | | | | | | | | | | | | the currently selected media is of type IFM_AUTO as auto-negotiation doesn't need to be kicked anyway. - In rlphy_status() just use if_dname instead of determining the name of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)). - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia(). - Fix some whitespace nits and remove commented out code that just can't be used with RealTek PHYs. MFC after: 2 weeks
* - In qsphy_service() for the MII_TICK case don't bother to check whethermarius2006-11-281-29/+4
| | | | | | | | | | | | | | the currently selected media is of type IFM_AUTO as auto-negotiation doesn't need to be kicked anyway. - Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations with multiple PHYs. There doesn't seem to be a problem with isolating QS6612 per se nor in combination with the NICs they're used with. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia(). Obtained from: NetBSD (except for the first item) MFC after: 2 weeks
* - Don't add IFM_NONE when used in combination with pcn(4) as for MIImarius2006-11-281-49/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loopback to work PCnet chips additionally need to be placed into external loopback mode which pcn(4) doesn't do so far. - In nsphy_service() just use if_dname instead of determining the name of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)). - Don't set MIIF_NOISOLATE, except for when used in combination with a NIC that wedges when isolating the PHYs, so nsphy(4) can be used in configurations with multiple PHYs. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired. - Take advantage of mii_phy_setmedia() (requires the MIIF_FORCEANEG added in sys/dev/mii/mii_physubr.c 1.26, sys/dev/mii/miivar.h 1.19). - Implement a separate nsphy_reset(). There are two reasons for this: 1) This PHY can take an inordinate amount of time to reset if media is attached; under fairly normal circumstances up to nearly one second. This is because it appears to go through an implicit auto- negotiation cycle as part of the reset. 2) During reset and auto-negotiation, the BMCR will clear the reset bit before the process is complete. It will return 0 until the process is complete and it's safe to access the PHY again. This is the first of two changes required to make the combination of Am79c971 and DP83840A found on certain HP cards and on-board in IBM machines work. - Fix some whitespace nits. Based on: NetBSD (except for the first and second item) MFC after: 2 weeks
* - Rely on mii_phy_add_media() setting mii_anegticks as appropriate.marius2006-11-281-4/+3
| | | | | | - Fix some whitespace nits. MFC after: 2 weeks
* - Don't set MIIF_NOISOLATE so lxtphy(4) can be used in configurationsmarius2006-11-281-35/+8
| | | | | | | | | | | | | with multiple PHYs. There doesn't seem to be a problem with isolating LXT970 per se nor in combination with the NICs they're used with and lxtphy(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 some whitespace nits. Obtained from: NetBSD MFC after: 2 weeks
* - Remove a dupe $FreeBSD$.marius2006-11-281-10/+8
| | | | - Fix some whitespace nits.
* Analogous to mii_add_media(), factor out the code for checking whethermarius2006-11-273-10/+8
| | | | | | | | the BMSR contains any media at all to mii_phy_add_media(). The majority of the drivers currently using mii_phy_add_media() were missing such a check anyway though. MFC after: 2 weeks
* - Add a MIIF_FORCEANEG flag which forces an auto-negotiation to alwaysmarius2006-11-272-4/+11
| | | | | | | | | | | | | | | take place if IFM_AUTO is selected. This allows drivers like nsphy(4), which need to force writing the ANAR according to the BMSR, to take advantage of mii_phy_setmedia(). [1] - In mii_phy_reset() once the current media is set don't isolate the PHY corresponding to the instance of the currently selected media rather than unconditionally not isolating the PHY corresponding to instance 0. This saves a isolation-unisolation-cycle of the PHY corresponding to the currently selected media for the case were it isn't instance 0. - Fix some whitespace nits. [1] Obtained from: NetBSD [1] MFC after: 2 weeks
* Add PHY support for BCM5752.yongari2006-08-311-0/+2
| | | | Tested by: delphij, Ganbold < ganbold AT micom DOT mng DOT net >
OpenPOWER on IntegriCloud