diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index f02790066b0..bd54fcdd88e 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -860,9 +860,6 @@ static void pcn_txeof(sc) ifp = &sc->arpcom.ac_if; - /* Clear the timeout timer. */ - ifp->if_timer = 0; - /* * Go through our tx list and free mbufs for those * frames that have been transmitted. @@ -899,13 +896,14 @@ static void pcn_txeof(sc) sc->pcn_cdata.pcn_tx_cnt--; PCN_INC(idx, PCN_TX_LIST_CNT); - ifp->if_timer = 0; } - sc->pcn_cdata.pcn_tx_cons = idx; - - if (cur_tx != NULL) + if (idx != sc->pcn_cdata.pcn_tx_cons) { + /* Some buffers have been freed. */ + sc->pcn_cdata.pcn_tx_cons = idx; ifp->if_flags &= ~IFF_OACTIVE; + } + ifp->if_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5; return; } diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 99ef4dda399..4ffe7a3f991 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1292,9 +1292,6 @@ static void rl_txeof(sc) ifp = &sc->arpcom.ac_if; - /* Clear the timeout timer. */ - ifp->if_timer = 0; - /* * Go through our tx list and free mbufs for those * frames that have been uploaded. @@ -1337,6 +1334,9 @@ static void rl_txeof(sc) ifp->if_flags &= ~IFF_OACTIVE; } while (sc->rl_cdata.last_tx != sc->rl_cdata.cur_tx); + ifp->if_timer = + (sc->rl_cdata.last_tx == sc->rl_cdata.cur_tx) ? 0 : 5; + return; }