diff options
author | ambrisko <ambrisko@FreeBSD.org> | 2002-08-07 22:18:33 +0000 |
---|---|---|
committer | ambrisko <ambrisko@FreeBSD.org> | 2002-08-07 22:18:33 +0000 |
commit | 0516dc643cb4cc01ddf0939879e53f7aca690bcf (patch) | |
tree | 3073b790f4487464905f54ffe41bd7e179ab49e5 /sys/dev/mii/mii.c | |
parent | f45f748ab2531997e65df2b642d524db80d9aa4c (diff) | |
download | FreeBSD-src-0516dc643cb4cc01ddf0939879e53f7aca690bcf.zip FreeBSD-src-0516dc643cb4cc01ddf0939879e53f7aca690bcf.tar.gz |
Only attach one PHY device to a controller. NetBSD has similar code.
The D-Link DFE-580 card will otherwise show 2 miibuses for each controller
and therefore 2 ukphy's.
Sponsored by: Vernier Networks
MFC after: 1 week
Diffstat (limited to 'sys/dev/mii/mii.c')
-rw-r--r-- | sys/dev/mii/mii.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 9a63276..aad3573 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -110,14 +110,17 @@ int miibus_probe(dev) { struct mii_attach_args ma, *args; struct mii_data *mii; - device_t child = NULL, parent; - int bmsr, capmask = 0xFFFFFFFF; + device_t child = NULL, parent, *children; + int bmsr, capmask = 0xFFFFFFFF, nchildren; mii = device_get_softc(dev); parent = device_get_parent(dev); LIST_INIT(&mii->mii_phys); for (ma.mii_phyno = 0; ma.mii_phyno < MII_NPHY; ma.mii_phyno++) { + device_get_children(dev, &children, &nchildren); + if (nchildren) + break; /* * Check to see if there is a PHY at this address. Note, * many braindead PHYs report 0/0 in their ID registers, |