aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/intel/igc/igc_ptp.c
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@intel.com>2020-09-02 16:36:56 -0700
committerTony Nguyen <anthony.l.nguyen@intel.com>2020-09-28 14:42:46 -0700
commitfec49eb4e00ab635ca863ff9cf8c64a44cf168f2 (patch)
treef6aa336c8f6789db7a93949206c096a74b259e39 /drivers/net/ethernet/intel/igc/igc_ptp.c
parentigc: Remove reset disable flag (diff)
downloadwireguard-linux-fec49eb4e00ab635ca863ff9cf8c64a44cf168f2.tar.xz
wireguard-linux-fec49eb4e00ab635ca863ff9cf8c64a44cf168f2.zip
igc: Export a way to read the PTP timer
The next patch will need a way to retrieve the current timestamp from the NIC's PTP clock. The 'i225' suffix is removed, if anything model specific is needed, those specifics should be hidden by this function. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_ptp.c')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_ptp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 49abefdab26c..ac0b9c85da7c 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -17,8 +17,7 @@
#define IGC_PTP_TX_TIMEOUT (HZ * 15)
/* SYSTIM read access for I225 */
-static void igc_ptp_read_i225(struct igc_adapter *adapter,
- struct timespec64 *ts)
+void igc_ptp_read(struct igc_adapter *adapter, struct timespec64 *ts)
{
struct igc_hw *hw = &adapter->hw;
u32 sec, nsec;
@@ -75,7 +74,7 @@ static int igc_ptp_adjtime_i225(struct ptp_clock_info *ptp, s64 delta)
spin_lock_irqsave(&igc->tmreg_lock, flags);
- igc_ptp_read_i225(igc, &now);
+ igc_ptp_read(igc, &now);
now = timespec64_add(now, then);
igc_ptp_write_i225(igc, (const struct timespec64 *)&now);
@@ -517,7 +516,7 @@ void igc_ptp_init(struct igc_adapter *adapter)
static void igc_ptp_time_save(struct igc_adapter *adapter)
{
- igc_ptp_read_i225(adapter, &adapter->prev_ptp_time);
+ igc_ptp_read(adapter, &adapter->prev_ptp_time);
adapter->ptp_reset_start = ktime_get();
}