Use net_device_ops also for EoE devices from 2.6.29 on.
authorFlorian Pose <fp@igh-essen.com>
Thu, 19 Nov 2009 13:53:33 +0100
changeset 1561 89f6cd5b90ff
parent 1560 0ca50da62c52
child 1562 5c249f469b81
Use net_device_ops also for EoE devices from 2.6.29 on.
master/ethernet.c
--- a/master/ethernet.c	Tue Nov 17 11:05:20 2009 +0100
+++ b/master/ethernet.c	Thu Nov 19 13:53:33 2009 +0100
@@ -81,6 +81,17 @@
 
 /*****************************************************************************/
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+static const struct net_device_ops ec_eoedev_ops = {
+    .ndo_open = ec_eoedev_open,
+    .ndo_stop = ec_eoedev_stop,
+    .ndo_start_xmit = ec_eoedev_tx,
+    .ndo_get_stats = ec_eoedev_stats,
+};
+#endif
+
+/*****************************************************************************/
+
 /** EoE constructor.
  *
  * Initializes the EoE handler, creates a net_device and registers it.
@@ -138,10 +149,14 @@
     }
 
     // initialize net_device
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+    eoe->dev->netdev_ops = &ec_eoedev_ops;
+#else
     eoe->dev->open = ec_eoedev_open;
     eoe->dev->stop = ec_eoedev_stop;
     eoe->dev->hard_start_xmit = ec_eoedev_tx;
     eoe->dev->get_stats = ec_eoedev_stats;
+#endif
 
     for (i = 0; i < ETH_ALEN; i++)
         eoe->dev->dev_addr[i] = i | (i << 4);