Index: if_bnxt.c =================================================================== --- if_bnxt.c +++ if_bnxt.c @@ -287,7 +287,7 @@ * 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 = { @@ -1152,7 +1152,12 @@ 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; @@ -1192,7 +1197,12 @@ 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; @@ -1213,7 +1223,12 @@ 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; @@ -1249,7 +1264,12 @@ 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; @@ -1270,7 +1290,12 @@ 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: @@ -2023,9 +2048,6 @@ 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: @@ -2107,6 +2129,32 @@ 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; } return;