mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 06:04:23 +08:00
Merge branch 'net-make-timestamping-selectable'
First part of "net: Make timestamping selectable" from Kory Maincent. Change the driver-facing type already to lower rebasing pain. Link: https://lore.kernel.org/20240709-feature_ptp_netnext-v17-0-b5317f50df2a@bootlin.com/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
30b3560050
@ -5755,10 +5755,10 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
|
||||
}
|
||||
|
||||
static int bond_ethtool_get_ts_info(struct net_device *bond_dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct bonding *bond = netdev_priv(bond_dev);
|
||||
struct ethtool_ts_info ts_info;
|
||||
struct kernel_ethtool_ts_info ts_info;
|
||||
struct net_device *real_dev;
|
||||
bool sw_tx_support = false;
|
||||
struct list_head *iter;
|
||||
|
@ -376,7 +376,7 @@ EXPORT_SYMBOL(can_eth_ioctl_hwts);
|
||||
* supporting hardware timestamps
|
||||
*/
|
||||
int can_ethtool_op_get_ts_info_hwts(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping =
|
||||
SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
|
@ -777,7 +777,7 @@ static const struct net_device_ops peak_canfd_netdev_ops = {
|
||||
};
|
||||
|
||||
static int peak_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping =
|
||||
SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
|
@ -1148,7 +1148,7 @@ static int gs_usb_set_phys_id(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int gs_usb_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct gs_can *dev = netdev_priv(netdev);
|
||||
|
||||
|
@ -897,7 +897,7 @@ int peak_usb_set_eeprom(struct net_device *netdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pcan_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping =
|
||||
SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
|
@ -145,7 +145,7 @@ void peak_usb_get_ts_time(struct peak_time_ref *time_ref, u32 ts, ktime_t *tv);
|
||||
int peak_usb_netif_rx_64(struct sk_buff *skb, u32 ts_low, u32 ts_high);
|
||||
void peak_usb_async_complete(struct urb *urb);
|
||||
void peak_usb_restart_complete(struct peak_usb_device *dev);
|
||||
int pcan_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info);
|
||||
int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info);
|
||||
|
||||
/* common 32-bit CAN channel ID ethtool management */
|
||||
int peak_usb_get_eeprom_len(struct net_device *netdev);
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "hellcreek_ptp.h"
|
||||
|
||||
int hellcreek_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct hellcreek *hellcreek = ds->priv;
|
||||
|
||||
|
@ -48,7 +48,7 @@ void hellcreek_port_txtstamp(struct dsa_switch *ds, int port,
|
||||
struct sk_buff *skb);
|
||||
|
||||
int hellcreek_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
|
||||
long hellcreek_hwtstamp_work(struct ptp_clock_info *ptp);
|
||||
|
||||
|
@ -293,7 +293,7 @@ static int ksz_ptp_enable_mode(struct ksz_device *dev)
|
||||
/* The function is return back the capability of timestamping feature when
|
||||
* requested through ethtool -T <interface> utility
|
||||
*/
|
||||
int ksz_get_ts_info(struct dsa_switch *ds, int port, struct ethtool_ts_info *ts)
|
||||
int ksz_get_ts_info(struct dsa_switch *ds, int port, struct kernel_ethtool_ts_info *ts)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
struct ksz_ptp_data *ptp_data;
|
||||
|
@ -38,7 +38,7 @@ int ksz_ptp_clock_register(struct dsa_switch *ds);
|
||||
void ksz_ptp_clock_unregister(struct dsa_switch *ds);
|
||||
|
||||
int ksz_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *ts);
|
||||
struct kernel_ethtool_ts_info *ts);
|
||||
int ksz_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr);
|
||||
int ksz_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr);
|
||||
void ksz_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb);
|
||||
|
@ -64,7 +64,7 @@ static int mv88e6xxx_ptp_read(struct mv88e6xxx_chip *chip, int addr,
|
||||
#define TX_TSTAMP_TIMEOUT msecs_to_jiffies(40)
|
||||
|
||||
int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
const struct mv88e6xxx_ptp_ops *ptp_ops;
|
||||
struct mv88e6xxx_chip *chip;
|
||||
|
@ -121,7 +121,7 @@ void mv88e6xxx_port_txtstamp(struct dsa_switch *ds, int port,
|
||||
struct sk_buff *skb);
|
||||
|
||||
int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
|
||||
int mv88e6xxx_hwtstamp_setup(struct mv88e6xxx_chip *chip);
|
||||
void mv88e6xxx_hwtstamp_free(struct mv88e6xxx_chip *chip);
|
||||
@ -157,7 +157,7 @@ static inline void mv88e6xxx_port_txtstamp(struct dsa_switch *ds, int port,
|
||||
}
|
||||
|
||||
static inline int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
@ -1234,7 +1234,7 @@ static int felix_get_sset_count(struct dsa_switch *ds, int port, int sset)
|
||||
}
|
||||
|
||||
static int felix_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
|
@ -111,7 +111,7 @@ int sja1105_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr)
|
||||
}
|
||||
|
||||
int sja1105_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct sja1105_private *priv = ds->priv;
|
||||
struct sja1105_ptp_data *ptp_data = &priv->ptp_data;
|
||||
|
@ -101,7 +101,7 @@ void sja1105pqrs_ptp_cmd_packing(u8 *buf, struct sja1105_ptp_cmd *cmd,
|
||||
enum packing_op op);
|
||||
|
||||
int sja1105_get_ts_info(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *ts);
|
||||
struct kernel_ethtool_ts_info *ts);
|
||||
|
||||
void sja1105_ptp_txtstamp_skb(struct dsa_switch *ds, int slot,
|
||||
struct sk_buff *clone);
|
||||
|
@ -577,7 +577,7 @@ static int xgbe_set_rxfh(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int xgbe_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
||||
|
||||
|
@ -652,7 +652,7 @@ static int aq_ethtool_set_wol(struct net_device *ndev,
|
||||
}
|
||||
|
||||
static int aq_ethtool_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct aq_nic_s *aq_nic = netdev_priv(ndev);
|
||||
|
||||
|
@ -3634,7 +3634,7 @@ static int bnx2x_set_channels(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int bnx2x_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(dev);
|
||||
|
||||
|
@ -5024,7 +5024,7 @@ static int bnxt_get_dump_data(struct net_device *dev, struct ethtool_dump *dump,
|
||||
}
|
||||
|
||||
static int bnxt_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct bnxt *bp = netdev_priv(dev);
|
||||
struct bnxt_ptp_cfg *ptp;
|
||||
|
@ -6141,7 +6141,7 @@ static void tg3_refclk_write(struct tg3 *tp, u64 newval)
|
||||
|
||||
static inline void tg3_full_lock(struct tg3 *tp, int irq_sync);
|
||||
static inline void tg3_full_unlock(struct tg3 *tp);
|
||||
static int tg3_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
static int tg3_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct tg3 *tp = netdev_priv(dev);
|
||||
|
||||
|
@ -1168,7 +1168,7 @@ struct macb_ptp_info {
|
||||
s32 (*get_ptp_max_adj)(void);
|
||||
unsigned int (*get_tsu_rate)(struct macb *bp);
|
||||
int (*get_ts_info)(struct net_device *dev,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
int (*get_hwtst)(struct net_device *netdev,
|
||||
struct kernel_hwtstamp_config *tstamp_config);
|
||||
int (*set_hwtst)(struct net_device *netdev,
|
||||
|
@ -3399,7 +3399,7 @@ static s32 gem_get_ptp_max_adj(void)
|
||||
}
|
||||
|
||||
static int gem_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct macb *bp = netdev_priv(dev);
|
||||
|
||||
@ -3440,7 +3440,7 @@ static struct macb_ptp_info gem_ptp_info = {
|
||||
#endif
|
||||
|
||||
static int macb_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct macb *bp = netdev_priv(netdev);
|
||||
|
||||
|
@ -2497,7 +2497,7 @@ ret_intrmod:
|
||||
}
|
||||
|
||||
static int lio_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct lio *lio = GET_LIO(netdev);
|
||||
|
||||
|
@ -836,7 +836,7 @@ static int nicvf_set_pauseparam(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int nicvf_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct nicvf *nic = netdev_priv(netdev);
|
||||
|
||||
|
@ -1550,7 +1550,7 @@ out_free_fw:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int get_ts_info(struct net_device *dev, struct ethtool_ts_info *ts_info)
|
||||
static int get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct port_info *pi = netdev_priv(dev);
|
||||
struct adapter *adapter = pi->adapter;
|
||||
|
@ -599,7 +599,7 @@ static int enic_set_rxfh(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int enic_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
SOF_TIMESTAMPING_RX_SOFTWARE |
|
||||
|
@ -305,7 +305,7 @@ static void tsnep_ethtool_get_channels(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int tsnep_ethtool_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct tsnep_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
|
@ -394,7 +394,7 @@ static int dpaa_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
|
||||
}
|
||||
|
||||
static int dpaa_get_ts_info(struct net_device *net_dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct device *dev = net_dev->dev.parent;
|
||||
struct device_node *mac_node = dev->of_node;
|
||||
|
@ -794,7 +794,7 @@ int dpaa2_phc_index = -1;
|
||||
EXPORT_SYMBOL(dpaa2_phc_index);
|
||||
|
||||
static int dpaa2_eth_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
if (!dpaa2_ptp)
|
||||
return ethtool_op_get_ts_info(dev, info);
|
||||
|
@ -841,7 +841,7 @@ static int enetc_set_coalesce(struct net_device *ndev,
|
||||
}
|
||||
|
||||
static int enetc_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
int *phc_idx;
|
||||
|
||||
|
@ -2768,7 +2768,7 @@ static void fec_enet_get_regs(struct net_device *ndev,
|
||||
}
|
||||
|
||||
static int fec_enet_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct fec_enet_private *fep = netdev_priv(ndev);
|
||||
|
||||
|
@ -1448,7 +1448,7 @@ static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
|
||||
}
|
||||
|
||||
static int gfar_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct gfar_private *priv = netdev_priv(dev);
|
||||
struct platform_device *ptp_dev;
|
||||
|
@ -1040,7 +1040,7 @@ static int fun_set_rxfh(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int fun_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
|
||||
SOF_TIMESTAMPING_RX_HARDWARE |
|
||||
|
@ -786,7 +786,7 @@ struct hnae3_ae_ops {
|
||||
void (*get_rx_hwts)(struct hnae3_handle *handle, struct sk_buff *skb,
|
||||
u32 nsec, u32 sec);
|
||||
int (*get_ts_info)(struct hnae3_handle *handle,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
int (*get_link_diagnosis_info)(struct hnae3_handle *handle,
|
||||
u32 *status_code);
|
||||
void (*clean_vf_config)(struct hnae3_ae_dev *ae_dev, int num_vfs);
|
||||
|
@ -2009,7 +2009,7 @@ static int hns3_set_tunable(struct net_device *netdev,
|
||||
ETHTOOL_RING_USE_TX_PUSH)
|
||||
|
||||
static int hns3_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct hnae3_handle *handle = hns3_get_handle(netdev);
|
||||
|
||||
|
@ -378,7 +378,7 @@ int hclge_ptp_set_cfg(struct hclge_dev *hdev, struct ifreq *ifr)
|
||||
}
|
||||
|
||||
int hclge_ptp_get_ts_info(struct hnae3_handle *handle,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct hclge_vport *vport = hclge_get_vport(handle);
|
||||
struct hclge_dev *hdev = vport->back;
|
||||
|
@ -138,6 +138,6 @@ int hclge_ptp_set_cfg(struct hclge_dev *hdev, struct ifreq *ifr);
|
||||
int hclge_ptp_init(struct hclge_dev *hdev);
|
||||
void hclge_ptp_uninit(struct hclge_dev *hdev);
|
||||
int hclge_ptp_get_ts_info(struct hnae3_handle *handle,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
int hclge_ptp_cfg_qry(struct hclge_dev *hdev, u32 *cfg);
|
||||
#endif
|
||||
|
@ -2263,7 +2263,7 @@ static int e1000e_set_eee(struct net_device *netdev, struct ethtool_keee *edata)
|
||||
}
|
||||
|
||||
static int e1000e_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
|
@ -2546,7 +2546,7 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
|
||||
}
|
||||
|
||||
static int i40e_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct i40e_pf *pf = i40e_netdev_to_pf(dev);
|
||||
|
||||
|
@ -3783,7 +3783,7 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
|
||||
}
|
||||
|
||||
static int
|
||||
ice_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
ice_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct ice_pf *pf = ice_netdev_to_pf(dev);
|
||||
|
||||
|
@ -2381,7 +2381,7 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
||||
}
|
||||
|
||||
static int igb_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct igb_adapter *adapter = netdev_priv(dev);
|
||||
|
||||
|
@ -1559,7 +1559,7 @@ static int igc_ethtool_set_channels(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int igc_ethtool_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct igc_adapter *adapter = netdev_priv(dev);
|
||||
|
||||
|
@ -3170,7 +3170,7 @@ static int ixgbe_set_rxfh(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int ixgbe_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct ixgbe_adapter *adapter = netdev_priv(dev);
|
||||
|
||||
|
@ -5259,7 +5259,7 @@ static int mvpp2_get_ts_config(struct mvpp2_port *port, struct ifreq *ifr)
|
||||
}
|
||||
|
||||
static int mvpp2_ethtool_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct mvpp2_port *port = netdev_priv(dev);
|
||||
|
||||
|
@ -954,7 +954,7 @@ static u32 otx2_get_link(struct net_device *netdev)
|
||||
}
|
||||
|
||||
static int otx2_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct otx2_nic *pfvf = netdev_priv(netdev);
|
||||
|
||||
|
@ -1884,7 +1884,7 @@ out:
|
||||
}
|
||||
|
||||
static int mlx4_en_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct mlx4_en_priv *priv = netdev_priv(dev);
|
||||
struct mlx4_en_dev *mdev = priv->mdev;
|
||||
|
@ -1191,7 +1191,7 @@ int mlx5e_set_per_queue_coalesce(struct net_device *dev, u32 queue,
|
||||
u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
|
||||
u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
|
||||
int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
|
||||
struct ethtool_flash *flash);
|
||||
|
||||
|
@ -1658,7 +1658,7 @@ static int mlx5e_set_pauseparam(struct net_device *netdev,
|
||||
}
|
||||
|
||||
int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
|
||||
@ -1682,7 +1682,7 @@ int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
|
||||
}
|
||||
|
||||
static int mlx5e_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct mlx5e_priv *priv = netdev_priv(dev);
|
||||
|
||||
|
@ -136,7 +136,7 @@ static int mlx5i_get_coalesce(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int mlx5i_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct mlx5e_priv *priv = mlx5i_epriv(netdev);
|
||||
|
||||
|
@ -238,7 +238,7 @@ struct mlxsw_sp_ptp_ops {
|
||||
struct hwtstamp_config *config);
|
||||
void (*shaper_work)(struct work_struct *work);
|
||||
int (*get_ts_info)(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
int (*get_stats_count)(void);
|
||||
void (*get_stats_strings)(u8 **p);
|
||||
void (*get_stats)(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||
|
@ -1082,7 +1082,7 @@ mlxsw_sp_set_module_eeprom_by_page(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int
|
||||
mlxsw_sp_get_ts_info(struct net_device *netdev, struct ethtool_ts_info *info)
|
||||
mlxsw_sp_get_ts_info(struct net_device *netdev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(netdev);
|
||||
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
|
||||
|
@ -1276,7 +1276,7 @@ int mlxsw_sp1_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||
}
|
||||
|
||||
int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->phc_index = ptp_clock_index(mlxsw_sp->clock->ptp);
|
||||
|
||||
@ -1661,7 +1661,7 @@ err_get_message_types:
|
||||
}
|
||||
|
||||
int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->phc_index = ptp_clock_index(mlxsw_sp->clock->ptp);
|
||||
|
||||
|
@ -11,7 +11,7 @@ struct mlxsw_sp;
|
||||
struct mlxsw_sp_port;
|
||||
struct mlxsw_sp_ptp_clock;
|
||||
|
||||
static inline int mlxsw_sp_ptp_get_ts_info_noptp(struct ethtool_ts_info *info)
|
||||
static inline int mlxsw_sp_ptp_get_ts_info_noptp(struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
|
||||
SOF_TIMESTAMPING_SOFTWARE;
|
||||
@ -50,7 +50,7 @@ int mlxsw_sp1_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||
void mlxsw_sp1_ptp_shaper_work(struct work_struct *work);
|
||||
|
||||
int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
|
||||
int mlxsw_sp1_get_stats_count(void);
|
||||
void mlxsw_sp1_get_stats_strings(u8 **p);
|
||||
@ -84,7 +84,7 @@ int mlxsw_sp2_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||
struct hwtstamp_config *config);
|
||||
|
||||
int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
|
||||
int mlxsw_sp2_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core,
|
||||
struct mlxsw_sp_port *mlxsw_sp_port,
|
||||
@ -152,7 +152,7 @@ static inline void mlxsw_sp1_ptp_shaper_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
static inline int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
return mlxsw_sp_ptp_get_ts_info_noptp(info);
|
||||
}
|
||||
@ -227,7 +227,7 @@ mlxsw_sp2_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||
}
|
||||
|
||||
static inline int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
return mlxsw_sp_ptp_get_ts_info_noptp(info);
|
||||
}
|
||||
|
@ -1029,7 +1029,7 @@ static int lan743x_ethtool_set_rxfh(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int lan743x_ethtool_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct lan743x_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
|
@ -538,7 +538,7 @@ static int lan966x_set_pauseparam(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int lan966x_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct lan966x_port *port = netdev_priv(dev);
|
||||
struct lan966x *lan966x = port->lan966x;
|
||||
|
@ -1183,7 +1183,7 @@ static void sparx5_config_port_stats(struct sparx5 *sparx5, int portno)
|
||||
}
|
||||
|
||||
static int sparx5_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct sparx5_port *port = netdev_priv(dev);
|
||||
struct sparx5 *sparx5 = port->sparx5;
|
||||
|
@ -980,7 +980,7 @@ static int ocelot_port_get_sset_count(struct net_device *dev, int sset)
|
||||
}
|
||||
|
||||
static int ocelot_port_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct ocelot_port_private *priv = netdev_priv(dev);
|
||||
struct ocelot *ocelot = priv->port.ocelot;
|
||||
|
@ -580,7 +580,7 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
|
||||
EXPORT_SYMBOL(ocelot_hwstamp_set);
|
||||
|
||||
int ocelot_get_ts_info(struct ocelot *ocelot, int port,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->phc_index = ocelot->ptp_clock ?
|
||||
ptp_clock_index(ocelot->ptp_clock) : -1;
|
||||
|
@ -977,7 +977,7 @@ static int ionic_get_module_eeprom(struct net_device *netdev,
|
||||
}
|
||||
|
||||
static int ionic_get_ts_info(struct net_device *netdev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct ionic_lif *lif = netdev_priv(netdev);
|
||||
struct ionic *ionic = lif->ionic;
|
||||
|
@ -1137,7 +1137,7 @@ static int qede_set_channels(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int qede_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct qede_dev *edev = netdev_priv(dev);
|
||||
|
||||
|
@ -321,7 +321,7 @@ int qede_ptp_hw_ts(struct qede_dev *edev, struct ifreq *ifr)
|
||||
sizeof(config)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info)
|
||||
int qede_ptp_get_ts_info(struct qede_dev *edev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct qede_ptp *ptp = edev->ptp;
|
||||
|
||||
|
@ -17,7 +17,7 @@ void qede_ptp_tx_ts(struct qede_dev *edev, struct sk_buff *skb);
|
||||
int qede_ptp_hw_ts(struct qede_dev *edev, struct ifreq *req);
|
||||
void qede_ptp_disable(struct qede_dev *edev);
|
||||
int qede_ptp_enable(struct qede_dev *edev);
|
||||
int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *ts);
|
||||
int qede_ptp_get_ts_info(struct qede_dev *edev, struct kernel_ethtool_ts_info *ts);
|
||||
|
||||
static inline void qede_ptp_record_rx_ts(struct qede_dev *edev,
|
||||
union eth_rx_cqe *cqe,
|
||||
|
@ -1737,7 +1737,7 @@ static int ravb_set_ringparam(struct net_device *ndev,
|
||||
}
|
||||
|
||||
static int ravb_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct ravb_private *priv = netdev_priv(ndev);
|
||||
const struct ravb_hw_info *hw_info = priv->info;
|
||||
|
@ -1809,7 +1809,7 @@ static const struct net_device_ops rswitch_netdev_ops = {
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
};
|
||||
|
||||
static int rswitch_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info)
|
||||
static int rswitch_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct rswitch_device *rdev = netdev_priv(ndev);
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ static const struct net_device_ops rtsn_netdev_ops = {
|
||||
};
|
||||
|
||||
static int rtsn_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct rtsn_private *priv = netdev_priv(ndev);
|
||||
|
||||
|
@ -226,7 +226,7 @@ static void efx_ethtool_get_fec_stats(struct net_device *net_dev,
|
||||
}
|
||||
|
||||
static int efx_ethtool_get_ts_info(struct net_device *net_dev,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct efx_nic *efx = efx_netdev_priv(net_dev);
|
||||
|
||||
|
@ -297,7 +297,7 @@ static inline struct falcon_board *falcon_board(struct ef4_nic *efx)
|
||||
return &data->board;
|
||||
}
|
||||
|
||||
struct ethtool_ts_info;
|
||||
struct kernel_ethtool_ts_info;
|
||||
|
||||
extern const struct ef4_nic_type falcon_a1_nic_type;
|
||||
extern const struct ef4_nic_type falcon_b0_nic_type;
|
||||
|
@ -1864,7 +1864,7 @@ static int efx_ptp_ts_init(struct efx_nic *efx, struct kernel_hwtstamp_config *i
|
||||
return 0;
|
||||
}
|
||||
|
||||
void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info)
|
||||
void efx_ptp_get_ts_info(struct efx_nic *efx, struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct efx_ptp_data *ptp = efx->ptp_data;
|
||||
struct efx_nic *primary = efx->primary;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <linux/net_tstamp.h>
|
||||
#include "net_driver.h"
|
||||
|
||||
struct ethtool_ts_info;
|
||||
struct kernel_ethtool_ts_info;
|
||||
int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel);
|
||||
void efx_ptp_defer_probe_with_channel(struct efx_nic *efx);
|
||||
struct efx_channel *efx_ptp_channel(struct efx_nic *efx);
|
||||
@ -23,7 +23,8 @@ int efx_ptp_set_ts_config(struct efx_nic *efx,
|
||||
struct netlink_ext_ack *extack);
|
||||
int efx_ptp_get_ts_config(struct efx_nic *efx,
|
||||
struct kernel_hwtstamp_config *config);
|
||||
void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info);
|
||||
void efx_ptp_get_ts_info(struct efx_nic *efx,
|
||||
struct kernel_ethtool_ts_info *ts_info);
|
||||
bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
|
||||
int efx_ptp_get_mode(struct efx_nic *efx);
|
||||
int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
|
||||
|
@ -226,7 +226,7 @@ static void efx_ethtool_get_fec_stats(struct net_device *net_dev,
|
||||
}
|
||||
|
||||
static int efx_ethtool_get_ts_info(struct net_device *net_dev,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct efx_nic *efx = netdev_priv(net_dev);
|
||||
|
||||
|
@ -1780,7 +1780,7 @@ static int efx_ptp_ts_init(struct efx_nic *efx,
|
||||
}
|
||||
|
||||
void efx_siena_ptp_get_ts_info(struct efx_nic *efx,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct efx_ptp_data *ptp = efx->ptp_data;
|
||||
struct efx_nic *primary = efx->primary;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <linux/net_tstamp.h>
|
||||
#include "net_driver.h"
|
||||
|
||||
struct ethtool_ts_info;
|
||||
struct kernel_ethtool_ts_info;
|
||||
void efx_siena_ptp_defer_probe_with_channel(struct efx_nic *efx);
|
||||
struct efx_channel *efx_siena_ptp_channel(struct efx_nic *efx);
|
||||
int efx_siena_ptp_set_ts_config(struct efx_nic *efx,
|
||||
@ -21,7 +21,7 @@ int efx_siena_ptp_set_ts_config(struct efx_nic *efx,
|
||||
int efx_siena_ptp_get_ts_config(struct efx_nic *efx,
|
||||
struct kernel_hwtstamp_config *config);
|
||||
void efx_siena_ptp_get_ts_info(struct efx_nic *efx,
|
||||
struct ethtool_ts_info *ts_info);
|
||||
struct kernel_ethtool_ts_info *ts_info);
|
||||
bool efx_siena_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
|
||||
int efx_siena_ptp_get_mode(struct efx_nic *efx);
|
||||
int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
|
||||
|
@ -1199,7 +1199,7 @@ static int stmmac_set_channels(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int stmmac_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
|
||||
|
@ -692,7 +692,7 @@ static void am65_cpsw_get_eth_mac_stats(struct net_device *ndev,
|
||||
};
|
||||
|
||||
static int am65_cpsw_get_ethtool_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct am65_cpsw_common *common = am65_ndev_to_common(ndev);
|
||||
unsigned int ptp_v2_filter;
|
||||
|
@ -717,7 +717,7 @@ err:
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_TI_CPTS)
|
||||
int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info)
|
||||
int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
|
||||
|
||||
@ -738,7 +738,7 @@ int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info)
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info)
|
||||
int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping =
|
||||
SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
|
@ -510,6 +510,6 @@ int cpsw_set_ringparam(struct net_device *ndev,
|
||||
int cpsw_set_channels_common(struct net_device *ndev,
|
||||
struct ethtool_channels *chs,
|
||||
cpdma_handler_fn rx_handler);
|
||||
int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info);
|
||||
int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info);
|
||||
|
||||
#endif /* DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ */
|
||||
|
@ -110,7 +110,7 @@ static void emac_get_ethtool_stats(struct net_device *ndev,
|
||||
}
|
||||
|
||||
static int emac_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct prueth_emac *emac = netdev_priv(ndev);
|
||||
|
||||
|
@ -1999,7 +1999,7 @@ static int keystone_set_link_ksettings(struct net_device *ndev,
|
||||
|
||||
#if IS_ENABLED(CONFIG_TI_CPTS)
|
||||
static int keystone_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct netcp_intf *netcp = netdev_priv(ndev);
|
||||
struct gbe_intf *gbe_intf;
|
||||
@ -2027,7 +2027,7 @@ static int keystone_get_ts_info(struct net_device *ndev,
|
||||
}
|
||||
#else
|
||||
static int keystone_get_ts_info(struct net_device *ndev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping =
|
||||
SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
|
@ -1015,7 +1015,7 @@ static void ixp4xx_get_drvinfo(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int ixp4xx_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct port *port = netdev_priv(dev);
|
||||
|
||||
|
@ -1084,7 +1084,7 @@ static int macvlan_ethtool_get_link_ksettings(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int macvlan_ethtool_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct net_device *real_dev = macvlan_dev_real_dev(dev);
|
||||
|
||||
|
@ -148,7 +148,7 @@ nsim_get_fec_stats(struct net_device *dev, struct ethtool_fec_stats *fec_stats)
|
||||
}
|
||||
|
||||
static int nsim_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct netdevsim *ns = netdev_priv(dev);
|
||||
|
||||
|
@ -841,7 +841,7 @@ static int bcm_ptp_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
}
|
||||
|
||||
static int bcm_ptp_ts_info(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct bcm_ptp_private *priv = mii2priv(mii_ts);
|
||||
|
||||
@ -931,6 +931,9 @@ struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev)
|
||||
return ERR_CAST(clock);
|
||||
priv->ptp_clock = clock;
|
||||
|
||||
/* Timestamp selected by default to keep legacy API */
|
||||
phydev->default_timestamp = true;
|
||||
|
||||
priv->phydev = phydev;
|
||||
bcm_ptp_init(priv);
|
||||
|
||||
|
@ -1395,7 +1395,7 @@ static void dp83640_txtstamp(struct mii_timestamper *mii_ts,
|
||||
}
|
||||
|
||||
static int dp83640_ts_info(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct dp83640_private *dp83640 =
|
||||
container_of(mii_ts, struct dp83640_private, mii_ts);
|
||||
@ -1447,6 +1447,8 @@ static int dp83640_probe(struct phy_device *phydev)
|
||||
for (i = 0; i < MAX_RXTS; i++)
|
||||
list_add(&dp83640->rx_pool_data[i].list, &dp83640->rxpool);
|
||||
|
||||
/* Timestamp selected by default to keep legacy API */
|
||||
phydev->default_timestamp = true;
|
||||
phydev->mii_ts = &dp83640->mii_ts;
|
||||
phydev->priv = dp83640;
|
||||
|
||||
|
@ -2552,7 +2552,7 @@ static void lan8814_ptp_tx_ts_get(struct phy_device *phydev,
|
||||
*seq_id = lanphy_read_page_reg(phydev, 5, PTP_TX_MSG_HEADER2);
|
||||
}
|
||||
|
||||
static int lan8814_ts_info(struct mii_timestamper *mii_ts, struct ethtool_ts_info *info)
|
||||
static int lan8814_ts_info(struct mii_timestamper *mii_ts, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct kszphy_ptp_priv *ptp_priv = container_of(mii_ts, struct kszphy_ptp_priv, mii_ts);
|
||||
struct phy_device *phydev = ptp_priv->phydev;
|
||||
@ -3781,6 +3781,9 @@ static void lan8814_ptp_init(struct phy_device *phydev)
|
||||
ptp_priv->mii_ts.ts_info = lan8814_ts_info;
|
||||
|
||||
phydev->mii_ts = &ptp_priv->mii_ts;
|
||||
|
||||
/* Timestamp selected by default to keep legacy API */
|
||||
phydev->default_timestamp = true;
|
||||
}
|
||||
|
||||
static int lan8814_ptp_probe_once(struct phy_device *phydev)
|
||||
@ -4314,7 +4317,7 @@ static irqreturn_t lan8841_handle_interrupt(struct phy_device *phydev)
|
||||
}
|
||||
|
||||
static int lan8841_ts_info(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct kszphy_ptp_priv *ptp_priv;
|
||||
|
||||
@ -5279,6 +5282,9 @@ static int lan8841_probe(struct phy_device *phydev)
|
||||
|
||||
phydev->mii_ts = &ptp_priv->mii_ts;
|
||||
|
||||
/* Timestamp selected by default to keep legacy API */
|
||||
phydev->default_timestamp = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1134,7 +1134,7 @@ static int vsc85xx_hwtstamp(struct mii_timestamper *mii_ts,
|
||||
}
|
||||
|
||||
static int vsc85xx_ts_info(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct vsc8531_private *vsc8531 =
|
||||
container_of(mii_ts, struct vsc8531_private, mii_ts);
|
||||
@ -1570,6 +1570,9 @@ int vsc8584_ptp_probe(struct phy_device *phydev)
|
||||
return PTR_ERR(vsc8531->load_save);
|
||||
}
|
||||
|
||||
/* Timestamp selected by default to keep legacy API */
|
||||
phydev->default_timestamp = true;
|
||||
|
||||
vsc8531->ptp->phydev = phydev;
|
||||
|
||||
return 0;
|
||||
|
@ -1058,7 +1058,7 @@ nxp_c45_no_ptp_irq:
|
||||
}
|
||||
|
||||
static int nxp_c45_ts_info(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *ts_info)
|
||||
struct kernel_ethtool_ts_info *ts_info)
|
||||
{
|
||||
struct nxp_c45_phy *priv = container_of(mii_ts, struct nxp_c45_phy,
|
||||
mii_ts);
|
||||
@ -1660,6 +1660,9 @@ static int nxp_c45_probe(struct phy_device *phydev)
|
||||
priv->mii_ts.ts_info = nxp_c45_ts_info;
|
||||
phydev->mii_ts = &priv->mii_ts;
|
||||
ret = nxp_c45_init_ptp_clock(priv);
|
||||
|
||||
/* Timestamp selected by default to keep legacy API */
|
||||
phydev->default_timestamp = true;
|
||||
} else {
|
||||
phydev_dbg(phydev, "PTP support not enabled even if the phy supports it");
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ static bool ines_timestamp_expired(struct ines_timestamp *ts)
|
||||
}
|
||||
|
||||
static int ines_ts_info(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
info->so_timestamping =
|
||||
SOF_TIMESTAMPING_TX_HARDWARE |
|
||||
|
@ -247,7 +247,7 @@ static int qeth_set_channels(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int qeth_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
struct qeth_card *card = dev->ml_priv;
|
||||
|
||||
|
@ -186,7 +186,7 @@ void close_candev(struct net_device *dev);
|
||||
int can_change_mtu(struct net_device *dev, int new_mtu);
|
||||
int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd);
|
||||
int can_ethtool_op_get_ts_info_hwts(struct net_device *dev,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
|
||||
int register_candev(struct net_device *dev);
|
||||
void unregister_candev(struct net_device *dev);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <uapi/linux/ethtool.h>
|
||||
#include <uapi/linux/net_tstamp.h>
|
||||
|
||||
struct compat_ethtool_rx_flow_spec {
|
||||
u32 flow_type;
|
||||
@ -705,6 +706,22 @@ struct ethtool_rxfh_param {
|
||||
u8 input_xfrm;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct kernel_ethtool_ts_info - kernel copy of struct ethtool_ts_info
|
||||
* @cmd: command number = %ETHTOOL_GET_TS_INFO
|
||||
* @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags
|
||||
* @phc_index: device index of the associated PHC, or -1 if there is none
|
||||
* @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values
|
||||
* @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values
|
||||
*/
|
||||
struct kernel_ethtool_ts_info {
|
||||
u32 cmd;
|
||||
u32 so_timestamping;
|
||||
int phc_index;
|
||||
enum hwtstamp_tx_types tx_types;
|
||||
enum hwtstamp_rx_filters rx_filters;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ethtool_ops - optional netdev operations
|
||||
* @cap_link_lanes_supported: indicates if the driver supports lanes
|
||||
@ -1018,7 +1035,7 @@ struct ethtool_ops {
|
||||
int (*get_dump_data)(struct net_device *,
|
||||
struct ethtool_dump *, void *);
|
||||
int (*set_dump)(struct net_device *, struct ethtool_dump *);
|
||||
int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *);
|
||||
int (*get_ts_info)(struct net_device *, struct kernel_ethtool_ts_info *);
|
||||
void (*get_ts_stats)(struct net_device *dev,
|
||||
struct ethtool_ts_stats *ts_stats);
|
||||
int (*get_module_info)(struct net_device *,
|
||||
@ -1179,7 +1196,8 @@ int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index);
|
||||
|
||||
/* Some generic methods drivers may use in their ethtool_ops */
|
||||
u32 ethtool_op_get_link(struct net_device *dev);
|
||||
int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti);
|
||||
int ethtool_op_get_ts_info(struct net_device *dev,
|
||||
struct kernel_ethtool_ts_info *eti);
|
||||
|
||||
/**
|
||||
* ethtool_mm_frag_size_add_to_min - Translate (standard) additional fragment
|
||||
@ -1228,7 +1246,8 @@ static inline int ethtool_mm_frag_size_min_to_add(u32 val_min, u32 *val_add,
|
||||
* @info: buffer to hold the result
|
||||
* Returns zero on success, non-zero otherwise.
|
||||
*/
|
||||
int ethtool_get_ts_info_by_layer(struct net_device *dev, struct ethtool_ts_info *info);
|
||||
int ethtool_get_ts_info_by_layer(struct net_device *dev,
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
|
||||
/**
|
||||
* ethtool_sprintf - Write formatted string to ethtool string data
|
||||
|
@ -59,7 +59,7 @@ struct mii_timestamper {
|
||||
struct phy_device *phydev);
|
||||
|
||||
int (*ts_info)(struct mii_timestamper *mii_ts,
|
||||
struct ethtool_ts_info *ts_info);
|
||||
struct kernel_ethtool_ts_info *ts_info);
|
||||
|
||||
struct device *device;
|
||||
};
|
||||
|
@ -5,7 +5,16 @@
|
||||
|
||||
#include <uapi/linux/net_tstamp.h>
|
||||
|
||||
#define SOF_TIMESTAMPING_SOFTWARE_MASK (SOF_TIMESTAMPING_RX_SOFTWARE | \
|
||||
SOF_TIMESTAMPING_TX_SOFTWARE | \
|
||||
SOF_TIMESTAMPING_SOFTWARE)
|
||||
|
||||
#define SOF_TIMESTAMPING_HARDWARE_MASK (SOF_TIMESTAMPING_RX_HARDWARE | \
|
||||
SOF_TIMESTAMPING_TX_HARDWARE | \
|
||||
SOF_TIMESTAMPING_RAW_HARDWARE)
|
||||
|
||||
enum hwtstamp_source {
|
||||
HWTSTAMP_SOURCE_UNSPEC,
|
||||
HWTSTAMP_SOURCE_NETDEV,
|
||||
HWTSTAMP_SOURCE_PHYLIB,
|
||||
};
|
||||
|
@ -616,6 +616,8 @@ struct macsec_ops;
|
||||
* handling shall be postponed until PHY has resumed
|
||||
* @irq_rerun: Flag indicating interrupts occurred while PHY was suspended,
|
||||
* requiring a rerun of the interrupt handler after resume
|
||||
* @default_timestamp: Flag indicating whether we are using the phy
|
||||
* timestamp as the default one
|
||||
* @interface: enum phy_interface_t value
|
||||
* @possible_interfaces: bitmap if interface modes that the attached PHY
|
||||
* will switch between depending on media speed.
|
||||
@ -681,6 +683,8 @@ struct phy_device {
|
||||
unsigned irq_suspended:1;
|
||||
unsigned irq_rerun:1;
|
||||
|
||||
unsigned default_timestamp:1;
|
||||
|
||||
int rate_matching;
|
||||
|
||||
enum phy_state state;
|
||||
@ -1614,7 +1618,7 @@ static inline bool phy_rxtstamp(struct phy_device *phydev, struct sk_buff *skb,
|
||||
}
|
||||
|
||||
static inline int phy_ts_info(struct phy_device *phydev,
|
||||
struct ethtool_ts_info *tsinfo)
|
||||
struct kernel_ethtool_ts_info *tsinfo)
|
||||
{
|
||||
return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo);
|
||||
}
|
||||
@ -1625,6 +1629,21 @@ static inline void phy_txtstamp(struct phy_device *phydev, struct sk_buff *skb,
|
||||
phydev->mii_ts->txtstamp(phydev->mii_ts, skb, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* phy_is_default_hwtstamp - Is the PHY hwtstamp the default timestamp
|
||||
* @phydev: Pointer to phy_device
|
||||
*
|
||||
* This is used to get default timestamping device taking into account
|
||||
* the new API choice, which is selecting the timestamping from MAC by
|
||||
* default if the phydev does not have default_timestamp flag enabled.
|
||||
*
|
||||
* Return: True if phy is the default hw timestamp, false otherwise.
|
||||
*/
|
||||
static inline bool phy_is_default_hwtstamp(struct phy_device *phydev)
|
||||
{
|
||||
return phy_has_hwtstamp(phydev) && phydev->default_timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* phy_is_internal - Convenience function for testing if a PHY is internal
|
||||
* @phydev: the phy_device struct
|
||||
|
@ -936,7 +936,7 @@ struct dsa_switch_ops {
|
||||
* ethtool timestamp info
|
||||
*/
|
||||
int (*get_ts_info)(struct dsa_switch *ds, int port,
|
||||
struct ethtool_ts_info *ts);
|
||||
struct kernel_ethtool_ts_info *ts);
|
||||
|
||||
/*
|
||||
* ethtool MAC merge layer
|
||||
|
@ -1016,7 +1016,7 @@ void ocelot_port_get_eth_mac_stats(struct ocelot *ocelot, int port,
|
||||
void ocelot_port_get_eth_phy_stats(struct ocelot *ocelot, int port,
|
||||
struct ethtool_eth_phy_stats *phy_stats);
|
||||
int ocelot_get_ts_info(struct ocelot *ocelot, int port,
|
||||
struct ethtool_ts_info *info);
|
||||
struct kernel_ethtool_ts_info *info);
|
||||
void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs);
|
||||
int ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, bool enabled,
|
||||
struct netlink_ext_ack *extack);
|
||||
|
@ -677,7 +677,7 @@ static void vlan_ethtool_get_drvinfo(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int vlan_ethtool_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *info)
|
||||
struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
const struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
|
||||
return ethtool_get_ts_info_by_layer(vlan->real_dev, info);
|
||||
|
@ -259,9 +259,7 @@ static int dev_eth_ioctl(struct net_device *dev,
|
||||
* @dev: Network device
|
||||
* @cfg: Timestamping configuration structure
|
||||
*
|
||||
* Helper for enforcing a common policy that phylib timestamping, if available,
|
||||
* should take precedence in front of hardware timestamping provided by the
|
||||
* netdev.
|
||||
* Helper for calling the default hardware provider timestamping.
|
||||
*
|
||||
* Note: phy_mii_ioctl() only handles SIOCSHWTSTAMP (not SIOCGHWTSTAMP), and
|
||||
* there only exists a phydev->mii_ts->hwtstamp() method. So this will return
|
||||
@ -271,7 +269,7 @@ static int dev_eth_ioctl(struct net_device *dev,
|
||||
static int dev_get_hwtstamp_phylib(struct net_device *dev,
|
||||
struct kernel_hwtstamp_config *cfg)
|
||||
{
|
||||
if (phy_has_hwtstamp(dev->phydev))
|
||||
if (phy_is_default_hwtstamp(dev->phydev))
|
||||
return phy_hwtstamp_get(dev->phydev, cfg);
|
||||
|
||||
return dev->netdev_ops->ndo_hwtstamp_get(dev, cfg);
|
||||
@ -327,7 +325,7 @@ int dev_set_hwtstamp_phylib(struct net_device *dev,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
const struct net_device_ops *ops = dev->netdev_ops;
|
||||
bool phy_ts = phy_has_hwtstamp(dev->phydev);
|
||||
bool phy_ts = phy_is_default_hwtstamp(dev->phydev);
|
||||
struct kernel_hwtstamp_config old_cfg = {};
|
||||
bool changed = false;
|
||||
int err;
|
||||
|
@ -25,7 +25,8 @@ void skb_clone_tx_timestamp(struct sk_buff *skb)
|
||||
struct sk_buff *clone;
|
||||
unsigned int type;
|
||||
|
||||
if (!skb->sk)
|
||||
if (!skb->sk || !skb->dev ||
|
||||
!phy_is_default_hwtstamp(skb->dev->phydev))
|
||||
return;
|
||||
|
||||
type = classify(skb);
|
||||
@ -47,7 +48,7 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb)
|
||||
struct mii_timestamper *mii_ts;
|
||||
unsigned int type;
|
||||
|
||||
if (!skb->dev || !skb->dev->phydev || !skb->dev->phydev->mii_ts)
|
||||
if (!skb->dev || !phy_is_default_hwtstamp(skb->dev->phydev))
|
||||
return false;
|
||||
|
||||
if (skb_headroom(skb) < ETH_HLEN)
|
||||
|
@ -1729,7 +1729,7 @@ static int dsa_user_set_rxnfc(struct net_device *dev,
|
||||
}
|
||||
|
||||
static int dsa_user_get_ts_info(struct net_device *dev,
|
||||
struct ethtool_ts_info *ts)
|
||||
struct kernel_ethtool_ts_info *ts)
|
||||
{
|
||||
struct dsa_user_priv *p = netdev_priv(dev);
|
||||
struct dsa_switch *ds = p->dp->ds;
|
||||
|
@ -661,7 +661,7 @@ int ethtool_check_ops(const struct ethtool_ops *ops)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
int __ethtool_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
const struct ethtool_ops *ops = dev->ethtool_ops;
|
||||
struct phy_device *phydev = dev->phydev;
|
||||
@ -669,7 +669,7 @@ int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
memset(info, 0, sizeof(*info));
|
||||
info->cmd = ETHTOOL_GET_TS_INFO;
|
||||
|
||||
if (phy_has_tsinfo(phydev))
|
||||
if (phy_is_default_hwtstamp(phydev) && phy_has_tsinfo(phydev))
|
||||
return phy_ts_info(phydev, info);
|
||||
if (ops->get_ts_info)
|
||||
return ops->get_ts_info(dev, info);
|
||||
@ -683,7 +683,7 @@ int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
|
||||
int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index)
|
||||
{
|
||||
struct ethtool_ts_info info = { };
|
||||
struct kernel_ethtool_ts_info info = { };
|
||||
int num = 0;
|
||||
|
||||
if (!__ethtool_get_ts_info(dev, &info))
|
||||
@ -693,7 +693,7 @@ int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index)
|
||||
}
|
||||
EXPORT_SYMBOL(ethtool_get_phc_vclocks);
|
||||
|
||||
int ethtool_get_ts_info_by_layer(struct net_device *dev, struct ethtool_ts_info *info)
|
||||
int ethtool_get_ts_info_by_layer(struct net_device *dev, struct kernel_ethtool_ts_info *info)
|
||||
{
|
||||
return __ethtool_get_ts_info(dev, info);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user