Add preliminary support for PCI config header type 2:

Fetch subvendor/device ID from config space register 0x40.
This commit is contained in:
Stefan Eßer 1997-04-23 19:43:20 +00:00
parent a862685541
commit 7cb74fcfa2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25112
2 changed files with 40 additions and 22 deletions

View file

@ -1,6 +1,6 @@
/**************************************************************************
**
** $Id: pci.c,v 1.67 1997/03/25 19:01:46 se Exp $
** $Id: pci.c,v 1.68 1997/03/25 19:12:08 se Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@ -1821,20 +1821,29 @@ pci_remember(int bus, int dev, int func, struct pci_device *dvp)
}
p = &pci_dev_list[pci_dev_list_count - 1];
p->pc_sel.pc_bus = bus;
p->pc_sel.pc_dev = dev;
p->pc_sel.pc_bus = bus;
p->pc_sel.pc_dev = dev;
p->pc_sel.pc_func = func;
p->pc_hdr = (pci_conf_read (tag, PCI_HEADER_MISC) >> 16) & 0xff;
p->pc_dvp = dvp;
p->pc_cb = pcicb;
tag = pcibus->pb_tag (bus, dev, func);
p->pc_hdr = (pci_conf_read (tag, PCI_HEADER_MISC) >> 16) & 0xff;
p->pc_devid = pci_conf_read(tag, PCI_ID_REG);
p->pc_dvp = dvp;
p->pc_cb = pcicb;
if ((p->pc_hdr & 0x7f) == 1) {
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG1);
} else {
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG0);
}
p->pc_class = pci_conf_read(tag, PCI_CLASS_REG);
switch (p->pc_hdr & 0x7f) {
case 0:
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG0);
break;
case 1:
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG1);
break;
case 2:
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG2);
break;
default:
p->pc_subid = 0;
}
}
static int

View file

@ -1,6 +1,6 @@
/**************************************************************************
**
** $Id: pci.c,v 1.67 1997/03/25 19:01:46 se Exp $
** $Id: pci.c,v 1.68 1997/03/25 19:12:08 se Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@ -1821,20 +1821,29 @@ pci_remember(int bus, int dev, int func, struct pci_device *dvp)
}
p = &pci_dev_list[pci_dev_list_count - 1];
p->pc_sel.pc_bus = bus;
p->pc_sel.pc_dev = dev;
p->pc_sel.pc_bus = bus;
p->pc_sel.pc_dev = dev;
p->pc_sel.pc_func = func;
p->pc_hdr = (pci_conf_read (tag, PCI_HEADER_MISC) >> 16) & 0xff;
p->pc_dvp = dvp;
p->pc_cb = pcicb;
tag = pcibus->pb_tag (bus, dev, func);
p->pc_hdr = (pci_conf_read (tag, PCI_HEADER_MISC) >> 16) & 0xff;
p->pc_devid = pci_conf_read(tag, PCI_ID_REG);
p->pc_dvp = dvp;
p->pc_cb = pcicb;
if ((p->pc_hdr & 0x7f) == 1) {
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG1);
} else {
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG0);
}
p->pc_class = pci_conf_read(tag, PCI_CLASS_REG);
switch (p->pc_hdr & 0x7f) {
case 0:
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG0);
break;
case 1:
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG1);
break;
case 2:
p->pc_subid = pci_conf_read(tag, PCI_SUBID_REG2);
break;
default:
p->pc_subid = 0;
}
}
static int