mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
phy: rename hwtstamp callback to hwtstamp_set
PHY devices has hwtstamp callback which actually performs set operation. Rename it to better reflect the action. Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20251124181151.277256-2-vadim.fedorenko@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
c01a6e5b2e
commit
6aac2aa2df
@@ -2657,7 +2657,7 @@ static int gbe_hwtstamp_set(void *intf_priv, struct kernel_hwtstamp_config *cfg,
|
||||
|
||||
phy = gbe_intf->slave->phy;
|
||||
if (phy_has_hwtstamp(phy))
|
||||
return phy->mii_ts->hwtstamp(phy->mii_ts, cfg, extack);
|
||||
return phy->mii_ts->hwtstamp_set(phy->mii_ts, cfg, extack);
|
||||
|
||||
switch (cfg->tx_type) {
|
||||
case HWTSTAMP_TX_OFF:
|
||||
|
||||
@@ -780,9 +780,9 @@ out:
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
static int bcm_ptp_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int bcm_ptp_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct bcm_ptp_private *priv = mii2priv(mii_ts);
|
||||
u16 mode, ctrl;
|
||||
@@ -898,7 +898,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 = bcm_ptp_hwtstamp;
|
||||
priv->mii_ts.hwtstamp_set = bcm_ptp_hwtstamp_set;
|
||||
priv->mii_ts.ts_info = bcm_ptp_ts_info;
|
||||
|
||||
priv->phydev->mii_ts = &priv->mii_ts;
|
||||
|
||||
@@ -1176,9 +1176,9 @@ static irqreturn_t dp83640_handle_interrupt(struct phy_device *phydev)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int dp83640_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int dp83640_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct dp83640_private *dp83640 =
|
||||
container_of(mii_ts, struct dp83640_private, mii_ts);
|
||||
@@ -1407,7 +1407,7 @@ static int dp83640_probe(struct phy_device *phydev)
|
||||
dp83640->phydev = phydev;
|
||||
dp83640->mii_ts.rxtstamp = dp83640_rxtstamp;
|
||||
dp83640->mii_ts.txtstamp = dp83640_txtstamp;
|
||||
dp83640->mii_ts.hwtstamp = dp83640_hwtstamp;
|
||||
dp83640->mii_ts.hwtstamp_set = dp83640_hwtstamp_set;
|
||||
dp83640->mii_ts.ts_info = dp83640_ts_info;
|
||||
|
||||
INIT_DELAYED_WORK(&dp83640->ts_work, rx_timestamp_work);
|
||||
|
||||
@@ -3147,9 +3147,9 @@ static void lan8814_flush_fifo(struct phy_device *phydev, bool egress)
|
||||
lanphy_read_page_reg(phydev, LAN8814_PAGE_PORT_REGS, PTP_TSU_INT_STS);
|
||||
}
|
||||
|
||||
static int lan8814_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *config,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int lan8814_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *config,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct kszphy_ptp_priv *ptp_priv =
|
||||
container_of(mii_ts, struct kszphy_ptp_priv, mii_ts);
|
||||
@@ -4389,7 +4389,7 @@ static void lan8814_ptp_init(struct phy_device *phydev)
|
||||
|
||||
ptp_priv->mii_ts.rxtstamp = lan8814_rxtstamp;
|
||||
ptp_priv->mii_ts.txtstamp = lan8814_txtstamp;
|
||||
ptp_priv->mii_ts.hwtstamp = lan8814_hwtstamp;
|
||||
ptp_priv->mii_ts.hwtstamp_set = lan8814_hwtstamp_set;
|
||||
ptp_priv->mii_ts.ts_info = lan8814_ts_info;
|
||||
|
||||
phydev->mii_ts = &ptp_priv->mii_ts;
|
||||
@@ -5042,9 +5042,9 @@ static void lan8841_ptp_enable_processing(struct kszphy_ptp_priv *ptp_priv,
|
||||
#define LAN8841_PTP_TX_TIMESTAMP_EN 443
|
||||
#define LAN8841_PTP_TX_MOD 445
|
||||
|
||||
static int lan8841_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *config,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int lan8841_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *config,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct kszphy_ptp_priv *ptp_priv = container_of(mii_ts, struct kszphy_ptp_priv, mii_ts);
|
||||
struct phy_device *phydev = ptp_priv->phydev;
|
||||
@@ -5924,7 +5924,7 @@ static int lan8841_probe(struct phy_device *phydev)
|
||||
|
||||
ptp_priv->mii_ts.rxtstamp = lan8841_rxtstamp;
|
||||
ptp_priv->mii_ts.txtstamp = lan8814_txtstamp;
|
||||
ptp_priv->mii_ts.hwtstamp = lan8841_hwtstamp;
|
||||
ptp_priv->mii_ts.hwtstamp_set = lan8841_hwtstamp_set;
|
||||
ptp_priv->mii_ts.ts_info = lan8841_ts_info;
|
||||
|
||||
phydev->mii_ts = &ptp_priv->mii_ts;
|
||||
|
||||
@@ -476,9 +476,9 @@ static bool mchp_rds_ptp_rxtstamp(struct mii_timestamper *mii_ts,
|
||||
return true;
|
||||
}
|
||||
|
||||
static int mchp_rds_ptp_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *config,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int mchp_rds_ptp_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *config,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mchp_rds_ptp_clock *clock =
|
||||
container_of(mii_ts, struct mchp_rds_ptp_clock,
|
||||
@@ -1281,7 +1281,7 @@ struct mchp_rds_ptp_clock *mchp_rds_ptp_probe(struct phy_device *phydev, u8 mmd,
|
||||
|
||||
clock->mii_ts.rxtstamp = mchp_rds_ptp_rxtstamp;
|
||||
clock->mii_ts.txtstamp = mchp_rds_ptp_txtstamp;
|
||||
clock->mii_ts.hwtstamp = mchp_rds_ptp_hwtstamp;
|
||||
clock->mii_ts.hwtstamp_set = mchp_rds_ptp_hwtstamp_set;
|
||||
clock->mii_ts.ts_info = mchp_rds_ptp_ts_info;
|
||||
|
||||
phydev->mii_ts = &clock->mii_ts;
|
||||
|
||||
@@ -1051,9 +1051,9 @@ static void vsc85xx_ts_reset_fifo(struct phy_device *phydev)
|
||||
val);
|
||||
}
|
||||
|
||||
static int vsc85xx_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int vsc85xx_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct vsc8531_private *vsc8531 =
|
||||
container_of(mii_ts, struct vsc8531_private, mii_ts);
|
||||
@@ -1611,7 +1611,7 @@ int vsc8584_ptp_probe(struct phy_device *phydev)
|
||||
|
||||
vsc8531->mii_ts.rxtstamp = vsc85xx_rxtstamp;
|
||||
vsc8531->mii_ts.txtstamp = vsc85xx_txtstamp;
|
||||
vsc8531->mii_ts.hwtstamp = vsc85xx_hwtstamp;
|
||||
vsc8531->mii_ts.hwtstamp_set = vsc85xx_hwtstamp_set;
|
||||
vsc8531->mii_ts.ts_info = vsc85xx_ts_info;
|
||||
phydev->mii_ts = &vsc8531->mii_ts;
|
||||
|
||||
|
||||
@@ -1012,9 +1012,9 @@ static bool nxp_c45_rxtstamp(struct mii_timestamper *mii_ts,
|
||||
return true;
|
||||
}
|
||||
|
||||
static int nxp_c45_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int nxp_c45_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct nxp_c45_phy *priv = container_of(mii_ts, struct nxp_c45_phy,
|
||||
mii_ts);
|
||||
@@ -1749,7 +1749,7 @@ static int nxp_c45_probe(struct phy_device *phydev)
|
||||
IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING)) {
|
||||
priv->mii_ts.rxtstamp = nxp_c45_rxtstamp;
|
||||
priv->mii_ts.txtstamp = nxp_c45_txtstamp;
|
||||
priv->mii_ts.hwtstamp = nxp_c45_hwtstamp;
|
||||
priv->mii_ts.hwtstamp_set = nxp_c45_hwtstamp_set;
|
||||
priv->mii_ts.ts_info = nxp_c45_ts_info;
|
||||
phydev->mii_ts = &priv->mii_ts;
|
||||
ret = nxp_c45_init_ptp_clock(priv);
|
||||
|
||||
@@ -405,12 +405,14 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
|
||||
return 0;
|
||||
|
||||
case SIOCSHWTSTAMP:
|
||||
if (phydev->mii_ts && phydev->mii_ts->hwtstamp) {
|
||||
if (phydev->mii_ts && phydev->mii_ts->hwtstamp_set) {
|
||||
if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
|
||||
return -EFAULT;
|
||||
|
||||
hwtstamp_config_to_kernel(&kernel_cfg, &cfg);
|
||||
ret = phydev->mii_ts->hwtstamp(phydev->mii_ts, &kernel_cfg, &extack);
|
||||
ret = phydev->mii_ts->hwtstamp_set(phydev->mii_ts,
|
||||
&kernel_cfg,
|
||||
&extack);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -493,8 +495,9 @@ int __phy_hwtstamp_set(struct phy_device *phydev,
|
||||
if (!phydev)
|
||||
return -ENODEV;
|
||||
|
||||
if (phydev->mii_ts && phydev->mii_ts->hwtstamp)
|
||||
return phydev->mii_ts->hwtstamp(phydev->mii_ts, config, extack);
|
||||
if (phydev->mii_ts && phydev->mii_ts->hwtstamp_set)
|
||||
return phydev->mii_ts->hwtstamp_set(phydev->mii_ts, config,
|
||||
extack);
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
@@ -328,9 +328,9 @@ static u64 ines_find_txts(struct ines_port *port, struct sk_buff *skb)
|
||||
return ns;
|
||||
}
|
||||
|
||||
static int ines_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
static int ines_hwtstamp_set(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct ines_port *port = container_of(mii_ts, struct ines_port, mii_ts);
|
||||
u32 cm_one_step = 0, port_conf, ts_stat_rx, ts_stat_tx;
|
||||
@@ -709,7 +709,7 @@ static struct mii_timestamper *ines_ptp_probe_channel(struct device *device,
|
||||
}
|
||||
port->mii_ts.rxtstamp = ines_rxtstamp;
|
||||
port->mii_ts.txtstamp = ines_txtstamp;
|
||||
port->mii_ts.hwtstamp = ines_hwtstamp;
|
||||
port->mii_ts.hwtstamp_set = ines_hwtstamp_set;
|
||||
port->mii_ts.link_state = ines_link_state;
|
||||
port->mii_ts.ts_info = ines_ts_info;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ struct phy_device;
|
||||
* as soon as a timestamp becomes available. One of the PTP_CLASS_
|
||||
* values is passed in 'type'.
|
||||
*
|
||||
* @hwtstamp: Handles SIOCSHWTSTAMP ioctl for hardware time stamping.
|
||||
* @hwtstamp_set: Handles SIOCSHWTSTAMP ioctl for hardware time stamping.
|
||||
*
|
||||
* @link_state: Allows the device to respond to changes in the link
|
||||
* state. The caller invokes this function while holding
|
||||
@@ -51,9 +51,9 @@ struct mii_timestamper {
|
||||
void (*txtstamp)(struct mii_timestamper *mii_ts,
|
||||
struct sk_buff *skb, int type);
|
||||
|
||||
int (*hwtstamp)(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *kernel_config,
|
||||
struct netlink_ext_ack *extack);
|
||||
int (*hwtstamp_set)(struct mii_timestamper *mii_ts,
|
||||
struct kernel_hwtstamp_config *kernel_config,
|
||||
struct netlink_ext_ack *extack);
|
||||
|
||||
void (*link_state)(struct mii_timestamper *mii_ts,
|
||||
struct phy_device *phydev);
|
||||
|
||||
@@ -1915,7 +1915,7 @@ static inline bool phy_polling_mode(struct phy_device *phydev)
|
||||
*/
|
||||
static inline bool phy_has_hwtstamp(struct phy_device *phydev)
|
||||
{
|
||||
return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp;
|
||||
return phydev && phydev->mii_ts && phydev->mii_ts->hwtstamp_set;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1950,7 +1950,7 @@ static inline int phy_hwtstamp(struct phy_device *phydev,
|
||||
struct kernel_hwtstamp_config *cfg,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
return phydev->mii_ts->hwtstamp(phydev->mii_ts, cfg, extack);
|
||||
return phydev->mii_ts->hwtstamp_set(phydev->mii_ts, cfg, extack);
|
||||
}
|
||||
|
||||
static inline bool phy_rxtstamp(struct phy_device *phydev, struct sk_buff *skb,
|
||||
|
||||
Reference in New Issue
Block a user