Allow I/O port ranges above the standard ISA one so the PCI probe will succeed.

Reviewed by:  Richard J Kuhns <rjk@sparcmill.grauel.com>
This commit is contained in:
Justin T. Gibbs 1996-02-16 17:24:19 +00:00
parent 37b197b9ec
commit 34b72528fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14111
2 changed files with 12 additions and 13 deletions

View file

@ -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) {

View file

@ -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 */