Skip to content

Commit

Permalink
bnxt_en: Extend autoneg to all speeds.
Browse files Browse the repository at this point in the history
Allow all autoneg speeds aupported by firmware to be advertised.  If
the advertising parameter is 0, then all supported speeds will be
advertised.

Remove BNXT_ALL_COPPER_ETHTOOL_SPEED which is no longer used as all
supported speeds can be advertised.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Mar 8, 2016
1 parent 4b32cac commit f1a082a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
4 changes: 0 additions & 4 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,10 +757,6 @@ struct bnxt_ntuple_filter {
#define BNXT_FLTR_UPDATE 1
};

#define BNXT_ALL_COPPER_ETHTOOL_SPEED \
(ADVERTISED_100baseT_Full | ADVERTISED_1000baseT_Full | \
ADVERTISED_10000baseT_Full)

struct bnxt_link_info {
u8 media_type;
u8 transceiver;
Expand Down
14 changes: 4 additions & 10 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,16 +696,10 @@ static int bnxt_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
return rc;

if (cmd->autoneg == AUTONEG_ENABLE) {
if (link_info->media_type != PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP) {
netdev_err(dev, "Media type doesn't support autoneg\n");
rc = -EINVAL;
goto set_setting_exit;
}
if (cmd->advertising & ~(BNXT_ALL_COPPER_ETHTOOL_SPEED |
ADVERTISED_Autoneg |
ADVERTISED_TP |
ADVERTISED_Pause |
ADVERTISED_Asym_Pause)) {
u32 supported_spds = bnxt_fw_to_ethtool_support_spds(link_info);

if (cmd->advertising & ~(supported_spds | ADVERTISED_Autoneg |
ADVERTISED_TP | ADVERTISED_FIBRE)) {
netdev_err(dev, "Unsupported advertising mask (adv: 0x%x)\n",
cmd->advertising);
rc = -EINVAL;
Expand Down

0 comments on commit f1a082a

Please sign in to comment.