diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-08-24 13:54:11 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-08-24 13:54:11 +0000 |
commit | 3114d313f03f157779b6ad0d9ed17568ede10136 (patch) | |
tree | 681b4b4c5c8cca0c5745e0fccebe55ce243d1512 /sys | |
parent | 4b4d4e4a842e735b971e6b60ba51d90b6e1b89b3 (diff) |
this is what the interrupt handler will look like. there'll be some added
lines in here later that call the tx and rx completions.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_nxe.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c index 40402542732..909586814f4 100644 --- a/sys/dev/pci/if_nxe.c +++ b/sys/dev/pci/if_nxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nxe.c,v 1.48 2007/08/24 13:22:42 dlg Exp $ */ +/* $OpenBSD: if_nxe.c,v 1.49 2007/08/24 13:54:10 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -181,10 +181,10 @@ int nxedebug = 0; /* Interrupts */ #define NXE_ISR_VECTOR 0x06110100 /* Interrupt Vector */ -#define NXE_ISR_VECTOR_FUNC(_f) (0x08 << (_f)) #define NXE_ISR_MASK 0x06110104 /* Interrupt Mask */ #define NXE_ISR_TARGET_STATUS 0x06110118 #define NXE_ISR_TARGET_MASK 0x06110128 +#define NXE_ISR_MINE(_f) (0x08 << (_f)) /* lock registers (semaphores between chipset and driver) */ #define NXE_SEM_ROM_LOCK 0x0611c010 /* ROM access lock */ @@ -996,7 +996,20 @@ nxe_pci_unmap(struct nxe_softc *sc) int nxe_intr(void *xsc) { - return (0); + struct nxe_softc *sc = xsc; + u_int32_t vector; + + DASSERT(sc->sc_window == 1); + + vector = nxe_crb_read(sc, NXE_1_SW_INT_VECTOR); + if (!ISSET(vector, NXE_ISR_MINE(sc->sc_function))) + return (0); + + nxe_crb_write(sc, NXE_1_SW_INT_VECTOR, 0x80 << sc->sc_function); + + /* the interrupt is mine! we should do some work now */ + + return (1); } int |