summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bge.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-11-27 01:20:42 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-11-27 01:20:42 +0000
commit94775045423575dfcddf7dbdf1328ab7f1710230 (patch)
tree2e072a8c0512d3f3214277e14da35f8e06bece3f /sys/dev/pci/if_bge.c
parenta559439036a57ea18b33c6cb61928c75da44cc29 (diff)
Use pci_get_capability() to check if were on a PCI Express card or not.
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r--sys/dev/pci/if_bge.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 516b26c0dbe..f2df2e47353 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.104 2005/11/27 00:26:36 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.105 2005/11/27 01:20:41 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -1808,20 +1808,16 @@ 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;
+ /*
+ * ASF check.
+ */
sc->bge_asf_mode = 0;
if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) == BGE_MAGIC_NUMBER) {
if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG)