Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jun 2017 21:14:48 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319990 - head/sys/dev/bnxt
Message-ID:  <201706152114.v5FLEmXZ074948@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Thu Jun 15 21:14:48 2017
New Revision: 319990
URL: https://svnweb.freebsd.org/changeset/base/319990

Log:
  bnxt(4):  Implement temporary workaround in driver to report supported media
  types that are currently unavailable from the firmware.  e.g. 10G, 25G, 50G
  & 100G
  
  Submitted by:	bhargava.marreddy@broadcom.com
  Reviewed by:	venkatkumar.duvvuru@broadcom.com
  Differential Revision:	https://reviews.freebsd.org/D10816

Modified:
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/if_bnxt.c
==============================================================================
--- head/sys/dev/bnxt/if_bnxt.c	Thu Jun 15 21:06:03 2017	(r319989)
+++ head/sys/dev/bnxt/if_bnxt.c	Thu Jun 15 21:14:48 2017	(r319990)
@@ -287,7 +287,7 @@ static driver_t bnxt_iflib_driver = {
  * iflib shared context
  */
 
-#define BNXT_DRIVER_VERSION	"1.0.0.0"
+#define BNXT_DRIVER_VERSION	"1.0.0.1"
 char bnxt_driver_version[] = BNXT_DRIVER_VERSION;
 extern struct if_txrx bnxt_txrx;
 static struct if_shared_ctx bnxt_sctx_init = {
@@ -1158,7 +1158,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
 			ifmr->ifm_active |= IFM_1000_SGMII;
 			break;
 		default:
-			ifmr->ifm_active |= IFM_UNKNOWN;
+                        /*
+                         * Workaround: 
+                         *    Don't return IFM_UNKNOWN until 
+                         *    Stratus return proper media_type 
+                         */  
+			ifmr->ifm_active |= IFM_1000_KX;
 			break;
 		}
 	break;
@@ -1198,7 +1203,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
 			ifmr->ifm_active |= IFM_10G_T;
 			break;
 		default:
-			ifmr->ifm_active |= IFM_UNKNOWN;
+                        /*
+                         * Workaround: 
+                         *    Don't return IFM_UNKNOWN until 
+                         *    Stratus return proper media_type 
+                         */  
+			ifmr->ifm_active |= IFM_10G_CR1;
 			break;
 		}
 		break;
@@ -1219,7 +1229,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
 			ifmr->ifm_active |= IFM_25G_SR;
 			break;
 		default:
-			ifmr->ifm_active |= IFM_UNKNOWN;
+                        /*
+                         * Workaround: 
+                         *    Don't return IFM_UNKNOWN until 
+                         *    Stratus return proper media_type 
+                         */  
+			ifmr->ifm_active |= IFM_25G_CR;
 			break;
 		}
 		break;
@@ -1255,7 +1270,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
 			ifmr->ifm_active |= IFM_50G_KR2;
 			break;
 		default:
-			ifmr->ifm_active |= IFM_UNKNOWN;
+                        /*
+                         * Workaround: 
+                         *    Don't return IFM_UNKNOWN until 
+                         *    Stratus return proper media_type 
+                         */  
+			ifmr->ifm_active |= IFM_50G_CR2;
 			break;
 		}
 		break;
@@ -1276,7 +1296,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
 			ifmr->ifm_active |= IFM_100G_SR4;
 			break;
 		default:
-			ifmr->ifm_active |= IFM_UNKNOWN;
+                        /*
+                         * Workaround: 
+                         *    Don't return IFM_UNKNOWN until 
+                         *    Stratus return proper media_type 
+                         */  
+			ifmr->ifm_active |= IFM_100G_CR4;
 			break;
 		}
 	default:
@@ -2031,9 +2056,6 @@ bnxt_add_media_types(struct bnxt_softc *softc)
 			ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0,
 			    NULL);
 		break;
-	case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN:
-		/* Auto only */
-		break;
 	case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4:
 	case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2:
 	case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR:
@@ -2114,6 +2136,32 @@ bnxt_add_media_types(struct bnxt_softc *softc)
 		if (supported & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB)
 			ifmedia_add(softc->media, IFM_ETHER | IFM_1000_SGMII, 0,
 			    NULL);
+		break;
+	case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN:
+        default:
+                /*
+                 * Workaround for Cumulus & Stratus 
+                 *  For Stratus: 
+                 *      media_type is being returned as 0x0
+                 *      Return support speeds as 10G, 25G, 50G & 100G
+                 *
+                 *  For Cumulus: 
+                 *      phy_type is being returned as 0x14 (PHY_TYPE_40G_BASECR4)
+                 *      Return support speeds as 1G, 10G, 25G & 50G
+                 */
+		if (pci_get_device(softc->dev) == BCM57454) {
+                        /* For Stratus: 10G, 25G, 50G & 100G */
+			ifmedia_add(softc->media, IFM_ETHER | IFM_100G_CR4, 0, NULL);
+			ifmedia_add(softc->media, IFM_ETHER | IFM_50G_CR2, 0, NULL);
+			ifmedia_add(softc->media, IFM_ETHER | IFM_25G_CR, 0, NULL);
+			ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0, NULL);
+		} else if (pci_get_device(softc->dev) == BCM57414) {
+                        /* For Cumulus: 1G, 10G, 25G & 50G */
+			ifmedia_add(softc->media, IFM_ETHER | IFM_50G_CR2, 0, NULL);
+			ifmedia_add(softc->media, IFM_ETHER | IFM_25G_CR, 0, NULL);
+			ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0, NULL);
+			ifmedia_add(softc->media, IFM_ETHER | IFM_1000_T, 0, NULL);
+                } 
 		break;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706152114.v5FLEmXZ074948>