summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-10-05 22:32:12 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-10-05 22:32:12 +0000
commit27ff411066626f50207e003253d6ddec5dfd83b0 (patch)
tree4a41e9d1083ac095ff38fd2b1589d35f6e2e6181 /sys/dev
parent2fc13cfc67583a40640ee5cf5b8e1265bebd9116 (diff)
Detect if the adapter is a PCIe adapter and set the RL_FLAG_PCIE flag
if so.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rtl81x9reg.h3
-rw-r--r--sys/dev/pci/if_re_pci.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index 56fffea52af..2f0fab8d858 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.52 2008/08/27 20:38:59 brad Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.53 2008/10/05 22:32:11 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -806,6 +806,7 @@ struct rl_softc {
int rl_txstart;
u_int32_t rl_flags;
#define RL_FLAG_MSI 0x0001
+#define RL_FLAG_PCIE 0x0002
#define RL_FLAG_INVMAR 0x0004
#define RL_FLAG_PHYWAKE 0x0008
#define RL_FLAG_NOJUMBO 0x0010
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index f205c8af679..db822c3285b 100644
--- a/sys/dev/pci/if_re_pci.c
+++ b/sys/dev/pci/if_re_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_pci.c,v 1.21 2008/04/20 00:34:39 brad Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.22 2008/10/05 22:32:11 brad Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -187,6 +187,13 @@ re_pci_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dmat = pa->pa_dmat;
+ /*
+ * PCI Express check.
+ */
+ if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PCIEXPRESS,
+ NULL, NULL))
+ sc->rl_flags |= RL_FLAG_PCIE;
+
/* Call bus-independent attach routine */
re_attach(sc, intrstr);
}