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

net: Add struct kernel_ethtool_ts_info

In prevision to add new UAPI for hwtstamp we will be limited to the struct
ethtool_ts_info that is currently passed in fixed binary format through the
ETHTOOL_GET_TS_INFO ethtool ioctl. It would be good if new kernel code
already started operating on an extensible kernel variant of that
structure, similar in concept to struct kernel_hwtstamp_config vs struct
hwtstamp_config.

Since struct ethtool_ts_info is in include/uapi/linux/ethtool.h, here
we introduce the kernel-only structure in include/linux/ethtool.h.
The manual copy is then made in the function called by ETHTOOL_GET_TS_INFO.

Acked-by: Shannon Nelson <shannon.nelson@amd.com>
Acked-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20240709-feature_ptp_netnext-v17-6-b5317f50df2a@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kory Maincent and committed by
Jakub Kicinski
2111375b bc5a07ed

+151 -123
+2 -2
drivers/net/bonding/bond_main.c
··· 5755 5755 } 5756 5756 5757 5757 static int bond_ethtool_get_ts_info(struct net_device *bond_dev, 5758 - struct ethtool_ts_info *info) 5758 + struct kernel_ethtool_ts_info *info) 5759 5759 { 5760 5760 struct bonding *bond = netdev_priv(bond_dev); 5761 - struct ethtool_ts_info ts_info; 5761 + struct kernel_ethtool_ts_info ts_info; 5762 5762 struct net_device *real_dev; 5763 5763 bool sw_tx_support = false; 5764 5764 struct list_head *iter;
+1 -1
drivers/net/can/dev/dev.c
··· 376 376 * supporting hardware timestamps 377 377 */ 378 378 int can_ethtool_op_get_ts_info_hwts(struct net_device *dev, 379 - struct ethtool_ts_info *info) 379 + struct kernel_ethtool_ts_info *info) 380 380 { 381 381 info->so_timestamping = 382 382 SOF_TIMESTAMPING_TX_SOFTWARE |
+1 -1
drivers/net/can/peak_canfd/peak_canfd.c
··· 777 777 }; 778 778 779 779 static int peak_get_ts_info(struct net_device *dev, 780 - struct ethtool_ts_info *info) 780 + struct kernel_ethtool_ts_info *info) 781 781 { 782 782 info->so_timestamping = 783 783 SOF_TIMESTAMPING_TX_SOFTWARE |
+1 -1
drivers/net/can/usb/gs_usb.c
··· 1148 1148 } 1149 1149 1150 1150 static int gs_usb_get_ts_info(struct net_device *netdev, 1151 - struct ethtool_ts_info *info) 1151 + struct kernel_ethtool_ts_info *info) 1152 1152 { 1153 1153 struct gs_can *dev = netdev_priv(netdev); 1154 1154
+1 -1
drivers/net/can/usb/peak_usb/pcan_usb_core.c
··· 897 897 return 0; 898 898 } 899 899 900 - int pcan_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) 900 + int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info) 901 901 { 902 902 info->so_timestamping = 903 903 SOF_TIMESTAMPING_TX_SOFTWARE |
+1 -1
drivers/net/can/usb/peak_usb/pcan_usb_core.h
··· 145 145 int peak_usb_netif_rx_64(struct sk_buff *skb, u32 ts_low, u32 ts_high); 146 146 void peak_usb_async_complete(struct urb *urb); 147 147 void peak_usb_restart_complete(struct peak_usb_device *dev); 148 - int pcan_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info); 148 + int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info); 149 149 150 150 /* common 32-bit CAN channel ID ethtool management */ 151 151 int peak_usb_get_eeprom_len(struct net_device *netdev);
+1 -1
drivers/net/dsa/hirschmann/hellcreek_hwtstamp.c
··· 16 16 #include "hellcreek_ptp.h" 17 17 18 18 int hellcreek_get_ts_info(struct dsa_switch *ds, int port, 19 - struct ethtool_ts_info *info) 19 + struct kernel_ethtool_ts_info *info) 20 20 { 21 21 struct hellcreek *hellcreek = ds->priv; 22 22
+1 -1
drivers/net/dsa/hirschmann/hellcreek_hwtstamp.h
··· 48 48 struct sk_buff *skb); 49 49 50 50 int hellcreek_get_ts_info(struct dsa_switch *ds, int port, 51 - struct ethtool_ts_info *info); 51 + struct kernel_ethtool_ts_info *info); 52 52 53 53 long hellcreek_hwtstamp_work(struct ptp_clock_info *ptp); 54 54
+1 -1
drivers/net/dsa/microchip/ksz_ptp.c
··· 293 293 /* The function is return back the capability of timestamping feature when 294 294 * requested through ethtool -T <interface> utility 295 295 */ 296 - int ksz_get_ts_info(struct dsa_switch *ds, int port, struct ethtool_ts_info *ts) 296 + int ksz_get_ts_info(struct dsa_switch *ds, int port, struct kernel_ethtool_ts_info *ts) 297 297 { 298 298 struct ksz_device *dev = ds->priv; 299 299 struct ksz_ptp_data *ptp_data;
+1 -1
drivers/net/dsa/microchip/ksz_ptp.h
··· 38 38 void ksz_ptp_clock_unregister(struct dsa_switch *ds); 39 39 40 40 int ksz_get_ts_info(struct dsa_switch *ds, int port, 41 - struct ethtool_ts_info *ts); 41 + struct kernel_ethtool_ts_info *ts); 42 42 int ksz_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr); 43 43 int ksz_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr); 44 44 void ksz_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb);
+1 -1
drivers/net/dsa/mv88e6xxx/hwtstamp.c
··· 64 64 #define TX_TSTAMP_TIMEOUT msecs_to_jiffies(40) 65 65 66 66 int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port, 67 - struct ethtool_ts_info *info) 67 + struct kernel_ethtool_ts_info *info) 68 68 { 69 69 const struct mv88e6xxx_ptp_ops *ptp_ops; 70 70 struct mv88e6xxx_chip *chip;
+2 -2
drivers/net/dsa/mv88e6xxx/hwtstamp.h
··· 121 121 struct sk_buff *skb); 122 122 123 123 int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port, 124 - struct ethtool_ts_info *info); 124 + struct kernel_ethtool_ts_info *info); 125 125 126 126 int mv88e6xxx_hwtstamp_setup(struct mv88e6xxx_chip *chip); 127 127 void mv88e6xxx_hwtstamp_free(struct mv88e6xxx_chip *chip); ··· 157 157 } 158 158 159 159 static inline int mv88e6xxx_get_ts_info(struct dsa_switch *ds, int port, 160 - struct ethtool_ts_info *info) 160 + struct kernel_ethtool_ts_info *info) 161 161 { 162 162 return -EOPNOTSUPP; 163 163 }
+1 -1
drivers/net/dsa/ocelot/felix.c
··· 1234 1234 } 1235 1235 1236 1236 static int felix_get_ts_info(struct dsa_switch *ds, int port, 1237 - struct ethtool_ts_info *info) 1237 + struct kernel_ethtool_ts_info *info) 1238 1238 { 1239 1239 struct ocelot *ocelot = ds->priv; 1240 1240
+1 -1
drivers/net/dsa/sja1105/sja1105_ptp.c
··· 111 111 } 112 112 113 113 int sja1105_get_ts_info(struct dsa_switch *ds, int port, 114 - struct ethtool_ts_info *info) 114 + struct kernel_ethtool_ts_info *info) 115 115 { 116 116 struct sja1105_private *priv = ds->priv; 117 117 struct sja1105_ptp_data *ptp_data = &priv->ptp_data;
+1 -1
drivers/net/dsa/sja1105/sja1105_ptp.h
··· 101 101 enum packing_op op); 102 102 103 103 int sja1105_get_ts_info(struct dsa_switch *ds, int port, 104 - struct ethtool_ts_info *ts); 104 + struct kernel_ethtool_ts_info *ts); 105 105 106 106 void sja1105_ptp_txtstamp_skb(struct dsa_switch *ds, int slot, 107 107 struct sk_buff *clone);
+1 -1
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
··· 577 577 } 578 578 579 579 static int xgbe_get_ts_info(struct net_device *netdev, 580 - struct ethtool_ts_info *ts_info) 580 + struct kernel_ethtool_ts_info *ts_info) 581 581 { 582 582 struct xgbe_prv_data *pdata = netdev_priv(netdev); 583 583
+1 -1
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
··· 652 652 } 653 653 654 654 static int aq_ethtool_get_ts_info(struct net_device *ndev, 655 - struct ethtool_ts_info *info) 655 + struct kernel_ethtool_ts_info *info) 656 656 { 657 657 struct aq_nic_s *aq_nic = netdev_priv(ndev); 658 658
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
··· 3634 3634 } 3635 3635 3636 3636 static int bnx2x_get_ts_info(struct net_device *dev, 3637 - struct ethtool_ts_info *info) 3637 + struct kernel_ethtool_ts_info *info) 3638 3638 { 3639 3639 struct bnx2x *bp = netdev_priv(dev); 3640 3640
+1 -1
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
··· 5013 5013 } 5014 5014 5015 5015 static int bnxt_get_ts_info(struct net_device *dev, 5016 - struct ethtool_ts_info *info) 5016 + struct kernel_ethtool_ts_info *info) 5017 5017 { 5018 5018 struct bnxt *bp = netdev_priv(dev); 5019 5019 struct bnxt_ptp_cfg *ptp;
+1 -1
drivers/net/ethernet/broadcom/tg3.c
··· 6141 6141 6142 6142 static inline void tg3_full_lock(struct tg3 *tp, int irq_sync); 6143 6143 static inline void tg3_full_unlock(struct tg3 *tp); 6144 - static int tg3_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) 6144 + static int tg3_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info) 6145 6145 { 6146 6146 struct tg3 *tp = netdev_priv(dev); 6147 6147
+1 -1
drivers/net/ethernet/cadence/macb.h
··· 1168 1168 s32 (*get_ptp_max_adj)(void); 1169 1169 unsigned int (*get_tsu_rate)(struct macb *bp); 1170 1170 int (*get_ts_info)(struct net_device *dev, 1171 - struct ethtool_ts_info *info); 1171 + struct kernel_ethtool_ts_info *info); 1172 1172 int (*get_hwtst)(struct net_device *netdev, 1173 1173 struct kernel_hwtstamp_config *tstamp_config); 1174 1174 int (*set_hwtst)(struct net_device *netdev,
+2 -2
drivers/net/ethernet/cadence/macb_main.c
··· 3399 3399 } 3400 3400 3401 3401 static int gem_get_ts_info(struct net_device *dev, 3402 - struct ethtool_ts_info *info) 3402 + struct kernel_ethtool_ts_info *info) 3403 3403 { 3404 3404 struct macb *bp = netdev_priv(dev); 3405 3405 ··· 3440 3440 #endif 3441 3441 3442 3442 static int macb_get_ts_info(struct net_device *netdev, 3443 - struct ethtool_ts_info *info) 3443 + struct kernel_ethtool_ts_info *info) 3444 3444 { 3445 3445 struct macb *bp = netdev_priv(netdev); 3446 3446
+1 -1
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c
··· 2497 2497 } 2498 2498 2499 2499 static int lio_get_ts_info(struct net_device *netdev, 2500 - struct ethtool_ts_info *info) 2500 + struct kernel_ethtool_ts_info *info) 2501 2501 { 2502 2502 struct lio *lio = GET_LIO(netdev); 2503 2503
+1 -1
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c
··· 836 836 } 837 837 838 838 static int nicvf_get_ts_info(struct net_device *netdev, 839 - struct ethtool_ts_info *info) 839 + struct kernel_ethtool_ts_info *info) 840 840 { 841 841 struct nicvf *nic = netdev_priv(netdev); 842 842
+1 -1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
··· 1550 1550 return ret; 1551 1551 } 1552 1552 1553 - static int get_ts_info(struct net_device *dev, struct ethtool_ts_info *ts_info) 1553 + static int get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *ts_info) 1554 1554 { 1555 1555 struct port_info *pi = netdev_priv(dev); 1556 1556 struct adapter *adapter = pi->adapter;
+1 -1
drivers/net/ethernet/cisco/enic/enic_ethtool.c
··· 599 599 } 600 600 601 601 static int enic_get_ts_info(struct net_device *netdev, 602 - struct ethtool_ts_info *info) 602 + struct kernel_ethtool_ts_info *info) 603 603 { 604 604 info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | 605 605 SOF_TIMESTAMPING_RX_SOFTWARE |
+1 -1
drivers/net/ethernet/engleder/tsnep_ethtool.c
··· 305 305 } 306 306 307 307 static int tsnep_ethtool_get_ts_info(struct net_device *netdev, 308 - struct ethtool_ts_info *info) 308 + struct kernel_ethtool_ts_info *info) 309 309 { 310 310 struct tsnep_adapter *adapter = netdev_priv(netdev); 311 311
+1 -1
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
··· 394 394 } 395 395 396 396 static int dpaa_get_ts_info(struct net_device *net_dev, 397 - struct ethtool_ts_info *info) 397 + struct kernel_ethtool_ts_info *info) 398 398 { 399 399 struct device *dev = net_dev->dev.parent; 400 400 struct device_node *mac_node = dev->of_node;
+1 -1
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
··· 794 794 EXPORT_SYMBOL(dpaa2_phc_index); 795 795 796 796 static int dpaa2_eth_get_ts_info(struct net_device *dev, 797 - struct ethtool_ts_info *info) 797 + struct kernel_ethtool_ts_info *info) 798 798 { 799 799 if (!dpaa2_ptp) 800 800 return ethtool_op_get_ts_info(dev, info);
+1 -1
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
··· 841 841 } 842 842 843 843 static int enetc_get_ts_info(struct net_device *ndev, 844 - struct ethtool_ts_info *info) 844 + struct kernel_ethtool_ts_info *info) 845 845 { 846 846 int *phc_idx; 847 847
+1 -1
drivers/net/ethernet/freescale/fec_main.c
··· 2768 2768 } 2769 2769 2770 2770 static int fec_enet_get_ts_info(struct net_device *ndev, 2771 - struct ethtool_ts_info *info) 2771 + struct kernel_ethtool_ts_info *info) 2772 2772 { 2773 2773 struct fec_enet_private *fep = netdev_priv(ndev); 2774 2774
+1 -1
drivers/net/ethernet/freescale/gianfar_ethtool.c
··· 1448 1448 } 1449 1449 1450 1450 static int gfar_get_ts_info(struct net_device *dev, 1451 - struct ethtool_ts_info *info) 1451 + struct kernel_ethtool_ts_info *info) 1452 1452 { 1453 1453 struct gfar_private *priv = netdev_priv(dev); 1454 1454 struct platform_device *ptp_dev;
+1 -1
drivers/net/ethernet/fungible/funeth/funeth_ethtool.c
··· 1040 1040 } 1041 1041 1042 1042 static int fun_get_ts_info(struct net_device *netdev, 1043 - struct ethtool_ts_info *info) 1043 + struct kernel_ethtool_ts_info *info) 1044 1044 { 1045 1045 info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | 1046 1046 SOF_TIMESTAMPING_RX_HARDWARE |
+1 -1
drivers/net/ethernet/hisilicon/hns3/hnae3.h
··· 786 786 void (*get_rx_hwts)(struct hnae3_handle *handle, struct sk_buff *skb, 787 787 u32 nsec, u32 sec); 788 788 int (*get_ts_info)(struct hnae3_handle *handle, 789 - struct ethtool_ts_info *info); 789 + struct kernel_ethtool_ts_info *info); 790 790 int (*get_link_diagnosis_info)(struct hnae3_handle *handle, 791 791 u32 *status_code); 792 792 void (*clean_vf_config)(struct hnae3_ae_dev *ae_dev, int num_vfs);
+1 -1
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
··· 2009 2009 ETHTOOL_RING_USE_TX_PUSH) 2010 2010 2011 2011 static int hns3_get_ts_info(struct net_device *netdev, 2012 - struct ethtool_ts_info *info) 2012 + struct kernel_ethtool_ts_info *info) 2013 2013 { 2014 2014 struct hnae3_handle *handle = hns3_get_handle(netdev); 2015 2015
+1 -1
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
··· 378 378 } 379 379 380 380 int hclge_ptp_get_ts_info(struct hnae3_handle *handle, 381 - struct ethtool_ts_info *info) 381 + struct kernel_ethtool_ts_info *info) 382 382 { 383 383 struct hclge_vport *vport = hclge_get_vport(handle); 384 384 struct hclge_dev *hdev = vport->back;
+1 -1
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.h
··· 138 138 int hclge_ptp_init(struct hclge_dev *hdev); 139 139 void hclge_ptp_uninit(struct hclge_dev *hdev); 140 140 int hclge_ptp_get_ts_info(struct hnae3_handle *handle, 141 - struct ethtool_ts_info *info); 141 + struct kernel_ethtool_ts_info *info); 142 142 int hclge_ptp_cfg_qry(struct hclge_dev *hdev, u32 *cfg); 143 143 #endif
+1 -1
drivers/net/ethernet/intel/e1000e/ethtool.c
··· 2263 2263 } 2264 2264 2265 2265 static int e1000e_get_ts_info(struct net_device *netdev, 2266 - struct ethtool_ts_info *info) 2266 + struct kernel_ethtool_ts_info *info) 2267 2267 { 2268 2268 struct e1000_adapter *adapter = netdev_priv(netdev); 2269 2269
+1 -1
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
··· 2546 2546 } 2547 2547 2548 2548 static int i40e_get_ts_info(struct net_device *dev, 2549 - struct ethtool_ts_info *info) 2549 + struct kernel_ethtool_ts_info *info) 2550 2550 { 2551 2551 struct i40e_pf *pf = i40e_netdev_to_pf(dev); 2552 2552
+1 -1
drivers/net/ethernet/intel/ice/ice_ethtool.c
··· 3434 3434 } 3435 3435 3436 3436 static int 3437 - ice_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) 3437 + ice_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info) 3438 3438 { 3439 3439 struct ice_pf *pf = ice_netdev_to_pf(dev); 3440 3440
+1 -1
drivers/net/ethernet/intel/igb/igb_ethtool.c
··· 2381 2381 } 2382 2382 2383 2383 static int igb_get_ts_info(struct net_device *dev, 2384 - struct ethtool_ts_info *info) 2384 + struct kernel_ethtool_ts_info *info) 2385 2385 { 2386 2386 struct igb_adapter *adapter = netdev_priv(dev); 2387 2387
+1 -1
drivers/net/ethernet/intel/igc/igc_ethtool.c
··· 1559 1559 } 1560 1560 1561 1561 static int igc_ethtool_get_ts_info(struct net_device *dev, 1562 - struct ethtool_ts_info *info) 1562 + struct kernel_ethtool_ts_info *info) 1563 1563 { 1564 1564 struct igc_adapter *adapter = netdev_priv(dev); 1565 1565
+1 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
··· 3170 3170 } 3171 3171 3172 3172 static int ixgbe_get_ts_info(struct net_device *dev, 3173 - struct ethtool_ts_info *info) 3173 + struct kernel_ethtool_ts_info *info) 3174 3174 { 3175 3175 struct ixgbe_adapter *adapter = netdev_priv(dev); 3176 3176
+1 -1
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
··· 5259 5259 } 5260 5260 5261 5261 static int mvpp2_ethtool_get_ts_info(struct net_device *dev, 5262 - struct ethtool_ts_info *info) 5262 + struct kernel_ethtool_ts_info *info) 5263 5263 { 5264 5264 struct mvpp2_port *port = netdev_priv(dev); 5265 5265
+1 -1
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
··· 954 954 } 955 955 956 956 static int otx2_get_ts_info(struct net_device *netdev, 957 - struct ethtool_ts_info *info) 957 + struct kernel_ethtool_ts_info *info) 958 958 { 959 959 struct otx2_nic *pfvf = netdev_priv(netdev); 960 960
+1 -1
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
··· 1884 1884 } 1885 1885 1886 1886 static int mlx4_en_get_ts_info(struct net_device *dev, 1887 - struct ethtool_ts_info *info) 1887 + struct kernel_ethtool_ts_info *info) 1888 1888 { 1889 1889 struct mlx4_en_priv *priv = netdev_priv(dev); 1890 1890 struct mlx4_en_dev *mdev = priv->mdev;
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en.h
··· 1191 1191 u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv); 1192 1192 u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv); 1193 1193 int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv, 1194 - struct ethtool_ts_info *info); 1194 + struct kernel_ethtool_ts_info *info); 1195 1195 int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv, 1196 1196 struct ethtool_flash *flash); 1197 1197
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
··· 1658 1658 } 1659 1659 1660 1660 int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv, 1661 - struct ethtool_ts_info *info) 1661 + struct kernel_ethtool_ts_info *info) 1662 1662 { 1663 1663 struct mlx5_core_dev *mdev = priv->mdev; 1664 1664 ··· 1682 1682 } 1683 1683 1684 1684 static int mlx5e_get_ts_info(struct net_device *dev, 1685 - struct ethtool_ts_info *info) 1685 + struct kernel_ethtool_ts_info *info) 1686 1686 { 1687 1687 struct mlx5e_priv *priv = netdev_priv(dev); 1688 1688
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
··· 136 136 } 137 137 138 138 static int mlx5i_get_ts_info(struct net_device *netdev, 139 - struct ethtool_ts_info *info) 139 + struct kernel_ethtool_ts_info *info) 140 140 { 141 141 struct mlx5e_priv *priv = mlx5i_epriv(netdev); 142 142
+1 -1
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
··· 238 238 struct hwtstamp_config *config); 239 239 void (*shaper_work)(struct work_struct *work); 240 240 int (*get_ts_info)(struct mlxsw_sp *mlxsw_sp, 241 - struct ethtool_ts_info *info); 241 + struct kernel_ethtool_ts_info *info); 242 242 int (*get_stats_count)(void); 243 243 void (*get_stats_strings)(u8 **p); 244 244 void (*get_stats)(struct mlxsw_sp_port *mlxsw_sp_port,
+1 -1
drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c
··· 1082 1082 } 1083 1083 1084 1084 static int 1085 - mlxsw_sp_get_ts_info(struct net_device *netdev, struct ethtool_ts_info *info) 1085 + mlxsw_sp_get_ts_info(struct net_device *netdev, struct kernel_ethtool_ts_info *info) 1086 1086 { 1087 1087 struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(netdev); 1088 1088 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
+2 -2
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
··· 1276 1276 } 1277 1277 1278 1278 int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, 1279 - struct ethtool_ts_info *info) 1279 + struct kernel_ethtool_ts_info *info) 1280 1280 { 1281 1281 info->phc_index = ptp_clock_index(mlxsw_sp->clock->ptp); 1282 1282 ··· 1661 1661 } 1662 1662 1663 1663 int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, 1664 - struct ethtool_ts_info *info) 1664 + struct kernel_ethtool_ts_info *info) 1665 1665 { 1666 1666 info->phc_index = ptp_clock_index(mlxsw_sp->clock->ptp); 1667 1667
+5 -5
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h
··· 11 11 struct mlxsw_sp_port; 12 12 struct mlxsw_sp_ptp_clock; 13 13 14 - static inline int mlxsw_sp_ptp_get_ts_info_noptp(struct ethtool_ts_info *info) 14 + static inline int mlxsw_sp_ptp_get_ts_info_noptp(struct kernel_ethtool_ts_info *info) 15 15 { 16 16 info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | 17 17 SOF_TIMESTAMPING_SOFTWARE; ··· 50 50 void mlxsw_sp1_ptp_shaper_work(struct work_struct *work); 51 51 52 52 int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, 53 - struct ethtool_ts_info *info); 53 + struct kernel_ethtool_ts_info *info); 54 54 55 55 int mlxsw_sp1_get_stats_count(void); 56 56 void mlxsw_sp1_get_stats_strings(u8 **p); ··· 84 84 struct hwtstamp_config *config); 85 85 86 86 int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, 87 - struct ethtool_ts_info *info); 87 + struct kernel_ethtool_ts_info *info); 88 88 89 89 int mlxsw_sp2_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core, 90 90 struct mlxsw_sp_port *mlxsw_sp_port, ··· 152 152 } 153 153 154 154 static inline int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, 155 - struct ethtool_ts_info *info) 155 + struct kernel_ethtool_ts_info *info) 156 156 { 157 157 return mlxsw_sp_ptp_get_ts_info_noptp(info); 158 158 } ··· 227 227 } 228 228 229 229 static inline int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp, 230 - struct ethtool_ts_info *info) 230 + struct kernel_ethtool_ts_info *info) 231 231 { 232 232 return mlxsw_sp_ptp_get_ts_info_noptp(info); 233 233 }
+1 -1
drivers/net/ethernet/microchip/lan743x_ethtool.c
··· 1029 1029 } 1030 1030 1031 1031 static int lan743x_ethtool_get_ts_info(struct net_device *netdev, 1032 - struct ethtool_ts_info *ts_info) 1032 + struct kernel_ethtool_ts_info *ts_info) 1033 1033 { 1034 1034 struct lan743x_adapter *adapter = netdev_priv(netdev); 1035 1035
+1 -1
drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
··· 538 538 } 539 539 540 540 static int lan966x_get_ts_info(struct net_device *dev, 541 - struct ethtool_ts_info *info) 541 + struct kernel_ethtool_ts_info *info) 542 542 { 543 543 struct lan966x_port *port = netdev_priv(dev); 544 544 struct lan966x *lan966x = port->lan966x;
+1 -1
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c
··· 1183 1183 } 1184 1184 1185 1185 static int sparx5_get_ts_info(struct net_device *dev, 1186 - struct ethtool_ts_info *info) 1186 + struct kernel_ethtool_ts_info *info) 1187 1187 { 1188 1188 struct sparx5_port *port = netdev_priv(dev); 1189 1189 struct sparx5 *sparx5 = port->sparx5;
+1 -1
drivers/net/ethernet/mscc/ocelot_net.c
··· 980 980 } 981 981 982 982 static int ocelot_port_get_ts_info(struct net_device *dev, 983 - struct ethtool_ts_info *info) 983 + struct kernel_ethtool_ts_info *info) 984 984 { 985 985 struct ocelot_port_private *priv = netdev_priv(dev); 986 986 struct ocelot *ocelot = priv->port.ocelot;
+1 -1
drivers/net/ethernet/mscc/ocelot_ptp.c
··· 580 580 EXPORT_SYMBOL(ocelot_hwstamp_set); 581 581 582 582 int ocelot_get_ts_info(struct ocelot *ocelot, int port, 583 - struct ethtool_ts_info *info) 583 + struct kernel_ethtool_ts_info *info) 584 584 { 585 585 info->phc_index = ocelot->ptp_clock ? 586 586 ptp_clock_index(ocelot->ptp_clock) : -1;
+1 -1
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
··· 977 977 } 978 978 979 979 static int ionic_get_ts_info(struct net_device *netdev, 980 - struct ethtool_ts_info *info) 980 + struct kernel_ethtool_ts_info *info) 981 981 { 982 982 struct ionic_lif *lif = netdev_priv(netdev); 983 983 struct ionic *ionic = lif->ionic;
+1 -1
drivers/net/ethernet/qlogic/qede/qede_ethtool.c
··· 1137 1137 } 1138 1138 1139 1139 static int qede_get_ts_info(struct net_device *dev, 1140 - struct ethtool_ts_info *info) 1140 + struct kernel_ethtool_ts_info *info) 1141 1141 { 1142 1142 struct qede_dev *edev = netdev_priv(dev); 1143 1143
+1 -1
drivers/net/ethernet/qlogic/qede/qede_ptp.c
··· 321 321 sizeof(config)) ? -EFAULT : 0; 322 322 } 323 323 324 - int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info) 324 + int qede_ptp_get_ts_info(struct qede_dev *edev, struct kernel_ethtool_ts_info *info) 325 325 { 326 326 struct qede_ptp *ptp = edev->ptp; 327 327
+1 -1
drivers/net/ethernet/qlogic/qede/qede_ptp.h
··· 17 17 int qede_ptp_hw_ts(struct qede_dev *edev, struct ifreq *req); 18 18 void qede_ptp_disable(struct qede_dev *edev); 19 19 int qede_ptp_enable(struct qede_dev *edev); 20 - int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *ts); 20 + int qede_ptp_get_ts_info(struct qede_dev *edev, struct kernel_ethtool_ts_info *ts); 21 21 22 22 static inline void qede_ptp_record_rx_ts(struct qede_dev *edev, 23 23 union eth_rx_cqe *cqe,
+1 -1
drivers/net/ethernet/renesas/ravb_main.c
··· 1737 1737 } 1738 1738 1739 1739 static int ravb_get_ts_info(struct net_device *ndev, 1740 - struct ethtool_ts_info *info) 1740 + struct kernel_ethtool_ts_info *info) 1741 1741 { 1742 1742 struct ravb_private *priv = netdev_priv(ndev); 1743 1743 const struct ravb_hw_info *hw_info = priv->info;
+1 -1
drivers/net/ethernet/renesas/rswitch.c
··· 1809 1809 .ndo_set_mac_address = eth_mac_addr, 1810 1810 }; 1811 1811 1812 - static int rswitch_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) 1812 + static int rswitch_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info) 1813 1813 { 1814 1814 struct rswitch_device *rdev = netdev_priv(ndev); 1815 1815
+1 -1
drivers/net/ethernet/renesas/rtsn.c
··· 1213 1213 }; 1214 1214 1215 1215 static int rtsn_get_ts_info(struct net_device *ndev, 1216 - struct ethtool_ts_info *info) 1216 + struct kernel_ethtool_ts_info *info) 1217 1217 { 1218 1218 struct rtsn_private *priv = netdev_priv(ndev); 1219 1219
+1 -1
drivers/net/ethernet/sfc/ethtool.c
··· 226 226 } 227 227 228 228 static int efx_ethtool_get_ts_info(struct net_device *net_dev, 229 - struct ethtool_ts_info *ts_info) 229 + struct kernel_ethtool_ts_info *ts_info) 230 230 { 231 231 struct efx_nic *efx = efx_netdev_priv(net_dev); 232 232
+1 -1
drivers/net/ethernet/sfc/falcon/nic.h
··· 297 297 return &data->board; 298 298 } 299 299 300 - struct ethtool_ts_info; 300 + struct kernel_ethtool_ts_info; 301 301 302 302 extern const struct ef4_nic_type falcon_a1_nic_type; 303 303 extern const struct ef4_nic_type falcon_b0_nic_type;
+1 -1
drivers/net/ethernet/sfc/ptp.c
··· 1864 1864 return 0; 1865 1865 } 1866 1866 1867 - void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info) 1867 + void efx_ptp_get_ts_info(struct efx_nic *efx, struct kernel_ethtool_ts_info *ts_info) 1868 1868 { 1869 1869 struct efx_ptp_data *ptp = efx->ptp_data; 1870 1870 struct efx_nic *primary = efx->primary;
+3 -2
drivers/net/ethernet/sfc/ptp.h
··· 12 12 #include <linux/net_tstamp.h> 13 13 #include "net_driver.h" 14 14 15 - struct ethtool_ts_info; 15 + struct kernel_ethtool_ts_info; 16 16 int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel); 17 17 void efx_ptp_defer_probe_with_channel(struct efx_nic *efx); 18 18 struct efx_channel *efx_ptp_channel(struct efx_nic *efx); ··· 23 23 struct netlink_ext_ack *extack); 24 24 int efx_ptp_get_ts_config(struct efx_nic *efx, 25 25 struct kernel_hwtstamp_config *config); 26 - void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info); 26 + void efx_ptp_get_ts_info(struct efx_nic *efx, 27 + struct kernel_ethtool_ts_info *ts_info); 27 28 bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); 28 29 int efx_ptp_get_mode(struct efx_nic *efx); 29 30 int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
+1 -1
drivers/net/ethernet/sfc/siena/ethtool.c
··· 226 226 } 227 227 228 228 static int efx_ethtool_get_ts_info(struct net_device *net_dev, 229 - struct ethtool_ts_info *ts_info) 229 + struct kernel_ethtool_ts_info *ts_info) 230 230 { 231 231 struct efx_nic *efx = netdev_priv(net_dev); 232 232
+1 -1
drivers/net/ethernet/sfc/siena/ptp.c
··· 1780 1780 } 1781 1781 1782 1782 void efx_siena_ptp_get_ts_info(struct efx_nic *efx, 1783 - struct ethtool_ts_info *ts_info) 1783 + struct kernel_ethtool_ts_info *ts_info) 1784 1784 { 1785 1785 struct efx_ptp_data *ptp = efx->ptp_data; 1786 1786 struct efx_nic *primary = efx->primary;
+2 -2
drivers/net/ethernet/sfc/siena/ptp.h
··· 12 12 #include <linux/net_tstamp.h> 13 13 #include "net_driver.h" 14 14 15 - struct ethtool_ts_info; 15 + struct kernel_ethtool_ts_info; 16 16 void efx_siena_ptp_defer_probe_with_channel(struct efx_nic *efx); 17 17 struct efx_channel *efx_siena_ptp_channel(struct efx_nic *efx); 18 18 int efx_siena_ptp_set_ts_config(struct efx_nic *efx, ··· 21 21 int efx_siena_ptp_get_ts_config(struct efx_nic *efx, 22 22 struct kernel_hwtstamp_config *config); 23 23 void efx_siena_ptp_get_ts_info(struct efx_nic *efx, 24 - struct ethtool_ts_info *ts_info); 24 + struct kernel_ethtool_ts_info *ts_info); 25 25 bool efx_siena_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); 26 26 int efx_siena_ptp_get_mode(struct efx_nic *efx); 27 27 int efx_siena_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 1199 1199 } 1200 1200 1201 1201 static int stmmac_get_ts_info(struct net_device *dev, 1202 - struct ethtool_ts_info *info) 1202 + struct kernel_ethtool_ts_info *info) 1203 1203 { 1204 1204 struct stmmac_priv *priv = netdev_priv(dev); 1205 1205
+1 -1
drivers/net/ethernet/ti/am65-cpsw-ethtool.c
··· 692 692 }; 693 693 694 694 static int am65_cpsw_get_ethtool_ts_info(struct net_device *ndev, 695 - struct ethtool_ts_info *info) 695 + struct kernel_ethtool_ts_info *info) 696 696 { 697 697 struct am65_cpsw_common *common = am65_ndev_to_common(ndev); 698 698 unsigned int ptp_v2_filter;
+2 -2
drivers/net/ethernet/ti/cpsw_ethtool.c
··· 717 717 } 718 718 719 719 #if IS_ENABLED(CONFIG_TI_CPTS) 720 - int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) 720 + int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info) 721 721 { 722 722 struct cpsw_common *cpsw = ndev_to_cpsw(ndev); 723 723 ··· 738 738 return 0; 739 739 } 740 740 #else 741 - int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) 741 + int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info) 742 742 { 743 743 info->so_timestamping = 744 744 SOF_TIMESTAMPING_TX_SOFTWARE |
+1 -1
drivers/net/ethernet/ti/cpsw_priv.h
··· 510 510 int cpsw_set_channels_common(struct net_device *ndev, 511 511 struct ethtool_channels *chs, 512 512 cpdma_handler_fn rx_handler); 513 - int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info); 513 + int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info); 514 514 515 515 #endif /* DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ */
+1 -1
drivers/net/ethernet/ti/icssg/icssg_ethtool.c
··· 110 110 } 111 111 112 112 static int emac_get_ts_info(struct net_device *ndev, 113 - struct ethtool_ts_info *info) 113 + struct kernel_ethtool_ts_info *info) 114 114 { 115 115 struct prueth_emac *emac = netdev_priv(ndev); 116 116
+2 -2
drivers/net/ethernet/ti/netcp_ethss.c
··· 1999 1999 2000 2000 #if IS_ENABLED(CONFIG_TI_CPTS) 2001 2001 static int keystone_get_ts_info(struct net_device *ndev, 2002 - struct ethtool_ts_info *info) 2002 + struct kernel_ethtool_ts_info *info) 2003 2003 { 2004 2004 struct netcp_intf *netcp = netdev_priv(ndev); 2005 2005 struct gbe_intf *gbe_intf; ··· 2027 2027 } 2028 2028 #else 2029 2029 static int keystone_get_ts_info(struct net_device *ndev, 2030 - struct ethtool_ts_info *info) 2030 + struct kernel_ethtool_ts_info *info) 2031 2031 { 2032 2032 info->so_timestamping = 2033 2033 SOF_TIMESTAMPING_TX_SOFTWARE |
+1 -1
drivers/net/ethernet/xscale/ixp4xx_eth.c
··· 1015 1015 } 1016 1016 1017 1017 static int ixp4xx_get_ts_info(struct net_device *dev, 1018 - struct ethtool_ts_info *info) 1018 + struct kernel_ethtool_ts_info *info) 1019 1019 { 1020 1020 struct port *port = netdev_priv(dev); 1021 1021
+1 -1
drivers/net/macvlan.c
··· 1084 1084 } 1085 1085 1086 1086 static int macvlan_ethtool_get_ts_info(struct net_device *dev, 1087 - struct ethtool_ts_info *info) 1087 + struct kernel_ethtool_ts_info *info) 1088 1088 { 1089 1089 struct net_device *real_dev = macvlan_dev_real_dev(dev); 1090 1090
+1 -1
drivers/net/netdevsim/ethtool.c
··· 148 148 } 149 149 150 150 static int nsim_get_ts_info(struct net_device *dev, 151 - struct ethtool_ts_info *info) 151 + struct kernel_ethtool_ts_info *info) 152 152 { 153 153 struct netdevsim *ns = netdev_priv(dev); 154 154
+1 -1
drivers/net/phy/bcm-phy-ptp.c
··· 841 841 } 842 842 843 843 static int bcm_ptp_ts_info(struct mii_timestamper *mii_ts, 844 - struct ethtool_ts_info *ts_info) 844 + struct kernel_ethtool_ts_info *ts_info) 845 845 { 846 846 struct bcm_ptp_private *priv = mii2priv(mii_ts); 847 847
+1 -1
drivers/net/phy/dp83640.c
··· 1395 1395 } 1396 1396 1397 1397 static int dp83640_ts_info(struct mii_timestamper *mii_ts, 1398 - struct ethtool_ts_info *info) 1398 + struct kernel_ethtool_ts_info *info) 1399 1399 { 1400 1400 struct dp83640_private *dp83640 = 1401 1401 container_of(mii_ts, struct dp83640_private, mii_ts);
+2 -2
drivers/net/phy/micrel.c
··· 2552 2552 *seq_id = lanphy_read_page_reg(phydev, 5, PTP_TX_MSG_HEADER2); 2553 2553 } 2554 2554 2555 - static int lan8814_ts_info(struct mii_timestamper *mii_ts, struct ethtool_ts_info *info) 2555 + static int lan8814_ts_info(struct mii_timestamper *mii_ts, struct kernel_ethtool_ts_info *info) 2556 2556 { 2557 2557 struct kszphy_ptp_priv *ptp_priv = container_of(mii_ts, struct kszphy_ptp_priv, mii_ts); 2558 2558 struct phy_device *phydev = ptp_priv->phydev; ··· 4317 4317 } 4318 4318 4319 4319 static int lan8841_ts_info(struct mii_timestamper *mii_ts, 4320 - struct ethtool_ts_info *info) 4320 + struct kernel_ethtool_ts_info *info) 4321 4321 { 4322 4322 struct kszphy_ptp_priv *ptp_priv; 4323 4323
+1 -1
drivers/net/phy/mscc/mscc_ptp.c
··· 1134 1134 } 1135 1135 1136 1136 static int vsc85xx_ts_info(struct mii_timestamper *mii_ts, 1137 - struct ethtool_ts_info *info) 1137 + struct kernel_ethtool_ts_info *info) 1138 1138 { 1139 1139 struct vsc8531_private *vsc8531 = 1140 1140 container_of(mii_ts, struct vsc8531_private, mii_ts);
+1 -1
drivers/net/phy/nxp-c45-tja11xx.c
··· 1058 1058 } 1059 1059 1060 1060 static int nxp_c45_ts_info(struct mii_timestamper *mii_ts, 1061 - struct ethtool_ts_info *ts_info) 1061 + struct kernel_ethtool_ts_info *ts_info) 1062 1062 { 1063 1063 struct nxp_c45_phy *priv = container_of(mii_ts, struct nxp_c45_phy, 1064 1064 mii_ts);
+1 -1
drivers/ptp/ptp_ines.c
··· 556 556 } 557 557 558 558 static int ines_ts_info(struct mii_timestamper *mii_ts, 559 - struct ethtool_ts_info *info) 559 + struct kernel_ethtool_ts_info *info) 560 560 { 561 561 info->so_timestamping = 562 562 SOF_TIMESTAMPING_TX_HARDWARE |
+1 -1
drivers/s390/net/qeth_ethtool.c
··· 247 247 } 248 248 249 249 static int qeth_get_ts_info(struct net_device *dev, 250 - struct ethtool_ts_info *info) 250 + struct kernel_ethtool_ts_info *info) 251 251 { 252 252 struct qeth_card *card = dev->ml_priv; 253 253
+1 -1
include/linux/can/dev.h
··· 186 186 int can_change_mtu(struct net_device *dev, int new_mtu); 187 187 int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd); 188 188 int can_ethtool_op_get_ts_info_hwts(struct net_device *dev, 189 - struct ethtool_ts_info *info); 189 + struct kernel_ethtool_ts_info *info); 190 190 191 191 int register_candev(struct net_device *dev); 192 192 void unregister_candev(struct net_device *dev);
+22 -3
include/linux/ethtool.h
··· 18 18 #include <linux/if_ether.h> 19 19 #include <linux/netlink.h> 20 20 #include <uapi/linux/ethtool.h> 21 + #include <uapi/linux/net_tstamp.h> 21 22 22 23 struct compat_ethtool_rx_flow_spec { 23 24 u32 flow_type; ··· 715 714 }; 716 715 717 716 /** 717 + * struct kernel_ethtool_ts_info - kernel copy of struct ethtool_ts_info 718 + * @cmd: command number = %ETHTOOL_GET_TS_INFO 719 + * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags 720 + * @phc_index: device index of the associated PHC, or -1 if there is none 721 + * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values 722 + * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values 723 + */ 724 + struct kernel_ethtool_ts_info { 725 + u32 cmd; 726 + u32 so_timestamping; 727 + int phc_index; 728 + enum hwtstamp_tx_types tx_types; 729 + enum hwtstamp_rx_filters rx_filters; 730 + }; 731 + 732 + /** 718 733 * struct ethtool_ops - optional netdev operations 719 734 * @cap_link_lanes_supported: indicates if the driver supports lanes 720 735 * parameter. ··· 1037 1020 int (*get_dump_data)(struct net_device *, 1038 1021 struct ethtool_dump *, void *); 1039 1022 int (*set_dump)(struct net_device *, struct ethtool_dump *); 1040 - int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *); 1023 + int (*get_ts_info)(struct net_device *, struct kernel_ethtool_ts_info *); 1041 1024 void (*get_ts_stats)(struct net_device *dev, 1042 1025 struct ethtool_ts_stats *ts_stats); 1043 1026 int (*get_module_info)(struct net_device *, ··· 1198 1181 1199 1182 /* Some generic methods drivers may use in their ethtool_ops */ 1200 1183 u32 ethtool_op_get_link(struct net_device *dev); 1201 - int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti); 1184 + int ethtool_op_get_ts_info(struct net_device *dev, 1185 + struct kernel_ethtool_ts_info *eti); 1202 1186 1203 1187 /** 1204 1188 * ethtool_mm_frag_size_add_to_min - Translate (standard) additional fragment ··· 1248 1230 * @info: buffer to hold the result 1249 1231 * Returns zero on success, non-zero otherwise. 1250 1232 */ 1251 - int ethtool_get_ts_info_by_layer(struct net_device *dev, struct ethtool_ts_info *info); 1233 + int ethtool_get_ts_info_by_layer(struct net_device *dev, 1234 + struct kernel_ethtool_ts_info *info); 1252 1235 1253 1236 /** 1254 1237 * ethtool_sprintf - Write formatted string to ethtool string data
+1 -1
include/linux/mii_timestamper.h
··· 59 59 struct phy_device *phydev); 60 60 61 61 int (*ts_info)(struct mii_timestamper *mii_ts, 62 - struct ethtool_ts_info *ts_info); 62 + struct kernel_ethtool_ts_info *ts_info); 63 63 64 64 struct device *device; 65 65 };
+1 -1
include/linux/phy.h
··· 1618 1618 } 1619 1619 1620 1620 static inline int phy_ts_info(struct phy_device *phydev, 1621 - struct ethtool_ts_info *tsinfo) 1621 + struct kernel_ethtool_ts_info *tsinfo) 1622 1622 { 1623 1623 return phydev->mii_ts->ts_info(phydev->mii_ts, tsinfo); 1624 1624 }
+1 -1
include/net/dsa.h
··· 934 934 * ethtool timestamp info 935 935 */ 936 936 int (*get_ts_info)(struct dsa_switch *ds, int port, 937 - struct ethtool_ts_info *ts); 937 + struct kernel_ethtool_ts_info *ts); 938 938 939 939 /* 940 940 * ethtool MAC merge layer
+1 -1
include/soc/mscc/ocelot.h
··· 1016 1016 void ocelot_port_get_eth_phy_stats(struct ocelot *ocelot, int port, 1017 1017 struct ethtool_eth_phy_stats *phy_stats); 1018 1018 int ocelot_get_ts_info(struct ocelot *ocelot, int port, 1019 - struct ethtool_ts_info *info); 1019 + struct kernel_ethtool_ts_info *info); 1020 1020 void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs); 1021 1021 int ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, bool enabled, 1022 1022 struct netlink_ext_ack *extack);
+1 -1
net/8021q/vlan_dev.c
··· 677 677 } 678 678 679 679 static int vlan_ethtool_get_ts_info(struct net_device *dev, 680 - struct ethtool_ts_info *info) 680 + struct kernel_ethtool_ts_info *info) 681 681 { 682 682 const struct vlan_dev_priv *vlan = vlan_dev_priv(dev); 683 683 return ethtool_get_ts_info_by_layer(vlan->real_dev, info);
+1 -1
net/dsa/user.c
··· 1729 1729 } 1730 1730 1731 1731 static int dsa_user_get_ts_info(struct net_device *dev, 1732 - struct ethtool_ts_info *ts) 1732 + struct kernel_ethtool_ts_info *ts) 1733 1733 { 1734 1734 struct dsa_user_priv *p = netdev_priv(dev); 1735 1735 struct dsa_switch *ds = p->dp->ds;
+3 -3
net/ethtool/common.c
··· 629 629 return 0; 630 630 } 631 631 632 - int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) 632 + int __ethtool_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info) 633 633 { 634 634 const struct ethtool_ops *ops = dev->ethtool_ops; 635 635 struct phy_device *phydev = dev->phydev; ··· 651 651 652 652 int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index) 653 653 { 654 - struct ethtool_ts_info info = { }; 654 + struct kernel_ethtool_ts_info info = { }; 655 655 int num = 0; 656 656 657 657 if (!__ethtool_get_ts_info(dev, &info)) ··· 661 661 } 662 662 EXPORT_SYMBOL(ethtool_get_phc_vclocks); 663 663 664 - int ethtool_get_ts_info_by_layer(struct net_device *dev, struct ethtool_ts_info *info) 664 + int ethtool_get_ts_info_by_layer(struct net_device *dev, struct kernel_ethtool_ts_info *info) 665 665 { 666 666 return __ethtool_get_ts_info(dev, info); 667 667 }
+1 -1
net/ethtool/common.h
··· 44 44 const struct ethtool_cmd *legacy_settings); 45 45 int ethtool_get_max_rxfh_channel(struct net_device *dev, u32 *max); 46 46 int ethtool_get_max_rxnfc_channel(struct net_device *dev, u64 *max); 47 - int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info); 47 + int __ethtool_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info); 48 48 49 49 extern const struct ethtool_phy_ops *ethtool_phy_ops; 50 50 extern const struct ethtool_pse_ops *ethtool_pse_ops;
+11 -3
net/ethtool/ioctl.c
··· 65 65 } 66 66 EXPORT_SYMBOL(ethtool_op_get_link); 67 67 68 - int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) 68 + int ethtool_op_get_ts_info(struct net_device *dev, 69 + struct kernel_ethtool_ts_info *info) 69 70 { 70 71 info->so_timestamping = 71 72 SOF_TIMESTAMPING_TX_SOFTWARE | ··· 2570 2569 2571 2570 static int ethtool_get_ts_info(struct net_device *dev, void __user *useraddr) 2572 2571 { 2573 - struct ethtool_ts_info info; 2572 + struct kernel_ethtool_ts_info kernel_info; 2573 + struct ethtool_ts_info info = {}; 2574 2574 int err; 2575 2575 2576 - err = __ethtool_get_ts_info(dev, &info); 2576 + err = __ethtool_get_ts_info(dev, &kernel_info); 2577 2577 if (err) 2578 2578 return err; 2579 + 2580 + info.cmd = kernel_info.cmd; 2581 + info.so_timestamping = kernel_info.so_timestamping; 2582 + info.phc_index = kernel_info.phc_index; 2583 + info.tx_types = kernel_info.tx_types; 2584 + info.rx_filters = kernel_info.rx_filters; 2579 2585 2580 2586 if (copy_to_user(useraddr, &info, sizeof(info))) 2581 2587 return -EFAULT;
+3 -3
net/ethtool/tsinfo.c
··· 12 12 13 13 struct tsinfo_reply_data { 14 14 struct ethnl_reply_data base; 15 - struct ethtool_ts_info ts_info; 15 + struct kernel_ethtool_ts_info ts_info; 16 16 struct ethtool_ts_stats stats; 17 17 }; 18 18 ··· 55 55 { 56 56 const struct tsinfo_reply_data *data = TSINFO_REPDATA(reply_base); 57 57 bool compact = req_base->flags & ETHTOOL_FLAG_COMPACT_BITSETS; 58 - const struct ethtool_ts_info *ts_info = &data->ts_info; 58 + const struct kernel_ethtool_ts_info *ts_info = &data->ts_info; 59 59 int len = 0; 60 60 int ret; 61 61 ··· 136 136 { 137 137 const struct tsinfo_reply_data *data = TSINFO_REPDATA(reply_base); 138 138 bool compact = req_base->flags & ETHTOOL_FLAG_COMPACT_BITSETS; 139 - const struct ethtool_ts_info *ts_info = &data->ts_info; 139 + const struct kernel_ethtool_ts_info *ts_info = &data->ts_info; 140 140 int ret; 141 141 142 142 if (ts_info->so_timestamping) {
+1 -1
net/sched/sch_taprio.c
··· 1610 1610 1611 1611 if (FULL_OFFLOAD_IS_ENABLED(q->flags)) { 1612 1612 const struct ethtool_ops *ops = dev->ethtool_ops; 1613 - struct ethtool_ts_info info = { 1613 + struct kernel_ethtool_ts_info info = { 1614 1614 .cmd = ETHTOOL_GET_TS_INFO, 1615 1615 .phc_index = -1, 1616 1616 };