Fixed the media type shown via ifconfig.

Fixed a panic that occurs when bringing up an interface on 57710/57711
running very old bootcode versions.
Fixed how bool is defined for those who have been using this code on older
versions of FreeBSD.

Approved by:    re@ (gjb)
Approved by:    davidch (mentor)
This commit is contained in:
edavis 2013-10-10 21:10:51 +00:00
parent bde695ba4c
commit 6ef318c80c
3 changed files with 36 additions and 8 deletions

View File

@ -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");

View File

@ -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");

View File

@ -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 */