diff options
| author | Stefan Eßer <se@FreeBSD.org> | 1997-04-23 19:43:20 +0000 |
|---|---|---|
| committer | Stefan Eßer <se@FreeBSD.org> | 1997-04-23 19:43:20 +0000 |
| commit | 7cb74fcfa24f02189f1fe052b03b0a9244261a90 (patch) | |
| tree | dcc57cdf356688ae9b8871e367be3ca16ba5f40d /sys/pci/pci.c | |
| parent | a862685541f66e141f1c856366c402b7f945b434 (diff) | |
Notes
Diffstat (limited to 'sys/pci/pci.c')
| -rw-r--r-- | sys/pci/pci.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 531f4aa2b063..8c1bc7dbc19b 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -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_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; } - p->pc_class = pci_conf_read(tag, PCI_CLASS_REG); } static int |
