summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-12-05 21:38:45 +0000
committermarius <marius@FreeBSD.org>2011-12-05 21:38:45 +0000
commite9f3f59155bf98c69aa34bdd8c3f842cc3ae5768 (patch)
tree08b3276151e13b0b8b79f69e65983ffafafc918b /sys/dev/mii
parent85356b61d36413094ff3e179530770603e4f78e6 (diff)
downloadFreeBSD-src-e9f3f59155bf98c69aa34bdd8c3f842cc3ae5768.zip
FreeBSD-src-e9f3f59155bf98c69aa34bdd8c3f842cc3ae5768.tar.gz
- In mii_attach(9) just set the driver for a newly added miibus(4) instance
before calling bus_enumerate_hinted_children(9) (which is the minimum for this to work) instead of fully probing it so later on we can just call bus_generic_attach(9) on the parent of the miibus(4) instance. The latter is necessary in order to work around what seems to be a bzzarre race in newbus affecting a few machines since r227687, causing no driver being probed for the newly added miibus(4) instance. Presumably this is the same race that was the motivation for the work around done in r215348. Reported and tested by: yongari - Revert the removal of a static in r221913 in order to help compilers to produce more optimal code.
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/mii.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index 2f07e93..f85c579 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -499,7 +499,7 @@ mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp,
free(children, M_TEMP);
if (first != 0) {
- rv = device_probe(*miibus);
+ rv = device_set_driver(*miibus, &miibus_driver);
if (rv != 0)
goto fail;
bus_enumerate_hinted_children(*miibus);
@@ -511,7 +511,7 @@ mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp,
rv = ENXIO;
goto fail;
}
- rv = device_attach(*miibus);
+ rv = bus_generic_attach(dev);
if (rv != 0)
goto fail;
@@ -626,7 +626,7 @@ mii_down(struct mii_data *mii)
static unsigned char
mii_bitreverse(unsigned char x)
{
- unsigned const char const nibbletab[16] = {
+ static unsigned const char const nibbletab[16] = {
0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15
};
OpenPOWER on IntegriCloud