compat: properly handle tracing

We have to disable tracing on old kernels, but should
disable it only on old kernels. Since 2.6.33 it pretty
much hasn't changed at all, so we can keep it. Prior
to 2.6.33, there are various different reasons for not
supporting tracing, as noted in the tracepoint.h file.

This fixes tracing as the previous attempts here at
backporting it completely disabled it for all kernels,
not just for those where it's not possible.

Tested compilation of compat-wireless with tracing in
mac80211 against 2.6.24 through 3.3, but some versions
didn't compile due to unrelated issues.

Cc: stable@orbit-lab.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: avoid duplicate __ref definition

Cc: stable@orbit-lab.org
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: backport netif_wake_subqueue

Kernels 2.6.23 - 2.6.27 had some multiqueue support,
but called netif_wake_subqueue netif_start_subqueue.
So to backport, just add a define.

mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel                  3.4.0-030400rc1-generic	[OK]
Trying kernel                  3.3.0-030300rc2-generic	[OK]
Trying kernel                     3.2.2-030202-generic	[OK]
Trying kernel                    3.1.10-030110-generic	[OK]
Trying kernel                    3.0.18-030018-generic	[OK]
Trying kernel                  2.6.39-02063904-generic	[OK]
Trying kernel                  2.6.38-02063808-generic	[OK]
Trying kernel                  2.6.37-02063706-generic	[OK]
Trying kernel                  2.6.36-02063604-generic	[OK]
Trying kernel                  2.6.35-02063512-generic	[OK]
Trying kernel                  2.6.34-02063410-generic	[OK]
Trying kernel                  2.6.33-02063305-generic	[OK]
Trying kernel                  2.6.32-02063255-generic	[OK]
Trying kernel                  2.6.31-02063113-generic	[OK]
Trying kernel                  2.6.30-02063010-generic	[OK]
Trying kernel                  2.6.29-02062906-generic	[OK]
Trying kernel                  2.6.28-02062810-generic	[OK]
Trying kernel                    2.6.27-020627-generic	[OK]
Trying kernel                    2.6.26-020626-generic	[OK]
Trying kernel                    2.6.25-020625-generic	[OK]
Trying kernel                    2.6.24-020624-generic	[OK]

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
compat: add ndo_do_ioctl()

This helps reduce the delta on backporting calls of the
netdev's ioctl callback. Instead of ifdef'ing on where
the ioctl callback lies in different kernels we take
care of that for all kernels.

This lets us for example change this backport:

	@@ -925,8 +954,13 @@ static int wireless_process_ioctl(struct
				return private(dev, iwr, cmd, info, handler);
		}
		/* Old driver API : call driver ioctl handler */
	+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
		if (dev->netdev_ops->ndo_do_ioctl)
			return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
	+#else
	+       if (dev->do_ioctl)
	+               return dev->do_ioctl(dev, ifr, cmd);
	+#endif
		return -EOPNOTSUPP;
	 }

To this:

	--- a/net/wireless/wext-core.c
	+++ b/net/wireless/wext-core.c
	@@ -925,9 +925,7 @@ static int wireless_process_ioctl(struct
				return private(dev, iwr, cmd, info, handler);
		}
		/* Old driver API : call driver ioctl handler */
	-       if (dev->netdev_ops->ndo_do_ioctl)
	-               return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
	-       return -EOPNOTSUPP;
	+       return ndo_do_ioctl(dev, ifr, cmd);
	 }

	 /* If command is `set a parameter', or `get the encoding parameters',

This shows more deletions than additions. This is what we want.

If we add ndo_do_ioctl() upstream then this would require 0 delta!

Trying kernel                  3.4.0-030400rc1-generic	[OK]
Trying kernel                  3.3.0-030300rc2-generic	[OK]
Trying kernel                     3.2.2-030202-generic	[OK]
Trying kernel                    3.1.10-030110-generic	[OK]
Trying kernel                    3.0.18-030018-generic	[OK]
Trying kernel                  2.6.39-02063904-generic	[OK]
Trying kernel                  2.6.38-02063808-generic	[OK]
Trying kernel                  2.6.37-02063706-generic	[OK]
Trying kernel                  2.6.36-02063604-generic	[OK]
Trying kernel                  2.6.35-02063512-generic	[OK]
Trying kernel                  2.6.34-02063410-generic	[OK]
Trying kernel                  2.6.33-02063305-generic	[OK]
Trying kernel                  2.6.32-02063255-generic	[OK]
Trying kernel                  2.6.31-02063113-generic	[OK]
Trying kernel                  2.6.30-02063010-generic	[OK]
Trying kernel                  2.6.29-02062906-generic	[OK]
Trying kernel                  2.6.28-02062810-generic	[OK]
Trying kernel                    2.6.27-020627-generic	[OK]
Trying kernel                    2.6.26-020626-generic	[OK]
Trying kernel                    2.6.25-020625-generic	[OK]
Trying kernel                    2.6.24-020624-generic	[OK]

Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>