Hi list,

the patch below adds support for the new net_device_ops funtions (netdev_ops structure).
This is needed to support drivers with that new interface within ethercat.
Please note that this is only tested with the 8139too driver.

Best regards,

Andre
diff -r 9b5e0ac201af master/device.c
--- a/master/device.c	Fri Jun 26 11:21:40 2009 +0200
+++ b/master/device.c	Mon Jun 29 11:19:37 2009 +0200
@@ -226,7 +226,11 @@ int ec_device_open(
     device->tx_count = 0;
     device->rx_count = 0;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
     ret = device->dev->open(device->dev);
+#else
+    ret = device->dev->netdev_ops->ndo_open(device->dev);
+#endif
     if (!ret)
         device->open = 1;
 
@@ -255,7 +259,11 @@ int ec_device_close(
         return 0;
     }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
     ret = device->dev->stop(device->dev);
+#else
+    ret = device->dev->netdev_ops->ndo_stop(device->dev);
+#endif
     if (!ret)
         device->open = 0;
 
@@ -306,7 +314,11 @@ void ec_device_send(
     }
 
     // start sending
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)    
     if (device->dev->hard_start_xmit(skb, device->dev) == NETDEV_TX_OK) {
+#else
+    if (device->dev->netdev_ops->ndo_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);
_______________________________________________
etherlab-dev mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-dev

Reply via email to