Skip to content

Commit 5558a45

Browse files
Vadim Fedorenkopopcornmix
authored andcommitted
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> (cherry picked from commit 1cff839)
1 parent 4e98346 commit 5558a45

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/net/phy/bcm-phy-ptp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,18 @@ static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,
780780
kfree_skb(skb);
781781
}
782782

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+
783795
static int bcm_ptp_hwtstamp(struct mii_timestamper *mii_ts,
784796
struct kernel_hwtstamp_config *cfg,
785797
struct netlink_ext_ack *extack)
@@ -899,6 +911,7 @@ static void bcm_ptp_init(struct bcm_ptp_private *priv)
899911
priv->mii_ts.rxtstamp = bcm_ptp_rxtstamp;
900912
priv->mii_ts.txtstamp = bcm_ptp_txtstamp;
901913
priv->mii_ts.hwtstamp = bcm_ptp_hwtstamp;
914+
priv->mii_ts.hwtstamp_get = bcm_ptp_hwtstamp_get;
902915
priv->mii_ts.ts_info = bcm_ptp_ts_info;
903916

904917
priv->phydev->mii_ts = &priv->mii_ts;

0 commit comments

Comments
 (0)