}
 EXPORT_SYMBOL_GPL(can_change_mtu);
 
+/* generic implementation of netdev_ops::ndo_eth_ioctl for CAN devices
+ * supporting hardware timestamps
+ */
+int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd)
+{
+       struct hwtstamp_config hwts_cfg = { 0 };
+
+       switch (cmd) {
+       case SIOCSHWTSTAMP: /* set */
+               if (copy_from_user(&hwts_cfg, ifr->ifr_data, sizeof(hwts_cfg)))
+                       return -EFAULT;
+               if (hwts_cfg.tx_type == HWTSTAMP_TX_ON &&
+                   hwts_cfg.rx_filter == HWTSTAMP_FILTER_ALL)
+                       return 0;
+               return -ERANGE;
+
+       case SIOCGHWTSTAMP: /* get */
+               hwts_cfg.tx_type = HWTSTAMP_TX_ON;
+               hwts_cfg.rx_filter = HWTSTAMP_FILTER_ALL;
+               if (copy_to_user(ifr->ifr_data, &hwts_cfg, sizeof(hwts_cfg)))
+                       return -EFAULT;
+               return 0;
+
+       default:
+               return -EOPNOTSUPP;
+       }
+}
+EXPORT_SYMBOL(can_eth_ioctl_hwts);
+
 /* generic implementation of ethtool_ops::get_ts_info for CAN devices
  * supporting hardware timestamps
  */
 
 int open_candev(struct net_device *dev);
 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);