Fix if_timer logic to make sure that there is always a timeout

pending if there are packets queued for transmission.

Several drivers still have the same problem.

MFC after: 3 days
This commit is contained in:
luigi 2002-06-30 22:16:22 +00:00
parent af57fcc771
commit 36987f382b
2 changed files with 8 additions and 10 deletions

View File

@ -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;
}

View File

@ -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;
}