summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bge.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-10-14 01:38:10 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-10-14 01:38:10 +0000
commit04bec9797aec9a822cbfd301c7288accc524f92c (patch)
tree6924f0b6c56c6e3ed73cf6b13538934bc4782c5c /sys/dev/pci/if_bge.c
parent9fe9ff3de758e4b545d8a1c8cd3f98fdb6379746 (diff)
shuffle these structs up to the top.
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r--sys/dev/pci/if_bge.c401
1 files changed, 201 insertions, 200 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 08b1e854653..feb6a2bc51a 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.87 2005/10/10 00:10:29 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.88 2005/10/14 01:38:09 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -119,6 +119,15 @@
const struct bge_revision * bge_lookup_rev(uint32_t);
int bge_probe(struct device *, void *, void *);
void bge_attach(struct device *, struct device *, void *);
+
+struct cfattach bge_ca = {
+ sizeof(struct bge_softc), bge_probe, bge_attach
+};
+
+struct cfdriver bge_cd = {
+ 0, "bge", DV_IFNET
+};
+
void bge_txeof(struct bge_softc *);
void bge_rxeof(struct bge_softc *);
@@ -255,6 +264,197 @@ const struct pci_matchid bge_devices[] = {
#define BGE_QUIRK_5700_COMMON \
(BGE_QUIRK_5700_SMALLDMA|BGE_QUIRK_PRODUCER_BUG)
+static const struct bge_revision {
+ uint32_t br_chipid;
+ uint32_t br_quirks;
+ const char *br_name;
+} bge_revisions[] = {
+ { BGE_CHIPID_BCM5700_A0,
+ BGE_QUIRK_LINK_STATE_BROKEN,
+ "BCM5700 A0" },
+
+ { BGE_CHIPID_BCM5700_A1,
+ BGE_QUIRK_LINK_STATE_BROKEN,
+ "BCM5700 A1" },
+
+ { BGE_CHIPID_BCM5700_B0,
+ BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_CSUM_BROKEN|BGE_QUIRK_5700_COMMON,
+ "BCM5700 B0" },
+
+ { BGE_CHIPID_BCM5700_B1,
+ BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
+ "BCM5700 B1" },
+
+ { BGE_CHIPID_BCM5700_B2,
+ BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
+ "BCM5700 B2" },
+
+ { BGE_CHIPID_BCM5700_B3,
+ BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
+ "BCM5700 B3" },
+
+ /* This is treated like a BCM5700 Bx */
+ { BGE_CHIPID_BCM5700_ALTIMA,
+ BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
+ "BCM5700 Altima" },
+
+ { BGE_CHIPID_BCM5700_C0,
+ 0,
+ "BCM5700 C0" },
+
+ { BGE_CHIPID_BCM5701_A0,
+ BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
+ "BCM5701 A0" },
+
+ { BGE_CHIPID_BCM5701_B0,
+ BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
+ "BCM5701 B0" },
+
+ { BGE_CHIPID_BCM5701_B2,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
+ "BCM5701 B2" },
+
+ { BGE_CHIPID_BCM5701_B5,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
+ "BCM5701 B5" },
+
+ { BGE_CHIPID_BCM5703_A0,
+ 0,
+ "BCM5703 A0" },
+
+ { BGE_CHIPID_BCM5703_A1,
+ 0,
+ "BCM5703 A1" },
+
+ { BGE_CHIPID_BCM5703_A2,
+ BGE_QUIRK_ONLY_PHY_1,
+ "BCM5703 A2" },
+
+ { BGE_CHIPID_BCM5703_A3,
+ BGE_QUIRK_ONLY_PHY_1,
+ "BCM5703 A3" },
+
+ { BGE_CHIPID_BCM5704_A0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
+ "BCM5704 A0" },
+
+ { BGE_CHIPID_BCM5704_A1,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
+ "BCM5704 A1" },
+
+ { BGE_CHIPID_BCM5704_A2,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
+ "BCM5704 A2" },
+
+ { BGE_CHIPID_BCM5704_A3,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
+ "BCM5704 A3" },
+
+ { BGE_CHIPID_BCM5704_B0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
+ "BCM5704 B0" },
+
+ { BGE_CHIPID_BCM5705_A0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5705 A0" },
+
+ { BGE_CHIPID_BCM5705_A1,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5705 A1" },
+
+ { BGE_CHIPID_BCM5705_A2,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5705 A2" },
+
+ { BGE_CHIPID_BCM5705_A3,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5705 A3" },
+
+ { BGE_CHIPID_BCM5750_A0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5750 A0" },
+
+ { BGE_CHIPID_BCM5750_A1,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5750 A1" },
+
+ { BGE_CHIPID_BCM5750_A3,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5750 A3" },
+
+ { BGE_CHIPID_BCM5750_B0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5750 B0" },
+
+ { BGE_CHIPID_BCM5750_B1,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5750 B1" },
+
+ { BGE_CHIPID_BCM5750_C0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5750 C0" },
+
+ { BGE_CHIPID_BCM5714_A0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5714 A0" },
+
+ { BGE_CHIPID_BCM5752_A0,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5752 A0" },
+
+ { BGE_CHIPID_BCM5752_A1,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "BCM5752 A1" },
+
+ { 0, 0, NULL }
+};
+
+/*
+ * Some defaults for major revisions, so that newer steppings
+ * that we don't know about have a shot at working.
+ */
+static const struct bge_revision bge_majorrevs[] = {
+ { BGE_ASICREV_BCM5700,
+ BGE_QUIRK_LINK_STATE_BROKEN,
+ "unknown BCM5700" },
+
+ { BGE_ASICREV_BCM5701,
+ BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
+ "unknown BCM5701" },
+
+ { BGE_ASICREV_BCM5703,
+ 0,
+ "unknown BCM5703" },
+
+ { BGE_ASICREV_BCM5704,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
+ "unknown BCM5704" },
+
+ { BGE_ASICREV_BCM5705,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "unknown BCM5705" },
+
+ { BGE_ASICREV_BCM5750,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "unknown BCM5750" },
+
+ { BGE_ASICREV_BCM5714,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "unknown BCM5714" },
+
+ { BGE_ASICREV_BCM5752,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "unknown BCM5752" },
+
+ { BGE_ASICREV_BCM5780,
+ BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ "unknown BCM5780" },
+
+ { 0,
+ 0,
+ NULL }
+};
+
u_int32_t
bge_readmem_ind(sc, off)
struct bge_softc *sc;
@@ -1496,197 +1696,6 @@ bge_blockinit(sc)
return(0);
}
-static const struct bge_revision {
- uint32_t br_chipid;
- uint32_t br_quirks;
- const char *br_name;
-} bge_revisions[] = {
- { BGE_CHIPID_BCM5700_A0,
- BGE_QUIRK_LINK_STATE_BROKEN,
- "BCM5700 A0" },
-
- { BGE_CHIPID_BCM5700_A1,
- BGE_QUIRK_LINK_STATE_BROKEN,
- "BCM5700 A1" },
-
- { BGE_CHIPID_BCM5700_B0,
- BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_CSUM_BROKEN|BGE_QUIRK_5700_COMMON,
- "BCM5700 B0" },
-
- { BGE_CHIPID_BCM5700_B1,
- BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
- "BCM5700 B1" },
-
- { BGE_CHIPID_BCM5700_B2,
- BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
- "BCM5700 B2" },
-
- { BGE_CHIPID_BCM5700_B3,
- BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
- "BCM5700 B3" },
-
- /* This is treated like a BCM5700 Bx */
- { BGE_CHIPID_BCM5700_ALTIMA,
- BGE_QUIRK_LINK_STATE_BROKEN|BGE_QUIRK_5700_COMMON,
- "BCM5700 Altima" },
-
- { BGE_CHIPID_BCM5700_C0,
- 0,
- "BCM5700 C0" },
-
- { BGE_CHIPID_BCM5701_A0,
- BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
- "BCM5701 A0" },
-
- { BGE_CHIPID_BCM5701_B0,
- BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
- "BCM5701 B0" },
-
- { BGE_CHIPID_BCM5701_B2,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
- "BCM5701 B2" },
-
- { BGE_CHIPID_BCM5701_B5,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
- "BCM5701 B5" },
-
- { BGE_CHIPID_BCM5703_A0,
- 0,
- "BCM5703 A0" },
-
- { BGE_CHIPID_BCM5703_A1,
- 0,
- "BCM5703 A1" },
-
- { BGE_CHIPID_BCM5703_A2,
- BGE_QUIRK_ONLY_PHY_1,
- "BCM5703 A2" },
-
- { BGE_CHIPID_BCM5703_A3,
- BGE_QUIRK_ONLY_PHY_1,
- "BCM5703 A3" },
-
- { BGE_CHIPID_BCM5704_A0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
- "BCM5704 A0" },
-
- { BGE_CHIPID_BCM5704_A1,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
- "BCM5704 A1" },
-
- { BGE_CHIPID_BCM5704_A2,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
- "BCM5704 A2" },
-
- { BGE_CHIPID_BCM5704_A3,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
- "BCM5704 A3" },
-
- { BGE_CHIPID_BCM5704_B0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
- "BCM5704 B0" },
-
- { BGE_CHIPID_BCM5705_A0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5705 A0" },
-
- { BGE_CHIPID_BCM5705_A1,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5705 A1" },
-
- { BGE_CHIPID_BCM5705_A2,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5705 A2" },
-
- { BGE_CHIPID_BCM5705_A3,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5705 A3" },
-
- { BGE_CHIPID_BCM5750_A0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5750 A0" },
-
- { BGE_CHIPID_BCM5750_A1,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5750 A1" },
-
- { BGE_CHIPID_BCM5750_A3,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5750 A3" },
-
- { BGE_CHIPID_BCM5750_B0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5750 B0" },
-
- { BGE_CHIPID_BCM5750_B1,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5750 B1" },
-
- { BGE_CHIPID_BCM5750_C0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5750 C0" },
-
- { BGE_CHIPID_BCM5714_A0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5714 A0" },
-
- { BGE_CHIPID_BCM5752_A0,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5752 A0" },
-
- { BGE_CHIPID_BCM5752_A1,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "BCM5752 A1" },
-
- { 0, 0, NULL }
-};
-
-/*
- * Some defaults for major revisions, so that newer steppings
- * that we don't know about have a shot at working.
- */
-static const struct bge_revision bge_majorrevs[] = {
- { BGE_ASICREV_BCM5700,
- BGE_QUIRK_LINK_STATE_BROKEN,
- "unknown BCM5700" },
-
- { BGE_ASICREV_BCM5701,
- BGE_QUIRK_PCIX_DMA_ALIGN_BUG,
- "unknown BCM5701" },
-
- { BGE_ASICREV_BCM5703,
- 0,
- "unknown BCM5703" },
-
- { BGE_ASICREV_BCM5704,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_FEWER_MBUFS,
- "unknown BCM5704" },
-
- { BGE_ASICREV_BCM5705,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "unknown BCM5705" },
-
- { BGE_ASICREV_BCM5750,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "unknown BCM5750" },
-
- { BGE_ASICREV_BCM5714,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "unknown BCM5714" },
-
- { BGE_ASICREV_BCM5752,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "unknown BCM5752" },
-
- { BGE_ASICREV_BCM5780,
- BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
- "unknown BCM5780" },
-
- { 0,
- 0,
- NULL }
-};
-
const struct bge_revision *
bge_lookup_rev(uint32_t chipid)
{
@@ -3401,11 +3410,3 @@ bge_shutdown(xsc)
bge_stop(sc);
bge_reset(sc);
}
-
-struct cfattach bge_ca = {
- sizeof(struct bge_softc), bge_probe, bge_attach
-};
-
-struct cfdriver bge_cd = {
- 0, "bge", DV_IFNET
-};