Implemented new network device operations for kernel 2.6.29, thanks to M. Goetze.
--- 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);