diff options
Diffstat (limited to 'sys/dev/tws/tws.c')
-rw-r--r-- | sys/dev/tws/tws.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/sys/dev/tws/tws.c b/sys/dev/tws/tws.c index 87a7d2014ce0c..409631f28b48f 100644 --- a/sys/dev/tws/tws.c +++ b/sys/dev/tws/tws.c @@ -183,7 +183,7 @@ static int tws_attach(device_t dev) { struct tws_softc *sc = device_get_softc(dev); - u_int32_t cmd, bar; + u_int32_t bar; int error=0,i; /* no tracing yet */ @@ -224,14 +224,7 @@ tws_attach(device_t dev) OID_AUTO, "driver_version", CTLFLAG_RD, TWS_DRIVER_VERSION_STRING, 0, "TWS driver version"); - cmd = pci_read_config(dev, PCIR_COMMAND, 2); - if ( (cmd & PCIM_CMD_PORTEN) == 0) { - tws_log(sc, PCI_COMMAND_READ); - goto attach_fail_1; - } - /* Force the busmaster enable bit on. */ - cmd |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, cmd, 2); + pci_enable_busmaster(dev); bar = pci_read_config(dev, TWS_PCI_BAR0, 4); TWS_TRACE_DEBUG(sc, "bar0 ", bar, 0); @@ -461,13 +454,9 @@ static int tws_setup_irq(struct tws_softc *sc) { int messages; - u_int16_t cmd; - cmd = pci_read_config(sc->tws_dev, PCIR_COMMAND, 2); switch(sc->intr_type) { case TWS_INTx : - cmd = cmd & ~0x0400; - pci_write_config(sc->tws_dev, PCIR_COMMAND, cmd, 2); sc->irqs = 1; sc->irq_res_id[0] = 0; sc->irq_res[0] = bus_alloc_resource_any(sc->tws_dev, SYS_RES_IRQ, @@ -479,8 +468,6 @@ tws_setup_irq(struct tws_softc *sc) device_printf(sc->tws_dev, "Using legacy INTx\n"); break; case TWS_MSI : - cmd = cmd | 0x0400; - pci_write_config(sc->tws_dev, PCIR_COMMAND, cmd, 2); sc->irqs = 1; sc->irq_res_id[0] = 1; messages = 1; |