summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-11-24 23:48:30 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-11-24 23:48:30 +0000
commita449ca83d36aca1248df6919c4889e406a2a3258 (patch)
treeda4473c942141f37d6f1d6c3e115e98c3785966c
parent1b1b775efbf1ce5de10a4e90ce6f1b8fef11cf6d (diff)
add a few macros allowing selection of certain generations of
the Broadcom ASICs.
-rw-r--r--sys/dev/pci/if_bge.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 63357c5b90a..7f93acaf467 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.94 2005/11/24 12:25:07 fgsch Exp $ */
+/* $OpenBSD: if_bge.c,v 1.95 2005/11/24 23:48:29 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -263,6 +263,29 @@ const struct pci_matchid bge_devices[] = {
#define BGE_QUIRK_5700_COMMON \
(BGE_QUIRK_5700_SMALLDMA|BGE_QUIRK_PRODUCER_BUG)
+
+#define BGE_IS_5705_OR_BEYOND(sc) \
+ (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5750 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5780 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752)
+
+#define BGE_IS_575X_PLUS(sc) \
+ (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5750 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5780 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752)
+
+#define BGE_IS_5714_FAMILY(sc) \
+ (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5780)
+
+#define BGE_IS_JUMBO_CAPABLE(sc) \
+ (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5700 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5701 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5780 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5704)
+
+
static const struct bge_revision {
uint32_t br_chipid;
uint32_t br_quirks;