From 10882804c9c886111a95747a68d0ac10728bee77 Mon Sep 17 00:00:00 2001 From: Andrew Gallatin Date: Mon, 28 Jan 2008 13:20:51 +0000 Subject: [PATCH] Only reset driver state when a hardware error is detected. Preserve warning but do not reset if we enter the routine without seeing a hardware error. --- sys/dev/mxge/if_mxge.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c index c82882845539..24ca7295d75f 100644 --- a/sys/dev/mxge/if_mxge.c +++ b/sys/dev/mxge/if_mxge.c @@ -3436,6 +3436,11 @@ mxge_watchdog_reset(mxge_softc_t *sc) /* and redo any changes we made to our config space */ mxge_setup_cfg_space(sc); + + if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { + mxge_close(sc); + err = mxge_open(sc); + } } else { device_printf(sc->dev, "NIC did not reboot, ring state:\n"); device_printf(sc->dev, "tx.req=%d tx.done=%d\n", @@ -3443,11 +3448,7 @@ mxge_watchdog_reset(mxge_softc_t *sc) device_printf(sc->dev, "pkt_done=%d fw=%d\n", sc->ss->tx.pkt_done, be32toh(sc->ss->fw_stats->send_done_count)); - } - - if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { - mxge_close(sc); - err = mxge_open(sc); + device_printf(sc->dev, "not resetting\n"); } abort: