diff options
author | Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com> | 2014-03-21 03:37:24 -0700 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-21 03:37:24 -0700 |
commit | 0f49da0e78f445d7a7e3e566ae4871c9428b0448 (patch) | |
tree | 94c43b2269076a7a50aa04158b0a47be0ac4e287 /drivers/net/ethernet/intel/igb/igb_ethtool.c | |
parent | db41b87db93e1ef28b6e9c4035f1cdc17e2eceb2 (diff) | |
download | linux-stable-0f49da0e78f445d7a7e3e566ae4871c9428b0448.tar.gz linux-stable-0f49da0e78f445d7a7e3e566ae4871c9428b0448.tar.bz2 linux-stable-0f49da0e78f445d7a7e3e566ae4871c9428b0448.zip |
igb: specify phc_index of 82575 for get_ts_info
82575 has only software timestamping capability and it has
no PTP Hardware Clocks. Therefore, -1 has to be specified
to the phc_index for ethtool's get_ts_info, otherwise a wrong
value will be set to the phc_index.
v2: move the if (adapter->ptp_clock) section specifying phc_index
to above the switch statement as suggested by Matthew Vick.
adapter->ptpclock will always be NULL for 82575.
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
Acked-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_ethtool.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index d5c3e6572f2f..e5570acbeea8 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -2353,6 +2353,11 @@ static int igb_get_ts_info(struct net_device *dev, { struct igb_adapter *adapter = netdev_priv(dev); + if (adapter->ptp_clock) + info->phc_index = ptp_clock_index(adapter->ptp_clock); + else + info->phc_index = -1; + switch (adapter->hw.mac.type) { case e1000_82575: info->so_timestamping = @@ -2374,11 +2379,6 @@ static int igb_get_ts_info(struct net_device *dev, SOF_TIMESTAMPING_RX_HARDWARE | SOF_TIMESTAMPING_RAW_HARDWARE; - if (adapter->ptp_clock) - info->phc_index = ptp_clock_index(adapter->ptp_clock); - else - info->phc_index = -1; - info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON); |