summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_rl.c
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-08-24 18:52:24 +0000
committeryongari <yongari@FreeBSD.org>2010-08-24 18:52:24 +0000
commit35f3332f4d5f517fcbd4769185e8b478aebb4a36 (patch)
tree01d78f3457f9e6120898b2cc0bc328888c5b8c3c /sys/pci/if_rl.c
parent5b02e682403e7e9330dc8a6bd697b2ddd380cbc5 (diff)
downloadFreeBSD-src-35f3332f4d5f517fcbd4769185e8b478aebb4a36.zip
FreeBSD-src-35f3332f4d5f517fcbd4769185e8b478aebb4a36.tar.gz
Remove unnecessary controller reinitialization.
PR: kern/87506
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r--sys/pci/if_rl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 110e705..33285bf 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1302,6 +1302,7 @@ rl_rxeof(struct rl_softc *sc)
total_len < ETHER_MIN_LEN ||
total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) {
ifp->if_ierrors++;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
rl_init_locked(sc);
return (rx_npkts);
}
@@ -1413,6 +1414,7 @@ rl_txeof(struct rl_softc *sc)
CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG);
oldthresh = sc->rl_txthresh;
/* error recovery */
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
rl_init_locked(sc);
/* restore original threshold */
sc->rl_txthresh = oldthresh;
@@ -1606,8 +1608,10 @@ rl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
/* XXX We should check behaviour on receiver stalls. */
- if (status & RL_ISR_SYSTEM_ERR)
+ if (status & RL_ISR_SYSTEM_ERR) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
rl_init_locked(sc);
+ }
}
return (rx_npkts);
}
@@ -1645,8 +1649,10 @@ rl_intr(void *arg)
rl_rxeof(sc);
if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
rl_txeof(sc);
- if (status & RL_ISR_SYSTEM_ERR)
+ if (status & RL_ISR_SYSTEM_ERR) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
rl_init_locked(sc);
+ }
}
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -1808,6 +1814,9 @@ rl_init_locked(struct rl_softc *sc)
mii = device_get_softc(sc->rl_miibus);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ return;
+
/*
* Cancel pending I/O and free all RX/TX buffers.
*/
@@ -2036,6 +2045,7 @@ rl_watchdog(struct rl_softc *sc)
rl_txeof(sc);
rl_rxeof(sc);
+ sc->rl_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
rl_init_locked(sc);
}
OpenPOWER on IntegriCloud