diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-11-29 20:35:59 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-11-29 20:35:59 +0000 |
commit | 608c60e3cfd00f662e3ca6c7af011c2d43b17e65 (patch) | |
tree | 2e27b05127c8da71dd10049d3732aa03a39f2b19 /sys | |
parent | e6cf2203c3c6c1ad45639c0943bea6d864dfeafd (diff) |
Put this back in...
Use pci_get_capability() to check if were on a PCI Express card or not.
Tested by deraadt@, marco@ and a few end-users who reported issues.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_bge.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 0680833aff4..004a4d89619 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.106 2005/11/28 20:26:04 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.107 2005/11/29 20:35:58 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1801,19 +1801,12 @@ bge_attach(struct device *parent, struct device *self, void *aux) printf(": %s", intrstr); /* - * XXX: Broadcom Linux driver. Not in specs or eratta. - * PCI Express. + * PCI Express check. */ - if (BGE_IS_575X_PLUS(sc)) { - u_int32_t v; - - v = pci_conf_read(pc, pa->pa_tag, BGE_PCI_MSI_CAPID); - if (((v >> 8) & 0xff) == BGE_PCIE_CAPID_REG) { - v = pci_conf_read(pc, pa->pa_tag, BGE_PCIE_CAPID_REG); - if ((v & 0xff) == BGE_PCIE_CAPID) - sc->bge_pcie = 1; - } - } + sc->bge_pcie = 0; + if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_PCIEXPRESS, + NULL, NULL) != 0) + sc->bge_pcie = 1; /* Try to reset the chip. */ DPRINTFN(5, ("bge_reset\n")); |