+static int dp_dev_change_mtu(struct net_device *dev, int new_mtu)
+{
+ if (new_mtu < 68 || new_mtu > dp_min_mtu(dp_dev_get_dp(dev)))
+ return -EINVAL;
+
+ dev->mtu = new_mtu;
+ return 0;
+}
+
+static int dp_dev_init(struct net_device *netdev)
+{
+ struct dp_dev *dp_dev = dp_dev_priv(netdev);
+
+ dp_dev->lstats = alloc_percpu(struct pcpu_lstats);
+ if (!dp_dev->lstats)
+ return -ENOMEM;
+
+ return 0;
+}
+
+static void dp_dev_free(struct net_device *netdev)
+{
+ struct dp_dev *dp_dev = dp_dev_priv(netdev);
+
+ free_percpu(dp_dev->lstats);
+ free_netdev(netdev);
+}
+
+static int dp_dev_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+ if (dp_ioctl_hook)
+ return dp_ioctl_hook(dev, ifr, cmd);
+ return -EOPNOTSUPP;
+}
+
+#ifdef HAVE_NET_DEVICE_OPS
+static const struct net_device_ops dp_dev_netdev_ops = {
+ .ndo_init = dp_dev_init,
+ .ndo_open = dp_dev_open,
+ .ndo_stop = dp_dev_stop,
+ .ndo_start_xmit = dp_dev_xmit,
+ .ndo_set_mac_address = dp_dev_mac_addr,
+ .ndo_do_ioctl = dp_dev_do_ioctl,
+ .ndo_change_mtu = dp_dev_change_mtu,
+ .ndo_get_stats = dp_dev_get_stats,
+};
+#endif
+