From 4f4a3635624a81c4e2e7ef26e92d36d42850dbee Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 9 Feb 2006 12:57:17 +0000 Subject: [PATCH] Fix two important typos in watchdog handling: - Restart watchdog if we *did* processed any descriptors. [1] - Log the watchdog event if the link is *up*. [2] PR: kern/92948 [1] Submitted by: Mihail Balikov [1] PR: kern/92895 [2] Submitted by: Vladimir Ivanov [2] --- sys/dev/em/if_em.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index eef8a1f2b8a..2857d0e3461 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -887,7 +887,7 @@ em_watchdog(struct ifnet *ifp) return; } - if (em_check_for_link(&adapter->hw)) + if (!em_check_for_link(&adapter->hw)) printf("em%d: watchdog timeout -- resetting\n", adapter->unit); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -2745,7 +2745,7 @@ em_clean_transmit_interrupts(struct adapter * adapter) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (num_avail == adapter->num_tx_desc) ifp->if_timer = 0; - else if (num_avail == adapter->num_tx_desc_avail) + else if (num_avail != adapter->num_tx_desc_avail) ifp->if_timer = EM_TX_TIMEOUT; } adapter->num_tx_desc_avail = num_avail;