diff options
author | semenu <semenu@FreeBSD.org> | 2001-08-13 18:37:31 +0000 |
---|---|---|
committer | semenu <semenu@FreeBSD.org> | 2001-08-13 18:37:31 +0000 |
commit | e6e25b0f2c8d7fb99cbceef6cf6657e2b66c7308 (patch) | |
tree | 456f68284b6c25b16254c7b72e4ca24e70f3c3d4 /sys/dev/tx | |
parent | 9fb458f8dfc6854b052a40956e1c4c7a06baff0a (diff) | |
download | FreeBSD-src-e6e25b0f2c8d7fb99cbceef6cf6657e2b66c7308.zip FreeBSD-src-e6e25b0f2c8d7fb99cbceef6cf6657e2b66c7308.tar.gz |
Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing
common_attach is wrong as common attach initialize some fileds used by
mediainit routine. This was hard to notify because loading driver as kld
lead to mediainit routine being called after common_attach, though probe_phy
is called before.
MFC after: 1 week
Diffstat (limited to 'sys/dev/tx')
-rw-r--r-- | sys/dev/tx/if_tx.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index f7610c7..707355d 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -523,12 +523,9 @@ epic_freebsd_attach(dev) /* Workaround for Application Note 7-15 */ for (i=0; i<16; i++) CSR_WRITE_4(sc, TEST1, TEST1_CLOCK_TEST); - /* - * Do ifmedia setup. - */ - if (mii_phy_probe(dev, &sc->miibus, - epic_ifmedia_upd, epic_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!?\n"); + /* Do OS independent part, including chip wakeup and reset */ + if (epic_common_attach(sc)) { + device_printf(dev, "memory distribution error\n"); bus_teardown_intr(dev, sc->irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); bus_release_resource(dev, EPIC_RES, EPIC_RID, sc->res); @@ -536,9 +533,10 @@ epic_freebsd_attach(dev) goto fail; } - /* Do OS independent part, including chip wakeup and reset */ - if (epic_common_attach(sc)) { - device_printf(dev, "memory distribution error\n"); + /* Do ifmedia setup */ + if (mii_phy_probe(dev, &sc->miibus, + epic_ifmedia_upd, epic_ifmedia_sts)) { + device_printf(dev, "MII without any PHY!?\n"); bus_teardown_intr(dev, sc->irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); bus_release_resource(dev, EPIC_RES, EPIC_RID, sc->res); |