Lines Matching refs:ptp
288 pf->ptp.tstamp_config.tx_type = on ? HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF; in ice_set_tx_tstamp()
312 pf->ptp.tstamp_config.rx_filter = on ? HWTSTAMP_FILTER_ALL : in ice_set_rx_tstamp()
354 if (pf->ptp.clock) in ice_get_ptp_clock_index()
355 return ptp_clock_index(pf->ptp.clock); in ice_get_ptp_clock_index()
399 if (!pf->ptp.clock) in ice_set_ptp_clock_index()
408 value = (u32)ptp_clock_index(pf->ptp.clock); in ice_set_ptp_clock_index()
592 discard_time = pf->ptp.cached_phc_jiffies + msecs_to_jiffies(2000); in ice_ptp_extend_40b_ts()
594 pf->ptp.tx_hwtstamp_discarded++; in ice_ptp_extend_40b_ts()
598 return ice_ptp_extend_32b_ts(pf->ptp.cached_phc_time, in ice_ptp_extend_40b_ts()
756 pf->ptp.tx_hwtstamp_flushed++; in ice_ptp_flush_tx_tracker()
867 pf->ptp.tx_hwtstamp_timeouts++; in ice_ptp_tx_tstamp_cleanup()
898 update_before = pf->ptp.cached_phc_jiffies + msecs_to_jiffies(2000); in ice_ptp_update_cached_phctime()
899 if (pf->ptp.cached_phc_time && in ice_ptp_update_cached_phctime()
901 unsigned long time_taken = jiffies - pf->ptp.cached_phc_jiffies; in ice_ptp_update_cached_phctime()
905 pf->ptp.late_cached_phc_updates++; in ice_ptp_update_cached_phctime()
912 WRITE_ONCE(pf->ptp.cached_phc_time, systime); in ice_ptp_update_cached_phctime()
913 WRITE_ONCE(pf->ptp.cached_phc_jiffies, jiffies); in ice_ptp_update_cached_phctime()
977 kthread_queue_delayed_work(pf->ptp.kworker, &pf->ptp.work, in ice_ptp_reset_cached_phctime()
982 ice_ptp_flush_tx_tracker(pf, &pf->ptp.port.tx); in ice_ptp_reset_cached_phctime()
1249 kthread_queue_delayed_work(pf->ptp.kworker, in ice_ptp_wait_for_offset_valid()
1331 kthread_queue_delayed_work(pf->ptp.kworker, &ptp_port->ov_work, 0); in ice_ptp_port_phy_restart()
1359 ptp_port = &pf->ptp.port; in ice_ptp_link_change()
1435 ice_ptp_port_phy_restart(&pf->ptp.port); in ice_ptp_reset_phy_timestamping()
1486 struct ice_ptp *ptp = container_of(work, struct ice_ptp, extts_work); in ice_ptp_extts_work() local
1487 struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp); in ice_ptp_extts_work()
1501 if (pf->ptp.ext_ts_irq & (1 << chan)) { in ice_ptp_extts_work()
1509 ptp_clock_event(pf->ptp.clock, &event); in ice_ptp_extts_work()
1510 pf->ptp.ext_ts_irq &= ~(1 << chan); in ice_ptp_extts_work()
1531 if (chan > (unsigned int)pf->ptp.info.n_ext_ts) in ice_ptp_cfg_extts()
1559 pf->ptp.ext_ts_chan |= (1 << chan); in ice_ptp_cfg_extts()
1564 pf->ptp.ext_ts_chan &= ~(1 << chan); in ice_ptp_cfg_extts()
1565 if (!pf->ptp.ext_ts_chan) in ice_ptp_cfg_extts()
1608 gpio_pin = pf->ptp.perout_channels[chan].gpio_pin; in ice_ptp_cfg_clkout()
1613 memset(&pf->ptp.perout_channels[chan], 0, in ice_ptp_cfg_clkout()
1673 memcpy(&pf->ptp.perout_channels[chan], config, in ice_ptp_cfg_clkout()
1675 pf->ptp.perout_channels[chan].start_time = phase; in ice_ptp_cfg_clkout()
1696 for (i = 0; i < pf->ptp.info.n_per_out; i++) in ice_ptp_disable_all_clkout()
1697 if (pf->ptp.perout_channels[i].ena) in ice_ptp_disable_all_clkout()
1713 for (i = 0; i < pf->ptp.info.n_per_out; i++) in ice_ptp_enable_all_clkout()
1714 if (pf->ptp.perout_channels[i].ena) in ice_ptp_enable_all_clkout()
1715 ice_ptp_cfg_clkout(pf, i, &pf->ptp.perout_channels[i], in ice_ptp_enable_all_clkout()
1841 if (pf->ptp.port.link_up) in ice_ptp_settime64()
1842 ice_ptp_port_phy_stop(&pf->ptp.port); in ice_ptp_settime64()
1862 if (pf->ptp.port.link_up) in ice_ptp_settime64()
1863 ice_ptp_port_phy_restart(&pf->ptp.port); in ice_ptp_settime64()
2049 config = &pf->ptp.tstamp_config; in ice_ptp_get_ts_config()
2124 config = pf->ptp.tstamp_config; in ice_ptp_set_ts_config()
2288 struct ptp_clock_info *info = &pf->ptp.info; in ice_ptp_set_caps()
2322 if (pf->ptp.clock) in ice_ptp_create_clock()
2327 info = &pf->ptp.info; in ice_ptp_create_clock()
2335 pf->ptp.clock = clock; in ice_ptp_create_clock()
2387 return ice_ptp_tx_tstamp(&pf->ptp.port.tx); in ice_ptp_process_ts()
2392 struct ice_ptp *ptp = container_of(work, struct ice_ptp, work.work); in ice_ptp_periodic_work() local
2393 struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp); in ice_ptp_periodic_work()
2401 ice_ptp_tx_tstamp_cleanup(pf, &pf->ptp.port.tx); in ice_ptp_periodic_work()
2404 kthread_queue_delayed_work(ptp->kworker, &ptp->work, in ice_ptp_periodic_work()
2414 struct ice_ptp *ptp = &pf->ptp; in ice_ptp_reset() local
2447 if (ptp->cached_phc_time) { in ice_ptp_reset()
2448 time_diff = ktime_get_real_ns() - ptp->reset_time; in ice_ptp_reset()
2449 ts = ns_to_timespec64(ptp->cached_phc_time + time_diff); in ice_ptp_reset()
2476 err = ice_ptp_init_tx_e810(pf, &ptp->port.tx); in ice_ptp_reset()
2478 kthread_init_delayed_work(&ptp->port.ov_work, in ice_ptp_reset()
2480 err = ice_ptp_init_tx_e822(pf, &ptp->port.tx, in ice_ptp_reset()
2481 ptp->port.port_num); in ice_ptp_reset()
2489 kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0); in ice_ptp_reset()
2504 struct ice_ptp *ptp = &pf->ptp; in ice_ptp_prepare_for_reset() local
2512 kthread_cancel_delayed_work_sync(&ptp->work); in ice_ptp_prepare_for_reset()
2513 kthread_cancel_work_sync(&ptp->extts_work); in ice_ptp_prepare_for_reset()
2518 ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx); in ice_ptp_prepare_for_reset()
2529 ptp->reset_time = ktime_get_real_ns(); in ice_ptp_prepare_for_reset()
2595 pf->ptp.clock = NULL; in ice_ptp_init_owner()
2605 static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp) in ice_ptp_init_work() argument
2610 kthread_init_delayed_work(&ptp->work, ice_ptp_periodic_work); in ice_ptp_init_work()
2611 kthread_init_work(&ptp->extts_work, ice_ptp_extts_work); in ice_ptp_init_work()
2621 ptp->kworker = kworker; in ice_ptp_init_work()
2624 kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0); in ice_ptp_init_work()
2660 struct ice_ptp *ptp = &pf->ptp; in ice_ptp_init() local
2673 ptp->port.port_num = hw->pf_id; in ice_ptp_init()
2674 err = ice_ptp_init_port(pf, &ptp->port); in ice_ptp_init()
2682 err = ice_ptp_init_work(pf, ptp); in ice_ptp_init()
2691 if (pf->ptp.clock) { in ice_ptp_init()
2692 ptp_clock_unregister(ptp->clock); in ice_ptp_init()
2693 pf->ptp.clock = NULL; in ice_ptp_init()
2714 ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx); in ice_ptp_release()
2718 kthread_cancel_delayed_work_sync(&pf->ptp.work); in ice_ptp_release()
2720 ice_ptp_port_phy_stop(&pf->ptp.port); in ice_ptp_release()
2721 mutex_destroy(&pf->ptp.port.ps_lock); in ice_ptp_release()
2722 if (pf->ptp.kworker) { in ice_ptp_release()
2723 kthread_destroy_worker(pf->ptp.kworker); in ice_ptp_release()
2724 pf->ptp.kworker = NULL; in ice_ptp_release()
2727 if (!pf->ptp.clock) in ice_ptp_release()
2734 ptp_clock_unregister(pf->ptp.clock); in ice_ptp_release()
2735 pf->ptp.clock = NULL; in ice_ptp_release()