Lines Matching full:ptp
8 container_of_const(info, struct iavf_adapter, ptp.info)
99 adapter->ptp.hwtstamp_config = *config; in iavf_ptp_set_ts_config()
105 * iavf_ptp_cap_supported - Check if a PTP capability is supported
118 return (adapter->ptp.hw_caps.caps & cap) == cap; in iavf_ptp_cap_supported()
122 * iavf_allocate_ptp_cmd - Allocate a PTP command message structure
126 * Allocates a PTP command message and pre-fills it with the provided message
129 * Return: allocated PTP command.
147 * iavf_queue_ptp_cmd - Queue PTP command for sending over virtchnl
151 * Queue the given command structure into the PTP virtchnl command queue tos
157 mutex_lock(&adapter->ptp.aq_cmd_lock); in iavf_queue_ptp_cmd()
158 list_add_tail(&cmd->list, &adapter->ptp.aq_cmds); in iavf_queue_ptp_cmd()
159 mutex_unlock(&adapter->ptp.aq_cmd_lock); in iavf_queue_ptp_cmd()
169 * Send a request to obtain the PTP hardware clock time. This allocates the
181 if (!adapter->ptp.clock) in iavf_send_phc_read()
219 adapter->ptp.phc_time_ready = false; in iavf_read_phc_indirect()
227 ret = wait_event_interruptible_timeout(adapter->ptp.phc_time_waitqueue, in iavf_read_phc_indirect()
228 adapter->ptp.phc_time_ready, in iavf_read_phc_indirect()
238 *ts = ns_to_timespec64(adapter->ptp.cached_phc_time); in iavf_read_phc_indirect()
249 if (!adapter->ptp.clock) in iavf_ptp_gettimex64()
267 if (!time_is_before_jiffies(adapter->ptp.cached_phc_updated + HZ)) in iavf_ptp_cache_phc_time()
277 * iavf_ptp_do_aux_work - Perform periodic work required for PTP support
278 * @info: PTP clock info structure
280 * Handler to take care of periodic work required for PTP operation. This
306 * iavf_ptp_register_clock - Register a new PTP for userspace
309 * Allocate and register a new PTP clock device if necessary.
315 struct ptp_clock_info *ptp_info = &adapter->ptp.info; in iavf_ptp_register_clock()
329 adapter->ptp.clock = clock; in iavf_ptp_register_clock()
331 dev_dbg(&adapter->pdev->dev, "PTP clock %s registered\n", in iavf_ptp_register_clock()
332 adapter->ptp.info.name); in iavf_ptp_register_clock()
338 * iavf_ptp_init - Initialize PTP support if capability was negotiated
341 * Initialize PTP functionality, based on the capabilities that the PF has
350 "Device does not have PTP clock support\n"); in iavf_ptp_init()
357 "Failed to register PTP clock device (%p)\n", in iavf_ptp_init()
365 rx_ring->ptp = &adapter->ptp; in iavf_ptp_init()
368 ptp_schedule_worker(adapter->ptp.clock, 0); in iavf_ptp_init()
372 * iavf_ptp_release - Disable PTP support
375 * Release all PTP resources that were previously initialized.
381 if (!adapter->ptp.clock) in iavf_ptp_release()
384 pci_dbg(adapter->pdev, "removing PTP clock %s\n", in iavf_ptp_release()
385 adapter->ptp.info.name); in iavf_ptp_release()
386 ptp_clock_unregister(adapter->ptp.clock); in iavf_ptp_release()
387 adapter->ptp.clock = NULL; in iavf_ptp_release()
389 /* Cancel any remaining uncompleted PTP clock commands */ in iavf_ptp_release()
390 mutex_lock(&adapter->ptp.aq_cmd_lock); in iavf_ptp_release()
391 list_for_each_entry_safe(cmd, tmp, &adapter->ptp.aq_cmds, list) { in iavf_ptp_release()
396 mutex_unlock(&adapter->ptp.aq_cmd_lock); in iavf_ptp_release()
398 adapter->ptp.hwtstamp_config.rx_filter = HWTSTAMP_FILTER_NONE; in iavf_ptp_release()
403 * iavf_ptp_process_caps - Handle change in PTP capabilities
406 * Handle any state changes necessary due to change in PTP capabilities, such
414 * PTP hardware clock. If so, driver must respond appropriately by in iavf_ptp_process_caps()
415 * creating or destroying the PTP clock device. in iavf_ptp_process_caps()
417 if (adapter->ptp.clock && !phc) in iavf_ptp_process_caps()
419 else if (!adapter->ptp.clock && phc) in iavf_ptp_process_caps()
424 adapter->ptp.hwtstamp_config.rx_filter = HWTSTAMP_FILTER_NONE; in iavf_ptp_process_caps()