summaryrefslogtreecommitdiff
path: root/sys/dev/txp
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>2001-07-30 17:31:42 +0000
committerBill Paul <wpaul@FreeBSD.org>2001-07-30 17:31:42 +0000
commit06a192c0a91452da138f35463779db07e932d0c7 (patch)
treeccfbefb48142e8450627d743b53d62261128748a /sys/dev/txp
parent91789aee0463809f3488a610961c07a16ded9b32 (diff)
Notes
Diffstat (limited to 'sys/dev/txp')
-rw-r--r--sys/dev/txp/if_txp.c43
-rw-r--r--sys/dev/txp/if_txpreg.h1
2 files changed, 9 insertions, 35 deletions
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c
index 76625e7e0163..4f547462b9f7 100644
--- a/sys/dev/txp/if_txp.c
+++ b/sys/dev/txp/if_txp.c
@@ -82,8 +82,8 @@
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
+#include <pci/pcireg.h>
+#include <pci/pcivar.h>
#define TXP_USEIOSPACE
#define __STRICT_ALIGNMENT
@@ -223,48 +223,24 @@ txp_attach(dev)
sc->sc_dev = dev;
sc->sc_cold = 1;
- mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF|MTX_RECURSE);
-
- /*
- * Handle power management nonsense.
- */
- if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
- u_int32_t iobase, membase, irq;
-
- /* Save important PCI config data. */
- iobase = pci_read_config(dev, TXP_PCI_LOIO, 4);
- membase = pci_read_config(dev, TXP_PCI_LOMEM, 4);
- irq = pci_read_config(dev, TXP_PCI_INTLINE, 4);
-
- /* Reset the power state. */
- device_printf(dev, "chip is in D%d power mode "
- "-- setting to D0\n", pci_get_powerstate(dev));
- pci_set_powerstate(dev, PCI_POWERSTATE_D0);
-
- /* Restore PCI config data. */
- pci_write_config(dev, TXP_PCI_LOIO, iobase, 4);
- pci_write_config(dev, TXP_PCI_LOMEM, membase, 4);
- pci_write_config(dev, TXP_PCI_INTLINE, irq, 4);
- }
-
/*
* Map control/status registers.
*/
- pci_enable_busmaster(dev);
- pci_enable_io(dev, SYS_RES_IOPORT);
- pci_enable_io(dev, SYS_RES_MEMORY);
+ command = pci_read_config(dev, PCIR_COMMAND, 4);
+ command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
+ pci_write_config(dev, PCIR_COMMAND, command, 4);
command = pci_read_config(dev, PCIR_COMMAND, 4);
#ifdef TXP_USEIOSPACE
if (!(command & PCIM_CMD_PORTEN)) {
device_printf(dev, "failed to enable I/O ports!\n");
- error = ENXIO;
+ error = ENXIO;;
goto fail;
}
#else
if (!(command & PCIM_CMD_MEMEN)) {
device_printf(dev, "failed to enable memory mapping!\n");
- error = ENXIO;
+ error = ENXIO;;
goto fail;
}
#endif
@@ -393,7 +369,6 @@ txp_attach(dev)
fail:
txp_release_resources(sc);
- mtx_destroy(&sc->sc_mtx);
return(error);
}
@@ -419,7 +394,6 @@ txp_detach(dev)
txp_release_resources(sc);
- mtx_destroy(&sc->sc_mtx);
return(0);
}
@@ -1823,7 +1797,8 @@ txp_set_filter(sc)
else {
hash[0] = hash[1] = 0;
- TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
+ ifma = ifma->ifma_link.le_next) {
if (ifma->ifma_addr->sa_family != AF_LINK)
continue;
diff --git a/sys/dev/txp/if_txpreg.h b/sys/dev/txp/if_txpreg.h
index 634c29f07f7e..d4c530e951c5 100644
--- a/sys/dev/txp/if_txpreg.h
+++ b/sys/dev/txp/if_txpreg.h
@@ -600,7 +600,6 @@ struct txp_softc {
struct resource *sc_res;
struct resource *sc_irq;
void *sc_intrhand;
- struct mtx sc_mtx;
struct txp_ldata *sc_ldata;
void *sc_fwbuf;
int sc_rxbufprod;