Terminate interrupt handler if driver detect it's not running.

Also add check for driver running state before trying to send
frames. While I'm here, use for loop.
This commit is contained in:
Pyun YongHyeon 2011-05-06 22:55:53 +00:00
parent f321edf95a
commit 74517b0724

View File

@ -2273,10 +2273,14 @@ xl_intr(void *arg)
}
#endif
while ((status = CSR_READ_2(sc, XL_STATUS)) & XL_INTRS &&
status != 0xFFFF) {
for (;;) {
status = CSR_READ_2(sc, XL_STATUS);
if ((status & XL_INTRS) == 0 || status == 0xFFFF)
break;
CSR_WRITE_2(sc, XL_COMMAND,
XL_CMD_INTR_ACK|(status & XL_INTRS));
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
break;
if (status & XL_STAT_UP_COMPLETE) {
int curpkts;
@ -2304,6 +2308,7 @@ xl_intr(void *arg)
if (status & XL_STAT_ADFAIL) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
xl_init_locked(sc);
break;
}
if (status & XL_STAT_STATSOFLOW) {
@ -2313,7 +2318,8 @@ xl_intr(void *arg)
}
}
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
ifp->if_drv_flags & IFF_DRV_RUNNING) {
if (sc->xl_type == XL_TYPE_905B)
xl_start_90xB_locked(ifp);
else