[package] fix siit compilation failures on brcm-2.4
[openwrt-10.03/.git] / package / siit / src / siit.c
index 897423d8cc45dd149f3739c5eb37c2bf60dda1c5..f458f5de4b28fd16e0f6890be7a6390fc013ce32 100644 (file)
@@ -27,7 +27,9 @@
 #include <linux/init.h>
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
 #include <net/ip6_checksum.h>
+#endif
 #include <linux/in6.h>
 #include "siit.h"
 
@@ -1384,10 +1386,19 @@ static bool header_ops_init = false;
 static struct header_ops siit_header_ops ____cacheline_aligned;
 #endif
 
+#if !(defined CONFIG_COMPAT_NET_DEV_OPS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
+static const struct net_device_ops siit_netdev_ops = {
+       .ndo_open               = siit_open,
+       .ndo_stop               = siit_release,
+       .ndo_start_xmit         = siit_xmit,
+};
+#endif
+
 /*
  * The init function initialize of the SIIT device..
  * It is invoked by register_netdev()
  */
+
 static void
 siit_init(struct net_device *dev)
 {
@@ -1397,9 +1408,15 @@ siit_init(struct net_device *dev)
        /*
         * Assign device function.
         */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
        dev->open            = siit_open;
        dev->stop            = siit_release;
        dev->hard_start_xmit = siit_xmit;
+#else
+#if !(defined CONFIG_COMPAT_NET_DEV_OPS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
+       dev->netdev_ops = &siit_netdev_ops;
+#endif
+#endif
        dev->flags           |= IFF_NOARP;     /* ARP not used */
        dev->tx_queue_len = 10;