diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c')
| -rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 48ed005ba73f..76b9052a961c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
| @@ -257,14 +257,15 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
| 257 | { | 257 | { |
| 258 | struct bnx2x *bp = netdev_priv(dev); | 258 | struct bnx2x *bp = netdev_priv(dev); |
| 259 | int cfg_idx = bnx2x_get_link_cfg_idx(bp); | 259 | int cfg_idx = bnx2x_get_link_cfg_idx(bp); |
| 260 | u32 media_type; | ||
| 260 | 261 | ||
| 261 | /* Dual Media boards present all available port types */ | 262 | /* Dual Media boards present all available port types */ |
| 262 | cmd->supported = bp->port.supported[cfg_idx] | | 263 | cmd->supported = bp->port.supported[cfg_idx] | |
| 263 | (bp->port.supported[cfg_idx ^ 1] & | 264 | (bp->port.supported[cfg_idx ^ 1] & |
| 264 | (SUPPORTED_TP | SUPPORTED_FIBRE)); | 265 | (SUPPORTED_TP | SUPPORTED_FIBRE)); |
| 265 | cmd->advertising = bp->port.advertising[cfg_idx]; | 266 | cmd->advertising = bp->port.advertising[cfg_idx]; |
| 266 | if (bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type == | 267 | media_type = bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type; |
| 267 | ETH_PHY_SFP_1G_FIBER) { | 268 | if (media_type == ETH_PHY_SFP_1G_FIBER) { |
| 268 | cmd->supported &= ~(SUPPORTED_10000baseT_Full); | 269 | cmd->supported &= ~(SUPPORTED_10000baseT_Full); |
| 269 | cmd->advertising &= ~(ADVERTISED_10000baseT_Full); | 270 | cmd->advertising &= ~(ADVERTISED_10000baseT_Full); |
| 270 | } | 271 | } |
| @@ -312,12 +313,26 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
| 312 | cmd->lp_advertising |= ADVERTISED_100baseT_Full; | 313 | cmd->lp_advertising |= ADVERTISED_100baseT_Full; |
| 313 | if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE) | 314 | if (status & LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE) |
| 314 | cmd->lp_advertising |= ADVERTISED_1000baseT_Half; | 315 | cmd->lp_advertising |= ADVERTISED_1000baseT_Half; |
| 315 | if (status & LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE) | 316 | if (status & LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE) { |
| 316 | cmd->lp_advertising |= ADVERTISED_1000baseT_Full; | 317 | if (media_type == ETH_PHY_KR) { |
| 318 | cmd->lp_advertising |= | ||
| 319 | ADVERTISED_1000baseKX_Full; | ||
| 320 | } else { | ||
| 321 | cmd->lp_advertising |= | ||
| 322 | ADVERTISED_1000baseT_Full; | ||
| 323 | } | ||
| 324 | } | ||
| 317 | if (status & LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE) | 325 | if (status & LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE) |
| 318 | cmd->lp_advertising |= ADVERTISED_2500baseX_Full; | 326 | cmd->lp_advertising |= ADVERTISED_2500baseX_Full; |
| 319 | if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE) | 327 | if (status & LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE) { |
| 320 | cmd->lp_advertising |= ADVERTISED_10000baseT_Full; | 328 | if (media_type == ETH_PHY_KR) { |
| 329 | cmd->lp_advertising |= | ||
| 330 | ADVERTISED_10000baseKR_Full; | ||
| 331 | } else { | ||
| 332 | cmd->lp_advertising |= | ||
| 333 | ADVERTISED_10000baseT_Full; | ||
| 334 | } | ||
| 335 | } | ||
| 321 | if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE) | 336 | if (status & LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE) |
| 322 | cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full; | 337 | cmd->lp_advertising |= ADVERTISED_20000baseKR2_Full; |
| 323 | } | 338 | } |
| @@ -564,15 +579,20 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
| 564 | return -EINVAL; | 579 | return -EINVAL; |
| 565 | } | 580 | } |
| 566 | 581 | ||
| 567 | if (!(bp->port.supported[cfg_idx] & | 582 | if (bp->port.supported[cfg_idx] & |
| 568 | SUPPORTED_1000baseT_Full)) { | 583 | SUPPORTED_1000baseT_Full) { |
| 584 | advertising = (ADVERTISED_1000baseT_Full | | ||
| 585 | ADVERTISED_TP); | ||
| 586 | |||
| 587 | } else if (bp->port.supported[cfg_idx] & | ||
| 588 | SUPPORTED_1000baseKX_Full) { | ||
| 589 | advertising = ADVERTISED_1000baseKX_Full; | ||
| 590 | } else { | ||
| 569 | DP(BNX2X_MSG_ETHTOOL, | 591 | DP(BNX2X_MSG_ETHTOOL, |
| 570 | "1G full not supported\n"); | 592 | "1G full not supported\n"); |
| 571 | return -EINVAL; | 593 | return -EINVAL; |
| 572 | } | 594 | } |
| 573 | 595 | ||
| 574 | advertising = (ADVERTISED_1000baseT_Full | | ||
| 575 | ADVERTISED_TP); | ||
| 576 | break; | 596 | break; |
| 577 | 597 | ||
| 578 | case SPEED_2500: | 598 | case SPEED_2500: |
| @@ -600,17 +620,22 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
| 600 | return -EINVAL; | 620 | return -EINVAL; |
| 601 | } | 621 | } |
| 602 | phy_idx = bnx2x_get_cur_phy_idx(bp); | 622 | phy_idx = bnx2x_get_cur_phy_idx(bp); |
| 603 | if (!(bp->port.supported[cfg_idx] | 623 | if ((bp->port.supported[cfg_idx] & |
| 604 | & SUPPORTED_10000baseT_Full) || | 624 | SUPPORTED_10000baseT_Full) && |
| 605 | (bp->link_params.phy[phy_idx].media_type == | 625 | (bp->link_params.phy[phy_idx].media_type != |
| 606 | ETH_PHY_SFP_1G_FIBER)) { | 626 | ETH_PHY_SFP_1G_FIBER)) { |
| 627 | advertising = (ADVERTISED_10000baseT_Full | | ||
| 628 | ADVERTISED_FIBRE); | ||
| 629 | } else if (bp->port.supported[cfg_idx] & | ||
| 630 | SUPPORTED_10000baseKR_Full) { | ||
| 631 | advertising = (ADVERTISED_10000baseKR_Full | | ||
| 632 | ADVERTISED_FIBRE); | ||
| 633 | } else { | ||
| 607 | DP(BNX2X_MSG_ETHTOOL, | 634 | DP(BNX2X_MSG_ETHTOOL, |
| 608 | "10G full not supported\n"); | 635 | "10G full not supported\n"); |
| 609 | return -EINVAL; | 636 | return -EINVAL; |
| 610 | } | 637 | } |
| 611 | 638 | ||
| 612 | advertising = (ADVERTISED_10000baseT_Full | | ||
| 613 | ADVERTISED_FIBRE); | ||
| 614 | break; | 639 | break; |
| 615 | 640 | ||
| 616 | default: | 641 | default: |
| @@ -633,6 +658,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
| 633 | bp->link_params.multi_phy_config = new_multi_phy_config; | 658 | bp->link_params.multi_phy_config = new_multi_phy_config; |
| 634 | if (netif_running(dev)) { | 659 | if (netif_running(dev)) { |
| 635 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 660 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
| 661 | bnx2x_force_link_reset(bp); | ||
| 636 | bnx2x_link_set(bp); | 662 | bnx2x_link_set(bp); |
| 637 | } | 663 | } |
| 638 | 664 | ||
| @@ -1204,6 +1230,7 @@ static int bnx2x_acquire_nvram_lock(struct bnx2x *bp) | |||
| 1204 | if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) { | 1230 | if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) { |
| 1205 | DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, | 1231 | DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, |
| 1206 | "cannot get access to nvram interface\n"); | 1232 | "cannot get access to nvram interface\n"); |
| 1233 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_NVRAM); | ||
| 1207 | return -EBUSY; | 1234 | return -EBUSY; |
| 1208 | } | 1235 | } |
| 1209 | 1236 | ||
| @@ -1944,6 +1971,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev, | |||
| 1944 | 1971 | ||
| 1945 | if (netif_running(dev)) { | 1972 | if (netif_running(dev)) { |
| 1946 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 1973 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
| 1974 | bnx2x_force_link_reset(bp); | ||
| 1947 | bnx2x_link_set(bp); | 1975 | bnx2x_link_set(bp); |
| 1948 | } | 1976 | } |
| 1949 | 1977 | ||
