diff options
-rw-r--r-- | drivers/net/bnx2.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index dbe487f2915d..d1e5e5d9e986 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -6751,32 +6751,15 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
6751 | if (cmd->autoneg == AUTONEG_ENABLE) { | 6751 | if (cmd->autoneg == AUTONEG_ENABLE) { |
6752 | autoneg |= AUTONEG_SPEED; | 6752 | autoneg |= AUTONEG_SPEED; |
6753 | 6753 | ||
6754 | cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED; | 6754 | advertising = cmd->advertising; |
6755 | 6755 | if (cmd->port == PORT_TP) { | |
6756 | /* allow advertising 1 speed */ | 6756 | advertising &= ETHTOOL_ALL_COPPER_SPEED; |
6757 | if ((cmd->advertising == ADVERTISED_10baseT_Half) || | 6757 | if (!advertising) |
6758 | (cmd->advertising == ADVERTISED_10baseT_Full) || | ||
6759 | (cmd->advertising == ADVERTISED_100baseT_Half) || | ||
6760 | (cmd->advertising == ADVERTISED_100baseT_Full)) { | ||
6761 | |||
6762 | if (cmd->port == PORT_FIBRE) | ||
6763 | goto err_out_unlock; | ||
6764 | |||
6765 | advertising = cmd->advertising; | ||
6766 | |||
6767 | } else if (cmd->advertising == ADVERTISED_2500baseX_Full) { | ||
6768 | if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE) || | ||
6769 | (cmd->port == PORT_TP)) | ||
6770 | goto err_out_unlock; | ||
6771 | } else if (cmd->advertising == ADVERTISED_1000baseT_Full) | ||
6772 | advertising = cmd->advertising; | ||
6773 | else if (cmd->advertising == ADVERTISED_1000baseT_Half) | ||
6774 | goto err_out_unlock; | ||
6775 | else { | ||
6776 | if (cmd->port == PORT_FIBRE) | ||
6777 | advertising = ETHTOOL_ALL_FIBRE_SPEED; | ||
6778 | else | ||
6779 | advertising = ETHTOOL_ALL_COPPER_SPEED; | 6758 | advertising = ETHTOOL_ALL_COPPER_SPEED; |
6759 | } else { | ||
6760 | advertising &= ETHTOOL_ALL_FIBRE_SPEED; | ||
6761 | if (!advertising) | ||
6762 | advertising = ETHTOOL_ALL_FIBRE_SPEED; | ||
6780 | } | 6763 | } |
6781 | advertising |= ADVERTISED_Autoneg; | 6764 | advertising |= ADVERTISED_Autoneg; |
6782 | } | 6765 | } |