summaryrefslogtreecommitdiff
path: root/sys/dev/ips/ips_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ips/ips_pci.c')
-rw-r--r--sys/dev/ips/ips_pci.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/dev/ips/ips_pci.c b/sys/dev/ips/ips_pci.c
index d39f4acbf65c0..df917ed3729a4 100644
--- a/sys/dev/ips/ips_pci.c
+++ b/sys/dev/ips/ips_pci.c
@@ -59,7 +59,6 @@ static int ips_pci_probe(device_t dev)
static int ips_pci_attach(device_t dev)
{
- u_int32_t command;
ips_softc_t *sc;
@@ -95,22 +94,18 @@ static int ips_pci_attach(device_t dev)
} else
goto error;
/* make sure busmastering is on */
- command = pci_read_config(dev, PCIR_COMMAND, 1);
- command |= PCIM_CMD_BUSMASTEREN;
- pci_write_config(dev, PCIR_COMMAND, command, 1);
+ pci_enable_busmaster(dev);
/* seting up io space */
sc->iores = NULL;
- if(command & PCIM_CMD_MEMEN){
- PRINTF(10, "trying MEMIO\n");
- if(pci_get_device(dev) == IPS_COPPERHEAD_DEVICE_ID)
- sc->rid = PCIR_BAR(1);
- else
- sc->rid = PCIR_BAR(0);
- sc->iotype = SYS_RES_MEMORY;
- sc->iores = bus_alloc_resource_any(dev, sc->iotype,
- &sc->rid, RF_ACTIVE);
- }
- if(!sc->iores && command & PCIM_CMD_PORTEN){
+ PRINTF(10, "trying MEMIO\n");
+ if(pci_get_device(dev) == IPS_COPPERHEAD_DEVICE_ID)
+ sc->rid = PCIR_BAR(1);
+ else
+ sc->rid = PCIR_BAR(0);
+ sc->iotype = SYS_RES_MEMORY;
+ sc->iores = bus_alloc_resource_any(dev, sc->iotype, &sc->rid,
+ RF_ACTIVE);
+ if(!sc->iores){
PRINTF(10, "trying PORTIO\n");
sc->rid = PCIR_BAR(0);
sc->iotype = SYS_RES_IOPORT;