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
This commit is contained in:
parent
2c9067b16f
commit
395a636fb2
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user