aboutsummaryrefslogtreecommitdiffstats
path: root/package/siit/src
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-10-27 22:50:34 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-10-27 22:50:34 +0000
commitd8c2ea357777457daa10ebbc2512c5012d9b37ea (patch)
treeecc151c27f7c6db5c743fc5e0012bb88e27459a5 /package/siit/src
parent3a333ed6498f243c78e1ce30df57a981e5f3e5f4 (diff)
downloadupstream-d8c2ea357777457daa10ebbc2512c5012d9b37ea.tar.gz
upstream-d8c2ea357777457daa10ebbc2512c5012d9b37ea.tar.bz2
upstream-d8c2ea357777457daa10ebbc2512c5012d9b37ea.zip
[package] fix siit compile with 2.6.30 kernels and superior, when CONFIG_COMPAT_NET_DEV_OPS is not set
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18191 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/siit/src')
-rw-r--r--package/siit/src/siit.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/package/siit/src/siit.c b/package/siit/src/siit.c
index dddc8ef875..c645a2580d 100644
--- a/package/siit/src/siit.c
+++ b/package/siit/src/siit.c
@@ -1386,10 +1386,19 @@ static bool header_ops_init = false;
static struct header_ops siit_header_ops ____cacheline_aligned;
#endif
+#ifndef CONFIG_COMPAT_NET_DEV_OPS
+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)
{
@@ -1399,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
+#ifndef CONFIG_COMPAT_NET_DEV_OPS
+ dev->netdev_ops = &siit_netdev_ops;
+#endif
+#endif
dev->flags |= IFF_NOARP; /* ARP not used */
dev->tx_queue_len = 10;