]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
authormarius <marius@FreeBSD.org>
Tue, 3 May 2011 19:51:29 +0000 (19:51 +0000)
committermarius <marius@FreeBSD.org>
Tue, 3 May 2011 19:51:29 +0000 (19:51 +0000)
commitd0f32374e669176f507d67889e3a92cc6a46232a
treefe53a4391d1d2bae36941fd16b2470c7f5559e9f
parent46eb8f2e89a3a96e1047d23f59fb21f5a8165fe1
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
  (reporting IFM_LOOP based on BMCR_LOOP is left in place though as
  it might provide useful for debugging). For most mii(4) drivers it
  was unclear whether the PHYs driven by them actually support
  loopback or not. Moreover, typically loopback mode also needs to
  be activated on the MAC, which none of the Ethernet drivers using
  mii(4) implements. Given that loopback media has no real use (and
  obviously hardly had a chance to actually work) besides for driver
  development (which just loopback mode should be sufficient for
  though, i.e one doesn't necessary need support for loopback media)
  support for it is just dropped as both NetBSD and OpenBSD already
  did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
  instead of discrete function pointers, and extend this to include
  a "reset" entry point. Make sure any PHY-specific reset routine is
  always used, and provide one for lxtphy(4) which disables MII
  interrupts (as is done for a few other PHYs we have drivers for).
  This includes changing NIC drivers which previously just called the
  generic mii_phy_reset() to now actually call the PHY-specific reset
  routine, which might be crucial in some cases. While at it, the
  redundant checks in these NIC drivers for mii->mii_instance not being
  zero before calling the reset routines were removed because as soon
  as one PHY driver attaches mii->mii_instance is incremented and we
  hardly can end up in their media change callbacks etc if no PHY driver
  has attached as mii_attach() would have failed in that case and not
  attach a miibus(4) instance.
  Consequently, NIC drivers now no longer should call mii_phy_reset()
  directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
  The purpose of that function is to perform the common steps to attach
  a PHY driver instance and to hook it up to the miibus(4) instance and to
  optionally also handle the probing, addition and initialization of the
  supported media. So all a PHY driver without any special requirements
  has to do in its bus attach method is to call mii_phy_dev_attach()
  along with PHY-specific MIIF_* flags, a pointer to its PHY functions
  and the add_media set to one. All PHY drivers were updated to take
  advantage of mii_phy_dev_attach() as appropriate. Along with these
  changes the capability mask was added to the mii_softc structure so
  PHY drivers taking advantage of mii_phy_dev_attach() but still
  handling media on their own do not need to fiddle with the MII attach
  arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
  for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
  structure. Several PHY drivers require this information also after
  attaching and previously had to wrap their own softc around mii_softc.
  NetBSD/OpenBSD also keep track of the model and revision on their
  mii_softc structure. All PHY drivers were updated to take advantage
  as appropriate.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
  when mapping an OUI to the MII ID registers. All PHY drivers and
  miidevs where changed as necessary. Actually this now again allows to
  largely share miidevs with NetBSD, which fixed this problem already
  9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from: NetBSD (partially)
Reviewed by: yongari (earlier version), silence on arch@ and net@
72 files changed:
sys/dev/ae/if_ae.c
sys/dev/age/if_age.c
sys/dev/alc/if_alc.c
sys/dev/ale/if_ale.c
sys/dev/bce/if_bce.c
sys/dev/bfe/if_bfe.c
sys/dev/bge/if_bge.c
sys/dev/dc/dcphy.c
sys/dev/dc/pnphy.c
sys/dev/ed/if_ed_pccard.c
sys/dev/et/if_et.c
sys/dev/fxp/if_fxp.c
sys/dev/hme/if_hme.c
sys/dev/jme/if_jme.c
sys/dev/lge/if_lge.c
sys/dev/mii/acphy.c
sys/dev/mii/amphy.c
sys/dev/mii/atphy.c
sys/dev/mii/axphy.c
sys/dev/mii/bmtphy.c
sys/dev/mii/brgphy.c
sys/dev/mii/ciphy.c
sys/dev/mii/e1000phy.c
sys/dev/mii/exphy.c
sys/dev/mii/gentbi.c
sys/dev/mii/icsphy.c
sys/dev/mii/inphy.c
sys/dev/mii/ip1000phy.c
sys/dev/mii/jmphy.c
sys/dev/mii/lxtphy.c
sys/dev/mii/mii.c
sys/dev/mii/mii.h
sys/dev/mii/mii_physubr.c
sys/dev/mii/miidevs
sys/dev/mii/miivar.h
sys/dev/mii/mlphy.c
sys/dev/mii/nsgphy.c
sys/dev/mii/nsphy.c
sys/dev/mii/nsphyter.c
sys/dev/mii/pnaphy.c
sys/dev/mii/qsphy.c
sys/dev/mii/rdcphy.c
sys/dev/mii/rgephy.c
sys/dev/mii/rlphy.c
sys/dev/mii/rlswitch.c
sys/dev/mii/ruephy.c
sys/dev/mii/smcphy.c
sys/dev/mii/tdkphy.c
sys/dev/mii/tlphy.c
sys/dev/mii/truephy.c
sys/dev/mii/ukphy.c
sys/dev/mii/xmphy.c
sys/dev/nfe/if_nfe.c
sys/dev/nge/if_nge.c
sys/dev/nve/if_nve.c
sys/dev/pcn/if_pcn.c
sys/dev/sf/if_sf.c
sys/dev/sge/if_sge.c
sys/dev/sis/if_sis.c
sys/dev/ste/if_ste.c
sys/dev/tx/if_tx.c
sys/dev/usb/net/if_aue.c
sys/dev/usb/net/if_axe.c
sys/dev/usb/net/if_rue.c
sys/dev/usb/net/if_udav.c
sys/dev/vr/if_vr.c
sys/dev/vte/if_vte.c
sys/dev/wb/if_wb.c
sys/mips/atheros/if_arge.c
sys/mips/cavium/octe/octe.c
sys/mips/idt/if_kr.c
sys/modules/mii/Makefile