aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 8e9b87be300..818723c9e67 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -778,9 +778,9 @@ static int bnx2x_ets_e3b0_set_cos_bw(struct bnx2x *bp,
778{ 778{
779 u32 nig_reg_adress_crd_weight = 0; 779 u32 nig_reg_adress_crd_weight = 0;
780 u32 pbf_reg_adress_crd_weight = 0; 780 u32 pbf_reg_adress_crd_weight = 0;
781 /* Calculate and set BW for this COS*/ 781 /* Calculate and set BW for this COS - use 1 instead of 0 for BW */
782 const u32 cos_bw_nig = (bw * min_w_val_nig) / total_bw; 782 const u32 cos_bw_nig = ((bw ? bw : 1) * min_w_val_nig) / total_bw;
783 const u32 cos_bw_pbf = (bw * min_w_val_pbf) / total_bw; 783 const u32 cos_bw_pbf = ((bw ? bw : 1) * min_w_val_pbf) / total_bw;
784 784
785 switch (cos_entry) { 785 switch (cos_entry) {
786 case 0: 786 case 0:
@@ -852,18 +852,12 @@ static int bnx2x_ets_e3b0_get_total_bw(
852 /* Calculate total BW requested */ 852 /* Calculate total BW requested */
853 for (cos_idx = 0; cos_idx < ets_params->num_of_cos; cos_idx++) { 853 for (cos_idx = 0; cos_idx < ets_params->num_of_cos; cos_idx++) {
854 if (bnx2x_cos_state_bw == ets_params->cos[cos_idx].state) { 854 if (bnx2x_cos_state_bw == ets_params->cos[cos_idx].state) {
855 855 *total_bw +=
856 if (0 == ets_params->cos[cos_idx].params.bw_params.bw) { 856 ets_params->cos[cos_idx].params.bw_params.bw;
857 DP(NETIF_MSG_LINK,
858 "bnx2x_ets_E3B0_config BW was set to 0\n");
859 return -EINVAL;
860 } 857 }
861 *total_bw +=
862 ets_params->cos[cos_idx].params.bw_params.bw;
863 }
864 } 858 }
865 859
866 /*Check taotl BW is valid */ 860 /* Check total BW is valid */
867 if ((100 != *total_bw) || (0 == *total_bw)) { 861 if ((100 != *total_bw) || (0 == *total_bw)) {
868 if (0 == *total_bw) { 862 if (0 == *total_bw) {
869 DP(NETIF_MSG_LINK, 863 DP(NETIF_MSG_LINK,
@@ -1726,7 +1720,7 @@ static int bnx2x_xmac_enable(struct link_params *params,
1726 1720
1727 /* Check loopback mode */ 1721 /* Check loopback mode */
1728 if (lb) 1722 if (lb)
1729 val |= XMAC_CTRL_REG_CORE_LOCAL_LPBK; 1723 val |= XMAC_CTRL_REG_LINE_LOCAL_LPBK;
1730 REG_WR(bp, xmac_base + XMAC_REG_CTRL, val); 1724 REG_WR(bp, xmac_base + XMAC_REG_CTRL, val);
1731 bnx2x_set_xumac_nig(params, 1725 bnx2x_set_xumac_nig(params,
1732 ((vars->flow_ctrl & BNX2X_FLOW_CTRL_TX) != 0), 1); 1726 ((vars->flow_ctrl & BNX2X_FLOW_CTRL_TX) != 0), 1);
@@ -3630,6 +3624,12 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3630 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, 3624 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3631 MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT1, val16); 3625 MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT1, val16);
3632 3626
3627 /* Advertised and set FEC (Forward Error Correction) */
3628 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3629 MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT2,
3630 (MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_ABILITY |
3631 MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_REQ));
3632
3633 /* Enable CL37 BAM */ 3633 /* Enable CL37 BAM */
3634 if (REG_RD(bp, params->shmem_base + 3634 if (REG_RD(bp, params->shmem_base +
3635 offsetof(struct shmem_region, dev_info. 3635 offsetof(struct shmem_region, dev_info.
@@ -5925,7 +5925,7 @@ int bnx2x_set_led(struct link_params *params,
5925 (tmp | EMAC_LED_OVERRIDE)); 5925 (tmp | EMAC_LED_OVERRIDE));
5926 /* 5926 /*
5927 * return here without enabling traffic 5927 * return here without enabling traffic
5928 * LED blink andsetting rate in ON mode. 5928 * LED blink and setting rate in ON mode.
5929 * In oper mode, enabling LED blink 5929 * In oper mode, enabling LED blink
5930 * and setting rate is needed. 5930 * and setting rate is needed.
5931 */ 5931 */
@@ -5937,7 +5937,11 @@ int bnx2x_set_led(struct link_params *params,
5937 * This is a work-around for HW issue found when link 5937 * This is a work-around for HW issue found when link
5938 * is up in CL73 5938 * is up in CL73
5939 */ 5939 */
5940 REG_WR(bp, NIG_REG_LED_10G_P0 + port*4, 1); 5940 if ((!CHIP_IS_E3(bp)) ||
5941 (CHIP_IS_E3(bp) &&
5942 mode == LED_MODE_ON))
5943 REG_WR(bp, NIG_REG_LED_10G_P0 + port*4, 1);
5944
5941 if (CHIP_IS_E1x(bp) || 5945 if (CHIP_IS_E1x(bp) ||
5942 CHIP_IS_E2(bp) || 5946 CHIP_IS_E2(bp) ||
5943 (mode == LED_MODE_ON)) 5947 (mode == LED_MODE_ON))
@@ -10644,8 +10648,7 @@ static struct bnx2x_phy phy_warpcore = {
10644 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT, 10648 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
10645 .addr = 0xff, 10649 .addr = 0xff,
10646 .def_md_devad = 0, 10650 .def_md_devad = 0,
10647 .flags = (FLAGS_HW_LOCK_REQUIRED | 10651 .flags = FLAGS_HW_LOCK_REQUIRED,
10648 FLAGS_TX_ERROR_CHECK),
10649 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10652 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10650 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10653 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10651 .mdio_ctrl = 0, 10654 .mdio_ctrl = 0,
@@ -10771,8 +10774,7 @@ static struct bnx2x_phy phy_8706 = {
10771 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706, 10774 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706,
10772 .addr = 0xff, 10775 .addr = 0xff,
10773 .def_md_devad = 0, 10776 .def_md_devad = 0,
10774 .flags = (FLAGS_INIT_XGXS_FIRST | 10777 .flags = FLAGS_INIT_XGXS_FIRST,
10775 FLAGS_TX_ERROR_CHECK),
10776 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10778 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10777 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10779 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10778 .mdio_ctrl = 0, 10780 .mdio_ctrl = 0,
@@ -10803,8 +10805,7 @@ static struct bnx2x_phy phy_8726 = {
10803 .addr = 0xff, 10805 .addr = 0xff,
10804 .def_md_devad = 0, 10806 .def_md_devad = 0,
10805 .flags = (FLAGS_HW_LOCK_REQUIRED | 10807 .flags = (FLAGS_HW_LOCK_REQUIRED |
10806 FLAGS_INIT_XGXS_FIRST | 10808 FLAGS_INIT_XGXS_FIRST),
10807 FLAGS_TX_ERROR_CHECK),
10808 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10809 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10809 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10810 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10810 .mdio_ctrl = 0, 10811 .mdio_ctrl = 0,
@@ -10835,8 +10836,7 @@ static struct bnx2x_phy phy_8727 = {
10835 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727, 10836 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727,
10836 .addr = 0xff, 10837 .addr = 0xff,
10837 .def_md_devad = 0, 10838 .def_md_devad = 0,
10838 .flags = (FLAGS_FAN_FAILURE_DET_REQ | 10839 .flags = FLAGS_FAN_FAILURE_DET_REQ,
10839 FLAGS_TX_ERROR_CHECK),
10840 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10840 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10841 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff}, 10841 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
10842 .mdio_ctrl = 0, 10842 .mdio_ctrl = 0,