Module Name:    src
Committed By:   kiyohara
Date:           Sat May 19 15:17:35 UTC 2012

Modified Files:
        src/sys/arch/mips/alchemy/dev: if_aumac.c

Log Message:
Enable interrupt in aumac_init().  And disable in aumac_stop()/aumac_attach().
Interrupt storm happen if received packet and DMA not set.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mips/alchemy/dev/if_aumac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/alchemy/dev/if_aumac.c
diff -u src/sys/arch/mips/alchemy/dev/if_aumac.c:1.34 src/sys/arch/mips/alchemy/dev/if_aumac.c:1.35
--- src/sys/arch/mips/alchemy/dev/if_aumac.c:1.34	Thu Feb  2 19:42:59 2012
+++ src/sys/arch/mips/alchemy/dev/if_aumac.c	Sat May 19 15:17:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aumac.c,v 1.34 2012/02/02 19:42:59 tls Exp $ */
+/* $NetBSD: if_aumac.c,v 1.35 2012/05/19 15:17:35 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.34 2012/02/02 19:42:59 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aumac.c,v 1.35 2012/05/19 15:17:35 kiyohara Exp $");
 
 
 
@@ -123,6 +123,7 @@ struct aumac_softc {
 	struct ethercom sc_ethercom;	/* Ethernet common data */
 	void *sc_sdhook;		/* shutdown hook */
 
+	int sc_irq;
 	void *sc_ih;			/* interrupt cookie */
 
 	struct mii_data sc_mii;		/* MII/media information */
@@ -272,6 +273,8 @@ aumac_attach(device_t parent, device_t s
 		    "unable to register interrupt handler\n");
 		return;
 	}
+	sc->sc_irq = aa->aa_irq[0];
+	au_intr_disable(sc->sc_irq);
 
 	/*
 	 * Allocate space for the transmit and receive buffers.
@@ -808,6 +811,7 @@ aumac_init(struct ifnet *ifp)
 	ifp->if_flags |= IFF_RUNNING; 
 	ifp->if_flags &= ~IFF_OACTIVE;
 
+	au_intr_enable(sc->sc_irq);
 out:
 	if (error)
 		printf("%s: interface not running\n", device_xname(sc->sc_dev));
@@ -836,6 +840,8 @@ aumac_stop(struct ifnet *ifp, int disabl
 	/* Power down/reset the MAC. */
 	aumac_powerdown(sc);
 
+	au_intr_disable(sc->sc_irq);
+
 	/* Mark the interface as down and cancel the watchdog timer. */
 	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
 	ifp->if_timer = 0;

Reply via email to