diff options
author | yongari <yongari@FreeBSD.org> | 2011-05-06 22:55:53 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-05-06 22:55:53 +0000 |
commit | 9225850fe6baa34b67bf215d1803274a0133589d (patch) | |
tree | 4df3f2b211fd8fef61bea8c7aa6a07abaeae9101 /sys/dev/xl/if_xl.c | |
parent | 6356409dba298549e32431a1880412217b1987b3 (diff) | |
download | FreeBSD-src-9225850fe6baa34b67bf215d1803274a0133589d.zip FreeBSD-src-9225850fe6baa34b67bf215d1803274a0133589d.tar.gz |
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.
Diffstat (limited to 'sys/dev/xl/if_xl.c')
-rw-r--r-- | sys/dev/xl/if_xl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index 88a7ba8..15438a5 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -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 |