addition of SerDes support. According to the docs, the 5706C and 5708C
phys are supposed to use the same MII model that is separate from the
SerDes parts, but the 5706C actually uses the MII model of the SerDes
parts. To fix this, readd the old 5706C entry to miidevs and add a
special check in brgphy_probe() for phys that match the 5706C ID. If
the phy is supported by the gentbi(4) driver, then it's a SerDes phy, so
we fail the probe and let gentbi(4) grab it. Otherwise, it's a 5706C phy,
so we let brgphy(4) grab it.
In coordination with: dwhite
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
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().
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.
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.
- 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>
- 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
- 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
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
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.
- 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 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
- 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
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
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
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
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
- 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
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
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
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
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
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
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
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