From 27ff411066626f50207e003253d6ddec5dfd83b0 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 5 Oct 2008 22:32:12 +0000 Subject: Detect if the adapter is a PCIe adapter and set the RL_FLAG_PCIE flag if so. --- sys/dev/ic/rtl81x9reg.h | 3 ++- sys/dev/pci/if_re_pci.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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 @@ -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); } -- cgit v1.2.3