summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/if_em.c52
-rw-r--r--sys/dev/pci/if_em.h9
-rw-r--r--sys/dev/pci/if_em_hw.h3
3 files changed, 33 insertions, 31 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 44029fcc1c9..272a6890d47 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.80 2005/10/21 02:10:34 brad Exp $ */
+/* $OpenBSD: if_em.c,v 1.81 2005/10/24 21:42:34 brad Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
@@ -714,44 +714,52 @@ em_init(void *arg)
int
em_intr(void *arg)
{
- u_int32_t loop_cnt = EM_MAX_INTR;
- u_int32_t reg_icr;
- struct ifnet *ifp;
struct em_softc *sc = arg;
- int s;
+ struct ifnet *ifp;
+ u_int32_t reg_icr;
+ int s, claimed = 0, wantinit = 0;
s = splnet();
ifp = &sc->interface_data.ac_if;
- reg_icr = E1000_READ_REG(&sc->hw, ICR);
- if (!reg_icr) {
- splx(s);
- return (0);
- }
+ for (;;) {
+ reg_icr = E1000_READ_REG(&sc->hw, ICR);
+ if (reg_icr == 0)
+ break;
- /* Link status change */
- if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
- timeout_del(&sc->timer_handle);
- sc->hw.get_link_status = 1;
- em_check_for_link(&sc->hw);
- em_update_link_status(sc);
- timeout_add(&sc->timer_handle, hz);
- }
+ claimed = 1;
- while (loop_cnt > 0) {
if (ifp->if_flags & IFF_RUNNING) {
em_process_receive_interrupts(sc, -1);
em_clean_transmit_interrupts(sc);
}
- loop_cnt--;
+
+ /* Link status change */
+ if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) {
+ timeout_del(&sc->timer_handle);
+ sc->hw.get_link_status = 1;
+ em_check_for_link(&sc->hw);
+ em_update_link_status(sc);
+ timeout_add(&sc->timer_handle, hz);
+ }
+
+ if (reg_icr & E1000_ICR_RXO) {
+ ifp->if_ierrors++;
+ wantinit = 1;
+ }
}
+#if 0
+ if (wantinit)
+ em_init(sc);
+#endif
- if (ifp->if_flags & IFF_RUNNING && IFQ_IS_EMPTY(&ifp->if_snd) == 0)
+ if (ifp->if_flags & IFF_RUNNING &&
+ IFQ_IS_EMPTY(&ifp->if_snd) == 0)
em_start(ifp);
splx(s);
- return (1);
+ return (claimed);
}
/*********************************************************************
diff --git a/sys/dev/pci/if_em.h b/sys/dev/pci/if_em.h
index a9ac2feea9a..c5211b4f76e 100644
--- a/sys/dev/pci/if_em.h
+++ b/sys/dev/pci/if_em.h
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
/* $FreeBSD: if_em.h,v 1.26 2004/09/01 23:22:41 pdeuskar Exp $ */
-/* $OpenBSD: if_em.h,v 1.16 2005/10/21 02:10:34 brad Exp $ */
+/* $OpenBSD: if_em.h,v 1.17 2005/10/24 21:42:34 brad Exp $ */
#ifndef _EM_H_DEFINED_
#define _EM_H_DEFINED_
@@ -168,13 +168,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define EM_RADV 64
/*
- * This parameter controls the maximum no of times the driver will loop
- * in the isr.
- * Minimum Value = 1
- */
-#define EM_MAX_INTR 3
-
-/*
* This parameter controls the duration of transmit watchdog timer.
*/
#define EM_TX_TIMEOUT 5 /* set to 5 seconds */
diff --git a/sys/dev/pci/if_em_hw.h b/sys/dev/pci/if_em_hw.h
index 9b5e87c1dd2..93ca38dbf9a 100644
--- a/sys/dev/pci/if_em_hw.h
+++ b/sys/dev/pci/if_em_hw.h
@@ -31,7 +31,7 @@
*******************************************************************************/
-/* $OpenBSD: if_em_hw.h,v 1.9 2005/10/07 23:24:42 brad Exp $ */
+/* $OpenBSD: if_em_hw.h,v 1.10 2005/10/24 21:42:34 brad Exp $ */
/* $FreeBSD: if_em_hw.h,v 1.15 2005/05/26 23:32:02 tackerman Exp $ */
/* if_em_hw.h
* Structures, enums, and macros for the MAC
@@ -564,6 +564,7 @@ uint8_t em_arc_subsystem_valid(struct em_hw *hw);
E1000_IMS_TXDW | \
E1000_IMS_RXDMT0 | \
E1000_IMS_RXSEQ | \
+ E1000_IMS_RXO | \
E1000_IMS_LSC)
/* Number of high/low register pairs in the RAR. The RAR (Receive Address