From f2f7980981c3634bfda55658bda9f439ebb3969c Mon Sep 17 00:00:00 2001 From: edavis Date: Fri, 11 Oct 2013 17:34:20 +0000 Subject: [PATCH] Merge r256299 from head. Approved by: re@ (gjb) Approved by: davidch (mentor) git-svn-id: svn://svn.freebsd.org/base/stable/10@256319 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/bxe/bxe.c | 24 ++++++++++++++++++------ sys/dev/bxe/bxe_stats.c | 11 +++++++++++ sys/dev/bxe/ecore_sp.h | 9 +++++++-- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 0588d242c..bf0710a4b 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -34,7 +34,7 @@ #include __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 78b8dd807..977f6cfb2 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 19607e5df..ae7ddee28 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 */ -- 2.45.0