summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredavis <edavis@FreeBSD.org>2013-10-11 17:34:20 +0000
committeredavis <edavis@FreeBSD.org>2013-10-11 17:34:20 +0000
commit6ae9d57c2da58235102397383124570438585e6f (patch)
tree8dded925f4c93f2f64aea0303f5aa66ae332cfb2
parent58e4e84a2a946159977168cd852379d56fcb3c9b (diff)
downloadFreeBSD-src-6ae9d57c2da58235102397383124570438585e6f.zip
FreeBSD-src-6ae9d57c2da58235102397383124570438585e6f.tar.gz
Merge r256299 from head.
Approved by: re@ (gjb) Approved by: davidch (mentor)
-rw-r--r--sys/dev/bxe/bxe.c24
-rw-r--r--sys/dev/bxe/bxe_stats.c11
-rw-r--r--sys/dev/bxe/ecore_sp.h9
3 files changed, 36 insertions, 8 deletions
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 0588d24..bf0710a 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#define BXE_DRIVER_VERSION "1.78.17"
+#define BXE_DRIVER_VERSION "1.78.18"
#include "bxe.h"
#include "ecore_sp.h"
@@ -936,8 +936,8 @@ bxe_dma_alloc(struct bxe_softc *sc,
int rc;
if (dma->size > 0) {
- BLOGE(sc, "dma block '%s' already has size %lu\n", msg,
- (unsigned long) dma->size);
+ BLOGE(sc, "dma block '%s' already has size %lu\n", msg,
+ (unsigned long)dma->size);
return (1);
}
@@ -14201,8 +14201,14 @@ bxe_media_detect(struct bxe_softc *sc)
uint32_t phy_idx = bxe_get_cur_phy_idx(sc);
switch (sc->link_params.phy[phy_idx].media_type) {
case ELINK_ETH_PHY_SFPP_10G_FIBER:
- case ELINK_ETH_PHY_SFP_1G_FIBER:
case ELINK_ETH_PHY_XFP_FIBER:
+ BLOGI(sc, "Found 10Gb Fiber media.\n");
+ sc->media = IFM_10G_SR;
+ break;
+ case ELINK_ETH_PHY_SFP_1G_FIBER:
+ BLOGI(sc, "Found 1Gb Fiber media.\n");
+ sc->media = IFM_1000_SX;
+ break;
case ELINK_ETH_PHY_KR:
case ELINK_ETH_PHY_CX4:
BLOGI(sc, "Found 10GBase-CX4 media.\n");
@@ -14213,8 +14219,14 @@ bxe_media_detect(struct bxe_softc *sc)
sc->media = IFM_10G_TWINAX;
break;
case ELINK_ETH_PHY_BASE_T:
- BLOGI(sc, "Found 10GBase-T media.\n");
- sc->media = IFM_10G_T;
+ if (sc->link_params.speed_cap_mask[0] &
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) {
+ BLOGI(sc, "Found 10GBase-T media.\n");
+ sc->media = IFM_10G_T;
+ } else {
+ BLOGI(sc, "Found 1000Base-T media.\n");
+ sc->media = IFM_1000_T;
+ }
break;
case ELINK_ETH_PHY_NOT_PRESENT:
BLOGI(sc, "Media not present.\n");
diff --git a/sys/dev/bxe/bxe_stats.c b/sys/dev/bxe/bxe_stats.c
index 78b8dd8..977f6cf 100644
--- a/sys/dev/bxe/bxe_stats.c
+++ b/sys/dev/bxe/bxe_stats.c
@@ -263,6 +263,17 @@ bxe_stats_pmf_update(struct bxe_softc *sc)
int loader_idx = PMF_DMAE_C(sc);
uint32_t *stats_comp = BXE_SP(sc, stats_comp);
+ if (sc->devinfo.bc_ver <= 0x06001400) {
+ /*
+ * Bootcode v6.0.21 fixed a GRC timeout that occurs when accessing
+ * BRB registers while the BRB block is in reset. The DMA transfer
+ * below triggers this issue resulting in the DMAE to stop
+ * functioning. Skip this initial stats transfer for old bootcode
+ * versions <= 6.0.20.
+ */
+ return;
+ }
+
/* sanity */
if (!sc->port.pmf || !sc->port.port_stx) {
BLOGE(sc, "BUG!\n");
diff --git a/sys/dev/bxe/ecore_sp.h b/sys/dev/bxe/ecore_sp.h
index 19607e5..ae7ddee 100644
--- a/sys/dev/bxe/ecore_sp.h
+++ b/sys/dev/bxe/ecore_sp.h
@@ -77,9 +77,14 @@ struct bxe_softc;
typedef bus_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
-#if __FreeBSD_version < 1000002
-typedef int bool;
+#ifndef __bool_true_false_are_defined
+#ifndef __cplusplus
+#define bool _Bool
+#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER)
+typedef _Bool bool;
#endif
+#endif /* !__cplusplus */
+#endif /* !__bool_true_false_are_defined$ */
#define ETH_ALEN ETHER_ADDR_LEN /* 6 */
OpenPOWER on IntegriCloud