X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/de1ea81e285fcd75ab40d2bd4ed35e7440050599..414f855ff18c8d9a0bcff2b6a9213c3466db300a:/package/siit/src/siit.c diff --git a/package/siit/src/siit.c b/package/siit/src/siit.c index 828df22e2..5362c1daa 100644 --- a/package/siit/src/siit.c +++ b/package/siit/src/siit.c @@ -4,9 +4,13 @@ * */ +#include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) +#include +#else #include +#endif #include -#include #include #include /* printk() */ #include @@ -27,7 +31,9 @@ #include #include #include - +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) +#include +#endif #include #include "siit.h" @@ -1384,10 +1390,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 +1412,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;