opnsense-src/sys/dev/mii
Marius Strobl a55fb8a458 Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages
of mii_attach() are:
- intended to be called multiple times in order to attach PHYs in multiple
  passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1
  range)
- being able to pass along the capability mask from the NIC to the PHY
  drivers
- being able to specify at which address (phyloc) to probe for a PHY
  (instead of always probing at all addresses from 0 to MII_NPHY - 1)
- being able to specify which PHY instance (offloc) to attach
- being able to pass along MIIF_* flags from the NIC to the PHY drivers
  (f.e. as required to indicated to the PHY drivers that flow control is
  supported by the NIC driver, which actually is the motivation for this
  change).

While at it, I used the opportunity to get rid of some hacks in mii(4)
like miibus_probe() generally doing work besides sheer probing and the
"EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by
passing the struct ifnet pointer via an argument of mii_attach() as well
as to fix some resource leaks in mii(4) in case something fails.
Commits which will update the PHY drivers to honor the MII flags passed
down from the NIC drivers and take advantage of mii_attach() to get rid
of certain types of hacks in NIC and PHY drivers as well as a conversion
of the remaining uses of mii_phy_probe() will follow shortly.

Reviewed by:	jhb, yongari
Obtained from:	NetBSD (partially)
2010-10-14 22:01:40 +00:00
..
acphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
acphyreg.h - Correct the AC_MCTL_BYP_PCS constant. 2007-01-12 22:58:04 +00:00
amphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
amphyreg.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
atphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
atphyreg.h Add Attansic/Atheros F1 PHY driver. 2008-05-19 01:12:10 +00:00
axphy.c Remove an header that apart from the license is empty. 2010-10-03 17:05:25 +00:00
bmtphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
bmtphyreg.h The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:55:51 +00:00
brgphy.c Just like xmphy(4) this driver doesn't use any of the generic subroutines 2010-10-14 21:30:13 +00:00
brgphyreg.h Correct definition of T2 mode bit of MRBE Message Page 5 Next Page 2010-09-08 21:08:54 +00:00
ciphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
ciphyreg.h Add support Vitesse VSC8601 PHY that is found on nVidia network 2007-06-06 06:55:49 +00:00
e1000phy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
e1000phyreg.h Add hack to pass controller specific information to phy driver. 2009-09-28 21:03:28 +00:00
exphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
gentbi.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
icsphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
icsphyreg.h The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:55:51 +00:00
inphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
inphyreg.h
ip1000phy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
ip1000phyreg.h For IP1001 PHYs, read auto-negotiation advertisement register to 2009-03-09 08:17:46 +00:00
jmphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
jmphyreg.h Add JMicron JMP202/JMP211 PHY driver. 2008-05-27 01:16:40 +00:00
lxtphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
lxtphyreg.h The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:55:51 +00:00
mii.c Add a NetBSD-compatible mii_attach(), which is intended to eventually 2010-10-14 22:01:40 +00:00
mii.h Add a NetBSD-compatible mii_attach(), which is intended to eventually 2010-10-14 22:01:40 +00:00
mii_physubr.c Use the mii_data provided via mii_attach_args and mii_pdata respectively 2010-09-27 20:31:03 +00:00
miibus_if.m
miidevs Add F1 PHY found on Atheros AR8151 v2.0 PCIe gigabit ethernet 2010-08-09 17:22:14 +00:00
miivar.h Add a NetBSD-compatible mii_attach(), which is intended to eventually 2010-10-14 22:01:40 +00:00
mlphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
nsgphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
nsgphyreg.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
nsphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
nsphyreg.h The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:55:51 +00:00
nsphyter.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
nsphyterreg.h The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:55:51 +00:00
pnaphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
qsphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
qsphyreg.h The NetBSD Foundation has granted permission to remove clause 3 and 4 from 2010-03-03 17:55:51 +00:00
rgephy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
rgephyreg.h Add RTL8211C(L) support. 2008-07-02 08:10:18 +00:00
rlphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
rlswitch.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
ruephy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
ruephyreg.h Add RealTek RTL8150 USB to fast Ethernet controller driver. 2003-05-03 10:16:56 +00:00
smcphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
tdkphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
tdkphyreg.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
tlphy.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
tlphyreg.h - Remove clause 3 and 4 from TNF licenses. 2010-09-26 22:11:41 +00:00
truephy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
truephyreg.h Add et(4), a port of DragonFly's Agere ET1310 10/100/Gigabit 2008-06-20 19:30:44 +00:00
ukphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
ukphy_subr.c Consistently always explicitly set IFM_HDX for half-duplex. 2010-10-03 17:00:57 +00:00
xmphy.c - In the spirit of previous simplifications factor out the checks for a 2010-10-02 18:53:12 +00:00
xmphyreg.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00