]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC: r214608, r215297(partial), r215713
authormarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 26 Nov 2010 20:37:19 +0000 (20:37 +0000)
committermarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 26 Nov 2010 20:37:19 +0000 (20:37 +0000)
commit3c5fc43f9432e6a71e045f809fac3b52e0030e5f
tree238eea1c6bf637783796b4179e440de7e38654b4
parentbfe8580a461d031a517becc167a758abffc46a18
MFC: r214608, r215297(partial), r215713

o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
  support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by: yongari (plus additional testing)
Obtained from: NetBSD (partially), OpenBSD (partially)

Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed
to set MIIF_FORCEPAUSE in stable/8 so they continue to always advertise
support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as
ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to
the master media option for setting master mode, both in order to not
violate POLA.

git-svn-id: svn://svn.freebsd.org/base/stable/8@215881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
16 files changed:
sys/dev/bce/if_bce.c
sys/dev/bge/if_bge.c
sys/dev/mii/brgphy.c
sys/dev/mii/ciphy.c
sys/dev/mii/e1000phy.c
sys/dev/mii/ip1000phy.c
sys/dev/mii/mii.h
sys/dev/mii/mii_physubr.c
sys/dev/mii/miivar.h
sys/dev/mii/smcphy.c
sys/dev/mii/ukphy.c
sys/dev/mii/ukphy_subr.c
sys/dev/msk/if_msk.c
sys/dev/nfe/if_nfe.c
sys/dev/stge/if_stge.c
sys/net/if_media.h