diff options
author | 2005-11-27 01:20:41 +0000 | |
---|---|---|
committer | 2005-11-27 01:20:41 +0000 | |
commit | 5d263715c6194c953bf835dc0b8387db2db6558f (patch) | |
tree | e354c5231da3021ccf9c5b8fdfd1949ac15cedb0 | |
parent | add initial support for ASF. (diff) | |
download | wireguard-openbsd-5d263715c6194c953bf835dc0b8387db2db6558f.tar.xz wireguard-openbsd-5d263715c6194c953bf835dc0b8387db2db6558f.zip |
Use pci_get_capability() to check if were on a PCI Express card or not.
-rw-r--r-- | sys/dev/pci/if_bge.c | 22 |
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) |