diff options
| author | Justin T. Gibbs <gibbs@FreeBSD.org> | 1997-01-22 18:07:15 +0000 |
|---|---|---|
| committer | Justin T. Gibbs <gibbs@FreeBSD.org> | 1997-01-22 18:07:15 +0000 |
| commit | 5ea6dc36ff9c9b8d10808db18b11580ff8a933c0 (patch) | |
| tree | 59988d55e1a247d776702e22c1d32f25852eb05d /sys | |
| parent | 71318ca3ea95b20de03a7bde7787a547339e5758 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/pci/aic7870.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/pci/aic7870.c b/sys/pci/aic7870.c index 9e005239988b..15e257338f9d 100644 --- a/sys/pci/aic7870.c +++ b/sys/pci/aic7870.c @@ -321,6 +321,7 @@ ahc_pci_attach(parent, self, aux) const char *intrstr; #endif u_int32_t id; + u_int32_t command; struct scb_data *shared_scb_data; int opri; ahc_type ahc_t = AHC_NONE; @@ -336,12 +337,12 @@ ahc_pci_attach(parent, self, aux) paddr = NULL; #if defined(__FreeBSD__) io_port = 0; -#ifdef AHC_ALLOW_MEMIO - if (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr) == 0) -#endif - if (pci_map_port(config_id, PCI_BASEADR0, &io_port) == 0) + command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); + if ((command & PCI_COMMAND_MEM_ENABLE) == 0 + || (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr)) == 0) + if ((command & PCI_COMMAND_IO_ENABLE) == 0 + || (pci_map_port(config_id, PCI_BASEADR0, &io_port)) == 0) return; - #elif defined(__NetBSD__) /* XXX Memory mapped I/O?? */ if (bus_io_map(pa->pa_bc, iobase, iosize, &ioh)) @@ -618,7 +619,8 @@ ahc_pci_attach(parent, self, aux) /* In case we are a wide card */ ahc_outb(ahc, SCSICONF + 1, our_id); - if (!ultra_enb || (ahc->flags & AHC_USEDEFAULTS)) { + if (ultra_enb == 0 + && (ahc->flags & AHC_USEDEFAULTS) == 0) { /* * If there wasn't a BIOS or the board * wasn't in this mode to begin with, |
