mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: phy: nxp-c45-tja11xx: add HW timestamp configuration reporting
The driver stores HW timestamping configuration and can technically report it. Add callback to do it. Reviewed-by: Kory Maincent <kory.maincent@bootlin.com> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20251124181151.277256-7-vadim.fedorenko@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
ab95392ab5
commit
d51de60b8e
@@ -1012,6 +1012,19 @@ static bool nxp_c45_rxtstamp(struct mii_timestamper *mii_ts,
|
||||
return true;
|
||||
}
|
||||
|
||||
static int nxp_c45_hwtstamp_get(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg)
|
||||
{
|
||||
struct nxp_c45_phy *priv = container_of(mii_ts, struct nxp_c45_phy,
|
||||
mii_ts);
|
||||
|
||||
cfg->tx_type = priv->hwts_tx;
|
||||
cfg->rx_filter = priv->hwts_rx ? HWTSTAMP_FILTER_PTP_V2_L2_EVENT
|
||||
: HWTSTAMP_FILTER_NONE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nxp_c45_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
@@ -1750,6 +1763,7 @@ static int nxp_c45_probe(struct phy_device *phydev)
|
||||
priv->mii_ts.rxtstamp = nxp_c45_rxtstamp;
|
||||
priv->mii_ts.txtstamp = nxp_c45_txtstamp;
|
||||
priv->mii_ts.hwtstamp_set = nxp_c45_hwtstamp_set;
|
||||
priv->mii_ts.hwtstamp_get = nxp_c45_hwtstamp_get;
|
||||
priv->mii_ts.ts_info = nxp_c45_ts_info;
|
||||
phydev->mii_ts = &priv->mii_ts;
|
||||
ret = nxp_c45_init_ptp_clock(priv);
|
||||
|
||||
Reference in New Issue
Block a user