Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251124181151.277256-4-vadim.fedorenko@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vadim Fedorenko and committed by
Jakub Kicinski
1cff8392 f467777e

+13
+13
drivers/net/phy/bcm-phy-ptp.c
··· 780 780 kfree_skb(skb); 781 781 } 782 782 783 + static int bcm_ptp_hwtstamp_get(struct mii_timestamper *mii_ts, 784 + struct kernel_hwtstamp_config *cfg) 785 + { 786 + struct bcm_ptp_private *priv = mii2priv(mii_ts); 787 + 788 + cfg->rx_filter = priv->hwts_rx ? HWTSTAMP_FILTER_PTP_V2_EVENT 789 + : HWTSTAMP_FILTER_NONE; 790 + cfg->tx_type = priv->tx_type; 791 + 792 + return 0; 793 + } 794 + 783 795 static int bcm_ptp_hwtstamp_set(struct mii_timestamper *mii_ts, 784 796 struct kernel_hwtstamp_config *cfg, 785 797 struct netlink_ext_ack *extack) ··· 911 899 priv->mii_ts.rxtstamp = bcm_ptp_rxtstamp; 912 900 priv->mii_ts.txtstamp = bcm_ptp_txtstamp; 913 901 priv->mii_ts.hwtstamp_set = bcm_ptp_hwtstamp_set; 902 + priv->mii_ts.hwtstamp_get = bcm_ptp_hwtstamp_get; 914 903 priv->mii_ts.ts_info = bcm_ptp_ts_info; 915 904 916 905 priv->phydev->mii_ts = &priv->mii_ts;