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()
704 pf->ptp.tx_hwtstamp_timeouts++; in ice_ptp_process_tx_tstamp()
882 pf->ptp.tx_hwtstamp_flushed++; in ice_ptp_flush_tx_tracker()
1008 update_before = pf->ptp.cached_phc_jiffies + msecs_to_jiffies(2000); in ice_ptp_update_cached_phctime()
1009 if (pf->ptp.cached_phc_time && in ice_ptp_update_cached_phctime()
1011 unsigned long time_taken = jiffies - pf->ptp.cached_phc_jiffies; in ice_ptp_update_cached_phctime()
1015 pf->ptp.late_cached_phc_updates++; in ice_ptp_update_cached_phctime()
1022 WRITE_ONCE(pf->ptp.cached_phc_time, systime); in ice_ptp_update_cached_phctime()
1023 WRITE_ONCE(pf->ptp.cached_phc_jiffies, jiffies); in ice_ptp_update_cached_phctime()
1080 kthread_queue_delayed_work(pf->ptp.kworker, &pf->ptp.work, in ice_ptp_reset_cached_phctime()
1089 ice_ptp_mark_tx_tracker_stale(&pf->ptp.port.tx); in ice_ptp_reset_cached_phctime()
1258 kthread_queue_delayed_work(pf->ptp.kworker, in ice_ptp_wait_for_offsets()
1270 kthread_queue_delayed_work(pf->ptp.kworker, in ice_ptp_wait_for_offsets()
1348 kthread_queue_delayed_work(pf->ptp.kworker, &ptp_port->ov_work, 0); in ice_ptp_port_phy_restart()
1376 ptp_port = &pf->ptp.port; in ice_ptp_link_change()
1440 ice_ptp_port_phy_restart(&pf->ptp.port); in ice_ptp_reset_phy_timestamping()
1488 if (pf->ptp.ext_ts_irq & (1 << chan)) { in ice_ptp_extts_event()
1496 ptp_clock_event(pf->ptp.clock, &event); in ice_ptp_extts_event()
1497 pf->ptp.ext_ts_irq &= ~(1 << chan); in ice_ptp_extts_event()
1518 if (chan > (unsigned int)pf->ptp.info.n_ext_ts) in ice_ptp_cfg_extts()
1546 pf->ptp.ext_ts_chan |= (1 << chan); in ice_ptp_cfg_extts()
1551 pf->ptp.ext_ts_chan &= ~(1 << chan); in ice_ptp_cfg_extts()
1552 if (!pf->ptp.ext_ts_chan) in ice_ptp_cfg_extts()
1595 gpio_pin = pf->ptp.perout_channels[chan].gpio_pin; in ice_ptp_cfg_clkout()
1600 memset(&pf->ptp.perout_channels[chan], 0, in ice_ptp_cfg_clkout()
1660 memcpy(&pf->ptp.perout_channels[chan], config, in ice_ptp_cfg_clkout()
1662 pf->ptp.perout_channels[chan].start_time = phase; in ice_ptp_cfg_clkout()
1683 for (i = 0; i < pf->ptp.info.n_per_out; i++) in ice_ptp_disable_all_clkout()
1684 if (pf->ptp.perout_channels[i].ena) in ice_ptp_disable_all_clkout()
1700 for (i = 0; i < pf->ptp.info.n_per_out; i++) in ice_ptp_enable_all_clkout()
1701 if (pf->ptp.perout_channels[i].ena) in ice_ptp_enable_all_clkout()
1702 ice_ptp_cfg_clkout(pf, i, &pf->ptp.perout_channels[i], in ice_ptp_enable_all_clkout()
1860 if (pf->ptp.port.link_up) in ice_ptp_settime64()
1861 ice_ptp_port_phy_stop(&pf->ptp.port); in ice_ptp_settime64()
1881 if (pf->ptp.port.link_up) in ice_ptp_settime64()
1882 ice_ptp_port_phy_restart(&pf->ptp.port); in ice_ptp_settime64()
2068 config = &pf->ptp.tstamp_config; in ice_ptp_get_ts_config()
2143 config = pf->ptp.tstamp_config; in ice_ptp_set_ts_config()
2339 struct ptp_clock_info *info = &pf->ptp.info; in ice_ptp_set_caps()
2375 if (pf->ptp.clock) in ice_ptp_create_clock()
2380 info = &pf->ptp.info; in ice_ptp_create_clock()
2388 pf->ptp.clock = clock; in ice_ptp_create_clock()
2445 return ice_ptp_tx_tstamp(&pf->ptp.port.tx); in ice_ptp_process_ts()
2450 struct ice_ptp *ptp = container_of(work, struct ice_ptp, work.work); in ice_ptp_periodic_work() local
2451 struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp); in ice_ptp_periodic_work()
2460 kthread_queue_delayed_work(ptp->kworker, &ptp->work, in ice_ptp_periodic_work()
2470 struct ice_ptp *ptp = &pf->ptp; in ice_ptp_reset() local
2503 if (ptp->cached_phc_time) { in ice_ptp_reset()
2504 time_diff = ktime_get_real_ns() - ptp->reset_time; in ice_ptp_reset()
2505 ts = ns_to_timespec64(ptp->cached_phc_time + time_diff); in ice_ptp_reset()
2532 err = ice_ptp_init_tx_e810(pf, &ptp->port.tx); in ice_ptp_reset()
2534 kthread_init_delayed_work(&ptp->port.ov_work, in ice_ptp_reset()
2536 err = ice_ptp_init_tx_e822(pf, &ptp->port.tx, in ice_ptp_reset()
2537 ptp->port.port_num); in ice_ptp_reset()
2545 kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0); in ice_ptp_reset()
2560 struct ice_ptp *ptp = &pf->ptp; in ice_ptp_prepare_for_reset() local
2568 kthread_cancel_delayed_work_sync(&ptp->work); in ice_ptp_prepare_for_reset()
2573 ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx); in ice_ptp_prepare_for_reset()
2584 ptp->reset_time = ktime_get_real_ns(); in ice_ptp_prepare_for_reset()
2650 pf->ptp.clock = NULL; in ice_ptp_init_owner()
2660 static int ice_ptp_init_work(struct ice_pf *pf, struct ice_ptp *ptp) in ice_ptp_init_work() argument
2665 kthread_init_delayed_work(&ptp->work, ice_ptp_periodic_work); in ice_ptp_init_work()
2675 ptp->kworker = kworker; in ice_ptp_init_work()
2678 kthread_queue_delayed_work(ptp->kworker, &ptp->work, 0); in ice_ptp_init_work()
2714 struct ice_ptp *ptp = &pf->ptp; in ice_ptp_init() local
2727 ptp->port.port_num = hw->pf_id; in ice_ptp_init()
2728 err = ice_ptp_init_port(pf, &ptp->port); in ice_ptp_init()
2736 err = ice_ptp_init_work(pf, ptp); in ice_ptp_init()
2745 if (pf->ptp.clock) { in ice_ptp_init()
2746 ptp_clock_unregister(ptp->clock); in ice_ptp_init()
2747 pf->ptp.clock = NULL; in ice_ptp_init()
2768 ice_ptp_release_tx_tracker(pf, &pf->ptp.port.tx); in ice_ptp_release()
2772 kthread_cancel_delayed_work_sync(&pf->ptp.work); in ice_ptp_release()
2774 ice_ptp_port_phy_stop(&pf->ptp.port); in ice_ptp_release()
2775 mutex_destroy(&pf->ptp.port.ps_lock); in ice_ptp_release()
2776 if (pf->ptp.kworker) { in ice_ptp_release()
2777 kthread_destroy_worker(pf->ptp.kworker); in ice_ptp_release()
2778 pf->ptp.kworker = NULL; in ice_ptp_release()
2781 if (!pf->ptp.clock) in ice_ptp_release()
2788 ptp_clock_unregister(pf->ptp.clock); in ice_ptp_release()
2789 pf->ptp.clock = NULL; in ice_ptp_release()