summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-04-10 22:10:10 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-04-10 22:10:10 +0000
commitbb605b30c3ebd5ed205752886780c5883f53868f (patch)
treee0dcf65649db84bc88b9f467481b542642024e62
parent032ff04156388543d12958bafc2b4dac1a468a33 (diff)
add shutdown hook to stop the adapter completely
put txp_set_filter() in the right places
-rw-r--r--sys/dev/pci/if_txp.c22
-rw-r--r--sys/dev/pci/if_txpreg.h6
2 files changed, 19 insertions, 9 deletions
diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c
index 24b877648da..b92b5f4c73c 100644
--- a/sys/dev/pci/if_txp.c
+++ b/sys/dev/pci/if_txp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txp.c,v 1.10 2001/04/10 19:52:37 jason Exp $ */
+/* $OpenBSD: if_txp.c,v 1.11 2001/04/10 22:10:09 jason Exp $ */
/*
* Copyright (c) 2001
@@ -508,14 +508,21 @@ txp_intr(vsc)
return (claimed);
}
-
void
txp_shutdown(vsc)
void *vsc;
{
struct txp_softc *sc = (struct txp_softc *)vsc;
- txp_stop(sc);
+ /* mask all interrupts */
+ WRITE_REG(sc, TXP_IMR,
+ TXP_INT_SELF | TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT |
+ TXP_INT_DMA3 | TXP_INT_DMA2 | TXP_INT_DMA1 | TXP_INT_DMA0 |
+ TXP_INT_LATCH);
+
+ txp_command(sc, TXP_CMD_TX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 0);
+ txp_command(sc, TXP_CMD_RX_DISABLE, 0, 0, 0, NULL, NULL, NULL, 0);
+ txp_command(sc, TXP_CMD_HALT, 0, 0, 0, NULL, NULL, NULL, 0);
}
int
@@ -688,7 +695,7 @@ txp_dma_malloc(sc, size, dma)
bus_size_t size;
struct txp_dma_alloc *dma;
{
- int r;
+ int r;
if ((r = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0,
&dma->dma_seg, 1, &dma->dma_nseg, BUS_DMA_NOWAIT)) != 0) {
@@ -698,7 +705,7 @@ txp_dma_malloc(sc, size, dma)
bus_dmamem_free(sc->sc_dmat, &dma->dma_seg, dma->dma_nseg);
return (-1);
}
-
+
if ((r = bus_dmamem_map(sc->sc_dmat, &dma->dma_seg, dma->dma_nseg,
size, &dma->dma_vaddr, BUS_DMA_NOWAIT)) != 0) {
bus_dmamem_free(sc->sc_dmat, &dma->dma_seg, dma->dma_nseg);
@@ -798,7 +805,7 @@ txp_ioctl(ifp, command, data)
* Multicast list has changed; set the hardware
* filter accordingly.
*/
- /* XXX TODO: set multicast list */
+ txp_set_filter(sc);
error = 0;
}
break;
@@ -820,6 +827,9 @@ void
txp_init(sc)
struct txp_softc *sc;
{
+#if 0
+ txp_set_filter(sc);
+#endif
}
void
diff --git a/sys/dev/pci/if_txpreg.h b/sys/dev/pci/if_txpreg.h
index 08bcc315292..05d2860b967 100644
--- a/sys/dev/pci/if_txpreg.h
+++ b/sys/dev/pci/if_txpreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txpreg.h,v 1.11 2001/04/10 19:52:38 jason Exp $ */
+/* $OpenBSD: if_txpreg.h,v 1.12 2001/04/10 22:10:09 jason Exp $ */
/*
* Copyright (c) 2001 Aaron Campbell <aaron@monkey.org>.
@@ -430,8 +430,8 @@ struct txp_hostvar {
#define STAT_SLEEPING 0x00000011
#define STAT_HALTED 0x00000014
-#define TX_ENTRIES 128
-#define RX_ENTRIES 128
+#define TX_ENTRIES 256
+#define RX_ENTRIES 256
#define CMD_ENTRIES 32
#define RSP_ENTRIES 32