summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2010-11-15 21:41:45 +0000
committermarius <marius@FreeBSD.org>2010-11-15 21:41:45 +0000
commit439476354934ee88c4991c97185d5164cf2b4678 (patch)
tree1ffae389e2f01a18f387e514c1821a6fac4f8a17 /sys/dev/mii
parent148263e158fc89f1572b4eedd787d777e50f6d3e (diff)
downloadFreeBSD-src-439476354934ee88c4991c97185d5164cf2b4678.zip
FreeBSD-src-439476354934ee88c4991c97185d5164cf2b4678.tar.gz
Return from mii_attach() after calling bus_generic_attach(9) on the device_t
of the MAC driver in order to attach miibus(4) on the first pass instead of falling through to also calling it on the device_t of miibus(4). The latter code flow was intended to attach the PHY drivers the same way regardless of whether it's the first or a repeated pass, modulo the bus_generic_attach() call in miibus_attach() which shouldn't be there. However, it turned out that these variants cause miibus(4) to be attached twice under certain conditions when using MAC drivers as modules. Submitted by: yongari MFC after: 3 days
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/mii.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index 79378f5..3df5dfa 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -438,6 +438,9 @@ mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp,
rv = bus_generic_attach(dev);
if (rv != 0)
goto fail;
+
+ /* Attaching of the PHY drivers is done in miibus_attach(). */
+ return (0);
}
rv = bus_generic_attach(*miibus);
if (rv != 0)
OpenPOWER on IntegriCloud