Implemented new network device operations for kernel 2.6.29, thanks to M. Goetze.
authorFlorian Pose <fp@igh-essen.com>
Tue, 16 Jun 2009 08:30:49 +0000
changeset 1476 1da1c72fd495
parent 1475 d76ae2389eab
child 1477 76a463df511b
Implemented new network device operations for kernel 2.6.29, thanks to M. Goetze.
master/device.c
--- a/master/device.c	Tue Jun 16 08:29:30 2009 +0000
+++ b/master/device.c	Tue Jun 16 08:30:49 2009 +0000
@@ -226,7 +226,11 @@
     device->tx_count = 0;
     device->rx_count = 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+    ret = device->dev->netdev_ops->ndo_open(device->dev);
+#else
     ret = device->dev->open(device->dev);
+#endif
     if (!ret)
         device->open = 1;
 
@@ -255,7 +259,11 @@
         return 0;
     }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+    ret = device->dev->netdev_ops->ndo_stop(device->dev);
+#else
     ret = device->dev->stop(device->dev);
+#endif
     if (!ret)
         device->open = 0;
 
@@ -306,7 +314,11 @@
     }
 
     // start sending
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
+    if (device->dev->netdev_ops->ndo_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
+#else
     if (device->dev->hard_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
+#endif
 		device->tx_count++;
 #ifdef EC_DEBUG_IF
 		ec_debug_send(&device->dbg, skb->data, ETH_HLEN + size);