diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_clock.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_clock.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c index 285fccf01404..999014413b1a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c @@ -35,83 +35,6 @@ #include "mlx4_en.h" -int mlx4_en_reset_config(struct net_device *dev, - struct hwtstamp_config ts_config, - netdev_features_t features) -{ - struct mlx4_en_priv *priv = netdev_priv(dev); - struct mlx4_en_dev *mdev = priv->mdev; - int port_up = 0; - int err = 0; - - if (priv->hwtstamp_config.tx_type == ts_config.tx_type && - priv->hwtstamp_config.rx_filter == ts_config.rx_filter && - !DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX)) - return 0; /* Nothing to change */ - - if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX) && - (features & NETIF_F_HW_VLAN_CTAG_RX) && - (priv->hwtstamp_config.rx_filter != HWTSTAMP_FILTER_NONE)) { - en_warn(priv, "Can't turn ON rx vlan offload while time-stamping rx filter is ON\n"); - return -EINVAL; - } - - mutex_lock(&mdev->state_lock); - if (priv->port_up) { - port_up = 1; - mlx4_en_stop_port(dev, 1); - } - - mlx4_en_free_resources(priv); - - en_warn(priv, "Changing device configuration rx filter(%x) rx vlan(%x)\n", - ts_config.rx_filter, !!(features & NETIF_F_HW_VLAN_CTAG_RX)); - - priv->hwtstamp_config.tx_type = ts_config.tx_type; - priv->hwtstamp_config.rx_filter = ts_config.rx_filter; - - if (DEV_FEATURE_CHANGED(dev, features, NETIF_F_HW_VLAN_CTAG_RX)) { - if (features & NETIF_F_HW_VLAN_CTAG_RX) - dev->features |= NETIF_F_HW_VLAN_CTAG_RX; - else - dev->features &= ~NETIF_F_HW_VLAN_CTAG_RX; - } else if (ts_config.rx_filter == HWTSTAMP_FILTER_NONE) { - /* RX time-stamping is OFF, update the RX vlan offload - * to the latest wanted state - */ - if (dev->wanted_features & NETIF_F_HW_VLAN_CTAG_RX) - dev->features |= NETIF_F_HW_VLAN_CTAG_RX; - else - dev->features &= ~NETIF_F_HW_VLAN_CTAG_RX; - } - - /* RX vlan offload and RX time-stamping can't co-exist ! - * Regardless of the caller's choice, - * Turn Off RX vlan offload in case of time-stamping is ON - */ - if (ts_config.rx_filter != HWTSTAMP_FILTER_NONE) { - if (dev->features & NETIF_F_HW_VLAN_CTAG_RX) - en_warn(priv, "Turning off RX vlan offload since RX time-stamping is ON\n"); - dev->features &= ~NETIF_F_HW_VLAN_CTAG_RX; - } - - err = mlx4_en_alloc_resources(priv); - if (err) { - en_err(priv, "Failed reallocating port resources\n"); - goto out; - } - if (port_up) { - err = mlx4_en_start_port(dev); - if (err) - en_err(priv, "Failed starting port\n"); - } - -out: - mutex_unlock(&mdev->state_lock); - netdev_features_change(dev); - return err; -} - /* mlx4_en_read_clock - read raw cycle counter (to be used by time counter) */ static cycle_t mlx4_en_read_clock(const struct cyclecounter *tc) |