Lines Matching +full:ptp +full:- +full:timer

1 // SPDX-License-Identifier: GPL-2.0
27 struct igc_hw *hw = &adapter->hw; in igc_ptp_read()
34 ts->tv_sec = sec; in igc_ptp_read()
35 ts->tv_nsec = nsec; in igc_ptp_read()
41 struct igc_hw *hw = &adapter->hw; in igc_ptp_write_i225()
43 wr32(IGC_SYSTIML, ts->tv_nsec); in igc_ptp_write_i225()
44 wr32(IGC_SYSTIMH, ts->tv_sec); in igc_ptp_write_i225()
47 static int igc_ptp_adjfine_i225(struct ptp_clock_info *ptp, long scaled_ppm) in igc_ptp_adjfine_i225() argument
49 struct igc_adapter *igc = container_of(ptp, struct igc_adapter, in igc_ptp_adjfine_i225()
51 struct igc_hw *hw = &igc->hw; in igc_ptp_adjfine_i225()
58 scaled_ppm = -scaled_ppm; in igc_ptp_adjfine_i225()
73 static int igc_ptp_adjtime_i225(struct ptp_clock_info *ptp, s64 delta) in igc_ptp_adjtime_i225() argument
75 struct igc_adapter *igc = container_of(ptp, struct igc_adapter, in igc_ptp_adjtime_i225()
80 spin_lock_irqsave(&igc->tmreg_lock, flags); in igc_ptp_adjtime_i225()
86 spin_unlock_irqrestore(&igc->tmreg_lock, flags); in igc_ptp_adjtime_i225()
91 static int igc_ptp_gettimex64_i225(struct ptp_clock_info *ptp, in igc_ptp_gettimex64_i225() argument
95 struct igc_adapter *igc = container_of(ptp, struct igc_adapter, in igc_ptp_gettimex64_i225()
97 struct igc_hw *hw = &igc->hw; in igc_ptp_gettimex64_i225()
100 spin_lock_irqsave(&igc->tmreg_lock, flags); in igc_ptp_gettimex64_i225()
103 ts->tv_nsec = rd32(IGC_SYSTIML); in igc_ptp_gettimex64_i225()
104 ts->tv_sec = rd32(IGC_SYSTIMH); in igc_ptp_gettimex64_i225()
107 spin_unlock_irqrestore(&igc->tmreg_lock, flags); in igc_ptp_gettimex64_i225()
112 static int igc_ptp_settime_i225(struct ptp_clock_info *ptp, in igc_ptp_settime_i225() argument
115 struct igc_adapter *igc = container_of(ptp, struct igc_adapter, in igc_ptp_settime_i225()
119 spin_lock_irqsave(&igc->tmreg_lock, flags); in igc_ptp_settime_i225()
123 spin_unlock_irqrestore(&igc->tmreg_lock, flags); in igc_ptp_settime_i225()
175 struct igc_hw *hw = &igc->hw; in igc_pin_perout()
221 struct igc_hw *hw = &igc->hw; in igc_pin_extts()
246 static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp, in igc_ptp_feature_enable_i225() argument
250 container_of(ptp, struct igc_adapter, ptp_caps); in igc_ptp_feature_enable_i225()
251 struct igc_hw *hw = &igc->hw; in igc_ptp_feature_enable_i225()
254 int use_freq = 0, pin = -1; in igc_ptp_feature_enable_i225()
258 switch (rq->type) { in igc_ptp_feature_enable_i225()
261 if (rq->extts.flags & ~(PTP_ENABLE_FEATURE | in igc_ptp_feature_enable_i225()
265 return -EOPNOTSUPP; in igc_ptp_feature_enable_i225()
268 if ((rq->extts.flags & PTP_STRICT_FLAGS) && in igc_ptp_feature_enable_i225()
269 (rq->extts.flags & PTP_ENABLE_FEATURE) && in igc_ptp_feature_enable_i225()
270 (rq->extts.flags & PTP_EXTTS_EDGES) != PTP_EXTTS_EDGES) in igc_ptp_feature_enable_i225()
271 return -EOPNOTSUPP; in igc_ptp_feature_enable_i225()
274 pin = ptp_find_pin(igc->ptp_clock, PTP_PF_EXTTS, in igc_ptp_feature_enable_i225()
275 rq->extts.index); in igc_ptp_feature_enable_i225()
277 return -EBUSY; in igc_ptp_feature_enable_i225()
279 if (rq->extts.index == 1) { in igc_ptp_feature_enable_i225()
286 spin_lock_irqsave(&igc->tmreg_lock, flags); in igc_ptp_feature_enable_i225()
290 igc_pin_extts(igc, rq->extts.index, pin); in igc_ptp_feature_enable_i225()
299 spin_unlock_irqrestore(&igc->tmreg_lock, flags); in igc_ptp_feature_enable_i225()
304 if (rq->perout.flags) in igc_ptp_feature_enable_i225()
305 return -EOPNOTSUPP; in igc_ptp_feature_enable_i225()
308 pin = ptp_find_pin(igc->ptp_clock, PTP_PF_PEROUT, in igc_ptp_feature_enable_i225()
309 rq->perout.index); in igc_ptp_feature_enable_i225()
311 return -EBUSY; in igc_ptp_feature_enable_i225()
313 ts.tv_sec = rq->perout.period.sec; in igc_ptp_feature_enable_i225()
314 ts.tv_nsec = rq->perout.period.nsec; in igc_ptp_feature_enable_i225()
320 return -EINVAL; in igc_ptp_feature_enable_i225()
324 if (rq->perout.index == 1) { in igc_ptp_feature_enable_i225()
347 spin_lock_irqsave(&igc->tmreg_lock, flags); in igc_ptp_feature_enable_i225()
350 if (rq->perout.index == 1) { in igc_ptp_feature_enable_i225()
361 int i = rq->perout.index; in igc_ptp_feature_enable_i225()
373 * wrap up and the timer keeps ticking as we program the in igc_ptp_feature_enable_i225()
378 if (rq->perout.start.sec < safe_start.tv_sec) in igc_ptp_feature_enable_i225()
379 igc->perout[i].start.tv_sec = safe_start.tv_sec; in igc_ptp_feature_enable_i225()
381 igc->perout[i].start.tv_sec = rq->perout.start.sec; in igc_ptp_feature_enable_i225()
382 igc->perout[i].start.tv_nsec = rq->perout.start.nsec; in igc_ptp_feature_enable_i225()
383 igc->perout[i].period.tv_sec = ts.tv_sec; in igc_ptp_feature_enable_i225()
384 igc->perout[i].period.tv_nsec = ts.tv_nsec; in igc_ptp_feature_enable_i225()
385 wr32(trgttimh, (u32)igc->perout[i].start.tv_sec); in igc_ptp_feature_enable_i225()
386 /* For now, always select timer 0 as source. */ in igc_ptp_feature_enable_i225()
387 wr32(trgttiml, (u32)(igc->perout[i].start.tv_nsec | in igc_ptp_feature_enable_i225()
396 spin_unlock_irqrestore(&igc->tmreg_lock, flags); in igc_ptp_feature_enable_i225()
400 spin_lock_irqsave(&igc->tmreg_lock, flags); in igc_ptp_feature_enable_i225()
406 igc->pps_sys_wrap_on = on; in igc_ptp_feature_enable_i225()
408 spin_unlock_irqrestore(&igc->tmreg_lock, flags); in igc_ptp_feature_enable_i225()
415 return -EOPNOTSUPP; in igc_ptp_feature_enable_i225()
418 static int igc_ptp_verify_pin(struct ptp_clock_info *ptp, unsigned int pin, in igc_ptp_verify_pin() argument
427 return -1; in igc_ptp_verify_pin()
433 * igc_ptp_systim_to_hwtstamp - convert system time value to HW timestamp
447 switch (adapter->hw.mac.type) { in igc_ptp_systim_to_hwtstamp()
451 hwtstamps->hwtstamp = ktime_set(systim >> 32, in igc_ptp_systim_to_hwtstamp()
455 return -EINVAL; in igc_ptp_systim_to_hwtstamp()
461 * igc_ptp_rx_pktstamp - Retrieve timestamp from Rx packet buffer
463 * @buf: Pointer to start of timestamp in HW format (2 32-bit words)
482 switch (adapter->link_speed) { in igc_ptp_rx_pktstamp()
497 netdev_warn_once(adapter->netdev, "Imprecise timestamp\n"); in igc_ptp_rx_pktstamp()
506 struct igc_hw *hw = &adapter->hw; in igc_ptp_disable_rx_timestamp()
512 for (i = 0; i < adapter->num_rx_queues; i++) { in igc_ptp_disable_rx_timestamp()
525 struct igc_hw *hw = &adapter->hw; in igc_ptp_enable_rx_timestamp()
533 for (i = 0; i < adapter->num_rx_queues; i++) { in igc_ptp_enable_rx_timestamp()
535 /* Enable retrieving timestamps from timer 0, the in igc_ptp_enable_rx_timestamp()
536 * "adjustable clock" and timer 1 the "free running in igc_ptp_enable_rx_timestamp()
552 if (tstamp->buffer_type == IGC_TX_BUFFER_TYPE_XSK) { in igc_ptp_free_tx_buffer()
554 tstamp->xsk_tx_buffer->xsk_pending_ts = false; in igc_ptp_free_tx_buffer()
556 /* Note: tstamp->skb and tstamp->xsk_tx_buffer are in union. in igc_ptp_free_tx_buffer()
557 * By setting tstamp->xsk_tx_buffer to NULL, tstamp->skb will in igc_ptp_free_tx_buffer()
560 tstamp->xsk_tx_buffer = NULL; in igc_ptp_free_tx_buffer()
561 tstamp->buffer_type = 0; in igc_ptp_free_tx_buffer()
564 igc_xsk_wakeup(adapter->netdev, tstamp->xsk_queue_index, 0); in igc_ptp_free_tx_buffer()
569 dev_kfree_skb_any(tstamp->skb); in igc_ptp_free_tx_buffer()
570 tstamp->skb = NULL; in igc_ptp_free_tx_buffer()
578 spin_lock_irqsave(&adapter->ptp_tx_lock, flags); in igc_ptp_clear_tx_tstamp()
581 struct igc_tx_timestamp_request *tstamp = &adapter->tx_tstamp[i]; in igc_ptp_clear_tx_tstamp()
583 if (tstamp->skb) in igc_ptp_clear_tx_tstamp()
587 spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags); in igc_ptp_clear_tx_tstamp()
592 struct igc_hw *hw = &adapter->hw; in igc_ptp_disable_tx_timestamp()
598 for (i = 0; i < adapter->num_tx_queues; i++) { in igc_ptp_disable_tx_timestamp()
599 struct igc_ring *tx_ring = adapter->tx_ring[i]; in igc_ptp_disable_tx_timestamp()
601 clear_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags); in igc_ptp_disable_tx_timestamp()
612 struct igc_hw *hw = &adapter->hw; in igc_ptp_enable_tx_timestamp()
624 for (i = 0; i < adapter->num_tx_queues; i++) { in igc_ptp_enable_tx_timestamp()
625 struct igc_ring *tx_ring = adapter->tx_ring[i]; in igc_ptp_enable_tx_timestamp()
627 set_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags); in igc_ptp_enable_tx_timestamp()
633 * igc_ptp_set_timestamp_mode - setup hardware for timestamping
642 switch (config->tx_type) { in igc_ptp_set_timestamp_mode()
650 return -ERANGE; in igc_ptp_set_timestamp_mode()
653 switch (config->rx_filter) { in igc_ptp_set_timestamp_mode()
672 config->rx_filter = HWTSTAMP_FILTER_ALL; in igc_ptp_set_timestamp_mode()
675 return -ERANGE; in igc_ptp_set_timestamp_mode()
681 /* Requires adapter->ptp_tx_lock held by caller. */
685 if (tstamp->skb) in igc_ptp_tx_timeout()
688 adapter->tx_hwtstamp_timeouts++; in igc_ptp_tx_timeout()
690 netdev_warn(adapter->netdev, "Tx timestamp timeout\n"); in igc_ptp_tx_timeout()
696 struct igc_hw *hw = &adapter->hw; in igc_ptp_tx_hang()
701 spin_lock_irqsave(&adapter->ptp_tx_lock, flags); in igc_ptp_tx_hang()
704 tstamp = &adapter->tx_tstamp[i]; in igc_ptp_tx_hang()
706 if (!tstamp->skb) in igc_ptp_tx_hang()
709 if (time_is_after_jiffies(tstamp->start + IGC_PTP_TX_TIMEOUT)) in igc_ptp_tx_hang()
723 spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags); in igc_ptp_tx_hang()
733 skb = tstamp->skb; in igc_ptp_tx_reg_to_stamp()
740 switch (adapter->link_speed) { in igc_ptp_tx_reg_to_stamp()
759 if (tstamp->buffer_type == IGC_TX_BUFFER_TYPE_XSK) { in igc_ptp_tx_reg_to_stamp()
762 xsk_pool = adapter->tx_ring[tstamp->xsk_queue_index]->xsk_pool; in igc_ptp_tx_reg_to_stamp()
764 xsk_tx_metadata_complete(&tstamp->xsk_meta, in igc_ptp_tx_reg_to_stamp()
776 * igc_ptp_tx_hwtstamp - utility function which checks for TX time stamp
783 * Context: Expects adapter->ptp_tx_lock to be held by caller.
787 struct igc_hw *hw = &adapter->hw; in igc_ptp_tx_hwtstamp()
828 igc_ptp_tx_reg_to_stamp(adapter, &adapter->tx_tstamp[0], regval); in igc_ptp_tx_hwtstamp()
836 struct igc_tx_timestamp_request *tstamp = &adapter->tx_tstamp[i]; in igc_ptp_tx_hwtstamp()
838 if (!(tstamp->mask & mask)) in igc_ptp_tx_hwtstamp()
841 regval = rd32(tstamp->regl); in igc_ptp_tx_hwtstamp()
842 regval |= (u64)rd32(tstamp->regh) << 32; in igc_ptp_tx_hwtstamp()
859 spin_lock_irqsave(&adapter->ptp_tx_lock, flags); in igc_ptp_tx_tstamp_event()
863 spin_unlock_irqrestore(&adapter->ptp_tx_lock, flags); in igc_ptp_tx_tstamp_event()
867 * igc_ptp_set_ts_config - set hardware time stamping config
878 if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) in igc_ptp_set_ts_config()
879 return -EFAULT; in igc_ptp_set_ts_config()
886 memcpy(&adapter->tstamp_config, &config, in igc_ptp_set_ts_config()
887 sizeof(adapter->tstamp_config)); in igc_ptp_set_ts_config()
889 return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? in igc_ptp_set_ts_config()
890 -EFAULT : 0; in igc_ptp_set_ts_config()
894 * igc_ptp_get_ts_config - get hardware time stamping config
905 struct hwtstamp_config *config = &adapter->tstamp_config; in igc_ptp_get_ts_config()
907 return copy_to_user(ifr->ifr_data, config, sizeof(*config)) ? in igc_ptp_get_ts_config()
908 -EFAULT : 0; in igc_ptp_get_ts_config()
916 * X86 systems with support for the Always Running Timer allow that);
926 * some i225-V models could cause lockups when bringing the in igc_is_crosststamp_supported()
928 * disabling crosstimestamping support for i225-V, as it in igc_is_crosststamp_supported()
929 * doesn't have any PTP support. That way we gain some time in igc_is_crosststamp_supported()
932 if (adapter->pdev->device == IGC_DEV_ID_I225_V) in igc_is_crosststamp_supported()
935 return pcie_ptm_enabled(adapter->pdev); in igc_is_crosststamp_supported()
953 struct net_device *netdev = adapter->netdev; in igc_ptm_log_error()
966 netdev_err(netdev, "PTM Error: 1588 timer adjusted during first PTM cycle\n"); in igc_ptm_log_error()
969 netdev_err(netdev, "PTM Error: 1588 timer adjusted during non-first PTM cycle\n"); in igc_ptm_log_error()
983 struct igc_hw *hw = &adapter->hw; in igc_phc_get_syncdevicetime()
988 ktime_get_snapshot(&adapter->snapshot); in igc_phc_get_syncdevicetime()
1017 netdev_err(adapter->netdev, "Timeout reading IGC_PTM_STAT register\n"); in igc_phc_get_syncdevicetime()
1027 /* The STAT register is write-1-to-clear (W1C), in igc_phc_get_syncdevicetime()
1033 } while (--count); in igc_phc_get_syncdevicetime()
1036 netdev_err(adapter->netdev, "Exceeded number of tries for PTM cycle\n"); in igc_phc_get_syncdevicetime()
1037 return -ETIMEDOUT; in igc_phc_get_syncdevicetime()
1059 static int igc_ptp_getcrosststamp(struct ptp_clock_info *ptp, in igc_ptp_getcrosststamp() argument
1062 struct igc_adapter *adapter = container_of(ptp, struct igc_adapter, in igc_ptp_getcrosststamp()
1066 adapter, &adapter->snapshot, cts); in igc_ptp_getcrosststamp()
1069 static int igc_ptp_getcyclesx64(struct ptp_clock_info *ptp, in igc_ptp_getcyclesx64() argument
1073 struct igc_adapter *igc = container_of(ptp, struct igc_adapter, ptp_caps); in igc_ptp_getcyclesx64()
1074 struct igc_hw *hw = &igc->hw; in igc_ptp_getcyclesx64()
1077 spin_lock_irqsave(&igc->free_timer_lock, flags); in igc_ptp_getcyclesx64()
1080 ts->tv_nsec = rd32(IGC_SYSTIML_1); in igc_ptp_getcyclesx64()
1081 ts->tv_sec = rd32(IGC_SYSTIMH_1); in igc_ptp_getcyclesx64()
1084 spin_unlock_irqrestore(&igc->free_timer_lock, flags); in igc_ptp_getcyclesx64()
1090 * igc_ptp_init - Initialize PTP functionality
1093 * This function is called at device probe to initialize the PTP
1098 struct net_device *netdev = adapter->netdev; in igc_ptp_init()
1100 struct igc_hw *hw = &adapter->hw; in igc_ptp_init()
1103 tstamp = &adapter->tx_tstamp[0]; in igc_ptp_init()
1104 tstamp->mask = IGC_TSYNCTXCTL_TXTT_0; in igc_ptp_init()
1105 tstamp->regl = IGC_TXSTMPL_0; in igc_ptp_init()
1106 tstamp->regh = IGC_TXSTMPH_0; in igc_ptp_init()
1107 tstamp->flags = 0; in igc_ptp_init()
1109 tstamp = &adapter->tx_tstamp[1]; in igc_ptp_init()
1110 tstamp->mask = IGC_TSYNCTXCTL_TXTT_1; in igc_ptp_init()
1111 tstamp->regl = IGC_TXSTMPL_1; in igc_ptp_init()
1112 tstamp->regh = IGC_TXSTMPH_1; in igc_ptp_init()
1113 tstamp->flags = IGC_TX_FLAGS_TSTAMP_1; in igc_ptp_init()
1115 tstamp = &adapter->tx_tstamp[2]; in igc_ptp_init()
1116 tstamp->mask = IGC_TSYNCTXCTL_TXTT_2; in igc_ptp_init()
1117 tstamp->regl = IGC_TXSTMPL_2; in igc_ptp_init()
1118 tstamp->regh = IGC_TXSTMPH_2; in igc_ptp_init()
1119 tstamp->flags = IGC_TX_FLAGS_TSTAMP_2; in igc_ptp_init()
1121 tstamp = &adapter->tx_tstamp[3]; in igc_ptp_init()
1122 tstamp->mask = IGC_TSYNCTXCTL_TXTT_3; in igc_ptp_init()
1123 tstamp->regl = IGC_TXSTMPL_3; in igc_ptp_init()
1124 tstamp->regh = IGC_TXSTMPH_3; in igc_ptp_init()
1125 tstamp->flags = IGC_TX_FLAGS_TSTAMP_3; in igc_ptp_init()
1127 switch (hw->mac.type) { in igc_ptp_init()
1130 struct ptp_pin_desc *ppd = &adapter->sdp_config[i]; in igc_ptp_init()
1132 snprintf(ppd->name, sizeof(ppd->name), "SDP%d", i); in igc_ptp_init()
1133 ppd->index = i; in igc_ptp_init()
1134 ppd->func = PTP_PF_NONE; in igc_ptp_init()
1136 snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr); in igc_ptp_init()
1137 adapter->ptp_caps.owner = THIS_MODULE; in igc_ptp_init()
1138 adapter->ptp_caps.max_adj = 62499999; in igc_ptp_init()
1139 adapter->ptp_caps.adjfine = igc_ptp_adjfine_i225; in igc_ptp_init()
1140 adapter->ptp_caps.adjtime = igc_ptp_adjtime_i225; in igc_ptp_init()
1141 adapter->ptp_caps.gettimex64 = igc_ptp_gettimex64_i225; in igc_ptp_init()
1142 adapter->ptp_caps.getcyclesx64 = igc_ptp_getcyclesx64; in igc_ptp_init()
1143 adapter->ptp_caps.settime64 = igc_ptp_settime_i225; in igc_ptp_init()
1144 adapter->ptp_caps.enable = igc_ptp_feature_enable_i225; in igc_ptp_init()
1145 adapter->ptp_caps.pps = 1; in igc_ptp_init()
1146 adapter->ptp_caps.pin_config = adapter->sdp_config; in igc_ptp_init()
1147 adapter->ptp_caps.n_ext_ts = IGC_N_EXTTS; in igc_ptp_init()
1148 adapter->ptp_caps.n_per_out = IGC_N_PEROUT; in igc_ptp_init()
1149 adapter->ptp_caps.n_pins = IGC_N_SDP; in igc_ptp_init()
1150 adapter->ptp_caps.verify = igc_ptp_verify_pin; in igc_ptp_init()
1155 adapter->ptp_caps.getcrosststamp = igc_ptp_getcrosststamp; in igc_ptp_init()
1158 adapter->ptp_clock = NULL; in igc_ptp_init()
1162 spin_lock_init(&adapter->ptp_tx_lock); in igc_ptp_init()
1163 spin_lock_init(&adapter->free_timer_lock); in igc_ptp_init()
1164 spin_lock_init(&adapter->tmreg_lock); in igc_ptp_init()
1166 adapter->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE; in igc_ptp_init()
1167 adapter->tstamp_config.tx_type = HWTSTAMP_TX_OFF; in igc_ptp_init()
1169 adapter->prev_ptp_time = ktime_to_timespec64(ktime_get_real()); in igc_ptp_init()
1170 adapter->ptp_reset_start = ktime_get(); in igc_ptp_init()
1172 adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps, in igc_ptp_init()
1173 &adapter->pdev->dev); in igc_ptp_init()
1174 if (IS_ERR(adapter->ptp_clock)) { in igc_ptp_init()
1175 adapter->ptp_clock = NULL; in igc_ptp_init()
1177 } else if (adapter->ptp_clock) { in igc_ptp_init()
1179 adapter->ptp_flags |= IGC_PTP_ENABLED; in igc_ptp_init()
1185 igc_ptp_read(adapter, &adapter->prev_ptp_time); in igc_ptp_time_save()
1186 adapter->ptp_reset_start = ktime_get(); in igc_ptp_time_save()
1191 struct timespec64 ts = adapter->prev_ptp_time; in igc_ptp_time_restore()
1194 delta = ktime_sub(ktime_get(), adapter->ptp_reset_start); in igc_ptp_time_restore()
1203 struct igc_hw *hw = &adapter->hw; in igc_ptm_stop()
1213 * igc_ptp_suspend - Disable PTP work items and prepare for suspend
1216 * This function stops the overflow check work and PTP Tx timestamp work, and
1221 if (!(adapter->ptp_flags & IGC_PTP_ENABLED)) in igc_ptp_suspend()
1226 if (pci_device_is_present(adapter->pdev)) { in igc_ptp_suspend()
1233 * igc_ptp_stop - Disable PTP device and stop the overflow check.
1236 * This function stops the PTP support and cancels the delayed work.
1242 if (adapter->ptp_clock) { in igc_ptp_stop()
1243 ptp_clock_unregister(adapter->ptp_clock); in igc_ptp_stop()
1244 netdev_info(adapter->netdev, "PHC removed\n"); in igc_ptp_stop()
1245 adapter->ptp_flags &= ~IGC_PTP_ENABLED; in igc_ptp_stop()
1250 * igc_ptp_reset - Re-enable the adapter for PTP following a reset.
1253 * This function handles the reset work required to re-enable the PTP device.
1257 struct igc_hw *hw = &adapter->hw; in igc_ptp_reset()
1263 igc_ptp_set_timestamp_mode(adapter, &adapter->tstamp_config); in igc_ptp_reset()
1265 spin_lock_irqsave(&adapter->tmreg_lock, flags); in igc_ptp_reset()
1267 switch (adapter->hw.mac.type) { in igc_ptp_reset()
1277 (adapter->pps_sys_wrap_on ? IGC_TSICR_SYS_WRAP : 0)); in igc_ptp_reset()
1307 /* Re-initialize the timer. */ in igc_ptp_reset()
1308 if (hw->mac.type == igc_i225) { in igc_ptp_reset()
1311 timecounter_init(&adapter->tc, &adapter->cc, in igc_ptp_reset()
1315 spin_unlock_irqrestore(&adapter->tmreg_lock, flags); in igc_ptp_reset()