svn commit: r256299 - head/sys/dev/bxe

Eric Davis edavis at FreeBSD.org
Thu Oct 10 21:10:53 UTC 2013


Author: edavis
Date: Thu Oct 10 21:10:51 2013
New Revision: 256299
URL: http://svnweb.freebsd.org/changeset/base/256299

Log:
  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)

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe_stats.c
  head/sys/dev/bxe/ecore_sp.h

Modified: head/sys/dev/bxe/bxe.c
==============================================================================
--- head/sys/dev/bxe/bxe.c	Thu Oct 10 20:47:11 2013	(r256298)
+++ head/sys/dev/bxe/bxe.c	Thu Oct 10 21:10:51 2013	(r256299)
@@ -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");

Modified: head/sys/dev/bxe/bxe_stats.c
==============================================================================
--- head/sys/dev/bxe/bxe_stats.c	Thu Oct 10 20:47:11 2013	(r256298)
+++ head/sys/dev/bxe/bxe_stats.c	Thu Oct 10 21:10:51 2013	(r256299)
@@ -263,6 +263,17 @@ bxe_stats_pmf_update(struct bxe_softc *s
     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");

Modified: head/sys/dev/bxe/ecore_sp.h
==============================================================================
--- head/sys/dev/bxe/ecore_sp.h	Thu Oct 10 20:47:11 2013	(r256298)
+++ head/sys/dev/bxe/ecore_sp.h	Thu Oct 10 21:10:51 2013	(r256299)
@@ -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 */
 


More information about the svn-src-head mailing list