Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Many changes from FreeBSD and OpenBSD:
details: https://anonhg.NetBSD.org/src/rev/92d65eaf8832
branches: trunk
changeset: 751091:92d65eaf8832
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Sun Jan 24 16:21:09 2010 +0000
description:
Many changes from FreeBSD and OpenBSD:
- Add support for BCM5705F,BCM5714,SBCM5715S,BCM5717,BCM5718,BCM5720,BCM5723,
BCM5724,BCM5751F,BCM5753F,BCM5756,BCM5761,BCM5761E,BCM5761S,BCM5761SE,
BCM5764,BCM5781,BCM5784M,BCM5903M,BCM57760,BCM57761,BCM57765,BCM57780,
BCM57781,BCM57785,BCM57788,BCM57790,BCM57791 and BCM57795. Fixes PR#41694.
- Fix misunderstanding the capability for TSO4 on some chips.
- Many other bugfixes.
- Use proplib for no EEPROM systems (e.g. sparc64 with onboard bge).
- Add debug function to show some flags.
diffstat:
sys/dev/pci/if_bge.c | 869 +++++++++++++++++++++++++++++++----------------
sys/dev/pci/if_bgereg.h | 160 +++++---
sys/dev/pci/if_bgevar.h | 22 +-
3 files changed, 685 insertions(+), 366 deletions(-)
diffs (truncated from 1907 to 300 lines):
diff -r ef40386745dc -r 92d65eaf8832 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c Sun Jan 24 15:53:59 2010 +0000
+++ b/sys/dev/pci/if_bge.c Sun Jan 24 16:21:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.171 2010/01/24 15:29:10 msaitoh Exp $ */
+/* $NetBSD: if_bge.c,v 1.172 2010/01/24 16:21:09 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.171 2010/01/24 15:29:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.172 2010/01/24 16:21:09 msaitoh Exp $");
#include "vlan.h"
#include "rnd.h"
@@ -193,6 +193,7 @@
static void bge_txeof(struct bge_softc *);
static void bge_rxeof(struct bge_softc *);
+static int bge_get_eaddr_fw(struct bge_softc *, uint8_t[]);
static int bge_get_eaddr_mem(struct bge_softc *, uint8_t[]);
static int bge_get_eaddr_nvram(struct bge_softc *, uint8_t[]);
static int bge_get_eaddr_eeprom(struct bge_softc *, uint8_t[]);
@@ -200,6 +201,7 @@
static void bge_tick(void *);
static void bge_stats_update(struct bge_softc *);
+static void bge_stats_update_regs(struct bge_softc *);
static int bge_encap(struct bge_softc *, struct mbuf *, uint32_t *);
static int bge_intr(void *);
@@ -237,13 +239,13 @@
static void bge_reset(struct bge_softc *);
static void bge_link_upd(struct bge_softc *);
-#define BGE_DEBUG
#ifdef BGE_DEBUG
#define DPRINTF(x) if (bgedebug) printf x
#define DPRINTFN(n,x) if (bgedebug >= (n)) printf x
#define BGE_TSO_PRINTF(x) do { if (bge_tso_debug) printf x ;} while (0)
int bgedebug = 0;
int bge_tso_debug = 0;
+void bge_debug_info(struct bge_softc *);
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
@@ -331,6 +333,10 @@
"Broadcom BCM5705 Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5705F,
+ "Broadcom BCM5705F Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5705K,
"Broadcom BCM5705K Gigabit Ethernet",
},
@@ -344,15 +350,31 @@
},
{ PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5714,
- "Broadcom BCM5714/5715 Gigabit Ethernet",
+ "Broadcom BCM5714 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5714S,
+ "Broadcom BCM5714S Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5715,
- "Broadcom BCM5714/5715 Gigabit Ethernet",
+ "Broadcom BCM5715 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5715S,
+ "Broadcom BCM5715S Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
- PCI_PRODUCT_BROADCOM_BCM5789,
- "Broadcom BCM5789 Gigabit Ethernet",
+ PCI_PRODUCT_BROADCOM_BCM5717,
+ "Broadcom BCM5717 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5718,
+ "Broadcom BCM5718 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5720,
+ "Broadcom BCM5720 Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5721,
@@ -363,6 +385,14 @@
"Broadcom BCM5722 Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5723,
+ "Broadcom BCM5723 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5724,
+ "Broadcom BCM5724 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5750,
"Broadcom BCM5750 Gigabit Ethernet",
},
@@ -375,6 +405,10 @@
"Broadcom BCM5751 Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5751F,
+ "Broadcom BCM5751F Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5751M,
"Broadcom BCM5751M Gigabit Ethernet",
},
@@ -391,6 +425,10 @@
"Broadcom BCM5753 Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5753F,
+ "Broadcom BCM5753F Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5753M,
"Broadcom BCM5753M Gigabit Ethernet",
},
@@ -410,6 +448,30 @@
PCI_PRODUCT_BROADCOM_BCM5755M,
"Broadcom BCM5755M Gigabit Ethernet",
},
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5756,
+ "Broadcom BCM5756 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5761,
+ "Broadcom BCM5761 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5761E,
+ "Broadcom BCM5761E Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5761S,
+ "Broadcom BCM5761S Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5761SE,
+ "Broadcom BCM5761SE Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5764,
+ "Broadcom BCM5764 Gigabit Ethernet",
+ },
{ PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5780,
"Broadcom BCM5780 Gigabit Ethernet",
@@ -419,10 +481,18 @@
"Broadcom BCM5780S Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5781,
+ "Broadcom BCM5781 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5782,
"Broadcom BCM5782 Gigabit Ethernet",
},
{ PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5784M,
+ "BCM5784M NetLink 1000baseT Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5786,
"Broadcom BCM5786 Gigabit Ethernet",
},
@@ -450,13 +520,9 @@
PCI_PRODUCT_BROADCOM_BCM5901A2,
"Broadcom BCM5901A2 Fast Ethernet",
},
- { PCI_VENDOR_SCHNEIDERKOCH,
- PCI_PRODUCT_SCHNEIDERKOCH_SK_9DX1,
- "SysKonnect SK-9Dx1 Gigabit Ethernet",
- },
- { PCI_VENDOR_3COM,
- PCI_PRODUCT_3COM_3C996,
- "3Com 3c996 Gigabit Ethernet",
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM5903M,
+ "Broadcom BCM5903M Fast Ethernet",
},
{ PCI_VENDOR_BROADCOM,
PCI_PRODUCT_BROADCOM_BCM5906,
@@ -466,6 +532,54 @@
PCI_PRODUCT_BROADCOM_BCM5906M,
"Broadcom BCM5906M Fast Ethernet",
},
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57760,
+ "Broadcom BCM57760 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57761,
+ "Broadcom BCM57761 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57765,
+ "Broadcom BCM57765 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57780,
+ "Broadcom BCM57780 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57781,
+ "Broadcom BCM57781 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57785,
+ "Broadcom BCM57785 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57788,
+ "Broadcom BCM57788 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57790,
+ "Broadcom BCM57790 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57791,
+ "Broadcom BCM57791 Fast Ethernet",
+ },
+ { PCI_VENDOR_BROADCOM,
+ PCI_PRODUCT_BROADCOM_BCM57795,
+ "Broadcom BCM57795 Fast Ethernet",
+ },
+ { PCI_VENDOR_SCHNEIDERKOCH,
+ PCI_PRODUCT_SCHNEIDERKOCH_SK_9DX1,
+ "SysKonnect SK-9Dx1 Gigabit Ethernet",
+ },
+ { PCI_VENDOR_3COM,
+ PCI_PRODUCT_3COM_3C996,
+ "3Com 3c996 Gigabit Ethernet",
+ },
{ 0,
0,
NULL },
@@ -479,29 +593,12 @@
* how we map ASIC revision to "quirks" needs more thought.
* (defined here until the thought is done).
*/
-#define BGE_IS_5714_FAMILY(sc) \
- (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5714_A0 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5780 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5714 )
-
-#define BGE_IS_5750_OR_BEYOND(sc) \
- (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5750 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906 || \
- BGE_IS_5714_FAMILY(sc) )
-
-#define BGE_IS_5705_OR_BEYOND(sc) \
- (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 || \
- (BGE_IS_5750_OR_BEYOND(sc)))
-
-#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_BCM5704)
-
+#define BGE_IS_5700_FAMILY(sc) ((sc)->bge_flags & BGE_5700_FAMILY)
+#define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_5714_FAMILY)
+#define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_5705_PLUS)
+#define BGE_IS_5750_OR_BEYOND(sc) ((sc)->bge_flags & BGE_5750_PLUS)
+#define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_5755_PLUS)
+#define BGE_IS_JUMBO_CAPABLE(sc) ((sc)->bge_flags & BGE_JUMBO_CAPABLE)
static const struct bge_revision {
uint32_t br_chipid;
@@ -520,11 +617,11 @@
{ BGE_CHIPID_BCM5701_B0, "BCM5701 B0" },
{ BGE_CHIPID_BCM5701_B2, "BCM5701 B2" },
{ BGE_CHIPID_BCM5701_B5, "BCM5701 B5" },
- { BGE_CHIPID_BCM5703_A0, "BCM5703 A0" },
- { BGE_CHIPID_BCM5703_A1, "BCM5703 A1" },
- { BGE_CHIPID_BCM5703_A2, "BCM5703 A2" },
- { BGE_CHIPID_BCM5703_A3, "BCM5703 A3" },
- { BGE_CHIPID_BCM5703_B0, "BCM5703 B0" },
Home |
Main Index |
Thread Index |
Old Index