summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-05-05 02:12:05 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-05-05 02:12:05 +0000
commit47949d28d9f7f1613693a8acc010e38cbe43c4ea (patch)
treec8d8ff0431aebbec8b666077c9d603b2259937a3 /sys/dev
parent56fd9a44b484c395e7d7c930f1bab6f839f9934e (diff)
disable the interrupts on interface shutdown
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_nx.c15
-rw-r--r--sys/dev/pci/if_nxreg.h4
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/pci/if_nx.c b/sys/dev/pci/if_nx.c
index a0654137c1c..679a3ce9517 100644
--- a/sys/dev/pci/if_nx.c
+++ b/sys/dev/pci/if_nx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nx.c,v 1.41 2007/05/05 01:54:02 reyk Exp $ */
+/* $OpenBSD: if_nx.c,v 1.42 2007/05/05 02:12:04 reyk Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1569,9 +1569,9 @@ nx_init(struct ifnet *ifp)
goto done;
/* Set and enable interrupts */
- nxb_write(sc, NXISR_INT_MASK, NXISR_INT_MASK_ENABLE);
- nxb_write(sc, NXISR_INT_VECTOR, 0);
- nxb_write(sc, NXISR_TARGET_MASK, NXISR_TARGET_MASK_ENABLE);
+ nxb_writecrb(sc, NXISR_INT_MASK, NXISR_INT_MASK_ENABLE);
+ nxb_writecrb(sc, NXISR_INT_VECTOR, 0);
+ nxb_writecrb(sc, NXISR_TARGET_MASK, NXISR_TARGET_MASK_ENABLE);
ifp->if_flags |= IFF_RUNNING;
ifp->if_flags &= ~IFF_OACTIVE;
@@ -1584,10 +1584,17 @@ void
nx_stop(struct ifnet *ifp)
{
struct nx_softc *nx = (struct nx_softc *)ifp->if_softc;
+ struct nxb_softc *sc = nx->nx_sc;
int s;
s = splnet();
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+
+ /* Disable interrupts */
+ nxb_writecrb(sc, NXISR_INT_MASK, NXISR_INT_MASK_DISABLE);
+ nxb_writecrb(sc, NXISR_INT_VECTOR, 0);
+ nxb_writecrb(sc, NXISR_TARGET_MASK, NXISR_TARGET_MASK_DISABLE);
+
nx_free_rings(nx);
splx(s);
}
diff --git a/sys/dev/pci/if_nxreg.h b/sys/dev/pci/if_nxreg.h
index 25d357a9fb0..5075c236bb2 100644
--- a/sys/dev/pci/if_nxreg.h
+++ b/sys/dev/pci/if_nxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_nxreg.h,v 1.24 2007/05/05 01:54:02 reyk Exp $ */
+/* $OpenBSD: if_nxreg.h,v 1.25 2007/05/05 02:12:04 reyk Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
@@ -295,11 +295,13 @@ struct nx_ringcontext {
#define NXISR_INT_MASK_PORT(_n) (NXISR_INT_MASK_TARGET0 << (_n))
#define NXISR_INT_MASK_RC_INT (1<<5) /* root complex mask */
#define NXISR_INT_MASK_ENABLE 0x0000077f
+#define NXISR_INT_MASK_DISABLE 0x00000000
/* Interrupt target mask and status */
#define NXISR_TARGET_STATUS NXPCIE(0x00010118)
#define NXISR_TARGET_MASK NXPCIE(0x00010128)
#define NXISR_TARGET_MASK_ENABLE 0x00000bff
+#define NXISR_TARGET_MASK_DISABLE 0x00000000
/* Memory windows */
#define NXDDR_WINDOW(_f) NXPCIE_FUNC(0x00010200, _f)