aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2012-10-24 03:26:02 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-11-22 04:39:43 -0500
commitdb2adc2df2c2f4250fead3e8418be2e387a5278f (patch)
tree9b6dbb1a55525bb68eff68a246619f7f578a6fd1 /drivers/net/ethernet/intel
parentf3444d8b35e9a96e1be9c18a735358f43a9949b0 (diff)
ixgbe: ethtool correctly identify autoneg setting
This patch enables ethtool to correctly identify flow control (pause frame) auto negotiation, as well as disallow enabling it when it is not supported. The ixgbe_device_supports_autoneg_fc function is exported and used for this purpose. There is also one minor cleanup of the device_supports_autoneg_fc by removing an unnecessary return statement. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.h1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c5
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c3
4 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 8f285edb5094..5af1eebc32f1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -65,13 +65,12 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw);
65 * function check the device id to see if the associated phy supports 65 * function check the device id to see if the associated phy supports
66 * autoneg flow control. 66 * autoneg flow control.
67 **/ 67 **/
68static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw) 68s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
69{ 69{
70 70
71 switch (hw->device_id) { 71 switch (hw->device_id) {
72 case IXGBE_DEV_ID_X540T: 72 case IXGBE_DEV_ID_X540T:
73 case IXGBE_DEV_ID_X540T1: 73 case IXGBE_DEV_ID_X540T1:
74 return 0;
75 case IXGBE_DEV_ID_82599_T3_LOM: 74 case IXGBE_DEV_ID_82599_T3_LOM:
76 return 0; 75 return 0;
77 default: 76 default:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
index 587db4728072..1b65b6cc07bf 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
@@ -78,6 +78,7 @@ s32 ixgbe_disable_rx_buff_generic(struct ixgbe_hw *hw);
78s32 ixgbe_enable_rx_buff_generic(struct ixgbe_hw *hw); 78s32 ixgbe_enable_rx_buff_generic(struct ixgbe_hw *hw);
79s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval); 79s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
80s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw); 80s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw);
81s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw);
81void ixgbe_fc_autoneg(struct ixgbe_hw *hw); 82void ixgbe_fc_autoneg(struct ixgbe_hw *hw);
82 83
83s32 ixgbe_validate_mac_addr(u8 *mac_addr); 84s32 ixgbe_validate_mac_addr(u8 *mac_addr);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index a545728e100c..326858424345 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -383,6 +383,11 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
383 (adapter->flags & IXGBE_FLAG_DCB_ENABLED)) 383 (adapter->flags & IXGBE_FLAG_DCB_ENABLED))
384 return -EINVAL; 384 return -EINVAL;
385 385
386 /* some devices do not support autoneg of link flow control */
387 if ((pause->autoneg == AUTONEG_ENABLE) &&
388 (ixgbe_device_supports_autoneg_fc(hw) != 0))
389 return -EINVAL;
390
386 fc.disable_fc_autoneg = (pause->autoneg != AUTONEG_ENABLE); 391 fc.disable_fc_autoneg = (pause->autoneg != AUTONEG_ENABLE);
387 392
388 if ((pause->rx_pause && pause->tx_pause) || pause->autoneg) 393 if ((pause->rx_pause && pause->tx_pause) || pause->autoneg)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 004ea6caf45f..4f67fdc0d0d8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4567,7 +4567,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
4567 ixgbe_pbthresh_setup(adapter); 4567 ixgbe_pbthresh_setup(adapter);
4568 hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE; 4568 hw->fc.pause_time = IXGBE_DEFAULT_FCPAUSE;
4569 hw->fc.send_xon = true; 4569 hw->fc.send_xon = true;
4570 hw->fc.disable_fc_autoneg = false; 4570 hw->fc.disable_fc_autoneg =
4571 (ixgbe_device_supports_autoneg_fc(hw) == 0) ? false : true;
4571 4572
4572#ifdef CONFIG_PCI_IOV 4573#ifdef CONFIG_PCI_IOV
4573 /* assign number of SR-IOV VFs */ 4574 /* assign number of SR-IOV VFs */