aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2011-05-27 20:33:26 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2011-05-27 20:33:26 +0000
commit9be43817f9fc5b90d0583a08f26dac54cf8c46d4 (patch)
treeb40fdee904659e638cd1095341d087844615585e
parentd74859d795887f9c527fe1641857d459cc5594cd (diff)
Notes
-rw-r--r--sys/dev/xl/if_xl.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c
index 222b66305489..0c4982b4438b 100644
--- a/sys/dev/xl/if_xl.c
+++ b/sys/dev/xl/if_xl.c
@@ -1944,7 +1944,7 @@ xl_rxeof(struct xl_softc *sc)
struct mbuf *m;
struct ifnet *ifp = sc->xl_ifp;
struct xl_chain_onefrag *cur_rx;
- int total_len = 0;
+ int total_len;
int rx_npkts = 0;
u_int32_t rxstat;
@@ -1963,6 +1963,7 @@ again:
cur_rx = sc->xl_cdata.xl_rx_head;
sc->xl_cdata.xl_rx_head = cur_rx->xl_next;
total_len = rxstat & XL_RXSTAT_LENMASK;
+ rx_npkts++;
/*
* Since we have told the chip to allow large frames,
@@ -2047,7 +2048,6 @@ again:
XL_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
XL_LOCK(sc);
- rx_npkts++;
/*
* If we are running from the taskqueue, the interface
@@ -2273,17 +2273,17 @@ 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;
-
- curpkts = ifp->if_ipackets;
- xl_rxeof(sc);
- if (curpkts == ifp->if_ipackets) {
+ if (xl_rxeof(sc) == 0) {
while (xl_rx_resync(sc))
xl_rxeof(sc);
}
@@ -2304,6 +2304,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 +2314,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