diff options
| -rw-r--r-- | sys/i386/scsi/bt.c | 6 | ||||
| -rw-r--r-- | sys/pci/bt9xx.c | 19 |
2 files changed, 12 insertions, 13 deletions
diff --git a/sys/i386/scsi/bt.c b/sys/i386/scsi/bt.c index 9748b6002a26..2f8a2542fcd9 100644 --- a/sys/i386/scsi/bt.c +++ b/sys/i386/scsi/bt.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: bt.c,v 1.4 1996/01/07 19:24:36 gibbs Exp $ + * $Id: bt.c,v 1.5 1996/01/25 23:03:07 joerg Exp $ */ /* @@ -462,10 +462,6 @@ bt_alloc(unit, iobase) } } } - if (i >= sizeof(found)/sizeof(struct bt_found)) { - printf("bt%d: Invalid base address\n", unit); - return NULL; - } bt = malloc(sizeof(struct bt_data), M_DEVBUF, M_NOWAIT); if (!bt) { diff --git a/sys/pci/bt9xx.c b/sys/pci/bt9xx.c index b5befcf19752..319705f843d1 100644 --- a/sys/pci/bt9xx.c +++ b/sys/pci/bt9xx.c @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: bt9xx.c,v 1.4 1996/01/23 21:46:57 se Exp $ + * $Id: bt9xx.c,v 1.5 1996/02/12 17:00:39 gibbs Exp $ */ #include <pci.h> @@ -35,7 +35,6 @@ #include <i386/scsi/btreg.h> /* XXX Need more device IDs */ -#define PCI_BASEADR0 PCI_MAP_REG_START #define PCI_DEVICE_ID_BUSLOGIC_946 0x1040104Bul static char* bt_pci_probe __P((pcici_t tag, pcidi_t type)); @@ -70,17 +69,21 @@ bt_pci_attach(config_id, unit) pcici_t config_id; int unit; { + u_char reg; u_long io_port; unsigned opri = 0; struct bt_data *bt; - if(!(io_port = pci_conf_read(config_id, PCI_BASEADR0))) + for(reg = PCI_MAP_REG_START; reg < PCI_MAP_REG_END; reg+=4) { + io_port = pci_conf_read(config_id, reg); + if ((io_port&~7)==0) continue; + if(io_port & PCI_MAP_IO) { + io_port &= ~PCI_MAP_IO; + break; + } + } + if(reg == PCI_MAP_REG_END) return; - /* - * The first bit of PCI_BASEADR0 is always - * set hence we mask it off. - */ - io_port &= 0xfffffffe; if(!(bt = bt_alloc(unit, io_port))) return; /* XXX PCI code should take return status */ |
