[07/10] net/ixgbe/base: add max_drift_thresh to get_ptp_by_phy

Message ID 20250114101024.159941-8-yuanx.wang@intel.com (mailing list archive)
State Accepted
Delegated to: Bruce Richardson
Headers
Series update net/ixgbe base driver |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Yuan Wang Jan. 14, 2025, 10:10 a.m. UTC
From: Karol Kolacinski <karol.kolacinski@intel.com>

Add max_drift_thresh parameter to ixgbe_get_ptp_by_phy() to allow
passing maxDriftThreshold parameter from the response.

Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 5 ++++-
 drivers/net/ixgbe/base/ixgbe_e610.h | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index 802dfb5062..dc4eafaa5a 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -1833,12 +1833,14 @@  s32 ixgbe_set_ptp_by_phy(struct ixgbe_hw *hw, u8 ptp_request, u8 flags)
  * @hw: pointer to the HW struct
  * @ptp_config: timestamp mode config
  * @flags: timestamp mode flags
+ * @max_drift_thresh: maximal PHY clock drift threshold
  *
  * Get PTP by PHY using ACI command (0x0635).
  *
  * Return: 0 on success, negative error code otherwise
  */
-s32 ixgbe_get_ptp_by_phy(struct ixgbe_hw *hw, u8 *ptp_config, u8 *flags)
+s32 ixgbe_get_ptp_by_phy(struct ixgbe_hw *hw, u8 *ptp_config, u8 *flags,
+			 u16 *max_drift_thresh)
 {
 	struct ixgbe_aci_cmd_get_ptp_by_phy_resp *resp;
 	struct ixgbe_aci_desc desc;
@@ -1851,6 +1853,7 @@  s32 ixgbe_get_ptp_by_phy(struct ixgbe_hw *hw, u8 *ptp_config, u8 *flags)
 	if (!status) {
 		*ptp_config = resp->ptp_config;
 		*flags = resp->flags;
+		*max_drift_thresh = IXGBE_LE16_TO_CPU(resp->maxDriftThreshold);
 	}
 
 	return status;
diff --git a/drivers/net/ixgbe/base/ixgbe_e610.h b/drivers/net/ixgbe/base/ixgbe_e610.h
index ccf76e3b9b..f60268cf91 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_e610.h
@@ -48,7 +48,8 @@  s32 ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask);
 s32 ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate, u16 mask);
 
 s32 ixgbe_set_ptp_by_phy(struct ixgbe_hw *hw, u8 ptp_request, u8 flags);
-s32 ixgbe_get_ptp_by_phy(struct ixgbe_hw *hw, u8 *ptp_config, u8 *flags);
+s32 ixgbe_get_ptp_by_phy(struct ixgbe_hw *hw, u8 *ptp_config, u8 *flags,
+			 u16 *max_drift_thresh);
 
 s32 ixgbe_aci_get_netlist_node(struct ixgbe_hw *hw,
 			       struct ixgbe_aci_cmd_get_link_topo *cmd,