On Wed, Nov 13, 2024 at 04:46:14PM +0100, Milena Olech wrote: > PTP capabilities are negotiated using virtchnl command. Add get > capabilities function, direct access to read the PTP clock time and > direct access to read the cross timestamp - system time and PTP clock > time. Set initial PTP capabilities exposed to the stack. > > Reviewed-by: Alexander Lobakin <aleksander.loba...@intel.com> > Signed-off-by: Milena Olech <milena.ol...@intel.com>
... > diff --git a/drivers/net/ethernet/intel/idpf/idpf_ptp.h > b/drivers/net/ethernet/intel/idpf/idpf_ptp.h ... > /** > * struct idpf_ptp - PTP parameters > * @info: structure defining PTP hardware capabilities > * @clock: pointer to registered PTP clock device > * @adapter: back pointer to the adapter > + * @cmd: HW specific command masks > + * @dev_clk_regs: the set of registers to access the device clock > + * @caps: PTP capabilities negotiated with the Control Plane > + * @get_dev_clk_time_access: access type for getting the device clock time > + * @get_cross_tstamp_access: access type for the cross timestamping > */ > struct idpf_ptp { > struct ptp_clock_info info; > struct ptp_clock *clock; > struct idpf_adapter *adapter; > + struct idpf_ptp_cmd cmd; > + struct idpf_ptp_dev_clk_regs dev_clk_regs; > + u32 caps; > + enum idpf_ptp_access get_dev_clk_time_access:16; > + enum idpf_ptp_access get_cross_tstamp_access:16; > }; > > +/** > + * idpf_ptp_info_to_adapter - get driver adapter struct from ptp_clock_info > + * @info: pointer to ptp_clock_info struct Please in include a "Return:" section, as you have done elsewhere, to document the return value of this function. Flagged by ./scripts/kernel-doc -none -Wall > + */ > +static inline struct idpf_adapter * > +idpf_ptp_info_to_adapter(const struct ptp_clock_info *info) > +{ > + const struct idpf_ptp *ptp = container_of_const(info, struct idpf_ptp, > + info); > + return ptp->adapter; > +} > + > #if IS_ENABLED(CONFIG_PTP_1588_CLOCK) > int idpf_ptp_init(struct idpf_adapter *adapter); > void idpf_ptp_release(struct idpf_adapter *adapter); > +int idpf_ptp_get_caps(struct idpf_adapter *adapter); > +void idpf_ptp_get_features_access(const struct idpf_adapter *adapter); > #else /* CONFIG_PTP_1588_CLOCK */ > static inline int idpf_ptp_init(struct idpf_adapter *adpater) > { ...