[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251113113207.3928966-4-vadim.fedorenko@linux.dev>
Date: Thu, 13 Nov 2025 11:32:01 +0000
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Andrew Lunn <andrew+netdev@...n.ch>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Russell King <linux@...linux.org.uk>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Andrei Botila <andrei.botila@....nxp.com>,
Richard Cochran <richardcochran@...il.com>,
Andrew Lunn <andrew@...n.ch>
Cc: Simon Horman <horms@...nel.org>,
Vladimir Oltean <vladimir.oltean@....com>,
Jacob Keller <jacob.e.keller@...el.com>,
Kory Maincent <kory.maincent@...tlin.com>,
bcm-kernel-feedback-list@...adcom.com,
netdev@...r.kernel.org,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Subject: [PATCH net-next v2 3/9] net: phy: broadcom: add HW timestamp configuration reporting
The driver stores configuration information and can technically report
it. Implement hwtstamp_get callback to report the configuration.
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
---
drivers/net/phy/bcm-phy-ptp.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
index 6815e844a62e..65d609ed69fb 100644
--- a/drivers/net/phy/bcm-phy-ptp.c
+++ b/drivers/net/phy/bcm-phy-ptp.c
@@ -780,6 +780,18 @@ static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,
kfree_skb(skb);
}
+static int bcm_ptp_hwtstamp_get(struct mii_timestamper *mii_ts,
+ struct kernel_hwtstamp_config *cfg)
+{
+ struct bcm_ptp_private *priv = mii2priv(mii_ts);
+
+ cfg->rx_filter = priv->hwts_rx ? HWTSTAMP_FILTER_PTP_V2_EVENT
+ : HWTSTAMP_FILTER_NONE;
+ cfg->tx_type = priv->tx_type;
+
+ return 0;
+}
+
static int bcm_ptp_hwtstamp_set(struct mii_timestamper *mii_ts,
struct kernel_hwtstamp_config *cfg,
struct netlink_ext_ack *extack)
@@ -899,6 +911,7 @@ static void bcm_ptp_init(struct bcm_ptp_private *priv)
priv->mii_ts.rxtstamp = bcm_ptp_rxtstamp;
priv->mii_ts.txtstamp = bcm_ptp_txtstamp;
priv->mii_ts.hwtstamp_set = bcm_ptp_hwtstamp_set;
+ priv->mii_ts.hwtstamp_get = bcm_ptp_hwtstamp_get;
priv->mii_ts.ts_info = bcm_ptp_ts_info;
priv->phydev->mii_ts = &priv->mii_ts;
--
2.47.3
Powered by blists - more mailing lists