idpf: add mailbox access to read PTP clock time
authorMilena Olech <milena.olech@intel.com>
Wed, 16 Apr 2025 12:19:11 +0000 (14:19 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 16 May 2025 16:13:02 +0000 (09:13 -0700)
commit5a27503d3862c8ff812bfdbbe3b04964fa4e25af
tree556ce935315b1a8e37c2a561f0471b29731042fa
parent5cb8805d2366b20ee4d7afff586d8acf17649330
idpf: add mailbox access to read PTP clock time

When the access to read PTP clock is specified as mailbox, the driver
needs to send virtchnl message to perform PTP actions. Message is sent
using idpf_mbq_opc_send_msg_to_peer_drv mailbox opcode, with the parameters
received during PTP capabilities negotiation.

Add functions to recognize PTP messages, move them to dedicated secondary
mailbox, read the PTP clock time and cross timestamp using mailbox
messages.

Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Milena Olech <milena.olech@intel.com>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/idpf/idpf_controlq_api.h
drivers/net/ethernet/intel/idpf/idpf_ptp.c
drivers/net/ethernet/intel/idpf/idpf_ptp.h
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
drivers/net/ethernet/intel/idpf/idpf_virtchnl_ptp.c